Commit fcf437cf authored by Ozan Tonkal's avatar Ozan Tonkal

combine representation methods to one as setRepresentation

parent 94ca5d65
...@@ -65,9 +65,7 @@ namespace cv ...@@ -65,9 +65,7 @@ namespace cv
void setDesiredUpdateRate(double time); void setDesiredUpdateRate(double time);
double getDesiredUpdateRate(); double getDesiredUpdateRate();
void setRepresentationToSurface(); void setRepresentation(int representation);
void setRepresentationToWireframe();
void setRepresentationToPoints();
private: private:
struct VizImpl; struct VizImpl;
......
...@@ -87,6 +87,4 @@ double cv::viz::Viz3d::getRenderingProperty(const String &id, int property) { re ...@@ -87,6 +87,4 @@ double cv::viz::Viz3d::getRenderingProperty(const String &id, int property) { re
void cv::viz::Viz3d::setDesiredUpdateRate(double time) { impl_->setDesiredUpdateRate(time); } void cv::viz::Viz3d::setDesiredUpdateRate(double time) { impl_->setDesiredUpdateRate(time); }
double cv::viz::Viz3d::getDesiredUpdateRate() { return impl_->getDesiredUpdateRate(); } double cv::viz::Viz3d::getDesiredUpdateRate() { return impl_->getDesiredUpdateRate(); }
void cv::viz::Viz3d::setRepresentationToSurface() { impl_->setRepresentationToSurface(); } void cv::viz::Viz3d::setRepresentation(int representation) { impl_->setRepresentation(representation); }
void cv::viz::Viz3d::setRepresentationToWireframe() { impl_->setRepresentationToWireframe(); }
void cv::viz::Viz3d::setRepresentationToPoints() { impl_->setRepresentationToPoints(); }
\ No newline at end of file
...@@ -464,33 +464,32 @@ void cv::viz::Viz3d::VizImpl::resetCamera() ...@@ -464,33 +464,32 @@ void cv::viz::Viz3d::VizImpl::resetCamera()
} }
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
void cv::viz::Viz3d::VizImpl::setRepresentationToSurface() void cv::viz::Viz3d::VizImpl::setRepresentation(int representation)
{ {
vtkActorCollection * actors = renderer_->GetActors(); vtkActorCollection * actors = renderer_->GetActors();
actors->InitTraversal(); actors->InitTraversal();
vtkActor * actor; vtkActor * actor;
while ((actor = actors->GetNextActor()) != NULL) switch (representation)
actor->GetProperty()->SetRepresentationToSurface(); {
} case REPRESENTATION_POINTS:
{
/////////////////////////////////////////////////////////////////////////////////// while ((actor = actors->GetNextActor()) != NULL)
void cv::viz::Viz3d::VizImpl::setRepresentationToPoints() actor->GetProperty()->SetRepresentationToPoints();
{ break;
vtkActorCollection * actors = renderer_->GetActors(); }
actors->InitTraversal(); case REPRESENTATION_SURFACE:
vtkActor * actor; {
while ((actor = actors->GetNextActor()) != NULL) while ((actor = actors->GetNextActor()) != NULL)
actor->GetProperty()->SetRepresentationToPoints(); actor->GetProperty()->SetRepresentationToSurface();
} break;
}
/////////////////////////////////////////////////////////////////////////////////// case REPRESENTATION_WIREFRAME:
void cv::viz::Viz3d::VizImpl::setRepresentationToWireframe() {
{ while ((actor = actors->GetNextActor()) != NULL)
vtkActorCollection * actors = renderer_->GetActors(); actor->GetProperty()->SetRepresentationToWireframe();
actors->InitTraversal(); break;
vtkActor *actor; }
while ((actor = actors->GetNextActor()) != NULL) }
actor->GetProperty()->SetRepresentationToWireframe();
} }
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
......
...@@ -44,9 +44,7 @@ public: ...@@ -44,9 +44,7 @@ public:
} }
} }
void setRepresentationToSurface(); void setRepresentation(int representation);
void setRepresentationToPoints();
void setRepresentationToWireframe();
void setCamera(const Camera &camera); void setCamera(const Camera &camera);
Camera getCamera() const; Camera getCamera() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment