From 04c2d0c6afbbfb58ac482775fb6149044d006de5 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Mon, 30 May 2011 10:40:55 +0200 Subject: [PATCH] Added "image" in actor type for SetActorVisibility and added corresponding GetActorVisibility. --- vv/vvSlicer.cxx | 35 ++++++++++++++++++++++++++++++----- vv/vvSlicer.h | 3 ++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index c9d9be2..6651833 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -428,25 +428,50 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion) //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +bool vvSlicer::GetActorVisibility(const std::string& actor_type, int overlay_index) +{ + bool vis = false; + if (actor_type == "image") { + vis = this->ImageActor->GetVisibility(); + } + else if (actor_type == "vector") { + vis = this->mVFActor->GetVisibility(); + } + else if (actor_type == "overlay") { + vis = this->mOverlayActor->GetVisibility(); + } + else if (actor_type == "fusion") { + vis = this->mFusionActor->GetVisibility(); + } + else if (actor_type == "contour") + vis = this->mSurfaceCutActors[overlay_index]->GetActor()->GetVisibility(); + + return vis; +} +//------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_index ,bool vis) { - if (actor_type == "vector") { + if (actor_type == "image") { + this->ImageActor->SetVisibility(vis); + } + else if (actor_type == "vector") { this->mVFActor->SetVisibility(vis); } - if (actor_type == "overlay") { + else if (actor_type == "overlay") { this->mOverlayActor->SetVisibility(vis); } - if (actor_type == "fusion") { + else if (actor_type == "fusion") { this->mFusionActor->SetVisibility(vis); } - if (actor_type == "contour") + else if (actor_type == "contour") this->mSurfaceCutActors[overlay_index]->GetActor()->SetVisibility(vis); UpdateDisplayExtent(); } //------------------------------------------------------------------------------ - //------------------------------------------------------------------------------ void vvSlicer::SetVF(vvImage::Pointer vf) { diff --git a/vv/vvSlicer.h b/vv/vvSlicer.h index 95ec75e..1cdb9f4 100644 --- a/vv/vvSlicer.h +++ b/vv/vvSlicer.h @@ -80,9 +80,10 @@ public: return mFusion; } - /**Set an actor's visibility ("overlay, fusion, vf, contour...") + /**Get/Set an actor's visibility ("overlay, fusion, vf, contour...") Overlay index is the index of the overlay by type, eg. if there are 5 contours and we want to activate the 3rd one, pass 2 **/ + bool GetActorVisibility(const std::string& actor_type, int overlay_index); void SetActorVisibility(const std::string& actor_type, int overlay_index,bool vis); void RemoveActor(const std::string& actor_type, int overlay_index); -- 2.45.1