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
2170559b
Commit
2170559b
authored
Sep 08, 2013
by
Ozan Tonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text3dwidget offers now users to decide whether it should face the camera or not
parent
286f81f3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
18 deletions
+28
-18
viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+1
-1
widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+1
-2
shape_widgets.cpp
modules/viz/src/shape_widgets.cpp
+22
-11
viz3d.cpp
modules/viz/src/viz3d.cpp
+1
-1
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+2
-2
viz3d_impl.hpp
modules/viz/src/viz3d_impl.hpp
+1
-1
No files found.
modules/viz/include/opencv2/viz/viz3d.hpp
View file @
2170559b
...
@@ -62,7 +62,7 @@ namespace cv
...
@@ -62,7 +62,7 @@ namespace cv
void
setRenderingProperty
(
const
String
&
id
,
int
property
,
double
value
);
void
setRenderingProperty
(
const
String
&
id
,
int
property
,
double
value
);
double
getRenderingProperty
(
const
String
&
id
,
int
property
);
double
getRenderingProperty
(
const
String
&
id
,
int
property
);
void
setDesiredUpdateRate
(
double
tim
e
);
void
setDesiredUpdateRate
(
double
rat
e
);
double
getDesiredUpdateRate
();
double
getDesiredUpdateRate
();
void
setRepresentation
(
int
representation
);
void
setRepresentation
(
int
representation
);
...
...
modules/viz/include/opencv2/viz/widgets.hpp
View file @
2170559b
...
@@ -14,7 +14,6 @@ namespace cv
...
@@ -14,7 +14,6 @@ namespace cv
OPACITY
,
OPACITY
,
LINE_WIDTH
,
LINE_WIDTH
,
FONT_SIZE
,
FONT_SIZE
,
COLOR
,
REPRESENTATION
,
REPRESENTATION
,
IMMEDIATE_RENDERING
,
IMMEDIATE_RENDERING
,
SHADING
SHADING
...
@@ -162,7 +161,7 @@ namespace cv
...
@@ -162,7 +161,7 @@ namespace cv
class
CV_EXPORTS
Text3DWidget
:
public
Widget3D
class
CV_EXPORTS
Text3DWidget
:
public
Widget3D
{
{
public
:
public
:
Text3DWidget
(
const
String
&
text
,
const
Point3f
&
position
,
double
text_scale
=
1.0
,
const
Color
&
color
=
Color
::
white
());
Text3DWidget
(
const
String
&
text
,
const
Point3f
&
position
,
double
text_scale
=
1.0
,
bool
face_camera
=
true
,
const
Color
&
color
=
Color
::
white
());
void
setText
(
const
String
&
text
);
void
setText
(
const
String
&
text
);
String
getText
()
const
;
String
getText
()
const
;
...
...
modules/viz/src/shape_widgets.cpp
View file @
2170559b
...
@@ -521,21 +521,32 @@ template<> cv::viz::GridWidget cv::viz::Widget::cast<cv::viz::GridWidget>()
...
@@ -521,21 +521,32 @@ template<> cv::viz::GridWidget cv::viz::Widget::cast<cv::viz::GridWidget>()
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
/// text3D widget implementation
/// text3D widget implementation
cv
::
viz
::
Text3DWidget
::
Text3DWidget
(
const
String
&
text
,
const
Point3f
&
position
,
double
text_scale
,
const
Color
&
color
)
cv
::
viz
::
Text3DWidget
::
Text3DWidget
(
const
String
&
text
,
const
Point3f
&
position
,
double
text_scale
,
bool
face_camera
,
const
Color
&
color
)
{
{
vtkSmartPointer
<
vtkVectorText
>
textSource
=
vtkSmartPointer
<
vtkVectorText
>::
New
();
vtkSmartPointer
<
vtkVectorText
>
textSource
=
vtkSmartPointer
<
vtkVectorText
>::
New
();
textSource
->
SetText
(
text
.
c_str
());
textSource
->
SetText
(
text
.
c_str
());
textSource
->
Update
();
textSource
->
Update
();
vtkSmartPointer
<
vtkPolyDataMapper
>
mapper
=
vtkSmartPointer
<
vtkPolyDataMapper
>::
New
();
vtkSmartPointer
<
vtkPolyDataMapper
>
mapper
=
vtkSmartPointer
<
vtkPolyDataMapper
>::
New
();
mapper
->
SetInputConnection
(
textSource
->
GetOutputPort
());
mapper
->
SetInputConnection
(
textSource
->
GetOutputPort
());
vtkSmartPointer
<
vtkFollower
>
actor
=
vtkSmartPointer
<
vtkFollower
>::
New
();
if
(
face_camera
)
actor
->
SetMapper
(
mapper
);
{
actor
->
SetPosition
(
position
.
x
,
position
.
y
,
position
.
z
);
vtkSmartPointer
<
vtkFollower
>
actor
=
vtkSmartPointer
<
vtkFollower
>::
New
();
actor
->
SetScale
(
text_scale
);
actor
->
SetMapper
(
mapper
);
actor
->
SetPosition
(
position
.
x
,
position
.
y
,
position
.
z
);
actor
->
SetScale
(
text_scale
);
WidgetAccessor
::
setProp
(
*
this
,
actor
);
}
else
{
vtkSmartPointer
<
vtkActor
>
actor
=
vtkSmartPointer
<
vtkActor
>::
New
();
actor
->
SetMapper
(
mapper
);
actor
->
SetPosition
(
position
.
x
,
position
.
y
,
position
.
z
);
actor
->
SetScale
(
text_scale
);
WidgetAccessor
::
setProp
(
*
this
,
actor
);
}
WidgetAccessor
::
setProp
(
*
this
,
actor
);
setColor
(
color
);
setColor
(
color
);
}
}
...
...
modules/viz/src/viz3d.cpp
View file @
2170559b
...
@@ -84,7 +84,7 @@ void cv::viz::Viz3d::setBackgroundColor(const Color& color) { impl_->setBackgrou
...
@@ -84,7 +84,7 @@ void cv::viz::Viz3d::setBackgroundColor(const Color& color) { impl_->setBackgrou
void
cv
::
viz
::
Viz3d
::
setRenderingProperty
(
const
String
&
id
,
int
property
,
double
value
)
{
getWidget
(
id
).
setRenderingProperty
(
property
,
value
);
}
void
cv
::
viz
::
Viz3d
::
setRenderingProperty
(
const
String
&
id
,
int
property
,
double
value
)
{
getWidget
(
id
).
setRenderingProperty
(
property
,
value
);
}
double
cv
::
viz
::
Viz3d
::
getRenderingProperty
(
const
String
&
id
,
int
property
)
{
return
getWidget
(
id
).
getRenderingProperty
(
property
);
}
double
cv
::
viz
::
Viz3d
::
getRenderingProperty
(
const
String
&
id
,
int
property
)
{
return
getWidget
(
id
).
getRenderingProperty
(
property
);
}
void
cv
::
viz
::
Viz3d
::
setDesiredUpdateRate
(
double
time
)
{
impl_
->
setDesiredUpdateRate
(
tim
e
);
}
void
cv
::
viz
::
Viz3d
::
setDesiredUpdateRate
(
double
rate
)
{
impl_
->
setDesiredUpdateRate
(
rat
e
);
}
double
cv
::
viz
::
Viz3d
::
getDesiredUpdateRate
()
{
return
impl_
->
getDesiredUpdateRate
();
}
double
cv
::
viz
::
Viz3d
::
getDesiredUpdateRate
()
{
return
impl_
->
getDesiredUpdateRate
();
}
void
cv
::
viz
::
Viz3d
::
setRepresentation
(
int
representation
)
{
impl_
->
setRepresentation
(
representation
);
}
void
cv
::
viz
::
Viz3d
::
setRepresentation
(
int
representation
)
{
impl_
->
setRepresentation
(
representation
);
}
modules/viz/src/viz3d_impl.cpp
View file @
2170559b
...
@@ -189,10 +189,10 @@ cv::Affine3f cv::viz::Viz3d::VizImpl::getWidgetPose(const String &id) const
...
@@ -189,10 +189,10 @@ cv::Affine3f cv::viz::Viz3d::VizImpl::getWidgetPose(const String &id) const
}
}
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setDesiredUpdateRate
(
double
tim
e
)
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setDesiredUpdateRate
(
double
rat
e
)
{
{
if
(
interactor_
)
if
(
interactor_
)
interactor_
->
SetDesiredUpdateRate
(
tim
e
);
interactor_
->
SetDesiredUpdateRate
(
rat
e
);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
...
...
modules/viz/src/viz3d_impl.hpp
View file @
2170559b
...
@@ -24,7 +24,7 @@ public:
...
@@ -24,7 +24,7 @@ public:
void
updateWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
);
void
updateWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
);
Affine3f
getWidgetPose
(
const
String
&
id
)
const
;
Affine3f
getWidgetPose
(
const
String
&
id
)
const
;
void
setDesiredUpdateRate
(
double
tim
e
);
void
setDesiredUpdateRate
(
double
rat
e
);
double
getDesiredUpdateRate
();
double
getDesiredUpdateRate
();
/** \brief Returns true when the user tried to close the window */
/** \brief Returns true when the user tried to close the window */
...
...
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