OIFwdKinematicsInterface Class Reference

Detailed Description

Defines the OIFwdKinematicsInterface class. To use this class you can either create a direct instance of this class or you can create a subclass and override the OIFwdKinematicsInterface::buildScenery() method.
If you create a direct instance of the OIFwdKinematicsInterface your code usually would look like this:

int main (int argc, char ** argv)
{
OIFwdKinematicsInterface viewer(argc, argv, "FileToOpen.iv");
// create an instance of the OIFwdKinematicsInterface
viewer.run(); // start the visualisation/simulation
return 0;
}

If you create a subclass of OIFwdKinematicsInterface you need to override the constructor and the OIFwdKinematicsInterface::buildScenery() method. If you create custom variables in the constructor or in OIFwdKinematicsInterface::buildScenery() you also need to create a destructor and free the memory of those variables.
A short example:

#include <iostream>
#include <ipsaclasses.h>
class MyOIFwdKinematicsInterface : public OIFwdKinematicsInterface
{
public:
MyOIFwdKinematicsInterface(int argc, char ** argv, std::string filename = "")
: MyOIFwdKinematicsInterface(argc, argv, filename) {}
protected:
virtual bool buildScenery();
};
bool MyOIFwdKinematicsInterface::buildScenery()
{
// omit this line if you do not want to read a scenegraph from a file
if ( true == this->readSceneryFromFile() )
return true;
// create your own scenegraph
root = new SoSeparator;
// the remaining code
}
int
main (int argc, char ** argv)
{
std::string sceneFilename = "";
if ( 2 <= argc )
{
// this can be omitted if you do not want to read a file
// the third parameter can also be left out in this case
sceneFilename = argv[1];
std::cout << "\n\nOpen file: " << sceneFilename << std::endl << std::endl;
}
MyOIFwdKinematicsInterface viewer(argc, argv, sceneFilename);
viewer.run();
return 0;
}

The documentation for this class was generated from the following file:
OIFwdKinematicsInterface
OIFwdKinematicsInterface.h
filename
std::string filename
Definition: VisualizationRobot.cpp:83
main
int main(int argc, char *argv[])
Definition: Admin.cpp:45