From e048df51ced6ff5863c806104ae0019deafcbb38 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Sun, 8 Dec 2013 18:31:04 +0400 Subject: [PATCH] for shapes switched vtkDataSetMapper to more efficient vtkPolyDataMapper --- modules/viz/src/shape_widgets.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/viz/src/shape_widgets.cpp b/modules/viz/src/shape_widgets.cpp index 3a2ba58f9..b7af4b760 100644 --- a/modules/viz/src/shape_widgets.cpp +++ b/modules/viz/src/shape_widgets.cpp @@ -65,7 +65,7 @@ cv::viz::WLine::WLine(const Point3f &pt1, const Point3f &pt2, const Color &color line->SetPoint2(pt2.x, pt2.y, pt2.z); line->Update(); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(line->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); @@ -117,7 +117,7 @@ cv::viz::WPlane::WPlane(const Vec4f& coefs, float size, const Color &color) Vec3d p_center; plane->GetOrigin(p_center.val); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(PlaneUtils::setSize(p_center, plane->GetOutputPort(), size)->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); @@ -138,7 +138,7 @@ cv::viz::WPlane::WPlane(const Vec4f& coefs, const Point3f& pt, float size, const Vec3f p_center = pt - coefs3 * t * norm_sqr; plane->SetCenter(p_center[0], p_center[1], p_center[2]); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(PlaneUtils::setSize(p_center, plane->GetOutputPort(), size)->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); @@ -167,7 +167,7 @@ cv::viz::WSphere::WSphere(const Point3f ¢er, float radius, int sphere_resolu sphere->LatLongTessellationOff(); sphere->Update(); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(sphere->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); @@ -240,7 +240,7 @@ cv::viz::WArrow::WArrow(const Point3f& pt1, const Point3f& pt2, float thickness, transformPD->SetTransform(transform); transformPD->SetInputConnection(arrowSource->GetOutputPort()); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(transformPD->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); @@ -276,7 +276,7 @@ cv::viz::WCircle::WCircle(const Point3f& pt, float radius, float thickness, cons tf->SetTransform(t); tf->SetInputConnection(disk->GetOutputPort()); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(tf->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); @@ -307,7 +307,7 @@ cv::viz::WCylinder::WCylinder(const Point3f& pt_on_axis, const Point3f& axis_dir tuber->SetRadius(radius); tuber->SetNumberOfSides(numsides); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(tuber->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); @@ -328,7 +328,7 @@ template<> cv::viz::WCylinder cv::viz::Widget::cast() cv::viz::WCube::WCube(const Point3f& pt_min, const Point3f& pt_max, bool wire_frame, const Color &color) { - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); if (wire_frame) { vtkSmartPointer cube = vtkSmartPointer::New(); @@ -390,7 +390,7 @@ cv::viz::WCoordinateSystem::WCoordinateSystem(float scale) axes_tubes->SetRadius(axes->GetScaleFactor() / 50.0); axes_tubes->SetNumberOfSides(6); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetScalarModeToUsePointData(); mapper->SetInputConnection(axes_tubes->GetOutputPort()); @@ -526,7 +526,7 @@ cv::viz::WGrid::WGrid(const Vec2i &dimensions, const Vec2d &spacing, const Color { vtkSmartPointer grid = GridUtils::createGrid(dimensions, spacing); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 mapper->SetInputConnection(grid->GetProducerPort()); #else @@ -583,7 +583,7 @@ cv::viz::WGrid::WGrid(const Vec4f &coefs, const Vec2i &dimensions, const Vec2d & #endif transform_filter->Update(); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(transform_filter->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); @@ -1076,7 +1076,7 @@ cv::viz::WCameraPosition::WCameraPosition(float scale) axes_tubes->SetRadius(axes->GetScaleFactor() / 50.0); axes_tubes->SetNumberOfSides(6); - vtkSmartPointer mapper = vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetScalarModeToUsePointData(); mapper->SetInputConnection(axes_tubes->GetOutputPort());