]> Creatis software - clitk.git/commitdiff
Added "image" in actor type for SetActorVisibility and added
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Mon, 30 May 2011 08:40:55 +0000 (10:40 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Mon, 30 May 2011 08:42:15 +0000 (10:42 +0200)
corresponding GetActorVisibility.

vv/vvSlicer.cxx
vv/vvSlicer.h

index c9d9be21d9e64d3f3227d313879a9f91f4e391bb..6651833f04c497bf3dfe98c828c3e73514d4b438 100644 (file)
@@ -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)
 {
index 95ec75e80438d4b5d4e6185f2bca504fc31c09fb..1cdb9f4efbdf4d762a39b82615fe58305ce7e533 100644 (file)
@@ -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);