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

SoSField Class Reference

The SoSField class is the base class for fields which contains only a single value. More...

#include <Inventor/fields/SoSField.h>

Inheritance diagram for SoSField::

SoField SoSFBool SoSFColor SoSFEngine SoSFEnum SoSFFloat SoSFImage SoSFInt32 SoSFMatrix SoSFName SoSFNode SoSFPath SoSFPlane SoSFRotation SoSFShort SoSFString SoSFTime SoSFTrigger SoSFUInt32 SoSFUShort SoSFVec2f SoSFVec3f SoSFVec4f List of all members.

Public Methods

virtual ~SoSField ()

Static Public Methods

void initClass (void)
SoType getClassTypeId (void)

Protected Methods

 SoSField (void)

Detailed Description

The SoSField class is the base class for fields which contains only a single value.

All field types which should always contain only a single member value inherits this class. SoSField is an abstract class.

You use methods setValue() and getValue() to store or fetch the value of single-value fields. Example:

    SoSpotLight * lightnode = new SoSpotLight;
    lightnode->on.setValue(TRUE); // The "on" field of SoSpotLight is
                                  // a single value field of type SoSFBool.
    ...
    ...
    // Change lightswitch.
    if (lightnode->on.getValue() == FALSE)
      lightnode->on = TRUE; // We can use operator = instead of setValue().
    else
      lightnode->on = FALSE;
    ...

When nodes, engines or other types of field containers are written to file, their single-value fields are written to file in this format:

    containerclass {
      fieldname value
      fieldname value
      ...
    }

..like this, for instance, a SpotLight node from a scene graph which will be default off when read back from file:

    SpotLight {
      on FALSE
    }

See also:
SoMField


Constructor & Destructor Documentation

SoSField::~SoSField [virtual]
 

The SoSField destructor is empty, and is only defined so we could make it virtual.

SoSField::SoSField void [protected]
 

The SoSField constructor is protected, as this is an abstract class.


Member Function Documentation

void SoSField::initClass void [static]
 

Internal method called upon initialization of the library (from SoDB::init()) to set up the type system.

Reimplemented from SoField.

Reimplemented in SoSFBool, SoSFColor, SoSFFloat, SoSFInt32, SoSFMatrix, SoSFName, SoSFPlane, SoSFRotation, SoSFShort, SoSFString, SoSFTime, SoSFUInt32, SoSFUShort, SoSFVec2f, SoSFVec3f, SoSFVec4f, SoSFImage, SoSFEnum, SoSFBitMask, SoSFNode, SoSFTrigger, SoSFEngine, and SoSFPath.

SoType SoSField::getClassTypeId void [static]
 

Returns a unique type identifier for this field class.

See also:
getTypeId(), SoType

Reimplemented from SoField.


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