39 #ifndef vpSimulator_HH
40 #define vpSimulator_HH
49 #include <visp3/core/vpConfig.h>
51 #ifdef VISP_HAVE_COIN3D_AND_GUI
53 #include <visp3/ar/vpViewer.h>
62 #include <Inventor/SoOffscreenRenderer.h>
63 #include <Inventor/fields/SoSFTime.h>
64 #include <Inventor/nodes/SoBaseColor.h>
65 #include <Inventor/nodes/SoCone.h>
66 #include <Inventor/nodes/SoCube.h>
67 #include <Inventor/nodes/SoImage.h>
68 #include <Inventor/nodes/SoLightModel.h>
69 #include <Inventor/nodes/SoPerspectiveCamera.h>
70 #include <Inventor/nodes/SoRotationXYZ.h>
71 #include <Inventor/nodes/SoSeparator.h>
72 #include <Inventor/nodes/SoTransform.h>
73 #include <Inventor/nodes/SoTranslation.h>
74 #include <Inventor/sensors/SoTimerSensor.h>
75 #include <Inventor/threads/SbThread.h>
78 #include <visp3/core/vpCameraParameters.h>
79 #include <visp3/core/vpDebug.h>
80 #include <visp3/core/vpHomogeneousMatrix.h>
81 #include <visp3/core/vpImage.h>
82 #include <visp3/core/vpImageConvert.h>
83 #include <visp3/core/vpRGBa.h>
113 #if defined(VISP_HAVE_SOWIN)
115 #elif defined(VISP_HAVE_SOQT)
117 #elif defined(VISP_HAVE_SOXT)
124 void initSoApplication();
127 typedef enum { grayImage, colorImage } vpImageType;
132 virtual void mainLoop();
142 virtual void initInternalViewer(
unsigned int nlig,
unsigned int ncol);
144 void initExternalViewer(
unsigned int nlig,
unsigned int ncol);
153 void initApplication(
void *(*start_routine)(
void *));
154 void initApplication(
void *(*start_routine)(
void *),
void *data);
156 void initMainApplication();
157 void closeMainApplication();
205 void initSceneGraph();
218 void load(
const char *file_name);
222 void save(
const char *name,
bool binary =
false);
225 void addAbsoluteFrame(
float zoom = 1);
229 void setZoomFactor(
float zoom);
264 void changeZoomFactor(
float zoom,
int index);
267 typedef enum { INTERNAL, EXTERNAL } vpSimulatorViewType;
268 #ifdef VISP_HAVE_MODULE_IO
269 void write(
const char *fileName);
289 void getSizeInternalView(
int &width,
int &height);
Generic class defining intrinsic camera parameters.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a simulator based on Coin3d (www.coin3d.org).
unsigned int getInternalWidth() const
SoPerspectiveCamera * internalCamera
internal camera
unsigned int internal_height
GLubyte * image_background
vpCameraParameters internalCameraParameters
internal camera parameters
unsigned char * bufferView
image of the internal view
SoTransform * extrenalCameraPosition
external camera position
void getCameraParameters(vpCameraParameters &cam)
get the intrinsic parameters of the camera
unsigned int external_height
unsigned int internal_width
bool cameraPositionInitialized
vpViewer * internalView
view from the camera
vpHomogeneousMatrix cMf
internal camera position
SoSeparator * internalCameraObject
representation of the camera in the external view
void getCameraPosition(vpHomogeneousMatrix &_cMf)
get the camera position (from an homogeneous matrix)
SbThread * mainThread
thread with the main program
vpViewer * externalView
view from an external camera
SoPerspectiveCamera * externalCamera
external camera
HWND mainWindow
main Widget
SoSeparator * externalRoot
root node of the external view
unsigned int getInternalHeight() const
unsigned char * getBufferedOffScreenRenderer()
get the image corresponding to the internal view
bool mainWindowInitialized
vpCameraParameters externalCameraParameters
internal camera parameters
SoOffscreenRenderer * offScreenRenderer
SoTransform * internalCameraPosition
internal camera position
SoSeparator * internalRoot
root node of the internal view
unsigned int external_width
Viewer used by the simulator.