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)
{
viewer.run();
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>
{
public:
MyOIFwdKinematicsInterface(
int argc,
char ** argv, std::string
filename =
"")
: MyOIFwdKinematicsInterface(argc, argv,
filename) {}
protected:
virtual bool buildScenery();
};
bool MyOIFwdKinematicsInterface::buildScenery()
{
if ( true == this->readSceneryFromFile() )
return true;
root = new SoSeparator;
}
int
main (
int argc,
char ** argv)
{
std::string sceneFilename = "";
if ( 2 <= argc )
{
sceneFilename = argv[1];
std::cout << "\n\nOpen file: " << sceneFilename << std::endl << std::endl;
}
MyOIFwdKinematicsInterface viewer(argc, argv, sceneFilename);
viewer.run();
return 0;
}