Skip to content

Commit 8de46e1

Browse files
committed
removed trailing spaces
1 parent 824c28a commit 8de46e1

29 files changed

+6428
-6428
lines changed

doc/tutorials/viz/creating_widgets/creating_widgets.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can download the code from :download:`here <../../../../samples/cpp/tutorial
2121
.. code-block:: cpp
2222
2323
#include <opencv2/viz.hpp>
24-
#include <opencv2/viz/widget_accessor.hpp>
24+
#include <opencv2/viz/widget_accessor.hpp>
2525
#include <iostream>
2626
2727
#include <vtkPoints.h>
@@ -43,7 +43,7 @@ You can download the code from :download:`here <../../../../samples/cpp/tutorial
4343
class WTriangle : public viz::Widget3D
4444
{
4545
public:
46-
WTriangle(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color = viz::Color::white());
46+
WTriangle(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color = viz::Color::white());
4747
};
4848
4949
/**
@@ -56,36 +56,36 @@ You can download the code from :download:`here <../../../../samples/cpp/tutorial
5656
points->InsertNextPoint(pt1.x, pt1.y, pt1.z);
5757
points->InsertNextPoint(pt2.x, pt2.y, pt2.z);
5858
points->InsertNextPoint(pt3.x, pt3.y, pt3.z);
59-
59+
6060
vtkSmartPointer<vtkTriangle> triangle = vtkSmartPointer<vtkTriangle>::New();
6161
triangle->GetPointIds()->SetId(0,0);
6262
triangle->GetPointIds()->SetId(1,1);
6363
triangle->GetPointIds()->SetId(2,2);
64-
64+
6565
vtkSmartPointer<vtkCellArray> cells = vtkSmartPointer<vtkCellArray>::New();
6666
cells->InsertNextCell(triangle);
67-
67+
6868
// Create a polydata object
6969
vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
70-
70+
7171
// Add the geometry and topology to the polydata
7272
polyData->SetPoints(points);
7373
polyData->SetPolys(cells);
74-
74+
7575
// Create mapper and actor
7676
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
7777
#if VTK_MAJOR_VERSION <= 5
7878
mapper->SetInput(polyData);
7979
#else
8080
mapper->SetInputData(polyData);
8181
#endif
82-
82+
8383
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
8484
actor->SetMapper(mapper);
85-
85+
8686
// Store this actor in the widget in order that visualizer can access it
8787
viz::WidgetAccessor::setProp(*this, actor);
88-
88+
8989
// Set the color of the widget. This has to be called after WidgetAccessor.
9090
setColor(color);
9191
}
@@ -94,22 +94,22 @@ You can download the code from :download:`here <../../../../samples/cpp/tutorial
9494
* @function main
9595
*/
9696
int main()
97-
{
97+
{
9898
/// Create a window
9999
viz::Viz3d myWindow("Creating Widgets");
100-
100+
101101
/// Create a triangle widget
102102
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());
103-
103+
104104
/// Show widget in the visualizer window
105105
myWindow.showWidget("TRIANGLE", tw);
106-
106+
107107
/// Start event loop
108108
myWindow.spin();
109-
109+
110110
return 0;
111111
}
112-
112+
113113
Explanation
114114
===========
115115

@@ -122,33 +122,33 @@ Here is the general structure of the program:
122122
class WTriangle : public viz::Widget3D
123123
{
124124
public:
125-
WTriangle(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color = viz::Color::white());
125+
WTriangle(const Point3f &pt1, const Point3f &pt2, const Point3f &pt3, const viz::Color & color = viz::Color::white());
126126
};
127-
127+
128128
* Assign a VTK actor to the widget.
129129

130130
.. code-block:: cpp
131131
132132
// Store this actor in the widget in order that visualizer can access it
133133
viz::WidgetAccessor::setProp(*this, actor);
134-
134+
135135
* Set color of the widget.
136136

137137
.. code-block:: cpp
138138
139139
// Set the color of the widget. This has to be called after WidgetAccessor.
140140
setColor(color);
141-
141+
142142
* Construct a triangle widget and display it in the window.
143143

144144
.. code-block:: cpp
145145
146146
/// Create a triangle widget
147147
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());
148-
148+
149149
/// Show widget in the visualizer window
150150
myWindow.showWidget("TRIANGLE", tw);
151-
151+
152152
Results
153153
=======
154154

