Jean-Yves Didier

maj module coin

......@@ -16,7 +16,7 @@
{
diffuseColor [1 0 0]
}
DEF cube0 Cube
DEF rouge Cube
{
width 2
height 1
......@@ -27,7 +27,7 @@
diffuseColor [0 1 0]
}
DEF cube1 Cube
DEF vert Cube
{
width 2
height 1
......
<application mode="gui">
<context>
<libraries>
<library path="../../lib/arcscoin"/>
<library path="../../libs/arcscoin"/>
</libraries>
<components>
<component id="v" type="Viewer"></component>
......
......@@ -27,7 +27,7 @@
<process controller="s">
<sheet id="start">
<connections>
<link source="i" signal="timeOut" destination="spy"
<link source="i" signal="timeOut(SFTime)" destination="spy"
slot="log()"/>
</connections>
<postconnections>
......@@ -35,7 +35,7 @@
<invoke destination="v" slot="setSceneGraph(SoFieldContainer*)" type="component">c</invoke>
<invoke destination="v" slot="appendToSceneGraph(SoFieldContainer*)" type="component">i</invoke>
<invoke destination="v" slot="show()" type="void"/>
<invoke destination="i" slot="set_fraction" type="SoSFFloat">1.0</invoke>
<invoke destination="i" slot="speed(SFFloat)" type="SoSFFloat">1.0</invoke>
</postconnections>
</sheet>
<sheet id="end"/>
......
......@@ -34,7 +34,7 @@
<invoke destination="v" slot="appendToSceneGraph(SoFieldContainer*)" type="component">c</invoke>
<invoke destination="v" slot="show()" type="void"/>
<!--invoke destination="c" slot="height" type="constant">height</invoke-->
<invoke destination="m" slot="diffuseColor" type="constant">color</invoke>
<invoke destination="m" slot="diffuseColor(MFColor)" type="constant">color</invoke>
</postconnections>
</sheet>
<sheet id="end"/>
......
......@@ -43,9 +43,9 @@
<invoke destination="sep" slot="addChild(SoFieldContainer*)" type="component">m2</invoke>
<invoke destination="sep" slot="addChild(SoFieldContainer*)" type="component">sph</invoke>
<!--invoke destination="c" slot="height" type="constant">height</invoke-->
<invoke destination="m1" slot="diffuseColor" type="constant">color</invoke>
<invoke destination="m2" slot="diffuseColor" type="constant">blue</invoke>
<invoke destination="tr" slot="translation" type="constant">translation</invoke>
<invoke destination="m1" slot="diffuseColor(MFColor)" type="constant">color</invoke>
<invoke destination="m2" slot="diffuseColor(MFColor)" type="constant">blue</invoke>
<invoke destination="tr" slot="translation(SFVec3f)" type="constant">translation</invoke>
<invoke destination="v" slot="show()" type="void"/>
......
This diff is collapsed. Click to expand it.
......@@ -7,7 +7,30 @@
/*! \defgroup coin Inventor integration.
* Inventor nodes are here seen as components.
* Therefore, we can integrate them in ARCS as an exogeneous family of components.
*/
*
* The following files are used:
* <ul>
* <li>inventorfamily.h defines the family of inventor components and how to
* instanciate an inventorcomponent from its typename;</li>
* <li>inventorcomponent.h defines an inventor component and how it generates
* wrappers in order to interact with the engine;</li>
* <li>inventortypes.h defines types that are used by OpenInventor and how to
* serialize/deserialize them; </li>
* <li>inventorsignalwrapper.h and inventorslotwrapper.h define the proxy
* objects that are used in order to make it possible for the inventor nodes
* to communicate with other systems.</li>
* </ul>
*
* Inventor components can be instanciated in two ways: first, by providing
* a node type name, second by providing a scenegraph as a textual string or
* as a filename. In the case of a single node, fields will be described as
* both signals and slots. The naming pattern is then
* <tt>fieldName(fieldTypeName)</tt>. In the second case, the top most node of
* the scenegraph is treated as the single node. More interestingly, named
* subnodes can also be accessed. The naming convention is then
* <tt>nodeName.fieldName(fieldTypeName)</tt>.
*
*/
//! This class implements an exogeneous family of components, which are inventor nodes
......
......@@ -10,6 +10,8 @@ InventorSlotWrapper::InventorSlotWrapper(SoFieldContainer* cnt,QString s) : QObj
fieldName = s.section("(",0,0);
else
fieldName= s;
if (!cnt)
std::cout << "$$$ Instanciated with a null container for " << qPrintable(s) << std::endl;
container = cnt;
if (s == "removeAllChildren()" || s == "addChild(SoFieldContainer*)")
slotName = s;
......@@ -26,8 +28,12 @@ InventorSlotWrapper::InventorSlotWrapper(SoFieldContainer* cnt,QString s) : QObj
void InventorSlotWrapper::callField(SoField* field)
{
std::cout << "$$$ Calling field" << std::endl;
if (!container)
{
std::cout << "$$$ Failed to bind a container" << std::endl;
return ;
}
SoField* fld = container->getField(SbName(qPrintable(fieldName)));
if (!fld)
......