ScXMLTransitionElt(3)
π ScXMLTransitionElt π
okay bestie, welcome to the <transition> SCXML element, straight out of the Coin manual (that's section 3, the C++ library girlies π). she's a class, she inherits from ScXMLElt, and she's about to take your state machine from one active state to another like it's nothing. periodt. π
β¨ SYNOPSIS β¨
#include <Inventor/scxml/ScXMLTransitionElt.h>
Inherits ScXMLElt.
πΈ Public Member Functions πΈ
virtual SoType getTypeId (void) constβ gives you back the type identification of an object derived from a class inheritingSoBase. this is the whole runtime type checking + "downward" casting situation.virtual void setEventAttribute (const char *event)β sets the event attribute.const char * getEventAttribute (void) constβ gets the event attribute.virtual void setCondAttribute (const char *cond)β sets the cond attribute.const char * getCondAttribute (void) constβ gets the cond attribute.virtual void setTargetAttribute (const char *target)β sets the target attribute.const char * getTargetAttribute (void) constβ gets the target attribute.virtual void setAnchorAttribute (const char *anchor)β sets the anchor attribute.const char * getAnchorAttribute (void) constβ gets the anchor attribute.virtual SbBool handleXMLAttributes (void)β handles those XML attributes, returns whether they're valid or a read error should happen.virtual void copyContents (const ScXMLElt *rhs)β copies the contents.virtual const ScXMLElt * search (const char *attrname, const char *attrvalue) constβ searches the SCXML structure for an element with the given attribute value for the given attribute.SbBool isConditionLess (void) constβ is this transition conditionless or not?SbBool isTargetLess (void) constβ is this transition missing a target setting or not?SbBool isSelfReferencing (void) constβ is this transition referencing its container or not?virtual SbBool isEventMatch (const ScXMLEvent *event) constβ TRUE if the transition matches the given event object, FALSE otherwise.virtual SbBool evaluateCondition (ScXMLStateMachine *statemachine)β uses the statemachine evaluator on its condition expression and returns TRUE or FALSE based on the result.virtual int getNumExecutables (void) constβ how many executables you got.virtual ScXMLExecutableElt * getExecutable (int idx) constβ grab the executable at that index.virtual void addExecutable (ScXMLExecutableElt *executable)β add an executable.virtual void removeExecutable (ScXMLExecutableElt *executable)β remove an executable.virtual void clearAllExecutables (void)β bye bye, all executables β¨virtual void execute (ScXMLStateMachine *statemachine) constβ runs the thing.
π¦ Public Member Functions inherited from ScXMLElt
void setXMLAttribute (const char *attribute, const char *value)const char * getXMLAttribute (const char *attribute) constScXMLElt * clone (void) constvirtual void setContainer (ScXMLElt *container)ScXMLElt * getContainer (void) constSbBool isContainedIn (const ScXMLElt *object) const
π¦ Public Member Functions inherited from ScXMLObject
SbBool isOfType (SoType type) constβ ReturnsTRUEif the type of this object is either of the same type or inherited from type.
π Static Public Member Functions π
static ScXMLEltReader * getElementReader (void)static SoType getClassTypeId (void)static void * createInstance (void)static void initClass (void)static void cleanClass (void)
π Static Public Member Functions inherited from ScXMLElt
static SoType getClassTypeId (void)static void initClass (void)static void cleanClass (void)
π Static Public Member Functions inherited from ScXMLObject
static SoType getClassTypeId (void)β this static method returns theSoTypeobject associated with objects of this class.static void initClass (void)β sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.static void cleanClass (void)β does the opposite ofinitClass, deallocates any class specific resources and resets the class to an uninitialized state with respect to the Coin type system.
π§ Protected Attributes π§
char * eventchar * condchar * targetchar * anchorSbBool needprefixmatchingSbName eventkeySbName targetkey
π Additional Inherited Members π
Static Protected Member Functions inherited from ScXMLElt
static void registerClassType (const char *xmlns, const char *classname, SoType type)static void registerInvokeClassType (const char *xmlns, const char *targettype, const char *source, SoType type)
Static Protected Member Functions inherited from ScXMLObject
static void registerClassType (const char *xmlns, const char *classname, SoType type)static void registerInvokeClassType (const char *xmlns, const char *targettype, const char *source, SoType type)
π Detailed Description π
the <transition> SCXML element. yes, that's the whole vibe. π
the <transition> element is used for invoking executable code and transition from the current active states in a state machine to a new set of active states.
by plural active states, it is meant that all the parent states of active states are also active at the same time, which is helpful when organizing common event triggered <transition> transitions. putting transitions in the root <scxml> element means that they are always active. like, always always. π
you also have the concept of parallel states in SCXML. this is not yet supported in Coin SCXML. sad but true bestie.
the following attributes are accepted:
eventcondtargetanchorβ not supported
the event attribute specifies the event that the transition will trigger for, if the <transition> element is in an active state. the event attribute can be specified with wildcard matching using "*", but with the following restrictions:
"*"must be at the end of the event name match."*"must match full dot-separated words.
Example 1: event="*"
Example 2: event="error.*"
the cond attribute can be used to specify additional conditions that must be met for the <transition> to be triggered. the condition expression language depends on which profile the SCXML state machine uses.
the "minimum" profile only specifies one function, which is the In({ID}) function. In() evaluates to TRUE if the state machine is currently in the state with the given ID.
the "x-coin" profile implements a number of expressions that evaluates to a truth value. while in development, documenting the expression language seems like too much overhead, so that part will have to wait. the source code can do the talking. see Coin/src/scxml/eval-coin-tab.y. iykyk π«Ά
the target attribute specifies the target states to transition to. if parallel states had been implemented, you would be able to specify multiple states in this attribute, but for now you can only specify one target state. if target is dropped, then the transition does not change what the active state is and will just execute the executable parts it contains. if target is the id of the state the <transition> is in, the state will be left/exited and then reentered again. for active substates, this means they will also be exited of course. π
the anchor attribute is not supported.
<transition> elements can contain executable SCXML elements as XML children, meaning <if> / <elseif> / <else>, <assign>, <send>, <event>, <log>.
Since
Coin 3.0
See also
ScXMLIfElt, ScXMLAssignElt, ScXMLSendElt, ScXMLEventElt, ScXMLLogElt
π Member Function Documentation π
β SoType ScXMLTransitionElt::getTypeId (void ) const [virtual]
returns the type identification of an object derived from a class inheriting SoBase. this is used for runtime type checking and "downward" casting.
See also
SoBase::getTypeId() const
implements ScXMLElt.
β SbBool ScXMLTransitionElt::handleXMLAttributes (void ) [virtual]
this method is called when the file reader has set all the XML attributes on the object, and wants the object to handle them and report if the values were OK or if a read error should be produced.
Returns
TRUE if the attributes are OK, and FALSE on error.
this base class implementation does nothing and just returns TRUE.
reimplemented from ScXMLElt.
β void ScXMLTransitionElt::copyContents (const ScXMLElt * rhs) [virtual]
reimplemented from ScXMLElt.
β const ScXMLElt * ScXMLTransitionElt::search (const char * attrname, const char * attrvalue) const [virtual]
this method searches the SCXML structure for an element with the given attribute value for the given attribute.
returns NULL if nothing was found. π
this function needs to be reimplemented to traverse child elements.
reimplemented from ScXMLElt.
β SbBool ScXMLTransitionElt::isConditionLess (void ) const
returns whether this is a conditionless SCXML transition or not.
a conditionless transition should always be taken. no questions asked. π
β SbBool ScXMLTransitionElt::isTargetLess (void ) const
returns whether this is a transition without a target setting or not.
when a targetless transition is taken, the state machine's state does not change. this differs from setting the target to its own state, which will cause the state machine to leave the state and reenter it again. yes they're different, no you cannot merge them. π
β SbBool ScXMLTransitionElt::isSelfReferencing (void ) const
returns whether this transition is referencing its container or not.
if TRUE, this means you should end up in the same state as you started with when doing this transition. note however that as opposed to a targetless transition, this transition should actually exit the state and then reenter it again. executable content will be invoked after exiting the state, before reentering.
β SbBool ScXMLTransitionElt::isEventMatch (const ScXMLEvent * eventobj) const [virtual]
this function returns TRUE if the transition matches the given eventobj object and FALSE otherwise.
β SbBool ScXMLTransitionElt::evaluateCondition (ScXMLStateMachine * statemachine) [virtual]
this function uses the statemachine evaluator to evaluate its condition expression, and returns TRUE or FALSE based on the evaluation.
on expression error, error events are emit'ed to the SCXML state machine.
if the transition is conditionless, this function will return TRUE.
β void ScXMLTransitionElt::execute (ScXMLStateMachine * statemachine) const [virtual]
calls invoke on all the ScXMLInvoke children.
πΈ Author πΈ
generated automatically by Doxygen for Coin from the source code.
ok so that's literally the whole page bestie, every flag, every signature, every inherited member, all of it. no skips, no cuts. you're welcome. π«Άβ¨
and for the cute sign-off: this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and it's the ScXMLTransitionElt(3) page, generated for Coin. slay, go build a state machine. πππ¦
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms