-// SALOME VTKViewer : build VTK viewer into Salome desktop
+// Copyright (C) 2007-2010 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;
class VISU_UnScaledActor;
class vtkDataSet;
-class VISU_PlanesWidget : public VISU_ImplicitFunctionWidget
+class VISU_PIPELINE_EXPORT VISU_PlanesWidget : public VISU_ImplicitFunctionWidget
{
public:
// Description:
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.
// 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);
// 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;
}
// 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
// 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).
// applies to the edges when tubed.)
vtkGetObjectMacro(EdgesProperty,vtkProperty);
- void InitialPlaceWidget(float bds[6]);
+ void
+ InitialPlaceWidget(vtkFloatingPointType bds[6]);
protected:
VISU_PlanesWidget();
//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();
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);
void HighlightNormal(int highlight);
void HighlightOutline(int highlight);
void UpdateRepresentation();
- void SetOriginInternal(float x[3]);
+ void SetOriginInternal(vtkFloatingPointType x[3]);
// Controlling ivars
int NormalToXAxis;
vtkPlane *myPlane1;
vtkPlane *myPlane2;
- float myDistance;
+ vtkFloatingPointType myDistance;
vtkImplicitBoolean *myImplicitFunction;
// The bounding box is represented by a single voxel image data