doc/tutorials/viz/launching_viz/launching_viz.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,46 +27,46 @@ You can download the code from :download:`here <../../../../samples/cpp/tutorial
2727
2828
using namespace cv;
2929
using namespace std;
30-
30+
3131
/**
3232
* @function main
3333
*/
3434
int main()
3535
{
3636
/// Create a window
3737
viz::Viz3d myWindow("Viz Demo");
38-
38+
3939
/// Start event loop
4040
myWindow.spin();
41-
41+
4242
/// Event loop is over when pressed q, Q, e, E
4343
cout << "First event loop is over" << endl;
44-
44+
4545
/// Access window via its name
4646
viz::Viz3d sameWindow = viz::get("Viz Demo");
47-
47+
4848
/// Start event loop
4949
sameWindow.spin();
50-
50+
5151
/// Event loop is over when pressed q, Q, e, E
5252
cout << "Second event loop is over" << endl;
53-
53+
5454
/// Event loop is over when pressed q, Q, e, E
5555
/// Start event loop once for 1 millisecond
5656
sameWindow.spinOnce(1, true);
5757
while(!sameWindow.wasStopped())
5858
{
5959
/// Interact with window
60-
60+
6161
/// Event loop for 1 millisecond
6262
sameWindow.spinOnce(1, true);
6363
}
64-
64+
6565
/// Once more event loop is stopped
6666
cout << "Last event loop is over" << endl;
6767
return 0;
6868
}
69-
69+
7070
Explanation
7171
===========
7272

@@ -78,21 +78,21 @@ Here is the general structure of the program:
7878
7979
/// Create a window
8080
viz::Viz3d myWindow("Viz Demo");
81-
81+
8282
* Start event loop. This event loop will run until user terminates it by pressing **e**, **E**, **q**, **Q**.
8383

8484
.. code-block:: cpp
8585
8686
/// Start event loop
8787
myWindow.spin();
88-
88+
8989
* Access same window via its name. Since windows are implicitly shared, **sameWindow** is exactly the same with **myWindow**. If the name does not exist, a new window is created.
9090

9191
.. code-block:: cpp
9292
9393
/// Access window via its name
9494
viz::Viz3d sameWindow = viz::get("Viz Demo");
95-
95+
9696
* Start a controlled event loop. Once it starts, **wasStopped** is set to false. Inside the while loop, in each iteration, **spinOnce** is called to prevent event loop from completely stopping. Inside the while loop, user can execute other statements including those which interact with the window.
9797

9898
.. code-block:: cpp
@@ -103,11 +103,11 @@ Here is the general structure of the program:
103103
while(!sameWindow.wasStopped())
104104
{
105105
/// Interact with window
106-
106+
107107
/// Event loop for 1 millisecond
108108
sameWindow.spinOnce(1, true);
109109
}
110-
110+
111111
Results
112112
=======
113113

doc/tutorials/viz/transformations/transformations.rst

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ You can download the code from :download:`here <../../../../samples/cpp/tutorial
4545
float dummy1, dummy2;
4646
for(size_t i = 0; i < 1889; ++i)
4747
ifs >> data[i].x >> data[i].y >> data[i].z >> dummy1 >> dummy2;
48-
48+
4949
cloud *= 5.0f;
5050
return cloud;
5151
}
@@ -54,40 +54,40 @@ You can download the code from :download:`here <../../../../samples/cpp/tutorial
5454
* @function main
5555
*/
5656
int main(int argn, char **argv)
57-
{
57+
{
5858
if (argn < 2)
5959
{
6060
cout << "Usage: " << endl << "./transformations [ G | C ]" << endl;
6161
return 1;
6262
}
63-
63+
6464
bool camera_pov = (argv[1][0] == 'C');
65-
65+
6666
/// Create a window
6767
viz::Viz3d myWindow("Coordinate Frame");
68-
68+
6969
/// Add coordinate axes
7070
myWindow.showWidget("Coordinate Widget", viz::WCoordinateSystem());
71-
71+
7272
/// Let's assume camera has the following properties
7373
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);
74-
74+
7575
/// We can get the pose of the cam using makeCameraPose
7676
Affine3f cam_pose = viz::makeCameraPose(cam_pos, cam_focal_point, cam_y_dir);
77-
77+
7878
/// We can get the transformation matrix from camera coordinate system to global using
7979
/// - makeTransformToGlobal. We need the axes of the camera
8080
Affine3f transform = viz::makeTransformToGlobal(Vec3f(0.0f,-1.0f,0.0f), Vec3f(-1.0f,0.0f,0.0f), Vec3f(0.0f,0.0f,-1.0f), cam_pos);
81-
81+
8282
/// Create a cloud widget.
8383
Mat bunny_cloud = cvcloud_load();
8484
viz::WCloud cloud_widget(bunny_cloud, viz::Color::green());
85-
85+
8686
/// Pose of the widget in camera frame
8787
Affine3f cloud_pose = Affine3f().translate(Vec3f(0.0f,0.0f,3.0f));
8888
/// Pose of the widget in global frame
8989
Affine3f cloud_pose_global = transform * cloud_pose;
90-
90+
9191
/// Visualize camera frame
9292
if (!camera_pov)
9393
{
@@ -96,21 +96,21 @@ You can download the code from :download:`here <../../../../samples/cpp/tutorial
9696
myWindow.showWidget("CPW", cpw, cam_pose);
9797
myWindow.showWidget("CPW_FRUSTUM", cpw_frustum, cam_pose);
9898
}
99-
99+
100100
/// Visualize widget
101101
myWindow.showWidget("bunny", cloud_widget, cloud_pose_global);
102-
102+
103103
/// Set the viewer pose to that of camera
104104
if (camera_pov)
105105
myWindow.setViewerPose(cam_pose);
106-
106+
107107
/// Start event loop.
108108
myWindow.spin();
109-
109+
110110
return 0;
111111
}
112112
113-
113+
114114
Explanation
115115
===========
116116

@@ -122,42 +122,42 @@ Here is the general structure of the program:
122122
123123
/// Create a window
124124
viz::Viz3d myWindow("Transformations");
125-
125+
126126
* Get camera pose from camera position, camera focal point and y direction.
127127

128128
.. code-block:: cpp
129129
130130
/// Let's assume camera has the following properties
131131
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);
132-
132+
133133
/// We can get the pose of the cam using makeCameraPose
134134
Affine3f cam_pose = viz::makeCameraPose(cam_pos, cam_focal_point, cam_y_dir);
135-
135+
136136
* Obtain transform matrix knowing the axes of camera coordinate system.
137137

138138
.. code-block:: cpp
139139
140140
/// We can get the transformation matrix from camera coordinate system to global using
141141
/// - makeTransformToGlobal. We need the axes of the camera
142142
Affine3f transform = viz::makeTransformToGlobal(Vec3f(0.0f,-1.0f,0.0f), Vec3f(-1.0f,0.0f,0.0f), Vec3f(0.0f,0.0f,-1.0f), cam_pos);
143-
143+
144144
* Create a cloud widget from bunny.ply file
145145

146146
.. code-block:: cpp
147147
148148
/// Create a cloud widget.
149149
Mat bunny_cloud = cvcloud_load();
150150
viz::WCloud cloud_widget(bunny_cloud, viz::Color::green());
151-
151+
152152
* Given the pose in camera coordinate system, estimate the global pose.
153-
153+
154154
.. code-block:: cpp
155155
156156
/// Pose of the widget in camera frame
157157
Affine3f cloud_pose = Affine3f().translate(Vec3f(0.0f,0.0f,3.0f));
158158
/// Pose of the widget in global frame
159159
Affine3f cloud_pose_global = transform * cloud_pose;
160-
160+
161161
* If the view point is set to be global, visualize camera coordinate frame and viewing frustum.
162162

163163
.. code-block:: cpp
@@ -170,22 +170,22 @@ Here is the general structure of the program:
170170
myWindow.showWidget("CPW", cpw, cam_pose);
171171
myWindow.showWidget("CPW_FRUSTUM", cpw_frustum, cam_pose);
172172
}
173-
173+
174174
* Visualize the cloud widget with the estimated global pose
175-
175+
176176
.. code-block:: cpp
177177
178178
/// Visualize widget
179179
myWindow.showWidget("bunny", cloud_widget, cloud_pose_global);
180-
180+
181181
* If the view point is set to be camera's, set viewer pose to **cam_pose**.
182-
182+
183183
.. code-block:: cpp
184184
185185
/// Set the viewer pose to that of camera
186186
if (camera_pov)
187187
myWindow.setViewerPose(cam_pose);
188-
188+
189189
Results
190190
=======
191191

0 commit comments

Comments
 (0)