Creating a Prototype
The HOOPS Visualize installation includes simple applications for a variety of GUI technologies. These applications provide a framework for the tutorials discussed later in this guide, and can also serve as containers for prototyping code. This section reviews how to start with a simple HOOPS Visualize application and insert a 'HelloWorld' text string in the scene-graph. Your the GUI technology can be selected on the menu to the right.
MFC - Microsoft Foundation Classes
The MFC demonstration application can be found in the HOOPS Visualize solution, mfc_simple_vcXX project. Open the file SampleHView.cpp and find the function OnRunMyCode(). After recompiling the project, the following code will be run when you start the application and click the down arrow:
This code does the following:
- Opens the model segment using the model key
- Inserts the text string at the origin
- Closes the segment, since we aren't doing anything else
- Updates the scene

Windows Forms
This tutorial describes how to take the 'simple' HOOPS/Winforms application and display the text 'Hello World' in the viewport. You may wish to first review the HOOPS/Winforms documentation to get an idea of the structure of the provided application.
Let's modify the csharp_simple application to display the 'Hello World' text each time a new window is opened. This can be achieved by adding code to the custom HSimpleModel constructor which does the following:
- Opens the segment associated with the model object. The numerical identifier of the segment (called a 'key') is accessed by calling the model object's HBaseModel::GetModelKey method, and the segment is opened using the HCS.Open_Segment_By_Key subroutine.
- Inserts a piece of text into the segment by calling HCS.Insert_Text.
- Closes the segment by calling HCS.Close_Segment.
The sample code would be added to the HSimpleModel::Init method in SimpleHNPanel.cs:
QT
This tutorial describes how to take the 'simple' HOOPS/QT application and display the text 'Hello World' in the viewport. You may wish to first review the HOOPS/QT documentation to get an idea of the structure of the provided application.
The source code to the simple HOOPS/Qt application is located in <hoops>/demo/qt/qt_simple_4. Compile and run it to make sure your development environment is set up correctly.
Let's modify the application to display the 'Hello World' text each time a new window is opened. This can be achieved by adding code to the custom HOOPS/QT widget's constructor, which does the following:
- Opens the HOOPS/3dGS segment associated with the model object. The numerical identifier of the segment (called a 'key') is accessed by calling the model object's HBaseModel::GetModelKey method, and the segment is opened using ::Open_Segment_By_Key.
- Inserts a piece of text into the segment by calling ::Insert_Text.
- Closes the segment by calling ::Close_Segment.
The modified SimpleHQWidget constructor would look like the following:
Note that the sample code could have also been inserted in an overloaded method of HBaseModel::Init.
Java
This tutorial describes how to take the 'simple' HOOPS/Java application and display the text 'Hello World' in the viewport. You may wish to first review the HOOPS/Java documentation to get an idea of the structure of the provided application.
The source code to the simple HOOPS/Java application is located in <hoops>/demo/java/java_simple. Follow the steps in the readme.txt file to recompile and run it.
Let's modify the application to display the 'Hello World' text each time a new window is opened. This can be achieved by adding code to the HSimpleModel::Init which does the following:
- Opens the segment associated with the model object. The numerical identifier of the segment (called a 'key') is accessed by calling the model object's HBaseModel::GetModelKey method, and the segment is opened using ::Open_Segment_By_Key.
- Inserts a piece of text into the segment by calling ::Insert_Text.
- Closes the segment by calling ::Close_Segment.
The modified HSimpleModel::Init method would look like the following:
Note that the sample code could have also been inserted in an overloaded method of HBaseModel::Init.