Skip to content

Inventor Mentor examples for Coin

License

Notifications You must be signed in to change notification settings

coin3d/ivexamples

Repository files navigation

These are examples taken from 'The Inventor Mentor' and 'The Inventor Toolmaker'
and adapted for Coin library and its GUI toolkit libraries (SoQt, SoWin, SoXt,
and SoWx).

Some of the original examples are strongly dependent on the original Open
Inventor component library, based on X11/Xt APIs, and therefore are not always
easily adaptable to different window systems.

The current status is the following:

````
+-----------------------------------------------------+
The Inventor Mentor     | SoQt  | SoWin | SoXt | SoWx |
+-----------------------+-------+-------+------+------+
02.1.HelloCone          |  ok   |       |  ok  |  ok  |
02.2.EngineSpin         |  ok   |       |  ok  |  ok  |
02.3.Trackball          |  ok   |       |  ok  |  ok  |
02.4.Examiner           |  ok   |       |  ok  |  ok  |
03.1.Molecule           |  ok   |       |  ok  |  ok  |
03.2.Robot              |  ok   |       |  ok  |  ok  |
03.3.Naming             |  ok   |       |  ok  |  ok  |
04.1.Cameras            |  ok   |       |  ok  |  ok  |
04.2.Lights             |  ok   |       |  ok  |  ok  |
05.1.FaceSet            |  ok   |       |  ok  |  ok  |
05.2.IndexedFaceSet     |  ok   |       |  ok  |  ok  |
05.3.TriangleStripSet   |  ok   |       |  ok  |  ok  |
05.4.QuadMesh           |  ok   |       |  ok  |  ok  |
05.5.Binding            |  ok   |       |  ok  |  ok  |
05.6.TransformOrdering  |  ok   |       |  ok  |  ok  |
06.1.Text               |  ok   |       |  ok  |  ok  |
06.2.Simple3DText       |  ok   |       |  ok  |  ok  |
06.3.Complex3DText      |  ok   |       |  ok  |  ok  |
07.1.BasicTexture       |  ok   |       |  ok  |  ok  |
07.2.TextureCoordinates |  ok   |       |  ok  |  ok  |
07.3.TextureFunction    |  ok   |       |  ok  |  ok  |
08.1.BSCurve            |  ok   |       |  ok  |  ok  |
08.2.UniCurve           |  ok   |       |  ok  |  ok  |
08.3.BezSurf            |  ok   |       |  ok  |  ok  |
08.4.TrimSurf           |  ok   |       |  ok  |  ok  |
09.1.Print              |  [1]  |       |  [1] |  ?   |   
09.2.Texture            |  [1]  |       |  [1] |  ?   |
09.3.Search             |  ok   |       |  ok  |  ok  |
09.4.PickAction         |  ok   |       |  ok  |  ok  |
09.5.GenSph             |  ok   |       |  ok  |  ok  |
10.1.addEventCB         |  ok   |       |  ok  |  ok  |
10.2.setEventCB         | N.A.  | N.A.  |  ok  | N.A. |
10.3and4.MotifList      | N.A.  | N.A.  |  [4] | N.A. |
10.5.SelectionCB        |  ok   |       |  ok  |  ok  |
10.6.PickFilterTopLevel |  ok   |       |  ok  |  ko  |
10.7.PickFilterManip    |  ok   |       |  ok  |      |
10.8.PickFilterNodeKit  | N.A.  | N.A.  |  [1] | N.A. |
11.1.ReadFile           |  ok   |       |  ok  |  ok  |
11.2.ReadString         |  ok   |       |  ok  |  ok  |
12.1.FieldSensor        |  ok   |       |  ok  |  ok  |
12.2.NodeSensor         |  ok   |       |  ok  |  ok  |
12.3.AlarmSensor        |  ok   |       |  ok  |  ok  |
12.4.TimerSensor        |  ok   |       |  ok  |  ok  |
13.1.GlobalFlds         |  ok   |       |  ok  |  ok  |
13.2.ElapsedTime        |  ok   |       |  ok  |  ok  |
13.3.TimeCounter        |  ok   |       |  ok  |  ok  |
13.4.Gate               |  ok   |       |  ok  |  ok  |
13.5.Boolean            |  ok   |       |  ok  |  ok  |
13.6.Calculator         |  ok   |       |  ok  |  ok  |
13.7.Rotor              |  ok   |       |  ok  |  ok  |
13.8.Blinker            |  ok   |       |  ok  |  ok  |
14.1.FrolickingWords    |  ok   |       |  [3] |  ok  |
14.2.Editors            |  [2]  | N.A.  |  [2] |  [2] |
14.3.Balance            |  ok   |       |  ok  |  ok  |
15.1.ConeRadius         |  ok   |       |  ok  |  ok  |
15.2.SliderBox          |  ok   |       |  ok  |  ok  |
15.3.AttachManip        |  ok   |       |  ok  |  ok  |
15.4.Customize          |  ok   |       |  ok  |  ok  |
16.1.Overlay            | N.A.  | N.A.  |  [4] | N.A. |
16.2.Callback           | N.A.  | N.A.  |  [1] |  [7] |
16.3.AttachEditor       | N.A.  | N.A.  |  [1] |  [7] |
16.4.OneWindow          | N.A.  | N.A.  |  KO  | N.A. |
16.5.Examiner           |  ok   |       |  ok  |  ok  |
17.1.ColorIndex         | N.A.  | N.A.  |  [6] | N.A. |
17.2.GLCallback         | N.A.  | N.A.  |  ok  |  ok  |
17.3.GLFloor            | N.A.  | N.A.  |  ok  | N.A. |
+-----------------------+-------+-------+------+------+


