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
fb62a66b
Commit
fb62a66b
authored
Nov 24, 2013
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unused code
parent
b88fdc73
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
95 deletions
+8
-95
interactor_style.hpp
modules/viz/src/interactor_style.hpp
+0
-0
precomp.hpp
modules/viz/src/precomp.hpp
+3
-4
viz.cpp
modules/viz/src/viz.cpp
+1
-1
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+4
-86
viz3d_impl.hpp
modules/viz/src/viz3d_impl.hpp
+0
-4
No files found.
modules/viz/src/interactor_style.h
→
modules/viz/src/interactor_style.h
pp
View file @
fb62a66b
File moved
modules/viz/src/precomp.hpp
View file @
fb62a66b
...
...
@@ -70,7 +70,7 @@
#include <vtkSmartPointer.h>
#include <vtkDataSet.h>
#include <vtkPolygon.h>
#include <vtkPointPicker.h>
//
#include <vtkPointPicker.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDiskSource.h>
#include <vtkPlaneSource.h>
...
...
@@ -105,7 +105,6 @@
#include <vtkCamera.h>
#include <vtkObjectFactory.h>
#include <vtkPlanes.h>
#include <vtkImageViewer.h>
#include <vtkImageFlip.h>
#include <vtkRenderWindow.h>
#include <vtkTextProperty.h>
...
...
@@ -119,6 +118,7 @@
#include <vtkTextureMapToPlane.h>
#include <vtkPolyDataNormals.h>
#include <vtkAlgorithmOutput.h>
#include <vtkImageMapper.h>
#if defined __GNUC__ && defined __DEPRECATED_DISABLED__
#define __DEPRECATED
...
...
@@ -136,7 +136,6 @@ namespace cv
{
typedef
std
::
map
<
String
,
vtkSmartPointer
<
vtkProp
>
>
WidgetActorMap
;
typedef
std
::
map
<
String
,
Viz3d
>
VizMap
;
typedef
std
::
pair
<
String
,
Viz3d
>
VizPair
;
class
VizStorage
{
...
...
@@ -162,7 +161,7 @@ namespace cv
}
}
#include "interactor_style.h"
#include "interactor_style.h
pp
"
#include "viz3d_impl.hpp"
...
...
modules/viz/src/viz.cpp
View file @
fb62a66b
...
...
@@ -125,7 +125,7 @@ void cv::viz::VizStorage::add(Viz3d window)
String
window_name
=
window
.
getWindowName
();
VizMap
::
iterator
vm_itr
=
storage
.
find
(
window_name
);
CV_Assert
(
vm_itr
==
storage
.
end
());
storage
.
insert
(
VizP
air
(
window_name
,
window
));
storage
.
insert
(
std
::
make_p
air
(
window_name
,
window
));
}
bool
cv
::
viz
::
VizStorage
::
windowExists
(
const
String
&
window_name
)
...
...
modules/viz/src/viz3d_impl.cpp
View file @
fb62a66b
...
...
@@ -95,9 +95,9 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name)
timer_id_
=
interactor_
->
CreateRepeatingTimer
(
5000L
);
// Set a simple PointPicker
vtkSmartPointer
<
vtkPointPicker
>
pp
=
vtkSmartPointer
<
vtkPointPicker
>::
New
();
pp
->
SetTolerance
(
pp
->
GetTolerance
()
*
2
);
interactor_
->
SetPicker
(
pp
);
//
vtkSmartPointer<vtkPointPicker> pp = vtkSmartPointer<vtkPointPicker>::New();
//
pp->SetTolerance(pp->GetTolerance() * 2);
//
interactor_->SetPicker(pp);
exit_main_loop_timer_callback_
=
vtkSmartPointer
<
ExitMainLoopTimerCallback
>::
New
();
exit_main_loop_timer_callback_
->
viz_
=
this
;
...
...
@@ -112,8 +112,7 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name)
//////////////////////////////
String
window_name
;
VizAccessor
::
generateWindowName
(
name
,
window_name
);
String
window_name
=
VizStorage
::
generateWindowName
(
name
);
window_
->
SetWindowName
(
window_name
.
c_str
());
}
...
...
@@ -314,45 +313,6 @@ bool cv::viz::Viz3d::VizImpl::removeActorFromRenderer(const vtkSmartPointer<vtkP
return
false
;
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
createActorFromVTKDataSet
(
const
vtkSmartPointer
<
vtkDataSet
>
&
data
,
vtkSmartPointer
<
vtkLODActor
>
&
actor
,
bool
use_scalars
)
{
if
(
!
actor
)
actor
=
vtkSmartPointer
<
vtkLODActor
>::
New
();
vtkSmartPointer
<
vtkDataSetMapper
>
mapper
=
vtkSmartPointer
<
vtkDataSetMapper
>::
New
();
#if VTK_MAJOR_VERSION <= 5
mapper
->
SetInput
(
data
);
#else
mapper
->
SetInputData
(
data
);
#endif
if
(
use_scalars
)
{
vtkSmartPointer
<
vtkDataArray
>
scalars
=
data
->
GetPointData
()
->
GetScalars
();
if
(
scalars
)
{
cv
::
Vec3d
minmax
(
scalars
->
GetRange
());
mapper
->
SetScalarRange
(
minmax
.
val
);
mapper
->
SetScalarModeToUsePointData
();
// interpolation OFF, if data is a vtkPolyData that contains only vertices, ON for anything else.
vtkPolyData
*
polyData
=
vtkPolyData
::
SafeDownCast
(
data
);
bool
interpolation
=
(
polyData
&&
polyData
->
GetNumberOfCells
()
!=
polyData
->
GetNumberOfVerts
());
mapper
->
SetInterpolateScalarsBeforeMapping
(
interpolation
);
mapper
->
ScalarVisibilityOn
();
}
}
mapper
->
ImmediateModeRenderingOff
();
actor
->
SetNumberOfCloudPoints
(
int
(
std
::
max
<
vtkIdType
>
(
1
,
data
->
GetNumberOfPoints
()
/
10
)));
actor
->
GetProperty
()
->
SetInterpolationToFlat
();
actor
->
GetProperty
()
->
BackfaceCullingOn
();
actor
->
SetMapper
(
mapper
);
}
//////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setBackgroundColor
(
const
Color
&
color
)
{
...
...
@@ -542,48 +502,6 @@ void cv::viz::Viz3d::VizImpl::setRepresentation(int representation)
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
updateCells
(
vtkSmartPointer
<
vtkIdTypeArray
>
&
cells
,
vtkSmartPointer
<
vtkIdTypeArray
>
&
initcells
,
vtkIdType
nr_points
)
{
// If no init cells and cells has not been initialized...
if
(
!
cells
)
cells
=
vtkSmartPointer
<
vtkIdTypeArray
>::
New
();
// If we have less values then we need to recreate the array
if
(
cells
->
GetNumberOfTuples
()
<
nr_points
)
{
cells
=
vtkSmartPointer
<
vtkIdTypeArray
>::
New
();
// If init cells is given, and there's enough data in it, use it
if
(
initcells
&&
initcells
->
GetNumberOfTuples
()
>=
nr_points
)
{
cells
->
DeepCopy
(
initcells
);
cells
->
SetNumberOfComponents
(
2
);
cells
->
SetNumberOfTuples
(
nr_points
);
}
else
{
// If the number of tuples is still too small, we need to recreate the array
cells
->
SetNumberOfComponents
(
2
);
cells
->
SetNumberOfTuples
(
nr_points
);
vtkIdType
*
cell
=
cells
->
GetPointer
(
0
);
// Fill it with 1s
std
::
fill
(
cell
,
cell
+
nr_points
*
2
,
1
);
cell
++
;
for
(
vtkIdType
i
=
0
;
i
<
nr_points
;
++
i
,
cell
+=
2
)
*
cell
=
i
;
// Save the results in initcells
initcells
=
vtkSmartPointer
<
vtkIdTypeArray
>::
New
();
initcells
->
DeepCopy
(
cells
);
}
}
else
{
// The assumption here is that the current set of cells has more data than needed
cells
->
SetNumberOfComponents
(
2
);
cells
->
SetNumberOfTuples
(
nr_points
);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setFullScreen
(
bool
mode
)
...
...
modules/viz/src/viz3d_impl.hpp
View file @
fb62a66b
...
...
@@ -52,7 +52,6 @@
struct
cv
::
viz
::
Viz3d
::
VizImpl
{
public
:
typedef
cv
::
Ptr
<
VizImpl
>
Ptr
;
typedef
Viz3d
::
KeyboardCallback
KeyboardCallback
;
typedef
Viz3d
::
MouseCallback
MouseCallback
;
...
...
@@ -181,9 +180,6 @@ private:
bool
camera_set_
;
bool
removeActorFromRenderer
(
const
vtkSmartPointer
<
vtkProp
>
&
actor
);
void
createActorFromVTKDataSet
(
const
vtkSmartPointer
<
vtkDataSet
>
&
data
,
vtkSmartPointer
<
vtkLODActor
>
&
actor
,
bool
use_scalars
=
true
);
void
updateCells
(
vtkSmartPointer
<
vtkIdTypeArray
>
&
cells
,
vtkSmartPointer
<
vtkIdTypeArray
>
&
initcells
,
vtkIdType
nr_points
);
};
...
...
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