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
159de9cc
Commit
159de9cc
authored
Dec 12, 2013
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed potential crash
parent
27050682
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
clouds.cpp
modules/viz/src/clouds.cpp
+5
-6
widget.cpp
modules/viz/src/widget.cpp
+1
-1
No files found.
modules/viz/src/clouds.cpp
View file @
159de9cc
...
...
@@ -334,7 +334,7 @@ namespace cv { namespace viz { namespace
return
polydata
;
}
static
void
createMapper
(
vtkSmartPointer
<
vtkLODActor
>
actor
,
vtkSmartPointer
<
vtkPolyData
>
poly_data
,
Vec3d
&
minmax
)
static
void
createMapper
(
vtkSmartPointer
<
vtkLODActor
>
actor
,
vtkSmartPointer
<
vtkPolyData
>
poly_data
)
{
vtkDataSetMapper
*
mapper
=
vtkDataSetMapper
::
SafeDownCast
(
actor
->
GetMapper
());
if
(
!
mapper
)
...
...
@@ -347,7 +347,7 @@ namespace cv { namespace viz { namespace
mapper_new
->
SetInputData
(
poly_data
);
#endif
mapper_new
->
SetScalarRange
(
minmax
.
val
);
mapper_new
->
SetScalarRange
(
0
,
255
);
mapper_new
->
SetScalarModeToUsePointData
();
bool
interpolation
=
(
poly_data
&&
poly_data
->
GetNumberOfCells
()
!=
poly_data
->
GetNumberOfVerts
());
...
...
@@ -435,8 +435,8 @@ void cv::viz::WCloudCollection::addCloud(InputArray _cloud, InputArray _colors,
vtkLODActor
*
actor
=
vtkLODActor
::
SafeDownCast
(
WidgetAccessor
::
getProp
(
*
this
));
CV_Assert
(
"Incompatible widget type."
&&
actor
);
Vec3d
minmax
(
scalars
->
GetRange
());
CloudCollectionUtils
::
createMapper
(
actor
,
transform_filter
->
GetOutput
()
,
minmax
);
CloudCollectionUtils
::
createMapper
(
actor
,
transform_filter
->
GetOutput
());
}
void
cv
::
viz
::
WCloudCollection
::
addCloud
(
InputArray
_cloud
,
const
Color
&
color
,
const
Affine3f
&
pose
)
...
...
@@ -474,8 +474,7 @@ void cv::viz::WCloudCollection::addCloud(InputArray _cloud, const Color &color,
vtkLODActor
*
actor
=
vtkLODActor
::
SafeDownCast
(
WidgetAccessor
::
getProp
(
*
this
));
CV_Assert
(
"Incompatible widget type."
&&
actor
);
Vec3d
minmax
(
scalars
->
GetRange
());
CloudCollectionUtils
::
createMapper
(
actor
,
transform_filter
->
GetOutput
(),
minmax
);
CloudCollectionUtils
::
createMapper
(
actor
,
transform_filter
->
GetOutput
());
}
template
<>
cv
::
viz
::
WCloudCollection
cv
::
viz
::
Widget
::
cast
<
cv
::
viz
::
WCloudCollection
>
()
...
...
modules/viz/src/widget.cpp
View file @
159de9cc
...
...
@@ -102,7 +102,7 @@ cv::viz::Widget cv::viz::Widget::fromPlyFile(const String &file_name)
vtkSmartPointer
<
vtkDataArray
>
scalars
=
data
->
GetPointData
()
->
GetScalars
();
if
(
scalars
)
{
cv
::
Vec
3
d
minmax
(
scalars
->
GetRange
());
cv
::
Vec
2
d
minmax
(
scalars
->
GetRange
());
mapper
->
SetScalarRange
(
minmax
.
val
);
mapper
->
SetScalarModeToUsePointData
();
...
...
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