+-----------------------------+-------+-------+------+------+
The Inventor Toolmaker        | SoQt  | SoWin | SoXt | SoWx |
+-----------------------------+-------+-------+------+------+
02.Nodes/newNodes             |  ok   |       |  ok  |  ok  |
03.Fields/fieldtest           |  ok   |       |  ok  |  ok  |
04.Actions/printVolume        |  ok   |       |  ok  |  ok  |
05.Elements/elementtest       |  ok   |       |  ok  |  ok  |
07.Nodekits/jumpingJackKitTest|  ok   |       |  ok  |  ok  |
08.Manips/newManips           |  ok   |       |  ok  |  ok  |
09.Highlights/overlayTest     |  ok   |       |  [5] |  [?] |
09.Highlights/selectionTest   |  ok   |       |  ok  |  ok  |
10.Components/tumble          | N.A.  |       |  KO  | N.A. |
11.Events/eventTest           | N.A.  |       | N.A. | N.A. |
+-----------------------------+-------+-------+------+------+
````

[1] On Linux systems indirect GLX rendering must be enabled in the X server [see here](https://groups.google.com/forum/#!topic/coin3d-discuss/eyb9jCIOkpA)

[2] So[Q,X]tDirectionalLightEditor::attach() functionality not yet completed

[3] The code has been modified to avoid a possible bug in Coin SoCalculator engine

[4] Possible internal SoXt bug

[5] SoXtGLWidget::setOverlayRender() functionality not yet completed

[6] Couldn't create visual

[7] Error with Coin offscreen rendering


How to build

First make sure you have a working Coin3D setup either by building Coin on your machine, or by downloading the build artifacts from the releases. Make sure you include the GUI toolkit binding of your choice (SoWin, SoQt, SoWx, SoXt) when building.

Then execute the typical CMake configure/build commands in the parent directory of your cloned ivexamples repository (make sure to include the submodules when cloning).

Using Windows, SoQt, Visual Studio 2019, 64 bit, and Qt 6.5.2 the commands would read:

cmake -S ivexamples -B ivexamples_build -G "Visual Studio 16 2019" -A x64 -DGui=Qt -DCMAKE_PREFIX_PATH=C:\Coin3D;C:\Qt\6.5.2\msvc2019_64
cmake --build ivexamples_build --target ALL_BUILD --config Release


Additional note on SoWx

Only CMake is supported to build with SoWx GUI toolkit binding.
If SoWx or wxWidgets are not in a standard path you can specify the path with CMAKE_PREFIX_PATH.
e.g.:
cmake -DCMAKE_PREFIX_PATH="/opt/SoWx;/opt/wxWidgets" <path to ivexamples sources>

Compilation in the same path of source code is deprecated.