Open Inventor Reference
SoSFTrigger Class Reference

Field used to trigger engines or connection networks. More...

#include <Inventor/fields/SoSFTrigger.h>

Inheritance diagram for SoSFTrigger:
SoSField SoField

Public Member Functions

void setValue ()
 Starts the notification process; this is equivalent to calling touch().
 
void getValue () const
 Forces any connected engines or fields to evaluate themselves.
 
virtual void touch ()
 Start notification.
 
bool operator== (const SoSFTrigger &t) const
 All trigger fields are equal; these methods always return TRUE and FALSE, respectively.
 
bool operator!= (const SoSFTrigger &t) const
 All trigger fields are equal; these methods always return TRUE and FALSE, respectively.
 
virtual void startNotify ()
 Notification can flow through a trigger, but can't start at a trigger.
 
virtual void notify (SoNotList *list)
 Override notify to always evaluate (after passing on notification) to clear upstream dirty bits.
 
- Public Member Functions inherited from SoSField
virtual ~SoSField ()
 Destructor.
 
- Public Member Functions inherited from SoField
virtual ~SoField ()
 Destructor.
 
void setIgnored (bool ig)
 Sets the ignore flag for this field.
 
bool isIgnored () const
 Gets the ignore flag for this field.
 
bool isDefault () const
 Gets the state of default flag of the field.
 
virtual SoType getTypeId () const =0
 Return the type identifier for this field instance (SoField *).
 
bool isOfType (SoType type) const
 Returns TRUE if this field is the given type or derived from that type.
 
void enableConnection (bool flag)
 Field connections may be enabled and disabled.
 
bool isConnectionEnabled () const
 Returns FALSE if connections to this field are disabled.
 
bool connectFrom (SoEngineOutput *engineOutput)
 Connects the field to the given output of an engine or to another field.
 
bool connectFrom (SoField *field)
 
void disconnect ()
 Disconnect the field from whatever it was connected to.
 
bool isConnected () const
 Returns TRUE if the field is connected to anything.
 
bool isConnectedFromEngine () const
 Returns TRUE if the field is connected to an engine's output.
 
bool isConnectedFromField () const
 Returns TRUE if the field is connected to another field.
 
bool getConnectedEngine (SoEngineOutput *&engineOutput) const
 Returns TRUE if this field is being written into by an engine, and returns the engine output it is connected to in engineOutput.
 
bool getConnectedField (SoField *&field) const
 Returns TRUE if this field is being written into by another field, and returns the field it is connected to in writingField.
 
int getForwardConnections (SoFieldList &list) const
 Adds pointers to all of the fields that this field is writing into (either fields in nodes, global fields or engine inputs) to the given field list, and returns the number of forward connections.
 
SoFieldContainergetContainer () const
 Returns the containing node or engine.
 
bool set (const char *valueString)
 Sets the field to the given value, which is an ASCII string in the Inventor file format.
 
void get (SbString &valueString)
 Returns the value of the field in the Inventor file format, even if the field has its default value.
 
virtual void touch ()
 Simulates a change to the field, causing attached sensors to fire, connected fields and engines to be marked as needing evaluation, and so forth.
 
bool operator== (const SoField &f) const
 Return TRUE (FALSE) if this field is of the same type and has the same value as f.
 
bool operator!= (const SoField &f) const
 Return TRUE (FALSE) if this field is of the same type and has the same value as f.
 
void setDefault (bool def)
 Sets default flag.
 
virtual void startNotify ()
 Initiates or propagates notification through container.
 
virtual void notify (SoNotList *list)
 
void setContainer (SoFieldContainer *cont)
 Sets the containing node.
 
bool shouldWrite () const
 Returns TRUE if the field really needs to be written out.
 
void addAuditor (void *auditor, SoNotRec::Type type)
 Adds/removes an auditor to/from list.
 
void removeAuditor (void *auditor, SoNotRec::Type type)
 
bool enableNotify (bool flag)
 Indicates whether notification will propagate as the result of setting the field value.
 
bool isNotifyEnabled () const
 
bool enableContainerNotify (bool flag)
 Indicates whether notification will propagate to the SoFieldContainer that owns the field.
 
