55#include <Inventor/SbString.h>
56#include <Inventor/SoTypedObject.h>
57#include <Inventor/misc/SoNotification.h>
58#include <Inventor/misc/SoAuditorList.h>
59#include <Inventor/threads/SbThreadMutex.h>
60#include <Inventor/threads/SbThreadLocalStorage.h>
61#include <Inventor/sensors/SoDataSensor.h>
62#include <Inventor/misc/SoMemoryObject.h>
65class SoVRMLInterpOutput;
66struct SoFieldConnectionInfo;
68struct SoFieldAuditorInfo;
69class SoFieldConverter;
77#ifndef HIDDEN_FROM_DOC
85struct SoFieldAuditorInfo {
88 { connection.field=NULL; }
93 SoAuditorList auditors;
100 SoVRMLInterpOutput *interpOutput;
113struct SoFieldConnectionInfo {
121 SoVRMLInterpOutput *interpOutput;
124 unsigned int converted : 1;
125 unsigned int fromEngine : 1;
126 unsigned int fromVRMLInterp : 1;
239#ifndef HIDDEN_FROM_DOC
299 {
return flags.connectionEnabled; }
375 if (indexToConnectInfo)
511 {
return isSame(f); }
517 {
return ! isSame(f); }
524 static void initClass();
525 static void exitClass();
527 SB_THREAD_TLS_HEADER();
530 static void initClasses();
531 static void exitClasses();
539 SbBool setVRML(
const char *valueString);
543 void setDefault(
SbBool def) { flags.hasDefault = def; }
546 virtual void startNotify();
547 virtual void notify(SoNotList *list);
556 SbBool shouldWrite()
const;
559 void addAuditor(
void *auditor, SoNotRec::Type type);
560 void removeAuditor(
void *auditor, SoNotRec::Type type);
566 SbBool isNotifyEnabled()
const
567 {
return flags.notifyEnabled; }
574 virtual void connectionStatusChanged(
int numConnections);
579 SbBool isReadOnly()
const {
return flags.readOnly; }
587 virtual void copyFrom(
const SoField &f) = 0;
593 virtual void fixCopy(
SbBool copyConnections);
601 virtual SbBool referencesCopy()
const;
605 void copyConnection(
const SoField *fromField);
616 virtual void countWriteRefs(
SoOutput *out)
const;
622 void evaluate()
const
623 {
if (flags.dirty) evaluateConnection(); }
626 void setFieldType(
int flagValue)
627 { flags.fieldType = flagValue; };
630 int getFieldType()
const
631 {
return flags.fieldType; };
635 {
return flags.dirty; };
637 void setDirty(
SbBool value)
638 { flags.dirty = value; };
641 SbBool getUserDataIsUsed()
const
642 {
return flags.userDataIsUsed; };
644 void setUserDataIsUsed(
SbBool value)
645 { flags.userDataIsUsed = value; };
648 SbBool getSameValueNotificationEnabled()
const
649 {
return flags.sameValueNotificationEnabled; };
692 void setOnValueChangedCallback(
const std::function<
void(
SoField* current )>& value );
694 virtual bool isEnabledMemObj() {
return false; }
704 FIELD_EVENTIN_FIELD = 3,
708 UNSUPPORTED_FIELD = 7
715 void valueChangedBasic(
SbBool resetDefault = TRUE);
720 virtual void evaluateConnection()
const;
729 virtual void writeValue(
SoOutput *out)
const = 0;
732 virtual void writeConnection(
SoOutput *out)
const;
743 static void *reallocFieldBuf(
void *ptr,
size_t newSize);
750 static SoType classTypeId;
753 static bool s_defaultSameValueNotificationEnabled;
758 unsigned int hasDefault : 1;
759 unsigned int ignored : 1;
760 unsigned int connected : 1;
761 unsigned int converted : 1;
762 unsigned int fromEngine : 1;
763 unsigned int connectionEnabled : 1;
764 unsigned int notifyEnabled : 1;
765 unsigned int hasAuditors : 1;
766 unsigned int isEngineModifying : 1;
767 unsigned int readOnly : 1;
768 unsigned int dirty : 1;
769 unsigned int fromVRMLInterp : 1;
770 unsigned int fieldType : 3;
771 unsigned int userDataIsUsed : 1;
772 unsigned int sameValueNotificationEnabled : 1;
798 void createAuditorInfo();
801 SoFieldConnectionInfo* createConnectionInfo(
void* fromWhere);
805 int findConnectionInfo(
void* fromWhere)
const ;
809 SoFieldConverter *createConverter(
const SoType &fromFieldType)
const;
812 void reallyDisconnect();
816 SoFieldConverter *getConverter()
const;
822 std::function<void(
SoField* current )> m_onValueChanged;
831#include <Inventor/fields/SoSField.h>
832#include <Inventor/fields/SoMField.h>
Character string stored in a hash table.
List of generic (void *) pointers.
int getLength() const
Returns number of pointers in list.
Class for smart character strings.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
Class for all engine outputs.
Abstract base class for objects that contain fields.
Base class for all fields.
SoNONUNICODE SbBool set(const char *valueString)
Sets the field to the given value, which is an ASCII string in the Open Inventor file format.
SbBool connectFrom(SoEngineOutput *engineOutput)
Connects this field from an engine output.
SbBool isDefault() const
Gets the state of default flag of the field.
void disconnect(SoVRMLInterpOutput *interpOutput)
Disconnect the field from the requested interpOutput.
SbBool appendConnection(SoVRMLInterpOutput *interpOutput)
Appends this field to the list of connections from another interpOutput.
int operator==(const SoField &f) const
Return TRUE if this field is of the same type and has the same value as f.
SbBool isConnected() const
Returns TRUE if the field is connected to anything.
friend class SoVRMLInterpOutput
void disconnect(SoField *field)
Disconnect the field from the requested field.
SbBool set(const SbString &valueString)
Sets the field to the given value, which is an ASCII string in the Open Inventor file format.
void disconnect()
Disconnect the field from whatever it was connected to.
SbBool isConnectionEnabled() const
Returns FALSE if connections to this field are disabled.
SoFieldAuditorInfo * auditorInfo
SbBool getConnectedField(SoField *&writingField) const
Returns TRUE if this field is being written into by another field, and returns the field it is connec...
virtual size_t getValueSize() const
Gets the size of the value.
SbBool isIgnored() const
Gets the ignore flag for this field.
SoFieldContainer * container
virtual void touch()
Simulates a change to the field, causing attached sensors to fire, connected fields and engines to be...
int getConnections(SoFieldList &list)
Returns a list of the connections to this field.
SbBool appendConnection(SoField *field)
Appends this field to the list of connections from another field.
void enableConnection(SbBool flag)
Field connections may be enabled and disabled.
void disconnect(SoEngineOutput *engineOutput)
Disconnect the field from the requested engineOutput.
SbBool connectFrom(SoField *field)
Connects this field to another field.
SbBool isConnectedFromEngine() const
Returns TRUE if the field is connected to an engine's output.
SbBool isConnectedFromField() const
Returns TRUE if the field is connected to another field.
static SoType getClassTypeId()
Return the type identifier for this field class.
SbBool connectFrom(SoVRMLInterpOutput *interpOutput)
Connects this field from an interpOutput.
void setIgnored(SbBool ig)
Sets the ignore flag for this field.
int getForwardConnections(SoFieldList &list) const
Adds references to all of the fields that this field is writing into (either fields in nodes,...
void get(SbString &valueString)
Returns the value of the field in the Open Inventor file format, even if the field has its default va...
SbBool isConnectedFromVRMLInterp() const
Returns TRUE if the field is connected to a VRML interpOutput.
int operator!=(const SoField &f) const
Return FALSE if this field is of the same type and has the same value as f.
int getNumConnections() const
Returns the number of connections to this field.
SbBool getConnectedEngine(SoEngineOutput *&engineOutput) const
Returns TRUE if this field is being written into by an engine, and returns the engine output it is co...
SbBool getConnectedVRMLInterp(SoVRMLInterpOutput *&interpOutput) const
Returns the VRMLInterpolator output field is connected to.
SoFieldContainer * getContainer() const
Returns the object that contains this field.
SbBool appendConnection(SoEngineOutput *engineOutput)
Appends this field to the list of connections from another engineOutput.
Maintains a list of pointers to fields.
Sensor class that can be attached to Open Inventor fields.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Handle memory bu...
Used to write Open Inventor data files.
Stores runtime type information.
Base class for object storing runtime type information.