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
daa2a205
Commit
daa2a205
authored
Jul 03, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove redundant methods, implement assignment operator for widget
parent
c8d2b5ff
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
types.hpp
modules/viz/include/opencv2/viz/types.hpp
+4
-1
types.cpp
modules/viz/src/types.cpp
+12
-11
test_viz3d.cpp
modules/viz/test/test_viz3d.cpp
+3
-1
No files found.
modules/viz/include/opencv2/viz/types.hpp
View file @
daa2a205
...
@@ -119,6 +119,9 @@ namespace temp_viz
...
@@ -119,6 +119,9 @@ namespace temp_viz
public
:
public
:
Widget
();
Widget
();
Widget
(
const
Widget
&
other
);
Widget
(
const
Widget
&
other
);
Widget
&
operator
=
(
const
Widget
&
other
);
void
copyTo
(
Widget
&
dst
);
void
setColor
(
const
Color
&
color
);
void
setColor
(
const
Color
&
color
);
void
setPose
(
const
Affine3f
&
pose
);
void
setPose
(
const
Affine3f
&
pose
);
...
@@ -134,6 +137,6 @@ namespace temp_viz
...
@@ -134,6 +137,6 @@ namespace temp_viz
class
LineWidget
:
public
Widget
class
LineWidget
:
public
Widget
{
{
public
:
public
:
LineWidget
(
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
);
LineWidget
(
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
=
Color
(
255
,
255
,
255
)
);
};
};
}
}
modules/viz/src/types.cpp
View file @
daa2a205
...
@@ -75,17 +75,6 @@ public:
...
@@ -75,17 +75,6 @@ public:
return
Affine3f
(
matrix_cv
);
return
Affine3f
(
matrix_cv
);
}
}
void
setActorMapperInput
(
const
vtkSmartPointer
<
vtkDataSet
>
&
data
)
{
vtkSmartPointer
<
vtkDataSetMapper
>
mapper
=
reinterpret_cast
<
vtkDataSetMapper
*>
(
actor
->
GetMapper
());
if
(
mapper
==
0
)
{
mapper
=
vtkSmartPointer
<
vtkDataSetMapper
>::
New
();
actor
->
SetMapper
(
mapper
);
}
mapper
->
SetInput
(
data
);
}
protected
:
protected
:
vtkSmartPointer
<
vtkMatrix4x4
>
convertToVtkMatrix
(
const
cv
::
Matx44f
&
m
)
const
vtkSmartPointer
<
vtkMatrix4x4
>
convertToVtkMatrix
(
const
cv
::
Matx44f
&
m
)
const
...
@@ -115,6 +104,18 @@ temp_viz::Widget::Widget(const Widget &other)
...
@@ -115,6 +104,18 @@ temp_viz::Widget::Widget(const Widget &other)
impl_
=
other
.
impl_
;
impl_
=
other
.
impl_
;
}
}
temp_viz
::
Widget
&
temp_viz
::
Widget
::
operator
=
(
const
Widget
&
other
)
{
if
(
this
!=
&
other
)
impl_
=
other
.
impl_
;
return
*
this
;
}
void
temp_viz
::
Widget
::
copyTo
(
Widget
&
dst
)
{
// TODO Deep copy the data if there is any
}
void
temp_viz
::
Widget
::
setColor
(
const
Color
&
color
)
void
temp_viz
::
Widget
::
setColor
(
const
Color
&
color
)
{
{
impl_
->
setColor
(
color
);
impl_
->
setColor
(
color
);
...
...
modules/viz/test/test_viz3d.cpp
View file @
daa2a205
...
@@ -97,6 +97,8 @@ TEST(Viz_viz3d, accuracy)
...
@@ -97,6 +97,8 @@ TEST(Viz_viz3d, accuracy)
temp_viz
::
LineWidget
lw
(
cv
::
Point3f
(
0.0
,
0.0
,
0.0
),
cv
::
Point3f
(
1.0
,
1.0
,
1.0
),
temp_viz
::
Color
(
0
,
255
,
0
));
temp_viz
::
LineWidget
lw
(
cv
::
Point3f
(
0.0
,
0.0
,
0.0
),
cv
::
Point3f
(
1.0
,
1.0
,
1.0
),
temp_viz
::
Color
(
0
,
255
,
0
));
v
.
showWidget
(
"line"
,
lw
);
v
.
showWidget
(
"line"
,
lw
);
temp_viz
::
LineWidget
lw2
=
lw
;
while
(
!
v
.
wasStopped
())
while
(
!
v
.
wasStopped
())
{
{
// Creating new point cloud with id cloud1
// Creating new point cloud with id cloud1
...
@@ -112,7 +114,7 @@ TEST(Viz_viz3d, accuracy)
...
@@ -112,7 +114,7 @@ TEST(Viz_viz3d, accuracy)
v
.
setShapePose
(
"circle1"
,
cloudPosition
);
v
.
setShapePose
(
"circle1"
,
cloudPosition
);
v
.
setShapePose
(
"sphere1"
,
cloudPosition
);
v
.
setShapePose
(
"sphere1"
,
cloudPosition
);
v
.
setShapePose
(
"arrow1"
,
cloudPosition
);
v
.
setShapePose
(
"arrow1"
,
cloudPosition
);
lw
.
setColor
(
temp_viz
::
Color
(
col_blue
,
col_green
,
col_red
));
lw
2
.
setColor
(
temp_viz
::
Color
(
col_blue
,
col_green
,
col_red
));
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