Running an example
Open Inventor Java is provided with few pre-compiled examples. Each one can be launched using any of the following ways:
- Run any example by a double click (Windows. requires you have configured your environment )
For instance using your favorite file explorer, go to %OIVJHOME%/examples/inventor/viewercomponents/swt/glcanvas/renderareaguiintegration and double click on Main.jar
- Run any example by using java -jar
For instance:
cd %OIVJHOME%/examples/inventor/viewercomponents/swt/glcanvas/renderareaguiintegration
java -jar Main.jar
- Run any example by using Eclipse ide
You must create an Eclipse project by importing the ant script file $OIVJHOME/examples/build.xml
- File / New / Project
- Select "Java Project from Existing Ant Buildfile"
- Select "Next"
- In the "Ant buildfile" area, browse $OIVJHOME/examples/build.xml
- In the “Select javac declaration to use to define project” area, select “javac” task found in target “javac”
- Select "Link to the buildfile in the file system" (optional)
- Select "Finish"
- Once the project is loaded, select for instance inventor.viewercomponents.swt.glcanvas.renderareaguiintegration
- right click "Run As/Java application"
- You will have to configure the demo by adding the path to the native librairies of OivJava (provided in the folder $OIVJHOME/jre/bin)
Modifying and recompiling examples
The examples program source are organized in java packages. So under $OIVJHOME/examples you will find
In order to modify a example and recompile it, you must use the provided ant script $OIVJHOME/examples/build.xml. Of course you must install the ant tool. (see http://ant.apache.org).
- inventor: package of examples showing general inventor features.
- inventor/viewercomponents: package of examples showing Viewer Components features.
- medical: package of examples showing Medical features.
- meshviz: package of examples showing MeshViz features.
- meshvizxlm: package of examples showing MeshVizXLM features.
- remoteviz: package of examples showing RemoteViz simple features
- volumeviz: package of examples showing VolumeViz features.
To list the available targets of this ant script:
ant -p
To recompile any example:
ant
Notes:This command re-compiles all needed examples (generates .class files) and build all the executable jars.
The ant script uses a custom ant task to build these executable jars. This custom task is provided by the CreateExecutableDemosJars.jar. Do not remove it!