40 #ifndef vpSimulator_HH
41 #define vpSimulator_HH
50 #include <visp3/core/vpConfig.h>
52 #ifdef VISP_HAVE_COIN3D_AND_GUI
54 #include <visp3/ar/vpViewer.h>
63 #include <Inventor/SoOffscreenRenderer.h>
64 #include <Inventor/fields/SoSFTime.h>
65 #include <Inventor/nodes/SoBaseColor.h>
66 #include <Inventor/nodes/SoCone.h>
67 #include <Inventor/nodes/SoCube.h>
68 #include <Inventor/nodes/SoImage.h>
69 #include <Inventor/nodes/SoLightModel.h>
70 #include <Inventor/nodes/SoPerspectiveCamera.h>
71 #include <Inventor/nodes/SoRotationXYZ.h>
72 #include <Inventor/nodes/SoSeparator.h>
73 #include <Inventor/nodes/SoTransform.h>
74 #include <Inventor/nodes/SoTranslation.h>
75 #include <Inventor/sensors/SoTimerSensor.h>
76 #include <Inventor/threads/SbThread.h>
79 #include <visp3/core/vpCameraParameters.h>
80 #include <visp3/core/vpDebug.h>
81 #include <visp3/core/vpHomogeneousMatrix.h>
82 #include <visp3/core/vpImage.h>
83 #include <visp3/core/vpImageConvert.h>
84 #include <visp3/core/vpRGBa.h>
114 #if defined(VISP_HAVE_SOWIN)
116 #elif defined(VISP_HAVE_SOQT)
118 #elif defined(VISP_HAVE_SOXT)
125 void initSoApplication();
128 typedef enum { grayImage, colorImage } vpImageType;
133 virtual void mainLoop();
143 virtual void initInternalViewer(
unsigned int nlig,
unsigned int ncol);
145 void initExternalViewer(
unsigned int nlig,
unsigned int ncol);
154 void initApplication(
void *(*start_routine)(
void *));
155 void initApplication(
void *(*start_routine)(
void *),
void *data);
157 void initMainApplication();
158 void closeMainApplication();
206 void initSceneGraph();
219 void load(
const char *file_name);
223 void save(
const char *name,
bool binary =
false);
226 void addAbsoluteFrame(
float zoom = 1);
230 void setZoomFactor(
float zoom);
265 void changeZoomFactor(
float zoom,
int index);
268 typedef enum { INTERNAL, EXTERNAL } vpSimulatorViewType;
269 #ifdef VISP_HAVE_MODULE_IO
270 void write(
const char *fileName);
290 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.