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
998aefd1
Commit
998aefd1
authored
Feb 02, 2014
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cloud collection merges data only on rendering
parent
975a6299
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
clouds.cpp
modules/viz/src/clouds.cpp
+7
-9
No files found.
modules/viz/src/clouds.cpp
View file @
998aefd1
...
...
@@ -211,13 +211,16 @@ void cv::viz::WCloudCollection::addCloud(InputArray cloud, InputArray colors, co
vtkSmartPointer
<
vtkPolyDataMapper
>
mapper
=
vtkPolyDataMapper
::
SafeDownCast
(
actor
->
GetMapper
());
if
(
!
mapper
)
{
vtkSmartPointer
<
vtkAppendPolyData
>
append_filter
=
vtkSmartPointer
<
vtkAppendPolyData
>::
New
();
VtkUtils
::
AddInputData
(
append_filter
,
polydata
);
// This is the first cloud
mapper
=
vtkSmartPointer
<
vtkPolyDataMapper
>::
New
();
mapper
->
SetScalarRange
(
0
,
255
);
mapper
->
SetScalarModeToUsePointData
();
mapper
->
ScalarVisibilityOn
();
mapper
->
ImmediateModeRenderingOff
();
VtkUtils
::
SetInputData
(
mapper
,
polydata
);
mapper
->
SetInputConnection
(
append_filter
->
GetOutputPort
()
);
actor
->
SetNumberOfCloudPoints
(
std
::
max
<
vtkIdType
>
(
1
,
polydata
->
GetNumberOfPoints
()
/
10
));
actor
->
GetProperty
()
->
SetInterpolationToFlat
();
...
...
@@ -226,15 +229,10 @@ void cv::viz::WCloudCollection::addCloud(InputArray cloud, InputArray colors, co
return
;
}
vtkPolyData
*
currdata
=
vtkPolyData
::
SafeDownCast
(
mapper
->
GetInput
());
CV_Assert
(
"Cloud Widget without data"
&&
currdata
);
vtkSmartPointer
<
vtkAppendPolyData
>
append_filter
=
vtkSmartPointer
<
vtkAppendPolyData
>::
New
();
VtkUtils
::
AddInputData
(
append_filter
,
currdata
);
vtkSmartPointer
<
vtkAlgorithm
>
producer
=
mapper
->
GetInputConnection
(
0
,
0
)
->
GetProducer
();
vtkSmartPointer
<
vtkAppendPolyData
>
append_filter
=
vtkAppendPolyData
::
SafeDownCast
(
producer
);
VtkUtils
::
AddInputData
(
append_filter
,
polydata
);
append_filter
->
Update
();
VtkUtils
::
SetInputData
(
mapper
,
append_filter
->
GetOutput
());
append_filter
->
Modified
();
actor
->
SetNumberOfCloudPoints
(
std
::
max
<
vtkIdType
>
(
1
,
actor
->
GetNumberOfCloudPoints
()
+
polydata
->
GetNumberOfPoints
()
/
10
));
}
...
...
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