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/nodes/SoBaseColor.h>
63 #include <Inventor/nodes/SoTransform.h>
64 #include <Inventor/nodes/SoCone.h>
65 #include <Inventor/nodes/SoCube.h>
66 #include <Inventor/nodes/SoImage.h>
67 #include <Inventor/nodes/SoLightModel.h>
68 #include <Inventor/nodes/SoPerspectiveCamera.h>
69 #include <Inventor/nodes/SoRotationXYZ.h>
70 #include <Inventor/nodes/SoSeparator.h>
71 #include <Inventor/nodes/SoTranslation.h>
72 #include <Inventor/sensors/SoTimerSensor.h>
73 #include <Inventor/SoOffscreenRenderer.h>
74 #include <Inventor/fields/SoSFTime.h>
75 #include <Inventor/threads/SbThread.h>
78 #include <visp3/core/vpDebug.h>
79 #include <visp3/core/vpHomogeneousMatrix.h>
80 #include <visp3/core/vpCameraParameters.h>
81 #include <visp3/core/vpImage.h>
82 #include <visp3/core/vpRGBa.h>
83 #include <visp3/core/vpImageConvert.h>
113 #if defined(VISP_HAVE_SOWIN)
115 #elif defined(VISP_HAVE_SOQT)
116 QWidget * mainWindow ;
117 #elif defined(VISP_HAVE_SOXT)
124 void initSoApplication() ;
135 virtual void mainLoop() ;
145 virtual void initInternalViewer(
const unsigned int nlig,
const unsigned int ncol) ;
147 void initExternalViewer(
const unsigned int nlig,
const unsigned int ncol) ;
156 void initApplication(
void *(*start_routine)(
void *)) ;
157 void initApplication(
void *(*start_routine)(
void *),
void* data);
159 void initMainApplication() ;
160 void closeMainApplication() ;
208 void initSceneGraph() ;
212 SoSeparator * root) ;
222 void load(
const char *file_name) ;
226 void save(
const char *name,
bool binary=
false) ;
229 void addAbsoluteFrame (
float zoom=1) ;
233 void setZoomFactor (
const float zoom) ;
268 void changeZoomFactor(
const float zoom,
const int index);
270 typedef enum { INTERNAL, EXTERNAL } vpSimulatorViewType ;
271 #ifdef VISP_HAVE_MODULE_IO
272 void write(
const char * fileName);
279 int * height = NULL);
294 void getSizeInternalView(
int& width,
int& height);
299 cam = internalCameraParameters;
HWND mainWindow
main Widget
SoSeparator * externalRoot
root node of the external view
SoPerspectiveCamera * internalCamera
internal camera
bool cameraPositionInitialized
SoTransform * internalCameraPosition
internal camera position
int get
Flag to protect the read and write of the framebuffer (between the simulator and the viewer)...
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a simulator based on Coin3d (www.coin3d.org).
vpCameraParameters internalCameraParameters
internal camera parameters
unsigned int getInternalHeight() const
unsigned int external_height
void getCameraParameters(vpCameraParameters &cam)
get the intrinsic parameters of the camera
bool mainWindowInitialized
vpViewer * internalView
view from the camera
SoSeparator * internalRoot
root node of the internal view
vpCameraParameters externalCameraParameters
internal camera parameters
unsigned char * getBufferedOffScreenRenderer()
get the image corresponding to the internal view
void getCameraPosition(vpHomogeneousMatrix &_cMf)
get the camera position (from an homogeneous matrix)
SoTransform * extrenalCameraPosition
external camera position
GLubyte * image_background
Viewer used by the simulator.
Generic class defining intrinsic camera parameters.
vpViewer * externalView
view from an external camera
SoPerspectiveCamera * externalCamera
external camera
unsigned int external_width
vpHomogeneousMatrix cMf
internal camera position
unsigned char * bufferView
image of the internal view
unsigned int internal_width
unsigned int getInternalWidth() const
SoOffscreenRenderer * offScreenRenderer
unsigned int internal_height
SoSeparator * internalCameraObject
representation of the camera in the external view
SbThread * mainThread
thread with the main program