![]() |
http://www.sim.no http://www.coin3d.org |
SoEngine is the base class for Coin engines. More...
#include <Inventor/engines/SoEngine.h>
Protected Member Functions | |
SoEngine (void) | |
virtual | ~SoEngine () |
virtual void | evaluate (void)=0 |
virtual SbBool | readInstance (SoInput *in, unsigned short flags) |
virtual void | inputChanged (SoField *which) |
void | writeOutputTypes (SoOutput *out) |
![]() | |
SoFieldContainer (void) | |
~SoFieldContainer () | |
![]() | |
SoBase (void) | |
virtual | ~SoBase () |
SbBool | hasMultipleWriteRefs (void) const |
SbBool | writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const |
void | writeFooter (SoOutput *out) const |
virtual const char * | getFileFormatName (void) const |
Static Protected Member Functions | |
static const SoFieldData ** | getInputDataPtr (void) |
static const SoEngineOutputData ** | getOutputDataPtr (void) |
![]() | |
static uint32_t | getCurrentWriteCounter (void) |
static void | staticDataLock (void) |
static void | staticDataUnlock (void) |
Friends | |
class | SoEngineOutput |
Additional Inherited Members | |
![]() | |
enum | BaseFlags { IS_ENGINE = 0x01 , IS_GROUP = 0x02 } |
![]() | |
SbBool | isBuiltIn |
SoEngine is the base class for Coin engines.
Engines enables the application programmers to make complex connections between fields.
The most common cases where you use engines are: 1) to constrain the values of a field with regard to the contents of one or more other fields in the scene graph, 2) as a convenient way to animate parts of the scene graph.
The reference count of an engine will be increased by 1 for each connection made to one of its engine outputs, and decreased by one for a disconnect. See SoEngineOutput::addConnection() and SoEngineOutput::removeConnection(). When the reference count goes down to zero, the engine will automatically be destroyed, and subsequent attempts at using the engine will lead to a crash.
If you want complete control over when an engine gets destructed, use SoBase::ref() and SoBase::unref() for explicit referencing/dereferencing.
|
protected |
Default constructor.
|
protectedvirtual |
Destructor.
References SoDebugError::postInfo().
Initializes all engines. Automatically called from SoEngine::initClass() upon initialization of Coin.
Triggers an engine evaluation.
References evaluate(), and getOutputData().
Referenced by SoField::evaluateConnection().
|
virtual |
Adds all outputs to list. Returns the number of outputs added to the list.
References SbList< Type >::append(), and getOutputData().
Referenced by SoFieldConverter::getForwardConnections().
SoEngineOutput * SoEngine::getOutput | ( | const SbName & | outputname | ) | const |
Returns the output with name outputname, or NULL
if no such output exists.
References getOutputData().
SbBool SoEngine::getOutputName | ( | const SoEngineOutput * | output, |
SbName & | outputname ) const |
Sets \outputname to the name of output. Returns FALSE
if no such output is contained within the engine instance.
References getOutputData().
|
pure virtual |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Implemented in SoBoolOperation, SoCalculator, SoComposeMatrix, SoComposeRotation, SoComposeRotationFromTo, SoComposeVec2f, SoComposeVec3f, SoComposeVec4f, SoComputeBoundingBox, SoConcatenate, SoCounter, SoDecomposeMatrix, SoDecomposeRotation, SoDecomposeVec2f, SoDecomposeVec3f, SoDecomposeVec4f, SoElapsedTime, SoFieldConverter, SoGate, SoInterpolate, SoInterpolateFloat, SoInterpolateRotation, SoInterpolateVec2f, SoInterpolateVec3f, SoInterpolateVec4f, SoOneShot, SoOnOff, SoSelectOne, SoTimeCounter, SoTransformVec3f, and SoTriggerAny.
Referenced by evaluateWrapper(), SoEngineOutput::getConnectionType(), getOutput(), getOutputName(), getOutputs(), and notify().
Returns the engine named name, or NULL
if no such engine exists. If several engines have been registered under the same name, returns the last one which was registered.
References SoBase::getNamedBase().
|
static |
Finds all engines named name. Returns the number of engines added to the el list.
References SoBase::getNamedBases().
SbBool SoEngine::isNotifying | ( | void | ) | const |
Returns whether we're in a notification process. This is needed to avoid double notification when an engine enables outputs during inputChanged().
Referenced by notify().
Notifies all auditors for this instance when changes are made.
Reimplemented from SoFieldContainer.
References SbList< Type >::append(), SoNotList::getLastField(), SoBase::getName(), getOutputData(), SoBase::getTypeId(), inputChanged(), SoFieldContainer::isNotifyEnabled(), isNotifying(), and SoDebugError::postInfo().
Make a duplicate of this engine and return a pointer to the duplicate.
Connections are shallow copied, ie the node or engine instance at the other end of the connection is not cloned. We just let the connection reference from the cloned engine refer to the same instance as the engine we've cloned ourselves from.
Note that this is not the function the application programmer should override if she needs some special behavior during a copy operation (like copying the value of internal data not exposed as fields). For that purpose, override the copyContents() method. Your overridden copyContents() method should then both copy internal data aswell as calling the parent superclass' copyContents() method for automatically handling of fields and other common data.
References SoFieldContainer::addCopy(), SoFieldContainer::checkCopy(), SoFieldContainer::copyDone(), SoFieldContainer::findCopy(), SoBase::getTypeId(), and SoFieldContainer::initCopyDict().
|
virtual |
Return copy of this instance.
Note: default implementation just returns this
pointer, SoNode and SoEngine overrides this method to return the pointer to the actual copy.
Reimplemented from SoFieldContainer.
References SoFieldContainer::checkCopy(), SoFieldContainer::findCopy(), and shouldCopy().
SbBool SoEngine::shouldCopy | ( | void | ) | const |
Returns whether this engine should be copied or simply referenced in a copy operation.
Engines which are not really part of the scenegraph should not be copied.
References SoFieldContainer::getFields(), SoBase::getName(), SoBase::getTypeId(), and SoDebugError::postInfo().
Referenced by copyThroughConnection().
Writes all the fields contained in this instance to the output stream within out.
This method is solely called from the write methods of fields.
Either from SoField if the write is done because of a field-to-field connection, or from one of the fields which may actually write SoFieldContainer instances, i.e. SoSFNode, SoMFNode, SoSFEngine, SoMFEngine, SoSFPath and SoMFPath.
This method, in addition to the ordinary write() method of SoNode, needs to be present since the fields don't have a write action instance in their writeValue() method, and writeInstance() will create a new SoWriteAction and call continueToApply() on it.
Reimplemented from SoFieldContainer.
Reimplemented in SoElapsedTime, and SoTimeCounter.
References SoBase::writeFooter(), SoBase::writeHeader(), and SoFieldContainer::writeInstance().
Referenced by SoElapsedTime::writeInstance(), and SoTimeCounter::writeInstance().
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Referenced by evaluateWrapper().
This method is mainly intended for internal use during file import operations.
It reads a definition of an instance from the input stream in. The input stream state points to the start of a serialized / persistant representation of an instance of this class type.
TRUE
or FALSE
is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not. The import process should be robust and handle corrupted input streams by returning FALSE
.
flags is used internally during binary import when reading user extension nodes, group nodes or engines.
Reimplemented from SoFieldContainer.
References SoFieldContainer::readInstance().
Called when an input is changed. The default method does nothing, but subclasses may override this method to do the The Right Thing when a specific field is changed.
Reimplemented in SoCalculator, SoGate, and SoTimeCounter.
Referenced by notify().
|
staticprotected |
Returns the SoFieldData class which holds information about inputs in this engine.
|
staticprotected |
Returns the SoEngineOutputData class which holds information about the outputs in this engine.
Writes the types of engine outputs for extension engines (i.e. engines not built in to Coin).
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Jan 22 2024 for Coin by Doxygen. 1.10.0