Inventor/fields/SoSubField.h File Reference

#include <Inventor/fields/SoField.h>
#include <Inventor/SoInput.h>
#include <Inventor/SoOutput.h>
#include <Inventor/errors/SoMemoryError.h>
#include <Inventor/errors/SoDebugError.h>

Go to the source code of this file.

Defines

#define SO__FIELD_HEADER(className)
#define SO__SFIELD_RW_HEADER(className)
#define SO__MFIELD_RW_HEADER(className)
#define SO_FIELD_INIT_CLASS_CHECK_PARENT(className, parentClass)
#define SO__FIELD_INIT_CLASS_INTERNAL(className, classPrintName, parentClass)
#define SO__FIELD_INIT_CLASS(className, classPrintName, parentClass)   SO__FIELD_INIT_CLASS_INTERNAL(className,classPrintName,parentClass);
#define SO__FIELD_INIT_ABSTRACT_CLASS_INTERNAL(className, classPrintName, parentClass)
#define SO__FIELD_INIT_ABSTRACT_CLASS(className, classPrintName, parentClass)   SO__FIELD_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parentClass);
#define SO__FIELD_EXIT_CLASS(className)
#define SO__FIELD_ID_ABSTRACT_SOURCE(className)
#define SO__FIELD_ID_SOURCE(className)
#define SO__FIELD_EQ_SAME_SOURCE(className)
#define SO_SFIELD_REQUIRED_HEADER(className)   SO__FIELD_HEADER(className)
#define SO_SFIELD_CONSTRUCTOR_HEADER(className)
#define SO_SFIELD_VALUE_HEADER(className, valueType, valueRef)
#define SO_SFIELD_DERIVED_VALUE_HEADER(className, valueType, valueRef)
#define SO_SFIELD_HEADER(className, valueType, valueRef)
#define SO_SFIELD_DERIVED_HEADER(className, valueType, valueRef)
#define SO_MFIELD_REQUIRED_HEADER(className)   SO__FIELD_HEADER(className)
#define SO_MFIELD_CONSTRUCTOR_HEADER(className)
#define SO_MFIELD_VALUE_HEADER(className, valueType, valueRef)
#define SO_MFIELD_DERIVED_VALUE_HEADER(className, valueType, valueRef)
#define SO_FIELD_SUPPORT_MEMOBJ()
#define SO_MFIELD_EDITING_HEADER(className, valueType)
#define SO_MFIELD_HEADER(className, valueType, valueRef)
#define SO_MFIELD_DERIVED_HEADER(className, valueType, valueRef)
#define SO_SFIELD_INIT_CLASS(className, parentClass)   SO__FIELD_INIT_CLASS(className, SO__QUOTE(className), parentClass);
#define SO_SFIELD_EXIT_CLASS(className)   SO__FIELD_EXIT_CLASS(className)
#define SO_SFIELD_REQUIRED_SOURCE(className)
#define SO_FIELD_CHECK_INIT(className)
#define SO_SFIELD_CONSTRUCTOR_SOURCE(className)
#define SO_SFIELD_VALUE_SOURCE(className, valueType, valueRef)
#define SO_SFIELD_SOURCE(className, valueType, valueRef)
#define SO_SFIELD_DERIVED_CONSTRUCTOR_SOURCE(className)
#define SO_SFIELD_DERIVED_SOURCE(className, valueType, valueRef)
#define SO_MFIELD_INIT_CLASS(className, parentClass)   SO__FIELD_INIT_CLASS(className, SO__QUOTE(className), parentClass);
#define SO_MFIELD_EXIT_CLASS(className)   SO__FIELD_EXIT_CLASS(className)
#define SO_MFIELD_REQUIRED_SOURCE(className)
#define SO_MFIELD_CONSTRUCTOR_SOURCE(className)
#define SO_MFIELD_DERIVED_CONSTRUCTOR_SOURCE(className)
#define SO_MFIELD_VALUE_SOURCE(className, valueType, valueRef)
#define SO_MFIELD_ALLOC_SOURCE(className, valueType)
#define SO_MFIELD_MALLOC_SOURCE(className, valueType)
#define SO_MFIELD_SOURCE(className, valueType, valueRef)
#define SO_MFIELD_SOURCE_MALLOC(className, valueType, valueRef)
#define SO_MFIELD_DERIVED_SOURCE(className, valueType, valueRef)
#define SO_MFIELD_SETVALUESPOINTER_HEADER(userType)
#define SO_MFIELD_SETVALUESPOINTER_SOURCE(className, valueType, userType)

