GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SOMFIELD (3)

NAME

SoMField — base class for all multiple-valued fields

CONTENTS

Inherits From
Synopsis
Description
Methods
See Also

INHERITS FROM

SoField > SoMField

SYNOPSIS

#include <Inventor/fields/SoField.h>

Methods from class SoMField:

    int    
                    
int                  getNum() const    
void    
                    
void                 setNum(int num)    
virtual void    
                    
virtual void         deleteValues(int start, int num = -1)    
virtual void    
                    
virtual void         insertSpace(int start, int num)    
SbBool    
                    
SbBool               set1(int index, const char *valueString)    
void    
                    
void                 get1(int index, SbString &valueString)    
static SoType    
                    
static SoType        getClassTypeId()

Methods from class SoField:

    void    
                    
void                 setIgnored(SbBool ignore)    
SbBool    
                    
SbBool               isIgnored() const    
SbBool    
                    
SbBool               isDefault() const    
virtual SoType    
                    
virtual SoType       getTypeId() const    
virtual SbBool    
                    
virtual SbBool       isOfType(SoType type) const    
SbBool    
                    
SbBool               set(const char *valueString)    
void    
                    
void                 get(SbString &valueString)    
int    
                    
int                  operator ==(const SoField &f) const    
int    
                    
int                  operator !=(const SoField &f) const    
void    
                    
void                 touch()    
SbBool    
                    
SbBool               connectFrom(SoField *fromField)    
SbBool    
                    
SbBool               connectFrom(SoEngineOutput *fromEngine)    
void    
                    
void                 disconnect()    
SbBool    
                    
SbBool               isConnected() const    
SbBool    
                    
SbBool               isConnectedFromField() const    
SbBool    
                    
SbBool               getConnectedField(SoField *&writingField) const    
SbBool    
                    
SbBool               isConnectedFromEngine() const    
SbBool    
                    
SbBool               getConnectedEngine(SoEngineOutput *&engineOutput) const    
void    
                    
void                 enableConnection(SbBool flag)    
SbBool    
                    
SbBool               isConnectionEnabled() const    
int    
                    
int                  getForwardConnections(SoFieldList &list) const    
SoFieldContainer *    
                    
SoFieldContainer *   getContainer() const

DESCRIPTION

Each class derived from SoMField begins with an SoMF prefix and contains a dynamic array of values of a particular type. Each has a setValues() method that is passed a pointer to a const array of values of the correct type; these values are copied into the array in the field, making extra room in the array if necessary. The start and num parameters to this method indicate the starting array index to copy into and the number of values to copy.

The getValues() method for a multiple-value field returns a const pointer to the array of values in the field. (Because this pointer is const, it cannot be used to change values in this array.)

In addition, the indexing operator "[]" is overloaded to return the i’th value in the array; because it returns a const reference, it can be used only to get values, not to set them.

Methods are provided for getting the number of values in the field, inserting space for new values in the middle, and deleting values.

There are other methods that allow you to set only one value of several in the field and to set the field to contain one and only one value.

Two other methods can be used to make several changes to a multiple-value field without the overhead of copying values into and out of the fields. The startEditing() method returns a non-const pointer to the array of values in the field; this pointer can then be used to change (but not add or remove) any values in the array. The finishEditing() method indicates that the editing is done and notifies any sensors or engines that may be connected to the field.

SoMFields are written to file as a series of values separated by commas, all enclosed in square brackets. If the field has no values (getNum() returns zero), then only the square brackets ("[]") are written. The last value may optionally be followed by a comma. Each field subtype defines how the values are written; for example, a field whose values are integers might be written as:



[ 1, 2, 3, 4 ] or: [ 1, 2, 3, 4, ]

METHODS

    int    
                    
int                  getNum() const
Returns the number of values currently in the field.

    void    
                    
void                 setNum(int num)
Forces this field to have exactly num values, inserting or deleting values as necessary.

    virtual void    
                    
virtual void         deleteValues(int start, int num = -1)
Deletes num values beginning at index start (index start through start+num-1 will be deleted, and any leftover values will be moved down to fill in the gap created). A num of -1 means delete all values from start to the last value in the field; getNum() will return start as the number of values in the field after this operation (deleteValues(0, -1) empties the field).

    virtual void    
                    
virtual void         insertSpace(int start, int num)
Inserts space for num values at index start. Index start through start+num-1 will be moved up to make room. For example, to make room for 7 new values at the beginning of the field call insertSpace(0, 10).

    SbBool    
                    
SbBool               set1(int index, const char *valueString)    
void    
                    
void                 get1(int index, SbString &valueString)
These are equivalent to the set() and get() methods of SoField, but they operate on only one value. See the SoField methods for details.

    static SoType    
                    
static SoType        getClassTypeId()
Return the type identifier for this field class.

SEE ALSO

SoNode, SoEngine

Search for    or go to Top of page |  Section 3 |  Main Index


SOMFIELD(3IV) (-->)

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.