39 #ifndef vpWireFrameSimulator_HH
40 #define vpWireFrameSimulator_HH
52 #include <visp3/core/vpConfig.h>
54 #include <visp3/core/vpConfig.h>
55 #include <visp3/core/vpDisplay.h>
56 #include <visp3/core/vpHomogeneousMatrix.h>
57 #include <visp3/core/vpImage.h>
58 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
59 #include <visp3/core/vpList.h>
61 #include <visp3/core/vpImagePoint.h>
62 #include <visp3/robot/vpImageSimulator.h>
63 #include <visp3/robot/vpWireFrameSimulatorTypes.h>
217 } vpSceneDesiredObject;
219 typedef enum { CT_LINE, CT_POINT } vpCameraTrajectoryDisplayType;
223 Bound_scene desiredScene;
225 std::list<vpImageSimulator> objectImage;
242 bool sceneInitialized;
244 bool displayCameraTrajectory;
245 std::list<vpImagePoint> cameraTrajectory;
246 std::list<vpHomogeneousMatrix> poseList;
247 std::list<vpHomogeneousMatrix> fMoList;
248 unsigned int nbrPtLimit;
267 bool displayDesiredObject;
269 bool displayImageSimulator;
279 unsigned int thickness_;
282 std::string scene_dir;
294 inline void deleteCameraPositionHistory()
296 cameraTrajectory.clear();
303 void displayTrajectory(
const vpImage<vpRGBa> &I,
const std::list<vpHomogeneousMatrix> &list_cMo,
317 if ((std::fabs(px_ext - 1.) >
vpMath::maximum(px_ext, 1.) * std::numeric_limits<double>::epsilon()) &&
318 (std::fabs(py_ext - 1) >
vpMath::maximum(py_ext, 1.) * std::numeric_limits<double>::epsilon()))
336 if ((std::fabs(px_ext - 1.) >
vpMath::maximum(px_ext, 1.) * std::numeric_limits<double>::epsilon()) &&
337 (std::fabs(py_ext - 1) >
vpMath::maximum(py_ext, 1.) * std::numeric_limits<double>::epsilon()))
369 if ((std::fabs(px_int - 1.) >
vpMath::maximum(px_int, 1.) * std::numeric_limits<double>::epsilon()) &&
370 (std::fabs(py_int - 1) >
vpMath::maximum(py_int, 1.) * std::numeric_limits<double>::epsilon()))
388 if ((std::fabs(px_int - 1.) >
vpMath::maximum(px_int, 1.) * std::numeric_limits<double>::epsilon()) &&
389 (std::fabs(py_int - 1) >
vpMath::maximum(py_int, 1.) * std::numeric_limits<double>::epsilon()))
413 void get_cMo_History(std::list<vpHomogeneousMatrix> &cMo_history)
416 for (std::list<vpHomogeneousMatrix>::const_iterator it = poseList.begin(); it != poseList.end(); ++it) {
417 cMo_history.push_back(rotz * (*it));
434 void get_fMo_History(std::list<vpHomogeneousMatrix> &fMo_history) { fMo_history = fMoList; }
436 void initScene(
const vpSceneObject &obj,
const vpSceneDesiredObject &desiredObject);
437 void initScene(
const char *obj,
const char *desiredObject);
438 void initScene(
const vpSceneObject &obj);
439 void initScene(
const char *obj);
441 void initScene(
const vpSceneObject &obj,
const vpSceneDesiredObject &desiredObject,
442 const std::list<vpImageSimulator> &imObj);
443 void initScene(
const char *obj,
const char *desiredObject,
const std::list<vpImageSimulator> &imObj);
444 void initScene(
const vpSceneObject &obj,
const std::list<vpImageSimulator> &imObj);
445 void initScene(
const char *obj,
const std::list<vpImageSimulator> &imObj);
452 void setCameraColor(
const vpColor &col) { camColor = col; }
460 this->cMo = rotz * cMo_;
461 fMc = fMo * this->cMo.
inverse();
472 this->fMc = fMc_ * rotz;
473 cMo = this->fMc.
inverse() * fMo;
482 inline void setCameraSizeFactor(
const float factor) { cameraFactor = factor; }
490 void setCameraTrajectoryColor(
const vpColor &col) { camTrajColor = col; }
499 inline void setCameraTrajectoryDisplayType(
const vpCameraTrajectoryDisplayType &camTraj_type)
501 this->camTrajType = camTraj_type;
509 void setCurrentViewColor(
const vpColor &col) { curColor = col; }
515 void setDesiredCameraPosition(
const vpHomogeneousMatrix &cdMo_) { this->cdMo = rotz * cdMo_; }
521 void setDesiredViewColor(
const vpColor &col) { desColor = col; }
530 void setDisplayCameraTrajectory(
const bool &do_display) { this->displayCameraTrajectory = do_display; }
550 this->camMf = rotz * cam_Mf;
553 this->camMf2.
buildFrom(0, 0, T[2], 0, 0, 0);
554 f2Mf = camMf2.
inverse() * this->camMf;
555 extCamChanged =
true;
561 void setGraphicsThickness(
unsigned int thickness) { this->thickness_ = thickness; }
581 inline void setNbPtTrajectory(
const unsigned int nbPt) { nbrPtLimit = nbPt; }