43 #ifndef vpSimulator_HH
44 #define vpSimulator_HH
53 #include <visp/vpConfig.h>
55 #ifdef VISP_HAVE_COIN_AND_GUI
57 #include <visp/vpViewer.h>
66 #include <Inventor/nodes/SoBaseColor.h>
67 #include <Inventor/nodes/SoTransform.h>
68 #include <Inventor/nodes/SoCone.h>
69 #include <Inventor/nodes/SoCube.h>
70 #include <Inventor/nodes/SoImage.h>
71 #include <Inventor/nodes/SoLightModel.h>
72 #include <Inventor/nodes/SoPerspectiveCamera.h>
73 #include <Inventor/nodes/SoRotationXYZ.h>
74 #include <Inventor/nodes/SoSeparator.h>
75 #include <Inventor/nodes/SoTranslation.h>
76 #include <Inventor/sensors/SoTimerSensor.h>
77 #include <Inventor/SoOffscreenRenderer.h>
78 #include <Inventor/fields/SoSFTime.h>
79 #include <Inventor/threads/SbThread.h>
82 #include <visp/vpDebug.h>
83 #include <visp/vpHomogeneousMatrix.h>
84 #include <visp/vpCameraParameters.h>
85 #include <visp/vpImage.h>
86 #include <visp/vpRGBa.h>
87 #include <visp/vpImageConvert.h>
117 #if defined(VISP_HAVE_SOWIN)
119 #elif defined(VISP_HAVE_SOQT)
120 QWidget * mainWindow ;
121 #elif defined(VISP_HAVE_SOXT)
128 void initSoApplication() ;
139 virtual void mainLoop() ;
149 virtual void initInternalViewer(
const unsigned int nlig,
const unsigned int ncol) ;
151 void initExternalViewer(
const unsigned int nlig,
const unsigned int ncol) ;
160 void initApplication(
void *(*start_routine)(
void *)) ;
161 void initApplication(
void *(*start_routine)(
void *),
void* data);
163 void initMainApplication() ;
164 void closeMainApplication() ;
212 void initSceneGraph() ;
216 SoSeparator * root) ;
226 void load(
const char *file_name) ;
230 void save(
const char *name,
bool binary=
false) ;
233 void addAbsoluteFrame (
float zoom=1) ;
237 void setZoomFactor (
const float zoom) ;
272 void changeZoomFactor(
const float zoom,
const int index);
274 typedef enum { INTERNAL, EXTERNAL } vpSimulatorViewType ;
275 void write(
const char * fileName);
281 int * height = NULL);
296 void getSizeInternalView(
int& width,
int& height);
301 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)...
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
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