Salome HOME
9d7e379ccfb6dc3c36861ad0d86948ef94cc84ef
[modules/visu.git] / src / PIPELINE / VISU_Plot3DPL.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  VISU OBJECT : interactive object for VISU entities implementation
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 "VISUPipeline.hxx"
31 #include "VISU_ScalarMapPL.hxx"
32 #include "VISU_CutPlanesPL.hxx"
33
34 class vtkWarpScalar;
35 class vtkContourFilter;
36 class vtkGeometryFilter;
37 class vtkCellDataToPointData;
38
39
40 //----------------------------------------------------------------------------
41 class VISU_PIPELINE_EXPORT VISU_Plot3DPL : public VISU_ScalarMapPL
42 {
43 public:
44   vtkTypeMacro(VISU_Plot3DPL, VISU_ScalarMapPL);
45
46   static
47   VISU_Plot3DPL* 
48   New();
49
50   virtual
51   unsigned long int 
52   GetMTime();
53
54   //----------------------------------------------------------------------------
55   VISU_CutPlanesPL::PlaneOrientation
56   GetPlaneOrientation();
57
58   vtkFloatingPointType
59   GetRotateX();
60
61   vtkFloatingPointType
62   GetRotateY();
63
64   void
65   SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
66                  vtkFloatingPointType theXAngle = 0.0,
67                  vtkFloatingPointType theYAngle = 0.0);
68
69   vtkFloatingPointType
70   GetPlanePosition();
71
72   bool
73   IsPositionRelative();
74
75   void
76   SetPlanePosition(vtkFloatingPointType thePosition,
77                    bool theIsRelative);
78
79   void
80   SetScaleFactor(vtkFloatingPointType theScaleFactor);
81
82   vtkFloatingPointType
83   GetScaleFactor();
84
85   void
86   SetContourPrs(bool theIsContourPrs );
87
88   bool
89   GetIsContourPrs();
90
91   void
92   SetNumberOfContours(int theNumber);
93
94   int
95   GetNumberOfContours();
96
97   void
98   GetBasePlane (vtkFloatingPointType theOrigin[3],
99                 vtkFloatingPointType theNormal[3],
100                 bool  theCenterOrigine = false );
101   
102   void
103   GetMinMaxPosition( vtkFloatingPointType& minPos, 
104                      vtkFloatingPointType& maxPos );
105   
106 public:
107   virtual
108   void
109   Init();
110
111   virtual
112   void
113   Update();
114
115   //! Gets memory size used by the instance (bytes).
116   virtual
117   unsigned long int
118   GetMemorySize();
119
120   static
121   VISU_CutPlanesPL::PlaneOrientation
122   GetOrientation(vtkDataSet* theDataSet);
123
124   static
125   vtkFloatingPointType
126   GetScaleFactor( VISU_ColoredPL* theColoredPL,
127                   vtkDataSet* theDataSet );
128
129   void 
130   SetMapScale(vtkFloatingPointType theMapScale);
131
132 protected:
133   VISU_Plot3DPL();
134
135   virtual 
136   ~VISU_Plot3DPL();
137
138   virtual
139   vtkDataSet* 
140   InsertCustomPL();
141
142   virtual
143   void
144   DoShallowCopy(VISU_PipeLine *thePipeLine,
145                 bool theIsCopyInput);
146
147   vtkFloatingPointType myAngle[3];
148   bool myIsRelative, myIsContour;
149   vtkFloatingPointType myPosition, myScaleFactor, myMapScaleFactor;
150   VISU_CutPlanesPL::PlaneOrientation myOrientation;
151
152   vtkSmartPointer<vtkCellDataToPointData> myCellDataToPointData;
153   vtkSmartPointer<vtkAppendPolyData> myAppendPolyData;
154   vtkSmartPointer<vtkGeometryFilter> myGeometryFilter;
155   vtkSmartPointer<vtkContourFilter> myContourFilter;
156   vtkSmartPointer<vtkWarpScalar> myWarpScalar;
157
158 private:
159   VISU_Plot3DPL(const VISU_Plot3DPL&);;  // Not implemented.
160   void operator=(const VISU_Plot3DPL&);  // Not implemented.
161 };
162
163 #endif