![]() |
VR-Vantage 3.0.3 API Documentation
|
Every object needs an agent to manage its creation on the master display engine and external display engines.
Since the generic functioning of agents is the same regardless of the object, it is possible to automate the process of creating them. VR-Vantage includes a tool, the Distributed Code Generator, that generates source code for agent classes from object classes so that they can be easily integrated into drivers.
The Distributed Code Generator generates an agent class, an agent implementation class, a definition class, and a creator class. Most of the time, you will only need to know about the agent class. However, the following is a brief description of all of the generated classes:
The exampleDistributedObject example has generated agent classes. Please see exampleDistributedObject for a description of the object class, generating agent classes, and adding the agent to a driver.
The Distributed Code Generator generates code based on the information in an object class definition (OCD). An OCD contains all the information the Distributed Code Generator needs to generate the agent classes, such as the object class name, namespace, functions, and comments. The functions that the agent will have are called distributed functions, because these function calls will be distributed to objects in display engines.
You create an OCD in the Distributed Code Generator's graphical user interface. You save the OCD in an object class definition file (extension .ocdx).
Once you create the OCD, you can build the classes from the Distributed Code Generator's GUI, from the command-line, or from within Visual Studio.
The Distributed Code Generator has the following limitations:
You can start the Distributed Code Generator from the command line. For details, please see 5.3.6 Distributed Code Generator Command-Line Arguments. On Windows, you can also start it from the Start menu.
To see an example of an object class definition, load ./examples/exampleDistributedObject/DtExampleObject.ocdx.
To create an object class definition:
Navigate to the location where you want to save the OCD file.
You can build agent classes from the Distributed Code Generator GUI, from the command-line, or as part of your build process using Microsoft Visual Studio. For command-line arguments, please see 5.3.6 Distributed Code Generator Command-Line Arguments.
To build agent classes from the Distributed Code Generator GUI:
You can integrate creation of agent classes into your build process. This is the recommended way to generate these classes.
To generate the agent files using Microsoft Visual Studio:
Right click on the .ocdx file in the Solution Explorer and examine its Custom Build Step in its properties. It will look something like this:
You can run the Distributed Code Generator from the command line if you have an object class definition file to input to it. The syntax is:
The following table describes the command line arguments.
| Distributed Code Generator Command-line Arguments | |
|---|---|
| Argument | Description |
| input_file | The Object Class Definition file to process. |
| (-i | –generateImplementation) | Generate all of the implementation classes. |
| (-a | –generateAll) | Generate all of the classes. |
| (-p | –generateAgent) | Generate only the abstract driver class. |
| (-A | –RelativeIncludeDirectory) root_dir | The root directory that generated include statements are relative to. |
| (-H | –HeaderOutputDirectory) header_dir | The directory to write header files to. |
| (-S | –SourceOutputDirectory) source_dir | The directory to write source files to. |
| (-o | –OutputDirectory) output_dir | The directory to write all files to. |
| (-v | –version) | Display version information and exit. |
| (-h | –help) | Display usage information and exit. |
| (– | –ignore_rest) | Ignore all command-line arguments after this one. |
Suppose that you are generating the file testAgent.hpp in the /productRoot/include/test/ directory. However, you want the include statement to look like:
and NOT
Use the arguments -H /productRoot/include/test -A /productRoot/include to specify the header location and relative include path.
[<< Distributed Rendering] [Home] [Top of Page] [Observers >>]