Functions

valueRef getValue () const
void setValue (valueRef newValue)
valueRef operator= (valueRef newValue)
int operator== (const className &f) const
int operator!= (const className &f) const
virtual size_t getValueSize () const

Variables

valueType * values

Define Documentation

#define SO__FIELD_EQ_SAME_SOURCE ( className   ) 
Value:
\
void \
className::copyFrom(const SoField &f) \
{ \
  *this = * (const className *) &f; \
} \
\
SbBool \
className::isSame(const SoField &f) const \
{ \
  return (getTypeId() == f.getTypeId() && \
          (*this) == (const className &) f); \
}
#define SO__FIELD_EXIT_CLASS ( className   ) 
Value:
SoType::removeType(classTypeId.getName()); \
  classTypeId = SoType::badType()
#define SO__FIELD_HEADER ( className   ) 
Value:
public: \
     \
    virtual SoType getTypeId() const; \
     \
    static SoType getClassTypeId(); \
\
     \
    const className & operator =(const className &f); \
\
 private:\
    /* Copy from another field of unknown type (assumed to be same type) */ \
    virtual void copyFrom(const SoField &f); \
\
    static void * createInstance(SoType* dynamicType = NULL);  \
\
    /* Returns TRUE if fields are same type and have same values */ \
    virtual SbBool isSame(const SoField &f) const; \
\
  private: \
    static  SoType classTypeId
#define SO__FIELD_ID_ABSTRACT_SOURCE ( className   ) 
Value:
\
  SoType className::classTypeId;                \
                                                \
  SoType                                        \
  className::getClassTypeId()                   \
  {                                             \
    return classTypeId;                         \
  }                                             \
                                                \
  SoType                                        \
  className::getTypeId() const                  \
  {                                             \
    return classTypeId;                         \
  }
#define SO__FIELD_ID_SOURCE ( className   ) 
Value:
SO__FIELD_ID_ABSTRACT_SOURCE(className);  \
  void *                                    \
  className::createInstance(SoType *)       \
  {                                         \
    return (void *)(new className);         \
  }
#define SO__FIELD_INIT_ABSTRACT_CLASS ( className,
classPrintName,
parentClass   )     SO__FIELD_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parentClass);
#define SO__FIELD_INIT_ABSTRACT_CLASS_INTERNAL ( className,
classPrintName,
parentClass   ) 
Value:
SO_FIELD_INIT_CLASS_CHECK_PARENT(className, parentClass);                                           \
  classTypeId = SoType::createType(parentClass::getClassTypeId(),       \
                                   classPrintName,                      \
                                   NULL)
#define SO__FIELD_INIT_CLASS ( className,
classPrintName,
parentClass   )     SO__FIELD_INIT_CLASS_INTERNAL(className,classPrintName,parentClass);
#define SO__FIELD_INIT_CLASS_INTERNAL ( className,
classPrintName,
parentClass   ) 
Value:
SO_FIELD_INIT_CLASS_CHECK_PARENT(className, parentClass); \
  classTypeId = SoType::createType(parentClass::getClassTypeId(), \
                                   classPrintName, \
                                   &className::createInstance)
#define SO__MFIELD_RW_HEADER ( className   ) 
Value:
private: \
    /* Reads indexed value of field from file */ \
    virtual SbBool read1Value(SoInput *in, int index); \
\
    /* Writes one (indexed) value to file */ \
    virtual void write1Value(SoOutput *out, int index) const
#define SO__SFIELD_RW_HEADER ( className   ) 
Value:
private: \
    /* Reads value of field from file */ \
    virtual SbBool readValue(SoInput *in); \
\
    /* Writes value of field to file */ \
    virtual void writeValue(SoOutput *out) const

Returns the type identifier for this specific instance.

Returns the type identifier for this class. Copy from another field of same type

