From 54fa69cab2266ffe4ad8e0ad8a57bf29ee2b5979 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Sun, 8 Dec 2013 17:12:02 +0400 Subject: [PATCH] renamed Spheres Trajectory, minor changes in Trajectory --- modules/viz/doc/widget.rst | 28 ++++++++++++++-------------- modules/viz/include/opencv2/viz/widgets.hpp | 12 ++++++------ modules/viz/src/shape_widgets.cpp | 10 +++++----- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/viz/doc/widget.rst b/modules/viz/doc/widget.rst index bbbfef6..90147e4 100644 --- a/modules/viz/doc/widget.rst +++ b/modules/viz/doc/widget.rst @@ -729,10 +729,10 @@ This 3D Widget represents a trajectory. :: class CV_EXPORTS WTrajectory : public Widget3D { public: - enum {DISPLAY_FRAMES = 1, DISPLAY_PATH = 2}; + enum {FRAMES = 1, PATH = 2, BOTH = FRAMES + PATH}; //! Displays trajectory of the given path either by coordinate frames or polyline - WTrajectory(const std::vector &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.0); + WTrajectory(const std::vector &path, int display_mode = WTrajectory::PATH, const Color &color = Color::white(), float scale = 1.0); //! Displays trajectory of the given path by frustums WTrajectory(const std::vector &path, const Matx33f &K, float scale = 1.0, const Color &color = Color::white()); //! Displays trajectory of the given path by frustums @@ -746,18 +746,18 @@ viz::WTrajectory::WTrajectory ----------------------------- Constructs a WTrajectory. -.. ocv:function:: WTrajectory(const std::vector &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.0) +.. ocv:function:: WTrajectory(const std::vector &path, int display_mode = WTrajectory::PATH, const Color &color = Color::white(), float scale = 1.0) :param path: List of poses on a trajectory. - :param display_mode: Display mode. This can be DISPLAY_PATH, DISPLAY_FRAMES, DISPLAY_PATH & DISPLAY_FRAMES. + :param display_mode: Display mode. This can be PATH, FRAMES, and BOTH. :param color: :ocv:class:`Color` of the polyline that represents path. Frames are not affected. :param scale: Scale of the frames. Polyline is not affected. Displays trajectory of the given path as follows: - * DISPLAY_PATH : Displays a poly line that represents the path. - * DISPLAY_FRAMES : Displays coordinate frames at each pose. - * DISPLAY_PATH & DISPLAY_FRAMES : Displays both poly line and coordinate frames. + * PATH : Displays a poly line that represents the path. + * FRAMES : Displays coordinate frames at each pose. + * PATH & FRAMES : Displays both poly line and coordinate frames. .. ocv:function:: WTrajectory(const std::vector &path, const Matx33f &K, float scale = 1.0, const Color &color = Color::white()) @@ -777,26 +777,26 @@ Constructs a WTrajectory. Displays frustums at each pose of the trajectory. -viz::WSpheresTrajectory +viz::WTrajectorySpheres ----------------------- -.. ocv:class:: WSpheresTrajectory +.. ocv:class:: WTrajectorySpheres This 3D Widget represents a trajectory using spheres and lines, where spheres represent the positions of the camera, and lines represent the direction from previous position to the current. :: - class CV_EXPORTS WSpheresTrajectory : public Widget3D + class CV_EXPORTS WTrajectorySpheres : public Widget3D { public: - WSpheresTrajectory(const std::vector &path, float line_length = 0.05f, + WTrajectorySpheres(const std::vector &path, float line_length = 0.05f, float init_sphere_radius = 0.021, sphere_radius = 0.007, Color &line_color = Color::white(), const Color &sphere_color = Color::white()); }; -viz::WSpheresTrajectory::WSpheresTrajectory +viz::WTrajectorySpheres::WTrajectorySpheres ------------------------------------------- -Constructs a WSpheresTrajectory. +Constructs a WTrajectorySpheres. -.. ocv:function:: WSpheresTrajectory(const std::vector &path, float line_length = 0.05f, float init_sphere_radius = 0.021, float sphere_radius = 0.007, const Color &line_color = Color::white(), const Color &sphere_color = Color::white()) +.. ocv:function:: WTrajectorySpheres(const std::vector &path, float line_length = 0.05f, float init_sphere_radius = 0.021, float sphere_radius = 0.007, const Color &line_color = Color::white(), const Color &sphere_color = Color::white()) :param path: List of poses on a trajectory. :param line_length: Length of the lines. diff --git a/modules/viz/include/opencv2/viz/widgets.hpp b/modules/viz/include/opencv2/viz/widgets.hpp index ea43976..fb2783b 100644 --- a/modules/viz/include/opencv2/viz/widgets.hpp +++ b/modules/viz/include/opencv2/viz/widgets.hpp @@ -257,21 +257,21 @@ namespace cv class CV_EXPORTS WTrajectory : public Widget3D { public: - enum {DISPLAY_FRAMES = 1, DISPLAY_PATH = 2}; + enum {FRAMES = 1, PATH = 2, BOTH = FRAMES + PATH }; //! Displays trajectory of the given path either by coordinate frames or polyline - WTrajectory(const std::vector &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.f); + WTrajectory(const std::vector &path, int display_mode = WTrajectory::PATH, const Color &color = Color::white(), float scale = 1.f); //! Displays trajectory of the given path by frustums WTrajectory(const std::vector &path, const Matx33f &K, float scale = 1.f, const Color &color = Color::white()); //! Displays trajectory of the given path by frustums WTrajectory(const std::vector &path, const Vec2f &fov, float scale = 1.f, const Color &color = Color::white()); }; - class CV_EXPORTS WSpheresTrajectory: public Widget3D + class CV_EXPORTS WTrajectorySpheres: public Widget3D { public: - WSpheresTrajectory(const std::vector &path, float line_length = 0.05f, float init_sphere_radius = 0.021f, - float sphere_radius = 0.007f, const Color &line_color = Color::white(), const Color &sphere_color = Color::white()); + WTrajectorySpheres(const std::vector &path, float line_length = 0.05f, float init_sphere_radius = 0.021f, + float sphere_radius = 0.007f, const Color &line_color = Color::white(), const Color &sphere_color = Color::white()); }; ///////////////////////////////////////////////////////////////////////////// @@ -330,7 +330,7 @@ namespace cv template<> CV_EXPORTS WImage3D Widget::cast(); template<> CV_EXPORTS WCameraPosition Widget::cast(); template<> CV_EXPORTS WTrajectory Widget::cast(); - template<> CV_EXPORTS WSpheresTrajectory Widget::cast(); + template<> CV_EXPORTS WTrajectorySpheres Widget::cast(); template<> CV_EXPORTS WCloud Widget::cast(); template<> CV_EXPORTS WCloudCollection Widget::cast(); template<> CV_EXPORTS WCloudNormals Widget::cast(); diff --git a/modules/viz/src/shape_widgets.cpp b/modules/viz/src/shape_widgets.cpp index 4823972..8d226ff 100644 --- a/modules/viz/src/shape_widgets.cpp +++ b/modules/viz/src/shape_widgets.cpp @@ -1240,7 +1240,7 @@ cv::viz::WTrajectory::WTrajectory(const std::vector &path, int display vtkSmartPointer appendFilter = vtkSmartPointer::New(); // Bitwise and with 3 in order to limit the domain to 2 bits - if ((~display_mode & 3) ^ WTrajectory::DISPLAY_PATH) + if ((~display_mode & 3) ^ WTrajectory::PATH) { // Create a poly line along the path vtkIdType nr_points = path.size(); @@ -1284,7 +1284,7 @@ cv::viz::WTrajectory::WTrajectory(const std::vector &path, int display #endif } - if ((~display_mode & 3) ^ WTrajectory::DISPLAY_FRAMES) + if ((~display_mode & 3) ^ WTrajectory::FRAMES) { // Create frames and transform along the path vtkSmartPointer axes = vtkSmartPointer::New(); @@ -1424,7 +1424,7 @@ template<> cv::viz::WTrajectory cv::viz::Widget::cast() /////////////////////////////////////////////////////////////////////////////////////////////// /// spheres trajectory widget implementation -cv::viz::WSpheresTrajectory::WSpheresTrajectory(const std::vector &path, float line_length, float init_sphere_radius, float sphere_radius, +cv::viz::WTrajectorySpheres::WTrajectorySpheres(const std::vector &path, float line_length, float init_sphere_radius, float sphere_radius, const Color &line_color, const Color &sphere_color) { vtkSmartPointer appendFilter = vtkSmartPointer::New(); @@ -1505,8 +1505,8 @@ cv::viz::WSpheresTrajectory::WSpheresTrajectory(const std::vector &pat WidgetAccessor::setProp(*this, actor); } -template<> cv::viz::WSpheresTrajectory cv::viz::Widget::cast() +template<> cv::viz::WTrajectorySpheres cv::viz::Widget::cast() { Widget3D widget = this->cast(); - return static_cast(widget); + return static_cast(widget); } -- 2.7.4