Salome HOME
Bug IPAL22927: TC6.5.0: bounding box is not updated for Point Map 3D
[modules/visu.git] / src / PIPELINE / VISU_PlanesWidget.hxx
index fdf45367f80800451ff67fc7b315ae388239d5db..272918272af8a3eb033d73d7ee686ebbba1c221d 100644 (file)
@@ -1,34 +1,35 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VISU_PlanesWidget.h
 //  Author : Peter KURNEV
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef __VISU_PlanesWidget_h
 #define __VISU_PlanesWidget_h
 
+#include "VISUPipeline.hxx"
 #include "VISU_ImplicitFunctionWidget.hxx"
 class vtkActor;
 class vtkPolyDataMapper;
@@ -37,7 +38,7 @@ class vtkConeSource;
 class vtkLineSource;
 class vtkSphereSource;
 class vtkPlane;
-class vtkCutter;
+class vtkEDFCutter;
 class vtkProperty;
 class vtkImageData;
 class vtkOutlineFilter;
@@ -49,7 +50,7 @@ class vtkImplicitFunction;
 class VISU_UnScaledActor;
 class vtkDataSet;
 
-class  VISU_PlanesWidget : public VISU_ImplicitFunctionWidget
+class VISU_PIPELINE_EXPORT VISU_PlanesWidget : public VISU_ImplicitFunctionWidget
 {
 public:
   // Description:
@@ -59,31 +60,59 @@ public:
   vtkTypeRevisionMacro(VISU_PlanesWidget,VISU_ImplicitFunctionWidget);
   void PrintSelf(ostream& os, vtkIndent indent);
 
-  void SetDistance (const float theDistance);
-  float Distance()const;
+  void 
+  SetDistance(const vtkFloatingPointType theDistance);
+
+  vtkFloatingPointType
+  Distance() const;
 
-  vtkGetMacro(InitialLength,float);
+  vtkGetMacro(InitialLength,vtkFloatingPointType);
 
-  virtual vtkImplicitFunction* ImplicitFunction();
+  virtual 
+  vtkImplicitFunction* 
+  ImplicitFunction();
 
   // Description:
   // Methods that satisfy the superclass' API.
-  virtual void SetEnabled(int);
-  virtual void PlaceWidget(float bounds[6]);
+  virtual
+  void
+  SetEnabled(int);
+
+  virtual
+  void
+  PlaceWidget(vtkFloatingPointType bounds[6]);
 
   // Description:
   // Get the origin of the plane.
-  void SetOrigin(float x, float y, float z);
-  void SetOrigin(float x[3]);
-  float* GetOrigin();
-  void GetOrigin(float xyz[3]);
+  void
+  SetOrigin(vtkFloatingPointType x, 
+            vtkFloatingPointType y, 
+            vtkFloatingPointType z);
+
+  void
+  SetOrigin(vtkFloatingPointType x[3]);
+
+  vtkFloatingPointType* 
+  GetOrigin();
+
+  void
+  GetOrigin(vtkFloatingPointType xyz[3]);
 
   // Description:
   // Get the normal to the plane.
-  void SetNormal(float x, float y, float z);
-  void SetNormal(float x[3]);
-  float* GetNormal();
-  void GetNormal(float xyz[3]);
+  void 
+  SetNormal(vtkFloatingPointType x, 
+            vtkFloatingPointType y, 
+            vtkFloatingPointType z);
+
+  void 
+  SetNormal(vtkFloatingPointType x[3]);
+
+  vtkFloatingPointType* 
+  GetNormal();
+
+  void
+  GetNormal(vtkFloatingPointType xyz[3]);
   
   // Description:
   // Force the plane widget to be aligned with one of the x-y-z axes.
@@ -91,13 +120,20 @@ public:
   // Remember that when the state changes, a ModifiedEvent is invoked.
   // This can be used to snap the plane to the axes if it is orginally
   // not aligned.
-  void SetNormalToXAxis(int);
+  void
+  SetNormalToXAxis(int);
+
   vtkGetMacro(NormalToXAxis,int);
   vtkBooleanMacro(NormalToXAxis,int);
-  void SetNormalToYAxis(int);
+
+  void
+  SetNormalToYAxis(int);
+
   vtkGetMacro(NormalToYAxis,int);
   vtkBooleanMacro(NormalToYAxis,int);
-  void SetNormalToZAxis(int);
+
+  void
+  SetNormalToZAxis(int);
   vtkGetMacro(NormalToZAxis,int);
   vtkBooleanMacro(NormalToZAxis,int);
 
@@ -113,8 +149,12 @@ public:
   // interferes with the object that it is operating on (i.e., the
   // plane interferes with the cut surface it produces producing
   // z-buffer artifacts.)
-  void SetDrawPlane(int plane);
-  int GetDrawPlane(){
+  void
+  SetDrawPlane(int plane);
+
+  int
+  GetDrawPlane()
+  {
     return myDrawPlane;
   }
 
@@ -128,7 +168,8 @@ public:
   // Description:
   // Grab the polydata that defines the plane. The polydata contains a single
   // polygon that is clipped by the bounding box.
-  void GetPolyData(vtkPolyData *pd);
+  void
+  GetPolyData(vtkPolyData *pd);
 
   // Description:
   // Satisfies superclass API.  This returns a pointer to the underlying
@@ -140,12 +181,14 @@ public:
   // instance of the class vtkPlane. Note that vtkPlane is a subclass of
   // vtkImplicitFunction, meaning that it can be used by a variety of filters
   // to perform clipping, cutting, and selection of data.
-  void GetPlane(vtkPlane *plane);
+  void
+  GetPlane(vtkPlane *plane);
 
   // Description:
   // Satisfies the superclass API.  This will change the state of the widget
   // to match changes that have been made to the underlying PolyDataSource
-  void UpdatePlacement(void);
+  void
+  UpdatePlacement(void);
 
   // Description:
   // Get the properties on the normal (line and cone).
@@ -168,7 +211,8 @@ public:
   // applies to the edges when tubed.)
   vtkGetObjectMacro(EdgesProperty,vtkProperty);
 
-  void InitialPlaceWidget(float bds[6]);
+  void
+  InitialPlaceWidget(vtkFloatingPointType bds[6]);
 
 protected:
   VISU_PlanesWidget();
@@ -191,8 +235,10 @@ protected:
 //ETX
     
   //handles the events
-  static void ProcessEvents(vtkObject* object, unsigned long event,
-                            void* clientdata, void* calldata);
+  static
+  void
+  ProcessEvents(vtkObject* object, unsigned long event,
+                void* clientdata, void* calldata);
 
   // ProcessEvents() dispatches to these methods.
   void OnLeftButtonDown();
@@ -204,7 +250,7 @@ protected:
   void OnMouseMove();
   //
   // Methods to manipulate the plane
-  void ConstrainOrigin(float x[3]);
+  void ConstrainOrigin(vtkFloatingPointType x[3]);
   void Rotate(int X, int Y, double *p1, double *p2, double *vpn);
   void TranslatePlane(double *p1, double *p2);
   void TranslateOutline(double *p1, double *p2);
@@ -221,7 +267,7 @@ protected:
   void HighlightNormal(int highlight);
   void HighlightOutline(int highlight);
   void UpdateRepresentation();
-  void SetOriginInternal(float x[3]);
+  void SetOriginInternal(vtkFloatingPointType x[3]);
 
   // Controlling ivars
   int NormalToXAxis;
@@ -238,7 +284,7 @@ protected:
   vtkPlane *myPlane1;
   vtkPlane *myPlane2;
   
-  float myDistance; 
+  vtkFloatingPointType myDistance; 
   vtkImplicitBoolean *myImplicitFunction;
 
   // The bounding box is represented by a single voxel image data
@@ -249,12 +295,12 @@ protected:
   
   int OutlineTranslation; //whether the outline can be moved
   
-  // The cut plane is produced with a vtkCutter
-  vtkCutter         *myCutter1;
+  // The cut plane is produced with a vtkEDFCutter
+  vtkEDFCutter         *myCutter1;
   vtkPolyDataMapper *myCutMapper1;
   vtkActor          *myCutActor1;
 
-  vtkCutter         *myCutter2;
+  vtkEDFCutter         *myCutter2;
   vtkPolyDataMapper *myCutMapper2;
   vtkActor          *myCutActor2;