Browse Source

vtkLightBoxRendererManager - Add GetHighlighted(ById) methods

Jean-Christophe Fillion-Robin 14 years ago
parent
commit
e1260cad07

+ 21 - 0
Libs/Visualization/VTK/Core/vtkLightBoxRendererManager.cpp

@@ -590,6 +590,27 @@ void vtkLightBoxRendererManager::SetRenderWindowColumnCount(int newColumnCount)
 }
 
 //----------------------------------------------------------------------------
+bool vtkLightBoxRendererManager::GetHighlightedById(int id)
+{
+  if (!this->IsInitialized())
+    {
+    vtkErrorMacro(<< "SetHighlightedById failed - vtkLightBoxRendererManager is NOT initialized");
+    return false;
+    }
+  if (id < 0 || id >= static_cast<int>(this->Internal->RenderWindowItemList.size()))
+    {
+    return false;
+    }
+  return this->Internal->RenderWindowItemList.at(id)->HighlightedBoxActor->GetVisibility();
+}
+
+//----------------------------------------------------------------------------
+bool vtkLightBoxRendererManager::GetHighlighted(int rowId, int columnId)
+{
+  return this->GetHighlightedById(this->ComputeRenderWindowItemId(rowId, columnId));
+}
+
+//----------------------------------------------------------------------------
 void vtkLightBoxRendererManager::SetHighlightedById(int id, bool highlighted)
 {
   if (!this->IsInitialized())

+ 8 - 0
Libs/Visualization/VTK/Core/vtkLightBoxRendererManager.h

@@ -77,6 +77,14 @@ class CTK_VISUALIZATION_VTK_CORE_EXPORT vtkLightBoxRendererManager : public vtkO
   /// \sa SetRenderWindowLayout
   int GetRenderWindowColumnCount();
 
+  /// Return True if the render view item identified by \a id is highlighted
+  bool GetHighlightedById(int id);
+
+  /// \brief Return True if the render view item identified by its position in the grid
+  /// is highlighted
+  /// \sa GetHighlightedById(int)
+  bool GetHighlighted(int rowId, int columnId);
+
   /// Highlight / Unhighlight a render view item given its \a id
   void SetHighlightedById(int id, bool highlighted);