renamed Spheres Trajectory, minor changes in Trajectory
This commit is contained in:
parent
c7ff13873d
commit
54fa69cab2
@ -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<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.0);
|
||||
WTrajectory(const std::vector<Affine3f> &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<Affine3f> &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<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.0)
|
||||
.. ocv:function:: WTrajectory(const std::vector<Affine3f> &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<Affine3f> &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<Affine3f> &path, float line_length = 0.05f,
|
||||
WTrajectorySpheres(const std::vector<Affine3f> &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<Affine3f> &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<Affine3f> &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.
|
||||
|
@ -257,20 +257,20 @@ 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<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.f);
|
||||
WTrajectory(const std::vector<Affine3f> &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<Affine3f> &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<Affine3f> &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<Affine3f> &path, float line_length = 0.05f, float init_sphere_radius = 0.021f,
|
||||
WTrajectorySpheres(const std::vector<Affine3f> &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<WImage3D>();
|
||||
template<> CV_EXPORTS WCameraPosition Widget::cast<WCameraPosition>();
|
||||
template<> CV_EXPORTS WTrajectory Widget::cast<WTrajectory>();
|
||||
template<> CV_EXPORTS WSpheresTrajectory Widget::cast<WSpheresTrajectory>();
|
||||
template<> CV_EXPORTS WTrajectorySpheres Widget::cast<WTrajectorySpheres>();
|
||||
template<> CV_EXPORTS WCloud Widget::cast<WCloud>();
|
||||
template<> CV_EXPORTS WCloudCollection Widget::cast<WCloudCollection>();
|
||||
template<> CV_EXPORTS WCloudNormals Widget::cast<WCloudNormals>();
|
||||
|
@ -1240,7 +1240,7 @@ cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, int display
|
||||
vtkSmartPointer<vtkAppendPolyData> appendFilter = vtkSmartPointer<vtkAppendPolyData>::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<Affine3f> &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<vtkAxes> axes = vtkSmartPointer<vtkAxes>::New();
|
||||
@ -1424,7 +1424,7 @@ template<> cv::viz::WTrajectory cv::viz::Widget::cast<cv::viz::WTrajectory>()
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// spheres trajectory widget implementation
|
||||
|
||||
cv::viz::WSpheresTrajectory::WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length, float init_sphere_radius, float sphere_radius,
|
||||
cv::viz::WTrajectorySpheres::WTrajectorySpheres(const std::vector<Affine3f> &path, float line_length, float init_sphere_radius, float sphere_radius,
|
||||
const Color &line_color, const Color &sphere_color)
|
||||
{
|
||||
vtkSmartPointer<vtkAppendPolyData> appendFilter = vtkSmartPointer<vtkAppendPolyData>::New();
|
||||
@ -1505,8 +1505,8 @@ cv::viz::WSpheresTrajectory::WSpheresTrajectory(const std::vector<Affine3f> &pat
|
||||
WidgetAccessor::setProp(*this, actor);
|
||||
}
|
||||
|
||||
template<> cv::viz::WSpheresTrajectory cv::viz::Widget::cast<cv::viz::WSpheresTrajectory>()
|
||||
template<> cv::viz::WTrajectorySpheres cv::viz::Widget::cast<cv::viz::WTrajectorySpheres>()
|
||||
{
|
||||
Widget3D widget = this->cast<Widget3D>();
|
||||
return static_cast<WSpheresTrajectory&>(widget);
|
||||
return static_cast<WTrajectorySpheres&>(widget);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user