MeVisLab Resolution Independence API
SoSFMLBase Class Reference

The SoSFMLBase field is the interface used by Inventor Nodes to output ML Base objects to the outside world. More...

#include <SoSFMLBase.h>

Inheritance diagram for SoSFMLBase:

Public Member Functions

void addAllowedType (const ml::RuntimeType *allowedType)
 Add type to list of allowed types.
 
template<typename T >
void addAllowedType ()
 Same as above, with template parameter where the Base type can be specified directly.
 
std::vector< const ml::RuntimeType * > getAllowedTypes () const
 Get list of allowed Base types for this field.
 
bool hasUnallowedType () const
 return true if the last call of setBaseValue had an unallowed type as argument, getBaseValue will return NULL then
 
virtual void setValue (ml::Base *mlBasePtr)
 Field access implementation.
 
virtual ml::Base * getValue () const
 
SbBool readValue (SoInput *in) override
 
void writeValue (SoOutput *out) const override
 
template<class Type >
Type getTypedValue ()
 Get a Base pointer of given Type, returns NULL is the base object is not derived from Type.
 

Static Public Member Functions

static void initClass ()
 Initializes field class, setting up runtime type info.
 

Protected Attributes

ml::Base * _value
 pointer to the stored base object
 
std::vector< const ml::RuntimeType * > _allowedTypes
 List of allowed Base types. If empty, any type is allowed.
 
bool _unallowedType
 remember if an unallowed type was assigned to this field
 
bool _isRefCountedBase
 

Detailed Description

The SoSFMLBase field is the interface used by Inventor Nodes to output ML Base objects to the outside world.

The SoSFMLBase field is the interface used by Inventor Nodes to output ML Base objects to the outside world

The initial value for input fields should be NULL. MeVisLab uses the name of the field to decide if it is an input or output field. If the name starts with out, it is an output field. Reading and writing to a scene is not implemented.

Definition at line 45 of file SoSFMLBase.h.

Member Function Documentation

◆ addAllowedType() [1/2]

template<typename T >
void SoSFMLBase::addAllowedType ( )
inline

Same as above, with template parameter where the Base type can be specified directly.

Definition at line 76 of file SoSFMLBase.h.

References addAllowedType().

Referenced by addAllowedType().

◆ addAllowedType() [2/2]

void SoSFMLBase::addAllowedType ( const ml::RuntimeType * allowedType)

Add type to list of allowed types.

This will set the Base value to NULL if it isn't NULL already and should only be called when initializing the SoSFMLField. Calls to setValue (or setStringValue) will only succeed if the given Base object is of one of the allowed types or NULL, or if the list is empty, otherwise NULL will be set instead.

◆ getAllowedTypes()

std::vector< const ml::RuntimeType * > SoSFMLBase::getAllowedTypes ( ) const
inline

Get list of allowed Base types for this field.

Definition at line 79 of file SoSFMLBase.h.

◆ getTypedValue()

template<class Type >
Type SoSFMLBase::getTypedValue ( )
inline

Get a Base pointer of given Type, returns NULL is the base object is not derived from Type.

Definition at line 63 of file SoSFMLBase.h.

◆ getValue()

virtual ml::Base * SoSFMLBase::getValue ( ) const
virtual

◆ hasUnallowedType()

bool SoSFMLBase::hasUnallowedType ( ) const
inline

return true if the last call of setBaseValue had an unallowed type as argument, getBaseValue will return NULL then

Definition at line 83 of file SoSFMLBase.h.

◆ initClass()

static void SoSFMLBase::initClass ( )
static

Initializes field class, setting up runtime type info.

◆ readValue()

SbBool SoSFMLBase::readValue ( SoInput * in)
override

◆ setValue()

virtual void SoSFMLBase::setValue ( ml::Base * mlBasePtr)
virtual

Field access implementation.

◆ writeValue()

void SoSFMLBase::writeValue ( SoOutput * out) const
override

Member Data Documentation

◆ _allowedTypes

std::vector<const ml::RuntimeType*> SoSFMLBase::_allowedTypes
protected

List of allowed Base types. If empty, any type is allowed.

Definition at line 90 of file SoSFMLBase.h.

◆ _isRefCountedBase

bool SoSFMLBase::_isRefCountedBase
protected

Definition at line 94 of file SoSFMLBase.h.

◆ _unallowedType

bool SoSFMLBase::_unallowedType
protected

remember if an unallowed type was assigned to this field

Definition at line 93 of file SoSFMLBase.h.

◆ _value

ml::Base* SoSFMLBase::_value
protected

pointer to the stored base object

Definition at line 87 of file SoSFMLBase.h.


The documentation for this class was generated from the following file: