From: Anatoly Baksheev Date: Sun, 1 Dec 2013 10:58:29 +0000 (+0400) Subject: allow fast switch between actors (except mesh, cloud, cloud collection) X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~3552^2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44c1d4dfdc8fc14093966d08d48cbf3666b41680;p=platform%2Fupstream%2Fopencv.git allow fast switch between actors (except mesh, cloud, cloud collection) --- diff --git a/modules/viz/src/cloud_widgets.cpp b/modules/viz/src/cloud_widgets.cpp index 0f36ef9..894051e 100644 --- a/modules/viz/src/cloud_widgets.cpp +++ b/modules/viz/src/cloud_widgets.cpp @@ -604,7 +604,7 @@ cv::viz::WCloudNormals::WCloudNormals(InputArray _cloud, InputArray _normals, in mapper->SetColorModeToMapScalars(); mapper->SetScalarModeToUsePointData(); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); setColor(color); diff --git a/modules/viz/src/precomp.hpp b/modules/viz/src/precomp.hpp index ab673b3..1beb435 100644 --- a/modules/viz/src/precomp.hpp +++ b/modules/viz/src/precomp.hpp @@ -101,6 +101,7 @@ #include #include #include +#include #include #include #include @@ -120,6 +121,9 @@ namespace cv { namespace viz { + typedef vtkLODActor vizActor; + //typedef vtkActor vizActor; + typedef std::map > WidgetActorMap; typedef std::map VizMap; diff --git a/modules/viz/src/shape_widgets.cpp b/modules/viz/src/shape_widgets.cpp index 6e4f4c7..aff3609 100644 --- a/modules/viz/src/shape_widgets.cpp +++ b/modules/viz/src/shape_widgets.cpp @@ -68,7 +68,7 @@ cv::viz::WLine::WLine(const Point3f &pt1, const Point3f &pt2, const Color &color vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(line->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -117,7 +117,7 @@ cv::viz::WPlane::WPlane(const Vec4f& coefs, float size, const Color &color) vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(SetSizeImpl::setSize(p_center, plane->GetOutputPort(), size)->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -138,7 +138,7 @@ cv::viz::WPlane::WPlane(const Vec4f& coefs, const Point3f& pt, float size, const vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(SetSizeImpl::setSize(p_center, plane->GetOutputPort(), size)->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -167,7 +167,7 @@ cv::viz::WSphere::WSphere(const Point3f ¢er, float radius, int sphere_resolu vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(sphere->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -240,7 +240,7 @@ cv::viz::WArrow::WArrow(const Point3f& pt1, const Point3f& pt2, float thickness, vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(transformPD->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -276,7 +276,7 @@ cv::viz::WCircle::WCircle(const Point3f& pt, float radius, float thickness, cons vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(tf->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -307,7 +307,7 @@ cv::viz::WCylinder::WCylinder(const Point3f& pt_on_axis, const Point3f& axis_dir vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(tuber->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -339,7 +339,7 @@ cv::viz::WCube::WCube(const Point3f& pt_min, const Point3f& pt_max, bool wire_fr mapper->SetInputConnection(cube->GetOutputPort()); } - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -391,7 +391,7 @@ cv::viz::WCoordinateSystem::WCoordinateSystem(float scale) mapper->SetScalarModeToUsePointData(); mapper->SetInputConnection(axes_tubes->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor); @@ -1068,7 +1068,7 @@ cv::viz::WCameraPosition::WCameraPosition(float scale) mapper->SetScalarModeToUsePointData(); mapper->SetInputConnection(axes_tubes->GetOutputPort()); - vtkSmartPointer actor = vtkSmartPointer::New(); + vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); WidgetAccessor::setProp(*this, actor);