Toggle navigation
Toggle navigation
This project
Loading...
Sign in
arcs
/
ARCS2-Components
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Yves Didier
2013-07-26 12:53:50 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d14ae3a74ea938f85a697cbb3415d71e4cf02b78
d14ae3a7
1 parent
ba17e3ee
maj module coin
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
10 deletions
applications/coin/scene.iv
applications/coin/scene.xml
applications/coin/spy.xml
applications/coin/viewer.xml
applications/coin/viewer2.xml
scene/coin/inventorcomponent.cpp
scene/coin/inventorfamily.h
scene/coin/inventorslotwrapper.cpp
applications/coin/scene.iv
View file @
d14ae3a
...
...
@@ -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
...
...
applications/coin/scene.xml
View file @
d14ae3a
<application
mode=
"gui"
>
<context>
<libraries>
<library
path=
"../../lib/arcscoin"
/>
<library
path=
"../../lib
s
/arcscoin"
/>
</libraries>
<components>
<component
id=
"v"
type=
"Viewer"
></component>
...
...
applications/coin/spy.xml
View file @
d14ae3a
...
...
@@ -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=
"s
et_fraction
"
type=
"SoSFFloat"
>
1.0
</invoke>
<invoke
destination=
"i"
slot=
"s
peed(SFFloat)
"
type=
"SoSFFloat"
>
1.0
</invoke>
</postconnections>
</sheet>
<sheet
id=
"end"
/>
...
...
applications/coin/viewer.xml
View file @
d14ae3a
...
...
@@ -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"
/>
...
...
applications/coin/viewer2.xml
View file @
d14ae3a
...
...
@@ -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"
/>
...
...
scene/coin/inventorcomponent.cpp
View file @
d14ae3a
This diff is collapsed. Click to expand it.
scene/coin/inventorfamily.h
View file @
d14ae3a
...
...
@@ -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
...
...
scene/coin/inventorslotwrapper.cpp
View file @
d14ae3a
...
...
@@ -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
)
...
...
Please
register
or
login
to post a comment