#define SO_FIELD_CHECK_INIT ( className   ) 
Value:
{ \
  if (classTypeId.isBad()) { \
    className::initClass(); \
  } \
}
#define SO_FIELD_INIT_CLASS_CHECK_PARENT ( className,
parentClass   ) 
Value:
if (parentClass::getClassTypeId().isBad())                                          \
    parentClass::initClass()
 
#define SO_FIELD_SUPPORT_MEMOBJ (  ) 
Value:
private: \
  virtual bool isEnabledMemObj() { return true; } \
  virtual SoMemoryObject* getMemObj() { return m_memObj; } \
  virtual void setMemObj( SoMemoryObject* memObj ) { m_memObj = memObj; }

Sets this field to newValue.

#define SO_MFIELD_ALLOC_SOURCE ( className,
valueType   ) 
#define SO_MFIELD_CONSTRUCTOR_HEADER ( className   ) 
Value:
public: \
     \
    className(); \
    \
     \
    virtual ~className()
#define SO_MFIELD_CONSTRUCTOR_SOURCE ( className   ) 
Value:
\
className::className() \
{ \
  SO_FIELD_CHECK_INIT(className) \
  values = NULL; \
  resetChangedStatus (); \
  m_memObj = NULL; \
} \
\
className::~className() \
{ \
    deleteAllValues(); \
\
}
#define SO_MFIELD_DERIVED_CONSTRUCTOR_SOURCE ( className   ) 
Value:
\
className::className() \
{ \
  SO_FIELD_CHECK_INIT(className) \
  resetChangedStatus (); \
} \
\
className::~className() \
{ \
}
#define SO_MFIELD_DERIVED_HEADER ( className,
valueType,
valueRef   ) 
#define SO_MFIELD_DERIVED_SOURCE ( className,
valueType,
valueRef   ) 
#define SO_MFIELD_DERIVED_VALUE_HEADER ( className,
valueType,
valueRef   ) 
Value:
SO__MFIELD_RW_HEADER(className); \
  public: \
     \
    valueRef operator =(valueRef newValue) \
    { setValue(newValue); return newValue; }
#define SO_MFIELD_EDITING_HEADER ( className,
valueType   ) 
Value:
\
   \
   \
   \
   \
   \
   \
#define SO_MFIELD_EXIT_CLASS ( className   )     SO__FIELD_EXIT_CLASS(className)
#define SO_MFIELD_HEADER ( className,
valueType,
valueRef   ) 
#define SO_MFIELD_INIT_CLASS ( className,
parentClass   )     SO__FIELD_INIT_CLASS(className, SO__QUOTE(className), parentClass);
#define SO_MFIELD_MALLOC_SOURCE ( className,
valueType   ) 
#define SO_MFIELD_REQUIRED_HEADER ( className   )     SO__FIELD_HEADER(className)
#define SO_MFIELD_REQUIRED_SOURCE ( className   ) 
Value:
\
  SO__FIELD_ID_SOURCE(className) \
  SO__FIELD_EQ_SAME_SOURCE(className) \
\
const className & \
className::operator =(const className &f) \
{ \
  if (f.getNum() < getNum()) \
   deleteAllValues(); \
  setValues(0, f.getNum(), f.getValues(0)); \
  return *this; \
}
#define SO_MFIELD_SETVALUESPOINTER_HEADER ( userType   ) 
Value:
public: \
   \
   \
   \
   \
   \
   \
   \
   \
   \
   \
   \
   \
   \
#define SO_MFIELD_SETVALUESPOINTER_SOURCE ( className,
valueType,
userType   ) 
Value:
void \
className::setValuesPointer(int myNum, userType const*userData) \
{ \
  if (myNum > 0 && userData != NULL) { \
    if ( getUserDataIsUsed() && userData == (userType const*)values ) { \
    } \
    else if (getNum() > 0) { \
      makeRoom(0); \
    } \
    values = (valueType *)userData; \
    setUserDataIsUsed(true); \
    num = myNum; \
    valueChanged(0, num); \
  } \
} \
\
void \
className::setValuesPointer(int myNum, userType *userData) \
{ \
  setValuesPointer(myNum, (userType const*)userData); \
}
#define SO_MFIELD_SOURCE ( className,
valueType,
valueRef   ) 
#define SO_MFIELD_SOURCE_MALLOC ( className,
valueType,
valueRef   ) 
#define SO_MFIELD_VALUE_HEADER ( className,
valueType,
valueRef   ) 
Value:
SO__MFIELD_RW_HEADER(className); \
\
  public: \
     \

