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)
122 bool mainWindowInitialized;
125 void initSoApplication();
128 typedef enum { grayImage, colorImage } vpImageType;
129 vpImageType typeImage;
131 GLubyte *image_background;
133 virtual void mainLoop();
143 virtual void initInternalViewer(
unsigned int nlig,
unsigned int ncol);
145 void initExternalViewer(
unsigned int nlig,
unsigned int ncol);
149 SbThread *mainThread;
154 void initApplication(
void *(*start_routine)(
void *));
155 void initApplication(
void *(*start_routine)(
void *),
void *data);
157 void initMainApplication();
158 void closeMainApplication();
163 unsigned int internal_width;
164 unsigned int internal_height;
165 unsigned int external_width;
166 unsigned int external_height;
174 unsigned int getInternalWidth()
const {
return internal_width; }
180 unsigned int getInternalHeight()
const {
return internal_height; }
187 SoSeparator *internalRoot;
189 SoSeparator *externalRoot;
192 SoPerspectiveCamera *internalCamera;
194 SoPerspectiveCamera *externalCamera;
197 SoTransform *internalCameraPosition;
200 SoTransform *extrenalCameraPosition;
203 SoSeparator *internalCameraObject;
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);
237 bool cameraPositionInitialized;
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);
274 SoOffscreenRenderer *offScreenRenderer;
279 unsigned char *bufferView;
287 unsigned char *getBufferedOffScreenRenderer() {
return bufferView; }
290 void getSizeInternalView(
int &width,
int &height);