Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoFieldContainer Class Reference

The SoFieldContainer class is a base class for all classes that contain fields. More...

#include <Inventor/fields/SoFieldContainer.h>

Inheritance diagram for SoFieldContainer::

SoBase SoEngine SoNode SoBoolOperation SoCalculator SoComposeMatrix SoComposeRotation SoComposeRotationFromTo SoComposeVec2f SoComposeVec3f SoComposeVec4f SoComputeBoundingBox SoConcatenate SoCounter SoDecomposeMatrix SoDecomposeRotation SoDecomposeVec2f SoDecomposeVec3f SoDecomposeVec4f SoElapsedTime SoFieldConverter SoGate SoInterpolate SoOneShot SoOnOff SoSelectOne SoTimeCounter SoTransformVec3f SoTriggerAny SoBaseColor SoBaseKit SoCallback SoCamera SoClipPlane SoColorIndex SoComplexity SoCoordinate3 SoCoordinate4 SoDrawStyle SoEnvironment SoEventCallback SoFile SoFont SoGroup SoInfo SoLabel SoLight SoLightModel SoMaterial SoMaterialBinding SoNodeKitListPart SoNormal SoNormalBinding SoPackedColor SoPickStyle SoPolygonOffset SoProfile SoProfileCoordinate2 SoProfileCoordinate3 SoShape SoShapeHints SoTexture2 SoTexture2Transform SoTextureCoordinate2 SoTextureCoordinateBinding SoTextureCoordinateFunction SoTransformation SoVertexProperty SoWWWInline List of all members.

Public Methods

void setToDefaults (void)
SbBool hasDefaultValues (void) const
SbBool fieldsAreEqual (const SoFieldContainer *container) const
void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE)
SbBool set (const char *const fielddata)
void get (SbString &fielddata)
virtual int getFields (SoFieldList &l) const
virtual int getAllFields (SoFieldList &l) const
virtual SoFieldgetField (const SbName &name) const
virtual SoFieldgetEventIn (const SbName &name) const
virtual SoFieldgetEventOut (const SbName &name) const
SbBool getFieldName (const SoField *const field, SbName &name) const
SbBool enableNotify (const SbBool flag)
SbBool isNotifyEnabled (void) const
SbBool set (const char *fielddata, SoInput *in)
void get (SbString &fielddata, SoOutput *out)
virtual void notify (SoNotList *l)
virtual SbBool validateNewFieldValue (SoField *field, void *newval)
virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE)
virtual void writeInstance (SoOutput *out)
SbBool getIsBuiltIn (void) const
virtual const SoFieldDatagetFieldData (void) const
virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)
virtual SoFieldContainer * copyThroughConnection (void) const

Static Public Methods

void initClass (void)
SoType getClassTypeId (void)
void initCopyDict (void)
void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)
SoFieldContainer * checkCopy (const SoFieldContainer *orig)
SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)
void copyDone (void)

Protected Methods

 SoFieldContainer (void)
 ~SoFieldContainer ()
virtual SbBool readInstance (SoInput *in, unsigned short flags)

Protected Attributes

SbBool isBuiltIn

Detailed Description

The SoFieldContainer class is a base class for all classes that contain fields.

The classes containing fields in Coin are the node and engine classes, so they are all subclasses of SoFieldContainer.

SoFieldContainer provides methods for reading, writing, comparing for equality, doing copy operations, etc on fields.

See also:
SoField


Constructor & Destructor Documentation

SoFieldContainer::SoFieldContainer void [protected]
 

Constructor.

SoFieldContainer::~SoFieldContainer [protected]
 

Destructor.


Member Function Documentation

void SoFieldContainer::initClass void [static]
 

Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.

Reimplemented from SoBase.

