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
e4c3416f
Commit
e4c3416f
authored
Jul 09, 2013
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
experimental widget casting functionality
parent
509a93c7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+8
-3
simple_widgets.cpp
modules/viz/src/simple_widgets.cpp
+6
-6
widget.cpp
modules/viz/src/widget.cpp
+10
-0
No files found.
modules/viz/include/opencv2/viz/widgets.hpp
View file @
e4c3416f
...
@@ -15,6 +15,8 @@ namespace temp_viz
...
@@ -15,6 +15,8 @@ namespace temp_viz
Widget
&
operator
=
(
const
Widget
&
other
);
Widget
&
operator
=
(
const
Widget
&
other
);
~
Widget
();
~
Widget
();
template
<
typename
_W
>
_W
cast
();
private
:
private
:
class
Impl
;
class
Impl
;
Impl
*
impl_
;
Impl
*
impl_
;
...
@@ -56,13 +58,10 @@ namespace temp_viz
...
@@ -56,13 +58,10 @@ namespace temp_viz
void
setColor
(
const
Color
&
color
);
void
setColor
(
const
Color
&
color
);
};
};
class
CV_EXPORTS
LineWidget
:
public
Widget3D
class
CV_EXPORTS
LineWidget
:
public
Widget3D
{
{
public
:
public
:
LineWidget
(
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
=
Color
::
white
());
LineWidget
(
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
=
Color
::
white
());
LineWidget
(
const
Widget
&
other
)
:
Widget3D
(
other
)
{}
LineWidget
&
operator
=
(
const
Widget
&
other
);
void
setLineWidth
(
float
line_width
);
void
setLineWidth
(
float
line_width
);
float
getLineWidth
();
float
getLineWidth
();
...
@@ -158,4 +157,10 @@ namespace temp_viz
...
@@ -158,4 +157,10 @@ namespace temp_viz
private
:
private
:
struct
ApplyCloudNormals
;
struct
ApplyCloudNormals
;
};
};
template
<>
CV_EXPORTS
Widget3D
Widget
::
cast
<
Widget3D
>
();
template
<>
CV_EXPORTS
LineWidget
Widget
::
cast
<
LineWidget
>
();
}
}
modules/viz/src/simple_widgets.cpp
View file @
e4c3416f
...
@@ -24,12 +24,6 @@ temp_viz::LineWidget::LineWidget(const Point3f &pt1, const Point3f &pt2, const C
...
@@ -24,12 +24,6 @@ temp_viz::LineWidget::LineWidget(const Point3f &pt1, const Point3f &pt2, const C
setColor
(
color
);
setColor
(
color
);
}
}
temp_viz
::
LineWidget
&
temp_viz
::
LineWidget
::
operator
=
(
const
Widget
&
other
)
{
Widget3D
::
operator
=
(
other
);
return
*
this
;
}
void
temp_viz
::
LineWidget
::
setLineWidth
(
float
line_width
)
void
temp_viz
::
LineWidget
::
setLineWidth
(
float
line_width
)
{
{
vtkLODActor
*
actor
=
vtkLODActor
::
SafeDownCast
(
WidgetAccessor
::
getProp
(
*
this
));
vtkLODActor
*
actor
=
vtkLODActor
::
SafeDownCast
(
WidgetAccessor
::
getProp
(
*
this
));
...
@@ -44,6 +38,12 @@ float temp_viz::LineWidget::getLineWidth()
...
@@ -44,6 +38,12 @@ float temp_viz::LineWidget::getLineWidth()
return
actor
->
GetProperty
()
->
GetLineWidth
();
return
actor
->
GetProperty
()
->
GetLineWidth
();
}
}
template
<>
temp_viz
::
LineWidget
temp_viz
::
Widget
::
cast
<
temp_viz
::
LineWidget
>
()
{
Widget3D
widget
=
this
->
cast
<
Widget3D
>
();
return
static_cast
<
LineWidget
&>
(
widget
);
}
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
/// plane widget implementation
/// plane widget implementation
...
...
modules/viz/src/widget.cpp
View file @
e4c3416f
...
@@ -165,6 +165,16 @@ void temp_viz::Widget3D::setColor(const Color &color)
...
@@ -165,6 +165,16 @@ void temp_viz::Widget3D::setColor(const Color &color)
actor
->
Modified
();
actor
->
Modified
();
}
}
template
<>
temp_viz
::
Widget3D
temp_viz
::
Widget
::
cast
<
temp_viz
::
Widget3D
>
()
{
vtkProp3D
*
actor
=
vtkProp3D
::
SafeDownCast
(
WidgetAccessor
::
getProp
(
*
this
));
CV_Assert
(
actor
);
Widget3D
widget
;
WidgetAccessor
::
setProp
(
widget
,
actor
);
return
widget
;
}
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
/// widget2D implementation
/// widget2D implementation
...
...
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