![]() |
VR-Forces 4.7 Class Documentation
|
The Add Simulation Command adds a new simulation command which will send a message to the back-end that will simply print a console message.
The example is intended to demonstrate the following:
Registering a new sim command item in the menu requires deriving a new class from makVrf::DtVrfSimulationCommand, configuring its key methods, and then registering the creator function in the makVrf::DtSimulationCommandMenu. Our command dialog creator class is called vrfAddSimCommandExample::DtSimulationCommandMessageCreator. The key methods of makVrf::DtVrfSimulationCommandDialogCreator that must be customized are:
| makVrf::DtVrfSimulationCommandDialogCreator::create() | Adds a new dialog object to the heap (vrfAddSimCommandExample::DtSimulationCommandMessageDialog in this example) and returns its pointer |
| makVrf::DtVrfSimulationCommandDialogCreator::supportsType() | Checks message against this dialog's task type. |
| makVrf::DtVrfSimulationCommandDialogCreator::objectNameFromStatement() | Returns empty name. |
The makVrf::DtVrfConditionalExpressionCreator class must be then registered with the dialog manager makVrf::DtVrfConditionalDialogManager. In our example, we register it in /examples/condition/conditionGui/addConditionPlugin.cxx.
this particular implementation inserts our menu item just before a menu item in the conditional combo box called "RANDOM"
Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces 3D application
To view the new behavior:
Note that the text you typed in to the 'My Sim Command' window also appears in the back-end console, prefaced by the name of the entity.
| DtSimulationCommandMessageAction | The menu item that registers the dialog to be created when the menu item is selected. |
| DtSimulationCommandMessageDialog | The widget that is used to enter the message to print in the back-end console. |
| DtSimulationCommandMessageLogic | The logic that is used to enter the message to print in the back-end console. |
| MySimCommand | The subclass of DtSimCommand that is used to communicate the new simulation command. |