Reimplemented in SoNode, SoCamera, SoPerspectiveCamera, SoOrthographicCamera, SoShape, SoAsciiText, SoCone, SoCube, SoCylinder, SoText3, SoTransformation, SoAntiSquish, SoMatrixTransform, SoRotation, SoPendulum, SoRotor, SoResetTransform, SoRotationXYZ, SoScale, SoTranslation, SoShuttle, SoSurroundScale, SoTransform, SoUnits, SoBaseColor, SoCallback, SoClipPlane, SoComplexity, SoCoordinate3, SoCoordinate4, SoLight, SoDirectionalLight, SoSpotLight, SoPointLight, SoDrawStyle, SoEnvironment, SoFile, SoFont, SoFontStyle, SoInfo, SoLabel, SoLightModel, SoProfile, SoLinearProfile, SoNurbsProfile, SoMaterial, SoMaterialBinding, SoNormal, SoNormalBinding, SoPackedColor, SoPickStyle, SoPolygonOffset, SoProfileCoordinate2, SoProfileCoordinate3, SoShapeHints, SoAnnotation, SoArray, SoBlinker, SoColorIndex, SoEventCallback, SoExtSelection, SoFaceSet, SoGroup, SoImage, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedNurbsCurve, SoIndexedNurbsSurface, SoIndexedShape, SoIndexedTriangleStripSet, SoLOD, SoLevelOfDetail, SoLineSet, SoLocateHighlight, SoMarkerSet, SoMultipleCopy, SoNonIndexedShape, SoNurbsCurve, SoNurbsSurface, SoPathSwitch, SoPointSet, SoQuadMesh, SoSelection, SoSeparator, SoSphere, SoSwitch, SoText2, SoTexture2, SoTexture2Transform, SoTextureCoordinate2, SoTextureCoordinateBinding, SoTextureCoordinateDefault, SoTextureCoordinateEnvironment, SoTextureCoordinateFunction, SoTextureCoordinatePlane, SoTransformSeparator, SoTriangleStripSet, SoVertexProperty, SoVertexShape, SoWWWAnchor, SoWWWInline, SoEngine, SoBoolOperation, SoCalculator, SoComputeBoundingBox, SoConcatenate, SoCounter, SoElapsedTime, SoFieldConverter, SoGate, SoInterpolate, SoOnOff, SoOneShot, SoSelectOne, SoTimeCounter, SoTransformVec3f, SoTriggerAny, SoNodeKitListPart, SoBaseKit, SoInteractionKit, SoSeparatorKit, SoShapeKit, SoWrapperKit, SoAppearanceKit, SoCameraKit, SoLightKit, SoSceneKit, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger, SoCenterballManip, SoClipPlaneManip, SoDirectionalLightManip, SoHandleBoxManip, SoJackManip, SoPointLightManip, SoSpotLightManip, SoTabBoxManip, SoTrackballManip, SoTransformBoxManip, SoTransformManip, and SoTransformerManip.

SoType SoFieldContainer::getClassTypeId void [static]
 

This static method returns the SoType object associated with objects of this class.

Reimplemented from SoBase.

Reimplemented in SoNode, and SoEngine.

void SoFieldContainer::setToDefaults void
 

This method sets all fields which we are parenting to their respective default values.

SbBool SoFieldContainer::hasDefaultValues void const
 

This method checks to see if the fields of this container have their default values, and returns TRUE if that is the case.

SbBool SoFieldContainer::fieldsAreEqual const SoFieldContainer * container const
 

This method returns TRUE if the values of the fields of this and container are equal.

void SoFieldContainer::copyFieldValues const SoFieldContainer * container,
SbBool copyconnections = FALSE
 

This method copies the field values from container into this. The fields are assumed to be of the same type. The copyconnections flag decides whether the field connections are to be copied aswell.

SbBool SoFieldContainer::set const char *const fielddata
 

This method parses the values of one or more fields from the fielddata string.

The fields must be in the same format as the Open Inventor file format. TRUE is returned upon success, and FALSE otherwise.

See also:
get()

void SoFieldContainer::get SbString & fielddata
 

This methods stores the field data in the given fielddata string. The format of the returned string follows the Open Inventor file format.

See also:
set()

int SoFieldContainer::getFields SoFieldList & l const [virtual]
 

This method adds the fields in this container to the l argument, and returns the number of fields added.

The virtual nature of this function means that it can be overridden to e.g. hide private fields.

int SoFieldContainer::getAllFields SoFieldList & l const [virtual]
 

Returns VRML eventIn and eventOut fields in addition to the "ordinary" fields.

See also:
getFields()

SoField * SoFieldContainer::getField const SbName & name const [virtual]
 

This method returns a pointer to the field with name, or NULL if no such field exists.

SoField * SoFieldContainer::getEventIn const SbName & name const [virtual]
 

This method returns a pointer to the eventIn with name name, or NULL if no such eventIn exists.

SoField * SoFieldContainer::getEventOut const SbName & name const [virtual]
 

This method returns a pointer to the eventOut with name name, or NULL if no such eventOut exists.

SbBool SoFieldContainer::getFieldName const SoField *const field,
SbName & name
const
 

Finds the name of the given field and returns the value in the name argument.

TRUE is returned if the field is contained within this instance, and FALSE otherwise.

SbBool SoFieldContainer::enableNotify const SbBool enable
 

This method sets whether notification will be propagated on changing the values of the contained fields. The old value of the flag is returned.

Notification is default on. Turning off automatic notification can be useful for optimizing performance. During series of updates you may want to avoid the propagation of notifications upon every field value change if you make a lot of them. This is how you should handle those cases:

  SbBool autonotify = node->enableNotify(FALSE);
  // ...
  // Make modifications to fields of "node" here.
  // ...
  node->enableNotify(autonotify);
  node->touch();

See also:
isNotifyEnabled()

SbBool SoFieldContainer::isNotifyEnabled void const
 

This method returns whether notification of changes to the field values in the container is propagated to its auditors.

See also:
enableNotify()

SbBool SoFieldContainer::set const char * fielddata,
SoInput * in
 

This method parses the values of one or more fields from the fielddata string.

The fields must be in the same format as the Open Inventor file format. TRUE is returned upon success, and FALSE otherwise.

We use the reference dictionary provided by in.

See also:
get()

void SoFieldContainer::get SbString & fielddata,
SoOutput * out
 

