34 #ifndef VP_SIMULATOR_H
35 #define VP_SIMULATOR_H
44 #include <visp3/core/vpConfig.h>
46 #ifdef VISP_HAVE_COIN3D_AND_GUI
48 #include <visp3/ar/vpViewer.h>
57 #include <Inventor/SoOffscreenRenderer.h>
58 #include <Inventor/fields/SoSFTime.h>
59 #include <Inventor/nodes/SoBaseColor.h>
60 #include <Inventor/nodes/SoCone.h>
61 #include <Inventor/nodes/SoCube.h>
62 #include <Inventor/nodes/SoImage.h>
63 #include <Inventor/nodes/SoLightModel.h>
64 #include <Inventor/nodes/SoPerspectiveCamera.h>
65 #include <Inventor/nodes/SoRotationXYZ.h>
66 #include <Inventor/nodes/SoSeparator.h>
67 #include <Inventor/nodes/SoTransform.h>
68 #include <Inventor/nodes/SoTranslation.h>
69 #include <Inventor/sensors/SoTimerSensor.h>
70 #include <Inventor/threads/SbThread.h>
73 #include <visp3/core/vpCameraParameters.h>
74 #include <visp3/core/vpDebug.h>
75 #include <visp3/core/vpHomogeneousMatrix.h>
76 #include <visp3/core/vpImage.h>
77 #include <visp3/core/vpImageConvert.h>
78 #include <visp3/core/vpRGBa.h>
109 #if defined(VISP_HAVE_SOWIN)
111 #elif defined(VISP_HAVE_SOQT)
113 #elif defined(VISP_HAVE_SOXT)
120 void initSoApplication();
123 typedef enum { grayImage, colorImage } vpImageType;
128 virtual void mainLoop();
138 virtual void initInternalViewer(
unsigned int nlig,
unsigned int ncol);
140 void initExternalViewer(
unsigned int nlig,
unsigned int ncol);
149 void initApplication(
void *(*start_routine)(
void *));
150 void initApplication(
void *(*start_routine)(
void *),
void *data);
152 void initMainApplication();
153 void closeMainApplication();
201 void initSceneGraph();
214 void load(
const char *file_name);
218 void save(
const char *name,
bool binary =
false);
221 void addAbsoluteFrame(
float zoom = 1);
225 void setZoomFactor(
float zoom);
260 void changeZoomFactor(
float zoom,
int index);
263 typedef enum { INTERNAL, EXTERNAL } vpSimulatorViewType;
264 #ifdef VISP_HAVE_MODULE_IO
265 void write(
const char *fileName);
285 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.