Browse Source

Clean color widget, adding comments and getters

Tristan 7 years ago
parent
commit
f8e5942e15

+ 6 - 0
Libs/Visualization/VTK/Core/vtkScalarsToColorsContextItem.cpp

@@ -116,6 +116,12 @@ void vtkScalarsToColorsContextItem::SetLeftAxisMode(int mode)
 }
 
 // ----------------------------------------------------------------------------
+int vtkScalarsToColorsContextItem::GetLeftAxisMode()
+{
+  return this->HistogramChart->GetLeftAxisMode();
+}
+
+// ----------------------------------------------------------------------------
 void vtkScalarsToColorsContextItem::CopyColorTransferFunction(
   vtkScalarsToColors* ctf)
 {

+ 3 - 0
Libs/Visualization/VTK/Core/vtkScalarsToColorsContextItem.h

@@ -46,7 +46,10 @@ class CTK_VISUALIZATION_VTK_CORE_EXPORT vtkScalarsToColorsContextItem
 public:
   static vtkScalarsToColorsContextItem* New();
 
+  /// Set/Get the left axis mode, which controls the axis range computation.
+  /// See vtkScalarsToColorsHistogramChart for more details.
   void SetLeftAxisMode(int mode);
+  int GetLeftAxisMode();
 
   /// Copy the color transfer function as a vtkDiscretizableColorTransferFunction
   void CopyColorTransferFunction(vtkScalarsToColors* ctf);

+ 6 - 0
Libs/Visualization/VTK/Core/vtkScalarsToColorsHistogramChart.cpp

@@ -89,6 +89,12 @@ void vtkScalarsToColorsHistogramChart::SetLeftAxisMode(int mode)
 }
 
 // ----------------------------------------------------------------------------
+void vtkScalarsToColorsHistogramChart::GetLeftAxisMode()
+{
+  return this->LeftAxisMode;
+}
+
+// ----------------------------------------------------------------------------
 void vtkScalarsToColorsHistogramChart::SetHistogramInputData(vtkTable* table,
     const char* xAxisColumn, const char* yAxisColumn)
 {

+ 6 - 0
Libs/Visualization/VTK/Core/vtkScalarsToColorsHistogramChart.h

@@ -44,7 +44,13 @@ public:
     MEAN_PLUS_THREE_SIGMA // Scale the axis to "mean + 3 * sigma".
   };
 
+  /// Set/Get the left axis mode, which controls the axis range computation.
+  ///   VTK_AUTO: VTK auto scaling. Scale the axis to view all data that is visible.
+  ///   MAXIMUM: Scale the axis to the maximum value of histogram.
+  ///   MEAN_PLUS_THREE_SIGMA: Scale the axis to "mean + 3 * sigma".
+  /// Default mode is VTK_AUTO.
   void SetLeftAxisMode(int mode);
+  int GetLeftAxisMode();
 
   /// Set input for histogram
   virtual void SetHistogramInputData(vtkTable* table, const char* xAxisColumn,

+ 8 - 0
Libs/Visualization/VTK/Widgets/ctkVTKDiscretizableColorTransferWidget.cpp

@@ -395,6 +395,14 @@ void ctkVTKDiscretizableColorTransferWidget::setLeftAxisMode(int mode)
 }
 
 // ----------------------------------------------------------------------------
+int ctkVTKDiscretizableColorTransferWidget::getLeftAxisMode()
+{
+  Q_D(ctkVTKDiscretizableColorTransferWidget);
+
+  return d->scalarsToColorsContextItem->GetLeftAxisMode();
+}
+
+// ----------------------------------------------------------------------------
 void ctkVTKDiscretizableColorTransferWidget::setHistogramConnection(
   vtkAlgorithmOutput* input)
 {

+ 3 - 0
Libs/Visualization/VTK/Widgets/ctkVTKDiscretizableColorTransferWidget.h

@@ -70,7 +70,10 @@ public:
   void copyColorTransferFunction(vtkScalarsToColors* ctf, bool useCtfRange = false);
   vtkDiscretizableColorTransferFunction* discretizableColorTransferFunction() const;
 
+  /// Set/Get the left axis mode, which controls the axis range computation.
+  /// See vtkScalarsToColorsHistogramChart for more details.
   void setLeftAxisMode(int mode);
+  int getLeftAxisMode();
 
   void setHistogramConnection(vtkAlgorithmOutput* input);
   void updateHistogram(bool updateDataRange);