From: ozantonkal Date: Sat, 24 Aug 2013 09:58:32 +0000 (+0200) Subject: implemented actor representation methods in viz3d X-Git-Tag: submit/tizen_ivi/20141117.190038~2^2~913^2~27^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f416352e1143f1d29d04292426f8003e67f5370;p=profile%2Fivi%2Fopencv.git implemented actor representation methods in viz3d --- diff --git a/modules/viz/include/opencv2/viz/viz3d.hpp b/modules/viz/include/opencv2/viz/viz3d.hpp index 7b08755..16e4911 100644 --- a/modules/viz/include/opencv2/viz/viz3d.hpp +++ b/modules/viz/include/opencv2/viz/viz3d.hpp @@ -57,6 +57,10 @@ namespace cv void setRenderingProperty(int property, double value, const String &id); double getRenderingProperty(int property, const String &id); + + void setRepresentationToSurface(); + void setRepresentationToWireframe(); + void setRepresentationToPoints(); private: struct VizImpl; diff --git a/modules/viz/src/viz3d.cpp b/modules/viz/src/viz3d.cpp index fc9ce01..8f1d12c 100644 --- a/modules/viz/src/viz3d.cpp +++ b/modules/viz/src/viz3d.cpp @@ -76,3 +76,7 @@ cv::String cv::viz::Viz3d::getWindowName() const { return impl_->getWindowName() void cv::viz::Viz3d::setRenderingProperty(int property, double value, const String &id) { getWidget(id).setRenderingProperty(property, value); } double cv::viz::Viz3d::getRenderingProperty(int property, const String &id) { return getWidget(id).getRenderingProperty(property); } + +void cv::viz::Viz3d::setRepresentationToSurface() { impl_->setRepresentationToSurface(); } +void cv::viz::Viz3d::setRepresentationToWireframe() { impl_->setRepresentationToWireframe(); } +void cv::viz::Viz3d::setRepresentationToPoints() { impl_->setRepresentationToPoints(); } diff --git a/modules/viz/src/viz3d_impl.cpp b/modules/viz/src/viz3d_impl.cpp index aa51b10..8802247 100644 --- a/modules/viz/src/viz3d_impl.cpp +++ b/modules/viz/src/viz3d_impl.cpp @@ -423,33 +423,33 @@ void cv::viz::Viz3d::VizImpl::resetCameraViewpoint (const std::string &id) } /////////////////////////////////////////////////////////////////////////////////// -void cv::viz::Viz3d::VizImpl::setRepresentationToSurfaceForAllActors () +void cv::viz::Viz3d::VizImpl::setRepresentationToSurface() { - vtkActorCollection * actors = renderer_->GetActors (); - actors->InitTraversal (); + vtkActorCollection * actors = renderer_->GetActors(); + actors->InitTraversal(); vtkActor * actor; - while ((actor = actors->GetNextActor ()) != NULL) - actor->GetProperty ()->SetRepresentationToSurface (); + while ((actor = actors->GetNextActor()) != NULL) + actor->GetProperty()->SetRepresentationToSurface(); } /////////////////////////////////////////////////////////////////////////////////// -void cv::viz::Viz3d::VizImpl::setRepresentationToPointsForAllActors () +void cv::viz::Viz3d::VizImpl::setRepresentationToPoints() { - vtkActorCollection * actors = renderer_->GetActors (); - actors->InitTraversal (); + vtkActorCollection * actors = renderer_->GetActors(); + actors->InitTraversal(); vtkActor * actor; - while ((actor = actors->GetNextActor ()) != NULL) - actor->GetProperty ()->SetRepresentationToPoints (); + while ((actor = actors->GetNextActor()) != NULL) + actor->GetProperty()->SetRepresentationToPoints(); } /////////////////////////////////////////////////////////////////////////////////// -void cv::viz::Viz3d::VizImpl::setRepresentationToWireframeForAllActors () +void cv::viz::Viz3d::VizImpl::setRepresentationToWireframe() { - vtkActorCollection * actors = renderer_->GetActors (); - actors->InitTraversal (); + vtkActorCollection * actors = renderer_->GetActors(); + actors->InitTraversal(); vtkActor *actor; - while ((actor = actors->GetNextActor ()) != NULL) - actor->GetProperty ()->SetRepresentationToWireframe (); + while ((actor = actors->GetNextActor()) != NULL) + actor->GetProperty()->SetRepresentationToWireframe(); } ////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/modules/viz/src/viz3d_impl.hpp b/modules/viz/src/viz3d_impl.hpp index 60ec707..7bb008a 100644 --- a/modules/viz/src/viz3d_impl.hpp +++ b/modules/viz/src/viz3d_impl.hpp @@ -39,16 +39,9 @@ public: } } - // to implement in Viz3d with shorter name - void setRepresentationToSurfaceForAllActors(); - void setRepresentationToPointsForAllActors(); - void setRepresentationToWireframeForAllActors(); - - - - - - + void setRepresentationToSurface(); + void setRepresentationToPoints(); + void setRepresentationToWireframe(); // ////////////////////////////////////////////////////////////////////////////////////