Put names and values of fields from this instance in the fielddata string. Fields will be separated in the returned string by end-of-line characters.

We use the reference dictionary provided by out.

See also:
set()

void SoFieldContainer::notify SoNotList * nl [virtual]
 

Notifies all auditors for this instance when changes are made.

Reimplemented from SoBase.

Reimplemented in SoNode, SoAsciiText, SoText3, SoMaterial, SoPackedColor, SoBlinker, SoImage, SoSeparator, SoTexture2, SoVertexProperty, SoVertexShape, and SoEngine.

SbBool SoFieldContainer::validateNewFieldValue SoField * field,
void * newval
[virtual]
 

For internal use only.

void SoFieldContainer::addWriteReference SoOutput * out,
SbBool isfromfield = FALSE
[virtual]
 

Overloaded from SoBase to make sure field connections into other field containers are also accounted for.

Reimplemented from SoBase.

Reimplemented in SoBaseKit.

void SoFieldContainer::writeInstance SoOutput * out [virtual]
 

Writes all the fields contained in this instance to the output stream within out.

Reimplemented in SoNode, SoEngine, SoElapsedTime, and SoTimeCounter.

SbBool SoFieldContainer::getIsBuiltIn void const
 

Returns TRUE if this object is instantiated from one of the native Coin classes, FALSE if the object's class is outside the standard Coin library.

const SoFieldData * SoFieldContainer::getFieldData void const [virtual]
 

Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.

void SoFieldContainer::copyContents const SoFieldContainer * from,
SbBool copyconnections
[virtual]
 

Makes a deep copy of all data of from into this instance, except external scenegraph references if copyconnections is FALSE.

This is the method that should be overridden by subclasses which needs to account for internal data that are not handled automatically.

Make sure that when you override the copyContents() method in your extension class that you also make it call upwards to it's parent superclass in the inheritance hierarchy, as copyContents() in for instance SoNode and SoFieldContainer does important work. It should go something like this:

  void
  MyCoinExtensionNode::copyContents(const SoFieldContainer * from,
                                    SbBool copyconnections)
  {
    // let parent superclasses do their thing (copy fields, copy
    // instance name, etc etc)
    SoNode::copyContents(from, copyconnections);

    // [..then copy internal data..]
  }

Reimplemented in SoNode, SoCallback, SoFile, SoGroup, SoWWWInline, SoNodeKitListPart, SoBaseKit, SoInteractionKit, SoRotateCylindricalDragger, SoRotateSphericalDragger, SoClipPlaneManip, SoDirectionalLightManip, SoPointLightManip, SoSpotLightManip, and SoTransformManip.

SoFieldContainer * SoFieldContainer::copyThroughConnection void const [virtual]
 

Return copy of this instance.

Note: default implementation just returns this pointer, SoNode and SoEngine overloads this method to return the pointer to the actual copy.

Reimplemented in SoNode, and SoEngine.

void SoFieldContainer::initCopyDict void [static]
 

For internal use only.

void SoFieldContainer::addCopy const SoFieldContainer * orig,
const SoFieldContainer * copy
[static]
 

Add a pair of pointers to an original fieldcontainer and a copy of it to an internal pointer dictionary used during scene graph copy operations.

SoFieldContainer * SoFieldContainer::checkCopy const SoFieldContainer * orig [static]
 

Returns the copy of orig, if any. If no copy exists, we return a NULL pointer.

SoFieldContainer * SoFieldContainer::findCopy const SoFieldContainer * orig,
const SbBool copyconnections
[static]
 

Returns a copy of orig.

If no copy has been made earlier when the function is called, a copy is made on-the-fly (which is the reason we need to pass along the copyconnections flag).

This method will also run the copyContents() method on the copy, if it hasn't been run already. Note that if you call copyContents() on the copy outside of this method, this will go undetected and the guts of orig will be copied multiple times into its copy.

See also:
checkCopy()

void SoFieldContainer::copyDone void [static]
 

For internal use only.

SbBool SoFieldContainer::readInstance SoInput * in,
unsigned short flags
[protected, virtual]
 

This method is mainly intended for internal use during file import operations.

It reads a definition of an instance from the input stream in. The input stream state points to the start of a serialized / persistant representation of an instance of this class type.

TRUE or FALSE is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not. The import process should be robust and handle corrupted input streams by returning FALSE.

flags is used internally during binary import when reading user extension nodes, group nodes or engines.

Reimplemented from SoBase.

Reimplemented in SoNode, SoFile, SoNormalBinding, SoGroup, SoImage, SoSeparator, SoTexture2, SoTextureCoordinateBinding, SoWWWInline, SoEngine, SoNodeKitListPart, SoBaseKit, and SoInteractionKit.


Member Data Documentation

SbBool SoFieldContainer::isBuiltIn [protected]
 

Flag for storing whether or not this class instance is a built-in class or not. By knowing the difference between a class which is native Coin or a user extension, it is possible to automatically store and read extension nodes and engines.


The documentation for this class was generated from the following files:
Generated at Tue Mar 5 03:31:24 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001