Default constructor.

Destructor

#define SO_MFIELD_VALUE_SOURCE ( className,
valueType,
valueRef   ) 
#define SO_SFIELD_CONSTRUCTOR_HEADER ( className   ) 
Value:
public: \
     \
    className(); \
    \
     \
    virtual ~className()
#define SO_SFIELD_CONSTRUCTOR_SOURCE ( className   ) 
Value:
#define SO_SFIELD_DERIVED_CONSTRUCTOR_SOURCE ( className   ) 
#define SO_SFIELD_DERIVED_HEADER ( className,
valueType,
valueRef   ) 
#define SO_SFIELD_DERIVED_SOURCE ( className,
valueType,
valueRef   ) 
#define SO_SFIELD_DERIVED_VALUE_HEADER ( className,
valueType,
valueRef   ) 
Value:
SO__SFIELD_RW_HEADER(className); \
  public: \
     \
    valueRef operator =(valueRef newValue) \
    { setValue(newValue); return (valueRef)value; }
#define SO_SFIELD_EXIT_CLASS ( className   )     SO__FIELD_EXIT_CLASS(className)
#define SO_SFIELD_HEADER ( className,
valueType,
valueRef   ) 
Value:

Sets this field to newValue.

#define SO_SFIELD_INIT_CLASS ( className,
parentClass   )     SO__FIELD_INIT_CLASS(className, SO__QUOTE(className), parentClass);
#define SO_SFIELD_REQUIRED_HEADER ( className   )     SO__FIELD_HEADER(className)
#define SO_SFIELD_REQUIRED_SOURCE ( className   ) 
Value:
\
  SO__FIELD_ID_SOURCE(className)/*;*/ \
  SO__FIELD_EQ_SAME_SOURCE(className) \
\
const className & \
className::operator =(const className &f) \
{ \
  setValue(f.getValue()); \
  return *this; \
}
#define SO_SFIELD_SOURCE ( className,
valueType,
valueRef   ) 
#define SO_SFIELD_VALUE_HEADER ( className,
valueType,
valueRef   ) 
Value:
SO__SFIELD_RW_HEADER(className); \
\
  public: \
     \

Default constructor.

Destructor

#define SO_SFIELD_VALUE_SOURCE ( className,
valueType,
valueRef   ) 
Value:
\
void \
className::setValue(valueRef newValue) \
{ \
  /*If container is NULL, we are doing the first init, so don't check for equality */ \
  /*because value has never been initialized */               \
  if ( getSameValueNotificationEnabled() || getContainer() == NULL || !(value==newValue) ) \
  { \
    value = newValue; \
    valueChanged(); \
  } \
} \
\
int \
className::operator ==(const className &f) const \
{ \
  return getValue() == f.getValue(); \
}

Function Documentation

valueRef getValue (  )  const

Returns this field's value.

size_t getValueSize (  )  const [virtual]

Gets the size of the value.

int operator!= ( const className f  )  const

Returns FALSE if otherField is of the same type and has the same value as this field.

Returns TRUE if all of the values of this field do not equal.

those of the given f. If the fields are different types TRUE will always be returned.

valueRef operator= ( valueRef  newValue  ) 

Sets this field to newValue.

Sets the first value in the array to newValue, and deletes.

the second and subsequent values. If field's values are stored in an user data array, this array is no more used.

int operator== ( const className f  )  const

Returns TRUE if otherField is of the same type and has the same value as this field.

Returns TRUE if all of the values of this field equal those of.

the given f. If the fields are different types FALSE will always be returned.

void setValue ( valueRef  newValue  ) 

Sets this field to newValue.

Sets the first value in the array to newValue, and deletes.

the second and subsequent values. If field's values are stored in an user data array, this array is no more used.


Variable Documentation

valueType* values

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/