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
38c9fa4a
Commit
38c9fa4a
authored
Jan 07, 2014
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more refactoring
parent
4833976a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
43 deletions
+2
-43
shapes.cpp
modules/viz/src/shapes.cpp
+1
-17
vizcore.cpp
modules/viz/src/vizcore.cpp
+1
-26
No files found.
modules/viz/src/shapes.cpp
View file @
38c9fa4a
...
...
@@ -45,14 +45,6 @@
#include "precomp.hpp"
namespace
cv
{
namespace
viz
{
template
<
typename
_Tp
>
Vec
<
_Tp
,
3
>*
vtkpoints_data
(
vtkSmartPointer
<
vtkPoints
>&
points
);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////
/// line widget implementation
cv
::
viz
::
WLine
::
WLine
(
const
Point3d
&
pt1
,
const
Point3d
&
pt2
,
const
Color
&
color
)
...
...
@@ -350,7 +342,7 @@ cv::viz::WCoordinateSystem::WCoordinateSystem(double scale)
polydata
->
GetPointData
()
->
SetScalars
(
colors
);
vtkSmartPointer
<
vtkTubeFilter
>
tube_filter
=
vtkSmartPointer
<
vtkTubeFilter
>::
New
();
VtkUtils
::
SetInputData
(
tube_filter
,
polydata
);
tube_filter
->
SetInputConnection
(
polydata
->
GetProducerPort
()
);
tube_filter
->
SetRadius
(
axes
->
GetScaleFactor
()
/
50.0
);
tube_filter
->
SetNumberOfSides
(
6
);
...
...
@@ -445,11 +437,7 @@ namespace cv { namespace viz { namespace
// Extract the edges so we have the grid
vtkSmartPointer
<
vtkExtractEdges
>
filter
=
vtkSmartPointer
<
vtkExtractEdges
>::
New
();
#if VTK_MAJOR_VERSION <= 5
filter
->
SetInputConnection
(
grid
->
GetProducerPort
());
#else
filter
->
SetInputData
(
grid
);
#endif
filter
->
Update
();
return
filter
->
GetOutput
();
}
...
...
@@ -461,11 +449,7 @@ cv::viz::WGrid::WGrid(const Vec2i &dimensions, const Vec2d &spacing, const Color
vtkSmartPointer
<
vtkPolyData
>
grid
=
GridUtils
::
createGrid
(
dimensions
,
spacing
);
vtkSmartPointer
<
vtkPolyDataMapper
>
mapper
=
vtkSmartPointer
<
vtkPolyDataMapper
>::
New
();
#if VTK_MAJOR_VERSION <= 5
mapper
->
SetInputConnection
(
grid
->
GetProducerPort
());
#else
mapper
->
SetInputData
(
grid
);
#endif
vtkSmartPointer
<
vtkActor
>
actor
=
vtkSmartPointer
<
vtkActor
>::
New
();
actor
->
SetMapper
(
mapper
);
...
...
modules/viz/src/vizcore.cpp
View file @
38c9fa4a
...
...
@@ -64,27 +64,6 @@ cv::Affine3d cv::viz::makeCameraPose(const Vec3d& position, const Vec3d& focal_p
return
makeTransformToGlobal
(
u
,
v
,
n
,
position
);
}
namespace
cv
{
namespace
viz
{
template
<
typename
_Tp
>
Vec
<
_Tp
,
3
>*
vtkpoints_data
(
vtkSmartPointer
<
vtkPoints
>&
points
);
template
<>
Vec3f
*
vtkpoints_data
<
float
>
(
vtkSmartPointer
<
vtkPoints
>&
points
)
{
CV_Assert
(
points
->
GetDataType
()
==
VTK_FLOAT
);
vtkDataArray
*
data
=
points
->
GetData
();
float
*
pointer
=
static_cast
<
vtkFloatArray
*>
(
data
)
->
GetPointer
(
0
);
return
reinterpret_cast
<
Vec3f
*>
(
pointer
);
}
template
<>
Vec3d
*
vtkpoints_data
<
double
>
(
vtkSmartPointer
<
vtkPoints
>&
points
)
{
CV_Assert
(
points
->
GetDataType
()
==
VTK_DOUBLE
);
vtkDataArray
*
data
=
points
->
GetData
();
double
*
pointer
=
static_cast
<
vtkDoubleArray
*>
(
data
)
->
GetPointer
(
0
);
return
reinterpret_cast
<
Vec3d
*>
(
pointer
);
}
}}
///////////////////////////////////////////////////////////////////////////////////////////////
/// VizStorage implementation
...
...
@@ -308,11 +287,7 @@ void cv::viz::computeNormals(const Mesh3d& mesh, OutputArray _normals)
vtkSmartPointer
<
vtkPolyData
>
polydata
=
getPolyData
(
WMesh
(
mesh
));
vtkSmartPointer
<
vtkPolyDataNormals
>
normal_generator
=
vtkSmartPointer
<
vtkPolyDataNormals
>::
New
();
#if VTK_MAJOR_VERSION <= 5
normal_generator
->
SetInput
(
polydata
);
#else
normal_generator
->
SetInputData
(
polydata
);
#endif
normal_generator
->
SetInputConnection
(
polydata
->
GetProducerPort
());
normal_generator
->
ComputePointNormalsOn
();
normal_generator
->
ComputeCellNormalsOff
();
...
...
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