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