rename widgets from *Widgets to W*

This commit is contained in:
Ozan Tonkal
2013-09-15 16:26:53 +02:00
parent f570b3e18d
commit c31fb8ffff
11 changed files with 545 additions and 656 deletions
+9 -9
View File
@@ -37,19 +37,19 @@ You can download the code from `here <../../../../samples/cpp/tutorial_code/viz/
using namespace std;
/**
* @class TriangleWidget
* @class WTriangle
* @brief Defining our own 3D Triangle widget
*/
class TriangleWidget : public viz::Widget3D
class WTriangle : public viz::Widget3D
{
public:
TriangleWidget(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color = viz::Color::white());
WTriangle(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color = viz::Color::white());
};
/**
* @function TriangleWidget::TriangleWidget
* @function WTriangle::WTriangle
*/
TriangleWidget::TriangleWidget(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color)
WTriangle::WTriangle(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color)
{
// Create a triangle
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
@@ -99,7 +99,7 @@ You can download the code from `here <../../../../samples/cpp/tutorial_code/viz/
viz::Viz3d myWindow("Creating Widgets");
/// Create a triangle widget
TriangleWidget tw(Point3f(0.0,0.0,0.0), Point3f(1.0,1.0,1.0), Point3f(0.0,1.0,0.0), viz::Color::red());
WTriangle tw(Point3f(0.0,0.0,0.0), Point3f(1.0,1.0,1.0), Point3f(0.0,1.0,0.0), viz::Color::red());
/// Show widget in the visualizer window
myWindow.showWidget("TRIANGLE", tw);
@@ -119,10 +119,10 @@ Here is the general structure of the program:
.. code-block:: cpp
class TriangleWidget : public viz::Widget3D
class WTriangle : public viz::Widget3D
{
public:
TriangleWidget(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color = viz::Color::white());
WTriangle(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color = viz::Color::white());
};
* Assign a VTK actor to the widget.
@@ -144,7 +144,7 @@ Here is the general structure of the program:
.. code-block:: cpp
/// Create a triangle widget
TriangleWidget tw(Point3f(0.0,0.0,0.0), Point3f(1.0,1.0,1.0), Point3f(0.0,1.0,0.0), viz::Color::red());
WTriangle tw(Point3f(0.0,0.0,0.0), Point3f(1.0,1.0,1.0), Point3f(0.0,1.0,0.0), viz::Color::red());
/// Show widget in the visualizer window
myWindow.showWidget("TRIANGLE", tw);
+7 -7
View File
@@ -67,7 +67,7 @@ You can download the code from `here <../../../../samples/cpp/tutorial_code/viz/
viz::Viz3d myWindow("Coordinate Frame");
/// Add coordinate axes
myWindow.showWidget("Coordinate Widget", viz::CoordinateSystemWidget());
myWindow.showWidget("Coordinate Widget", viz::WCoordinateSystem());
/// Let's assume camera has the following properties
Point3f cam_pos(3.0f,3.0f,3.0f), cam_focal_point(3.0f,3.0f,2.0f), cam_y_dir(-1.0f,0.0f,0.0f);
@@ -81,7 +81,7 @@ You can download the code from `here <../../../../samples/cpp/tutorial_code/viz/
/// Create a cloud widget.
Mat bunny_cloud = cvcloud_load();
viz::CloudWidget cloud_widget(bunny_cloud, viz::Color::green());
viz::WCloud cloud_widget(bunny_cloud, viz::Color::green());
/// Pose of the widget in camera frame
Affine3f cloud_pose = Affine3f().translate(Vec3f(0.0f,0.0f,3.0f));
@@ -91,8 +91,8 @@ You can download the code from `here <../../../../samples/cpp/tutorial_code/viz/
/// Visualize camera frame
if (!camera_pov)
{
viz::CameraPositionWidget cpw(0.5); // Coordinate axes
viz::CameraPositionWidget cpw_frustum(Vec2f(0.889484, 0.523599)); // Camera frustum
viz::WCameraPosition cpw(0.5); // Coordinate axes
viz::WCameraPosition cpw_frustum(Vec2f(0.889484, 0.523599)); // Camera frustum
myWindow.showWidget("CPW", cpw, cam_pose);
myWindow.showWidget("CPW_FRUSTUM", cpw_frustum, cam_pose);
}
@@ -147,7 +147,7 @@ Here is the general structure of the program:
/// Create a cloud widget.
Mat bunny_cloud = cvcloud_load();
viz::CloudWidget cloud_widget(bunny_cloud, viz::Color::green());
viz::WCloud cloud_widget(bunny_cloud, viz::Color::green());
* Given the pose in camera coordinate system, estimate the global pose.
@@ -165,8 +165,8 @@ Here is the general structure of the program:
/// Visualize camera frame
if (!camera_pov)
{
viz::CameraPositionWidget cpw(0.5); // Coordinate axes
viz::CameraPositionWidget cpw_frustum(Vec2f(0.889484, 0.523599)); // Camera frustum
viz::WCameraPosition cpw(0.5); // Coordinate axes
viz::WCameraPosition cpw_frustum(Vec2f(0.889484, 0.523599)); // Camera frustum
myWindow.showWidget("CPW", cpw, cam_pose);
myWindow.showWidget("CPW_FRUSTUM", cpw_frustum, cam_pose);
}
+10 -10
View File
@@ -37,16 +37,16 @@ You can download the code from `here <../../../../samples/cpp/tutorial_code/viz/
viz::Viz3d myWindow("Coordinate Frame");
/// Add coordinate axes
myWindow.showWidget("Coordinate Widget", viz::CoordinateSystemWidget());
myWindow.showWidget("Coordinate Widget", viz::WCoordinateSystem());
/// Add line to represent (1,1,1) axis
viz::LineWidget axis(Point3f(-1.0f,-1.0f,-1.0f), Point3f(1.0f,1.0f,1.0f));
axis.setRenderingProperty(viz::VIZ_LINE_WIDTH, 4.0);
viz::WLine axis(Point3f(-1.0f,-1.0f,-1.0f), Point3f(1.0f,1.0f,1.0f));
axis.setRenderingProperty(viz::LINE_WIDTH, 4.0);
myWindow.showWidget("Line Widget", axis);
/// Construct a cube widget
viz::CubeWidget cube_widget(Point3f(0.5,0.5,0.0), Point3f(0.0,0.0,-0.5), true, viz::Color::blue());
cube_widget.setRenderingProperty(viz::VIZ_LINE_WIDTH, 4.0);
viz::WCube cube_widget(Point3f(0.5,0.5,0.0), Point3f(0.0,0.0,-0.5), true, viz::Color::blue());
cube_widget.setRenderingProperty(viz::LINE_WIDTH, 4.0);
/// Display widget (update if already displayed)
myWindow.showWidget("Cube Widget", cube_widget);
@@ -97,15 +97,15 @@ Here is the general structure of the program:
.. code-block:: cpp
/// Add coordinate axes
myWindow.showWidget("Coordinate Widget", viz::CoordinateSystemWidget());
myWindow.showWidget("Coordinate Widget", viz::WCoordinateSystem());
* Display a line representing the axis (1,1,1).
.. code-block:: cpp
/// Add line to represent (1,1,1) axis
viz::LineWidget axis(Point3f(-1.0f,-1.0f,-1.0f), Point3f(1.0f,1.0f,1.0f));
axis.setRenderingProperty(viz::VIZ_LINE_WIDTH, 4.0);
viz::WLine axis(Point3f(-1.0f,-1.0f,-1.0f), Point3f(1.0f,1.0f,1.0f));
axis.setRenderingProperty(viz::LINE_WIDTH, 4.0);
myWindow.showWidget("Line Widget", axis);
* Construct a cube.
@@ -113,8 +113,8 @@ Here is the general structure of the program:
.. code-block:: cpp
/// Construct a cube widget
viz::CubeWidget cube_widget(Point3f(0.5,0.5,0.0), Point3f(0.0,0.0,-0.5), true, viz::Color::blue());
cube_widget.setRenderingProperty(viz::VIZ_LINE_WIDTH, 4.0);
viz::WCube cube_widget(Point3f(0.5,0.5,0.0), Point3f(0.0,0.0,-0.5), true, viz::Color::blue());
cube_widget.setRenderingProperty(viz::LINE_WIDTH, 4.0);
myWindow.showWidget("Cube Widget", cube_widget);
* Create rotation matrix from rodrigues vector