50#ifndef _SO_FIELD_CONTAINER_
51#define _SO_FIELD_CONTAINER_
53#include <Inventor/fields/SoSubFieldContainer.h>
54#include <Inventor/misc/SoBase.h>
55#include <Inventor/STL/set>
94class SoFieldContainer :
public SoBase {
131 SbBool copyConnections = FALSE);
138 {
return set(fieldDataString, NULL); }
166 {
return set(fieldDataString, NULL); }
175 {
get(fieldDataString, NULL); }
224 {
SbBool e = notifyEnabled; notifyEnabled = flag;
return e; }
249 {
return notifyEnabled; }
261 { m_userData = data; }
268 {
return m_userData; }
273 static void initClass();
274 static void exitClass();
292 {
return copyDictList; }
296 SoNONUNICODE
SbBool set(
const char *fieldDataString, SoInput *dictIn);
297 SbBool set(
const SbString& fieldDataString, SoInput *dictIn);
298 void get(SbString &fieldDataString, SoOutput *dictOut);
301 virtual void notify(SoNotList *);
304 virtual void fieldHasChanged( SoField* field );
307 virtual void startNotify();
311 virtual SbBool validateNewFieldValue(SoField *pField,
void *newValue);
316 virtual void addWriteReference(SoOutput *out,
SbBool isFromField = FALSE);
319 virtual void writeInstance(SoOutput *out);
323 virtual SbBool getIsBuiltIn()
const {
return FALSE; }
327 virtual const SoFieldData *getFieldData()
const;
335 static void initCopyDict();
338 static void addCopy(
const SoFieldContainer *orig,
339 const SoFieldContainer *copy);
344 static SoFieldContainer *checkCopy(
const SoFieldContainer *orig);
350 static SoFieldContainer *findCopy(
const SoFieldContainer *orig,
354 static void copyDone();
358 virtual void copyContents(
const SoFieldContainer *fromFC,
366 virtual SoFieldContainer *copyThroughConnection()
const;
370 typedef bool searchFieldContainerFunc(
const SoFieldContainer *fc);
371 static void searchParents(SoFieldContainer* node, searchFieldContainerFunc *func, std::set<SoFieldContainer*>& fclist);
384 SoFieldContainer(
const SoFieldContainer&);
387 virtual ~SoFieldContainer();
390 virtual SbBool readInstance(SoInput *in,
unsigned short flags);
392 static const SoFieldData** getFieldDataPtr() {
return NULL; }
403 static SoType classTypeId;
407 static SbPList *copyDictList;
411 static char *fieldBuf;
412 static size_t fieldBufSize;
416 static void unrefCopy(uintptr_t key,
void *instPtr);
420 static void *reallocFieldBuf(
void *ptr,
size_t newSize);
426 SoFieldContainer *cacheNext;
427 SoFieldContainer *cachePrev;
Character string stored in a hash table.
List of generic (void *) pointers.
Class for smart character strings.
Abstract base class for objects that contain fields.
SoNONUNICODE SbBool set(const char *fieldDataString)
Sets one or more fields in this object to the values specified in the given string,...
SbBool getFieldName(const SoField *field, SbName &fieldName) const
Returns the name of the given field in the fieldName argument.
virtual int getAllFields(SoFieldList &list) const
Returns a list of fields, including the eventIn's and eventOut's.
virtual SoField * getEventIn(const SbName &fieldName) const
Returns a the eventIn with the given name.
void get(SbString &fieldDataString)
Returns the values of the fields of this object in the Open Inventor ASCII file format in the given s...
static SoType getClassTypeId()
Returns the type of this class.
SbBool fieldsAreEqual(const SoFieldContainer *fc) const
Returns TRUE if this object's fields are exactly equal to fc's fields.
void setToDefaults()
Sets all fields in this object to their default values.
SbBool enableNotify(SbBool flag)
Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
void * getUserData(void) const
Gets user application data.
virtual SoField * getField(const SbName &fieldName) const
Returns a the field of this object whose name is fieldName.
virtual void setUserData(void *data)
Sets application data.
SbBool hasDefaultValues() const
Returns TRUE if all of the object's fields have their default values.
friend class SoFieldContainerExt
SbBool set(const SbString &fieldDataString)
Sets one or more fields in this object to the values specified in the given string,...
virtual SoField * getEventOut(const SbName &fieldName) const
Returns the eventOut with the given name.
void copyFieldValues(const SoFieldContainer *fc, SbBool copyConnections=FALSE)
Copies the contents of fc's fields into this object's fields.
virtual int getFields(SoFieldList &list) const
Appends references to all of this object's fields to resultList, and returns the number of fields app...
SbBool isNotifyEnabled() const
Notification is the process of telling interested objects that this object has changed.
Base class for all fields.
Maintains a list of pointers to fields.
Stores runtime type information.