scxml(3)
๐ scxml โ State Chart XML Classes ๐
okay bestie, welcome to scxml(3), from the Library Functions Manual โจ. this is the Coin-flavored SCXML page and it's a lot, so grab a snack ๐.
๐ธ NAME ๐ธ
scxml โ State Chart XML Classes. that's it, that's the vibe. ๐ฆ
โจ SYNOPSIS โจ
๐ Classes ๐
class ScXMLโ Namespace for static ScXML-related functions. ๐งclass ScXMLEventโ Base class for events sent to SCXML state machines.class ScXMLInvokeโ Implementation of the<invoke>SCXML element. ๐class ScXMLObjectโ Base class for all SCXML objects.class ScXMLStateMachineโ Manager for processing events and setting states in SCXML structures. ๐class SoScXMLEventโ Adds anSoEventholder to theScXMLEventbase.class SoScXMLStateMachineโ Integration level for using Coin events with SCXML-based state machines. ๐
๐ Detailed Description ๐
so this whole set of classes is a basic implementation of State Chart XML. and listen โ it is not complete, and it is not necessarily conformant to even the parts it does implement. ngl, it's still a decent start tho, and there are plans to implement more of the specification. ๐ช
currently Coin uses SCXML for managing 3D viewer user interaction (the non-model-interaction part) โ the examiner navigation mode, in layman's terms ๐ โ but with a more complete implementation of SCXML, the potential for more uses should be quite huge. lowkey iconic.
The Draft Specification for SCXML is at http://www.w3.org/TR/scxml/. ๐ฅ
Since
Coin 3.0
โญ State Chart XML โญ
The ScXML part of Coin is a basic, non-conformant, partial implementation of State Chart XML, based on the W3C Working Draft 21 February 2007 of SCXML http://www.w3.org/TR/2007/WD-scxml-20070221/. Read that document for a basic understanding how SCXML documents should be constructed. ๐
NOTE: A new version of the draft has just been released (May 2008). The code here does not reflect any changes done to the draft SCXML specification yet. ๐
Coin uses it for its navigation system, to be able to remove hardcoded logic for user navigation and externalize it into XML files. It is hoped that this technology will prove to be a useful addition to Coin and get broader use as this subsystem matures. The dragger and manipulator user interaction logic is likely one area where ScXML might be employed later. Attaching state machines to interactive parts of the scene graph could be another interesting idea for the future. ๐ฆ
For now, the ScXML system is not employed in any pre-established Coin usage patterns, and you will need to employ new features to touch base with it. The most obvious are where ScXML will be used is if you use Quarter 1.0 over Coin 3.0, as you manipulate the camera movements around the 3D models through mouse and keyboard interaction. ๐ฎ
The Coin type system makes it possible to override the default types to have the state chart description instantiated using customized objects. A design choice made in that regard was to both use the type overriding system in Coin, and also to use the 'xmlns' (XML Namespace) attribute to make ScXML types available and to prioritize which classtypes to instantiate objects from. The xmlns attribute is currently only checked at the document level, but the plan is to let any state have this attribute, and to simulate static scoping rules for namespace prioritization. ๐ง
Partially Supported Items:
- At the moment, the Coin ScXML module only supports "Executable Content" through the
<invoke>element, using theScXMLInvokeclass interface and having the Executable Content written in C++ in subclasses of theScXMLInvokeclass. ECMAScript and XPath is not supported yet. ๐ญ
Unsupported Items:
- External document referencing through the
<state>/<parallel>'src'attribute is not yet handled, but should be easy to implement so it will likely be one of the first things that will be fixed. ๐ง - The
<parallel>element is not supported as intended with parallel states. Coin will just treat it as an ordinary<state>element for now. Parallel states is not high up on the priority list, so expect this to be handled after a lot of other functionality is in place. ๐ - The
<datamodel>-related part of the specification is not supported. - The
conditionattribute in the<transition>element is not supported, so the only condition you can set is on the event type in the event attribute. TheScXMLTransitionclass has a virtual methodSbBool evaluateCondition()which is used in the state machine logic, and should be all that is needed to overload to implement this in subclasses yourself. ๐ - The
'target'attribute in the<transition>element can only identify a single state currently, not multiple as you would have to when having support for<parallel>elements (which we don't have). ๐ซ - The virtual state elements like
<history>and<anchor>are just implemented as dummy states for now and do not do anything in relation to what they should actually do. - There are no mechanisms for inter-statemachine event passing yet.
For learning more about how ScXML is implemented and used in Coin, take a look at $COINDIR/scxml/navigation/examiner.xml (or in the Coin source directory, data/scxml/navigation/examiner.xml) for an example of how an SCXML system for camera navigation looks, and look at the ScXML* source files in src/navigation/ for the C++ counterparts to the same SCXML navigation system. ๐
With support for <datamodel>, <transition>-conditions, and inline executable content in the XML file in some scripting language, the C++ parts could probably have been greatly simplified, if not more or less eliminated. This will hopefully evolve for future versions of Coin. ๐ฑ
Since
Coin 3.0
๐ Author ๐
Generated automatically by Doxygen for Coin from the source code. ๐ค (not me, i'm just the messenger bestie)
and that's a wrap on scxml(3) โ this one's from Coin, Version 3.1.3, and no date on the page so we're just gonna say it's giving timeless ๐
. slay, go read the spec, periodt. ๐โจ๐
๐ฆ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 ยท GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 ยท GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 ยท GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms