Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
03cc439b
Commit
03cc439b
authored
Jul 04, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cube widget implementation
parent
f07486b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+6
-0
simple_widgets.cpp
modules/viz/src/simple_widgets.cpp
+17
-0
test_viz3d.cpp
modules/viz/test/test_viz3d.cpp
+3
-0
No files found.
modules/viz/include/opencv2/viz/widgets.hpp
View file @
03cc439b
...
@@ -73,5 +73,11 @@ namespace temp_viz
...
@@ -73,5 +73,11 @@ namespace temp_viz
public
:
public
:
CylinderWidget
(
const
Point3f
&
pt_on_axis
,
const
Point3f
&
axis_direction
,
double
radius
,
int
numsides
=
30
,
const
Color
&
color
=
Color
::
white
());
CylinderWidget
(
const
Point3f
&
pt_on_axis
,
const
Point3f
&
axis_direction
,
double
radius
,
int
numsides
=
30
,
const
Color
&
color
=
Color
::
white
());
};
};
class
CV_EXPORTS
CubeWidget
:
public
Widget
{
public
:
CubeWidget
(
const
Point3f
&
pt_min
,
const
Point3f
&
pt_max
,
const
Color
&
color
=
Color
::
white
());
};
}
}
modules/viz/src/simple_widgets.cpp
View file @
03cc439b
...
@@ -208,3 +208,20 @@ temp_viz::CylinderWidget::CylinderWidget(const Point3f& pt_on_axis, const Point3
...
@@ -208,3 +208,20 @@ temp_viz::CylinderWidget::CylinderWidget(const Point3f& pt_on_axis, const Point3
setColor
(
color
);
setColor
(
color
);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////
/// cylinder widget implementation
temp_viz
::
CubeWidget
::
CubeWidget
(
const
Point3f
&
pt_min
,
const
Point3f
&
pt_max
,
const
Color
&
color
)
{
vtkSmartPointer
<
vtkCubeSource
>
cube
=
vtkSmartPointer
<
vtkCubeSource
>::
New
();
cube
->
SetBounds
(
pt_min
.
x
,
pt_max
.
x
,
pt_min
.
y
,
pt_max
.
y
,
pt_min
.
z
,
pt_max
.
z
);
vtkSmartPointer
<
vtkDataSetMapper
>
mapper
=
vtkSmartPointer
<
vtkDataSetMapper
>::
New
();
mapper
->
SetInput
(
cube
->
GetOutput
());
vtkSmartPointer
<
vtkLODActor
>
actor
=
WidgetAccessor
::
getActor
(
*
this
);
actor
->
SetMapper
(
mapper
);
setColor
(
color
);
}
modules/viz/test/test_viz3d.cpp
View file @
03cc439b
...
@@ -98,6 +98,7 @@ TEST(Viz_viz3d, accuracy)
...
@@ -98,6 +98,7 @@ TEST(Viz_viz3d, accuracy)
temp_viz
::
ArrowWidget
aw
(
cv
::
Point3f
(
0
,
0
,
0
),
cv
::
Point3f
(
1
,
1
,
1
),
temp_viz
::
Color
(
255
,
0
,
0
));
temp_viz
::
ArrowWidget
aw
(
cv
::
Point3f
(
0
,
0
,
0
),
cv
::
Point3f
(
1
,
1
,
1
),
temp_viz
::
Color
(
255
,
0
,
0
));
temp_viz
::
CircleWidget
cw
(
cv
::
Point3f
(
0
,
0
,
0
),
1.0
,
temp_viz
::
Color
(
0
,
255
,
0
));
temp_viz
::
CircleWidget
cw
(
cv
::
Point3f
(
0
,
0
,
0
),
1.0
,
temp_viz
::
Color
(
0
,
255
,
0
));
temp_viz
::
CylinderWidget
cyw
(
cv
::
Point3f
(
0
,
0
,
0
),
cv
::
Point3f
(
-
1
,
-
1
,
-
1
),
0.5
,
30
,
temp_viz
::
Color
(
0
,
255
,
0
));
temp_viz
::
CylinderWidget
cyw
(
cv
::
Point3f
(
0
,
0
,
0
),
cv
::
Point3f
(
-
1
,
-
1
,
-
1
),
0.5
,
30
,
temp_viz
::
Color
(
0
,
255
,
0
));
temp_viz
::
CubeWidget
cuw
(
cv
::
Point3f
(
-
2
,
-
2
,
-
2
),
cv
::
Point3f
(
-
1
,
-
1
,
-
1
),
temp_viz
::
Color
(
0
,
0
,
255
));
v
.
showWidget
(
"line"
,
lw
);
v
.
showWidget
(
"line"
,
lw
);
v
.
showWidget
(
"plane"
,
pw
);
v
.
showWidget
(
"plane"
,
pw
);
...
@@ -105,6 +106,7 @@ TEST(Viz_viz3d, accuracy)
...
@@ -105,6 +106,7 @@ TEST(Viz_viz3d, accuracy)
v
.
showWidget
(
"arrow"
,
aw
);
v
.
showWidget
(
"arrow"
,
aw
);
v
.
showWidget
(
"circle"
,
cw
);
v
.
showWidget
(
"circle"
,
cw
);
v
.
showWidget
(
"cylinder"
,
cyw
);
v
.
showWidget
(
"cylinder"
,
cyw
);
v
.
showWidget
(
"cube"
,
cuw
);
temp_viz
::
LineWidget
lw2
=
lw
;
temp_viz
::
LineWidget
lw2
=
lw
;
...
@@ -132,6 +134,7 @@ TEST(Viz_viz3d, accuracy)
...
@@ -132,6 +134,7 @@ TEST(Viz_viz3d, accuracy)
cw
.
setPose
(
cloudPosition
);
cw
.
setPose
(
cloudPosition
);
cyw
.
setPose
(
cloudPosition
);
cyw
.
setPose
(
cloudPosition
);
lw
.
setPose
(
cloudPosition
);
lw
.
setPose
(
cloudPosition
);
cuw
.
setPose
(
cloudPosition
);
angle_x
+=
0.1
f
;
angle_x
+=
0.1
f
;
angle_y
-=
0.1
f
;
angle_y
-=
0.1
f
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment