Salome HOME
Merge with branch V2_2_0_VISU_improvement
[modules/visu.git] / src / PIPELINE / VISU_Plot3DPL.hxx
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 // File:    VISU_CutPlanesPL.hxx
24 // Author:  Alexey PETROV
25 // Module : VISU
26
27 #ifndef VISU_Plot3DPL_HeaderFile
28 #define VISU_Plot3DPL_HeaderFile
29
30 #include "VISU_ScalarMapPL.hxx"
31 #include "VISU_CutPlanesPL.hxx"
32
33 class vtkWarpScalar;
34 class vtkContourFilter;
35 class vtkGeometryFilter;
36 class vtkCellDataToPointData;
37
38 class VISU_Plot3DPL : public VISU_ScalarMapPL{
39 protected:
40   VISU_Plot3DPL();
41   VISU_Plot3DPL(const VISU_Plot3DPL&);
42
43 public:
44   vtkTypeMacro(VISU_Plot3DPL,VISU_ScalarMapPL);
45   static VISU_Plot3DPL* New();
46   virtual ~VISU_Plot3DPL();
47
48   virtual
49   void
50   ShallowCopy(VISU_PipeLine *thePipeLine);
51
52   VISU_CutPlanesPL::PlaneOrientation
53   GetPlaneOrientation() const;
54
55   float
56   GetRotateX();
57
58   float
59   GetRotateY();
60
61   void
62   SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
63                  float theXAngle = 0.0,
64                  float theYAngle = 0.0);
65
66   float
67   GetPlanePosition() const;
68
69   bool
70   IsPositionRelative() const;
71
72   void
73   SetPlanePosition(float thePosition,
74                    bool theIsRelative);
75
76   void
77   SetScaleFactor(float theScaleFactor);
78
79   float
80   GetScaleFactor() const;
81
82   void
83   SetContourPrs (bool theIsContourPrs ) { myIsContour = theIsContourPrs; }
84
85   bool
86   GetIsContourPrs() { return myIsContour; }
87
88   void
89   SetNumberOfContours(int theNumber);
90
91   int
92   GetNumberOfContours() const;
93
94   void GetBasePlane (float theOrigin[3],
95                      float theNormal[3],
96                      bool  theCenterOrigine = false ) const;
97
98   void GetMinMaxPosition( float& minPos, float& maxPos ) const;
99
100 public:
101   virtual void Init();
102   virtual void Update();
103
104   static
105   VISU_CutPlanesPL::PlaneOrientation
106   GetOrientation(vtkDataSet* theDataSet);
107
108   float
109   GetScaleFactor(vtkDataSet* theDataSet);
110
111   void SetMapScale(float theMapScale);
112
113 protected:
114   virtual THook* DoHook();
115
116   float myAngle[3];
117   bool myIsRelative, myIsContour;
118   float myPosition, myScaleFactor;
119   VISU_CutPlanesPL::PlaneOrientation myOrientation;
120
121   TVTKSmartPtr<vtkCellDataToPointData> myCellDataToPointData;
122   TVTKSmartPtr<vtkAppendPolyData> myAppendPolyData;
123   TVTKSmartPtr<vtkGeometryFilter> myGeometryFilter;
124   TVTKSmartPtr<vtkContourFilter> myContourFilter;
125   TVTKSmartPtr<vtkWarpScalar> myWarpScalar;
126 };
127
128 #endif