Date post: | 30-Dec-2015 |
Category: |
Documents |
Upload: | elvis-morin |
View: | 28 times |
Download: | 0 times |
Easy Studierstube Applicationswith a little help from OpenInventor
Gerhard ReitmayrGerhard Reitmayr
Vienna University of TechnologyVienna University of Technology
Gerhard Reitmayr StbDay2 – 22.05.2003
Stb application requirementsStb application requirements
User interface design needs iterative User interface design needs iterative development.development.
Need to be adapted to different user Need to be adapted to different user interface modalities.interface modalities.
Demos need to be kept alive !Demos need to be kept alive !
Reuse of application features is very Reuse of application features is very desirable.desirable.
Gerhard Reitmayr StbDay2 – 22.05.2003
User interface componentsUser interface components3D window
PIP
pen
icon
widgets
content
Gerhard Reitmayr StbDay2 – 22.05.2003
Structure of an applicationStructure of an application
SoMyContextKit
Widgets
Scene graph
Application
Different modalities
Different presentation styles
Reuse this ?
Gerhard Reitmayr StbDay2 – 22.05.2003
Skeleton of an applicationSkeleton of an application
SoApplicationKit { contextKit SomeApplication { templatePipSheet Separator {
# your PIP sheet widgets } windowGroup Group {
# content and windows ! }
# all kinds of application # specific fields }}
Gerhard Reitmayr StbDay2 – 22.05.2003
Use the file format !Use the file format !
Let your application become an Let your application become an understandable part of an OIV file.understandable part of an OIV file.
Use fields as inputs and outputs of Use fields as inputs and outputs of applications.applications.
Build scene graphs in the OIV file Build scene graphs in the OIV file instead of in code.instead of in code.
Try to write all applications as pure OIV Try to write all applications as pure OIV nodekits !nodekits !
Gerhard Reitmayr StbDay2 – 22.05.2003
Fields as inputs/outputsFields as inputs/outputs
Connecting to widgetsConnecting to widgets Callbacks tie you to the type of widgetCallbacks tie you to the type of widget Lower abstraction used then necessaryLower abstraction used then necessary
e.g. observe 3 buttons instead of a 3 valued e.g. observe 3 buttons instead of a 3 valued state variable.state variable.
Use fields that represent exactly the state Use fields that represent exactly the state the application needs.the application needs.
Output states as fields allows simple Output states as fields allows simple change of presentation.change of presentation.
Gerhard Reitmayr StbDay2 – 22.05.2003
OIV: Observing changesOIV: Observing changes
Sensors are the callbacks of OIV !Sensors are the callbacks of OIV !
SoFieldSensor SoFieldSensor Only one field per sensorOnly one field per sensor Not ref counted > take care yourselfNot ref counted > take care yourself
SoNodeSensorSoNodeSensor Reports changes on node / sub scene Reports changes on node / sub scene
graphgraph Beware of node fieldsBeware of node fields
Gerhard Reitmayr StbDay2 – 22.05.2003
Scene graphs as parametersScene graphs as parameters
Use node fieldsUse node fields As templates for complex scene graphsAs templates for complex scene graphs
Use partsUse parts For scene graphs that need traversalFor scene graphs that need traversal
Use conventionsUse conventions Node type, e.g. set a texture to be picked Node type, e.g. set a texture to be picked
up by geometry in the graphup by geometry in the graph Search for a given name, type and change Search for a given name, type and change
its fieldsits fields
Gerhard Reitmayr StbDay2 – 22.05.2003
Parameterized scene graphs Parameterized scene graphs
Using context sensitive traversalUsing context sensitive traversal
New element SoContextElementNew element SoContextElement
Maps int -> intMaps int -> int Context[3] = 2Context[3] = 2 Context[-5] = NILContext[-5] = NIL
SoContext to modify context during traversalSoContext to modify context during traversal
SoContextSwitch (…)SoContextSwitch (…) Modify traversal depending on contextModify traversal depending on context
Gerhard Reitmayr StbDay2 – 22.05.2003
Context2->0
Context ExampleContext Example
Context2->1
ContextSwitch
index[2]
Geometry
Group
Colorgreen
Colorred
Gerhard Reitmayr StbDay2 – 22.05.2003
OIV : NodeKits - conceptOIV : NodeKits - concept
A nodekit represents a tightly integrated A nodekit represents a tightly integrated template scene graph with meaning to template scene graph with meaning to the developer.the developer.
We getWe get Fixed scene graph Fixed scene graph Represented by a nodeRepresented by a node Internal connectionsInternal connections OIV interface of fields and childrenOIV interface of fields and children
Gerhard Reitmayr StbDay2 – 22.05.2003
Nodekit structureNodekit structure
Root node
Private partsPrivate parts
Public parts
SoTrackedArtifaktKit
Gerhard Reitmayr StbDay2 – 22.05.2003
OIV : setUpConnectionsOIV : setUpConnections
Central method to establish connections Central method to establish connections within a nodekit.within a nodekit.
Signals nodekit when the structure Signals nodekit when the structure changes.changes.
Important forImportant for Correct loading of applicationsCorrect loading of applications Distributed OpenInventorDistributed OpenInventor
Gerhard Reitmayr StbDay2 – 22.05.2003
Navigation app - 2Navigation app - 2 DEF NavKit NavigationContext {DEF NavKit NavigationContext { waypoint ["Karlskirche",… ]waypoint ["Karlskirche",… ] waypointPosition [0 1 0,… ] waypointPosition [0 1 0,… ] edge [1,… ]edge [1,… ] numEdge [3,… ] numEdge [3,… ] userPosition = SoTrakEngine{}.translationuserPosition = SoTrakEngine{}.translation destination = USE waypointList.selected destination = USE waypointList.selected path [“Karlskirche”,… ] path [“Karlskirche”,… ] edgeIndex [1,2,3] nodeIndex [2,3,5,10]edgeIndex [1,2,3] nodeIndex [2,3,5,10] templatePipSheet SoPipSheetKit {…}templatePipSheet SoPipSheetKit {…} windowGroup So3DSeparator {…}windowGroup So3DSeparator {…} }}
Gerhard Reitmayr StbDay2 – 22.05.2003
SoClassLoaderSoClassLoader
classLoader SoClassLoader { className "MyOIVNode" fileName "../somewhere/mynodes"}MyOIVNode { …}
Load OIV classes from within a file !Load OIV classes from within a file !
Gerhard Reitmayr StbDay2 – 22.05.2003
Timing issuesTiming issues
Delayed executionDelayed execution SoOneShotSensorSoOneShotSensor SoAlarmSensorSoAlarmSensor
Repeated actionsRepeated actions SoTimeSensorSoTimeSensor SoIdleSensorSoIdleSensor
Gerhard Reitmayr StbDay2 – 22.05.2003
Stb ApplicationsStb Applications
Applications are OpenInventor nodekitsApplications are OpenInventor nodekits
Subclasses of SoContextKitSubclasses of SoContextKit
Implementation as shared library (dll,so)Implementation as shared library (dll,so)
Additional callback API forAdditional callback API for User specific dataUser specific data DistributionDistribution
Gerhard Reitmayr StbDay2 – 22.05.2003
Writing STB applicationsWriting STB applications
SoApplicationKitSoApplicationKit
SoClassLoaderSoClassLoader
SoContextKitSoContextKit
templatePipSheettemplatePipSheet
windowGroupwindowGroup
Gerhard Reitmayr StbDay2 – 22.05.2003
Interfacing SoContextKitInterfacing SoContextKit
Use fields as interfaceUse fields as interface
Avoid connections based on names, Avoid connections based on names, pointers, etcpointers, etc
Special patterns for multi user Special patterns for multi user applicationsapplications
Use localized searchUse localized search
Gerhard Reitmayr StbDay2 – 22.05.2003
PIP - personal interaction PIP - personal interaction panelpanel
PIP
App 1
App 2
PipSheet
PipSheet 1
PipSheet 2
System Sheet
User
Gerhard Reitmayr StbDay2 – 22.05.2003
PIP Komponenten PIP Komponenten
system tab
window tab
sheet tab
Gerhard Reitmayr StbDay2 – 22.05.2003
Remedy – OpenInventorRemedy – OpenInventor
A set of guidelines toA set of guidelines to Structure application APIStructure application API Structure data flow in applicationStructure data flow in application Modularize applicationsModularize applications
OpenInventor can support us here !OpenInventor can support us here !
Gerhard Reitmayr StbDay2 – 22.05.2003
Beispiel : hello worldBeispiel : hello worldSoApplicationKit { contextKit SoContextKit { windowGroup DEF Hello Group { Material {diffuseColor 0.9 0.95 0.3} Scale {scaleFactor 0.1 0.1 0.1} Font { size 1 } Text3 { string ["Hello", "World !"] justification CENTER parts ALL } } templatePipSheet USE Hello }}
Gerhard Reitmayr StbDay2 – 22.05.2003
GuidelinesGuidelines
Data driven implementationData driven implementation Store all data in fields or childrenStore all data in fields or children React to changes and update internal and React to changes and update internal and
dependent statedependent state > Very flexible> Very flexible
> Highly reusable components> Highly reusable components