bool isContainerNotifyEnabled () const
 
virtual void connectionStatusChanged (int numConnections)
 Indicates to a field that a change has been made involving a connection from it (as source) to another field.
 
bool isReadOnly () const
 If this returns TRUE, it means we're in the middle of doing a setValue()+valueChanged() and values from an upstream connection shouldn't write into this field.
 
virtual bool isSame (const SoField &f) const =0
 Returns TRUE if the given field is of the same type and has the same value(s) as this.
 
virtual void copyFrom (const SoField &f)=0
 Copies the value from one field to another, assuming same subclass.
 
virtual void fixCopy (bool copyConnections)
 After a field value has been copied using copyFrom(), this is called to allow fields to update the copy.
 
virtual bool referencesCopy () const
 This returns TRUE if this field contains a reference to a node or engine that is copied during a copy operation (i.e., it is "inside").
 
void copyConnection (const SoField *fromField)
 Copies connection from one field to another.
 
virtual bool read (SoInput *in, const SbName &name)
 Reads value of field (with given name) from file as defined by SoInput.
 
virtual void write (SoOutput *out, const SbName &name) const
 Writes field (with given name) to file as defined by SoOutput.
 
virtual void countWriteRefs (SoOutput *out) const
 Counts write-references on field to prepare for writing.
 
void evaluate () const
 Evaluates the field from whatever it's connected to.
 

Static Public Member Functions

static void initClass ()
 
- Static Public Member Functions inherited from SoSField
static SoType getClassTypeId ()
 Return the type identifier for this field class.
 
static void initClass ()
 
static void * createInstance ()
 
- Static Public Member Functions inherited from SoField
static SoType getClassTypeId ()
 Return the type identifier for this field class.
 
static void initClass ()
 
static void initClasses ()
 Initialize ALL Inventor node classes.
 

Additional Inherited Members

- Protected Member Functions inherited from SoSField
 SoSField ()
 Constructor.
 
- Protected Member Functions inherited from SoField
 SoField ()
 Constuctor:
 
void valueChanged (bool resetDefault=TRUE)
 Called by an instance to indicate that a value has changed.
 
virtual void evaluateConnection () const
 Evaluates the field or engine the field is connected to, storing the result in the field.
 
virtual bool readValue (SoInput *in)=0
 Reads value(s) of field.
 
virtual bool readConnection (SoInput *in)
 Reads connection.
 
virtual void writeValue (SoOutput *out) const =0
 Writes value(s) of field.
 
virtual void writeConnection (SoOutput *out) const
 Writes field connection.
 

Detailed Description

This class can be used to start or to synchronize a network of field connections. It is the "null" field em a field with no values. It is typically used as the "start button" for engines that change over time.

Triggers can be connected from any other type of field, and will notify any engines or nodes they are part of (or any other triggers they are connected to) whenever the value of the field is set (even if it is set to its current value) or the field is touch()'ed.

Since they have no value, SoSFTriggers are not written to file. A node or engine containing an SoSFTrigger field will write only the field's name.

See Also
SoSFBool, SoMFBool

Definition at line 88 of file SoSFTrigger.h.

Member Function Documentation

◆ getValue()

void SoSFTrigger::getValue ( ) const
inline

Definition at line 100 of file SoSFTrigger.h.

◆ initClass()

static void SoSFTrigger::initClass ( )
static

◆ notify()

virtual void SoSFTrigger::notify ( SoNotList list)
virtual

Reimplemented from SoField.

◆ operator!=()

bool SoSFTrigger::operator!= ( const SoSFTrigger t) const

◆ operator==()

bool SoSFTrigger::operator== ( const SoSFTrigger t) const

◆ setValue()

void SoSFTrigger::setValue ( )
inline

Definition at line 97 of file SoSFTrigger.h.

References SoField::touch().

◆ startNotify()

virtual void SoSFTrigger::startNotify ( )
virtual

The only way to start notification at a trigger is to call touch().

Reimplemented from SoField.

◆ touch()

virtual void SoSFTrigger::touch ( )
virtual

Reimplemented from SoField.


The documentation for this class was generated from the following file: