]> SALOME platform Git repositories - modules/visu.git/blob - src/PIPELINE/VISU_StreamLinesPL.hxx
Salome HOME
0021711: [CEA 579] Simplify Properties dialog accordingly to dimension of mesh
[modules/visu.git] / src / PIPELINE / VISU_StreamLinesPL.hxx
1 // Copyright (C) 2007-2012  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_StreamLinesPL.hxx
25 // Author:  Alexey PETROV
26 // Module : VISU
27 //
28 #ifndef VISU_StreamLinesPL_HeaderFile
29 #define VISU_StreamLinesPL_HeaderFile
30
31 #include "VISUPipeline.hxx"
32 #include "VISU_DeformedShapePL.hxx"
33
34 #include <vtkStreamer.h>
35
36 class vtkDataSet;
37 class vtkPointSet;
38 class VTKViewer_CellCenters;
39 class VTKViewer_GeometryFilter;
40 class VISU_MaskPointsFilter;
41 class vtkStreamLine;
42
43
44 //----------------------------------------------------------------------------
45 class VISU_PIPELINE_EXPORT VISU_StreamLinesPL : public VISU_DeformedShapePL
46 {
47 public:
48   vtkTypeMacro(VISU_StreamLinesPL, VISU_DeformedShapePL);
49
50   static
51   VISU_StreamLinesPL*
52   New();
53
54   virtual
55   unsigned long int 
56   GetMTime();
57
58   //----------------------------------------------------------------------------
59   virtual
60   size_t
61   SetParams(vtkFloatingPointType theIntStep,
62             vtkFloatingPointType thePropogationTime,
63             vtkFloatingPointType theStepLength,
64             vtkPointSet* theSource,
65             vtkFloatingPointType thePercents,
66             int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS);
67
68   virtual
69   vtkPointSet*
70   GetSource();
71
72   virtual
73   vtkFloatingPointType
74   GetUsedPoints();
75
76   virtual
77   vtkFloatingPointType 
78   GetIntegrationStep();
79
80   virtual
81   vtkFloatingPointType
82   GetPropagationTime();
83
84   virtual
85   vtkFloatingPointType
86   GetStepLength();
87
88   virtual
89   int
90   GetDirection();
91
92   virtual
93   vtkDataSet* 
94   GetStreamerSource();
95
96   virtual
97   vtkFloatingPointType 
98   GetVelocityCoeff();
99
100   virtual
101   vtkFloatingPointType
102   GetMaxIntegrationStep();
103
104   virtual
105   vtkFloatingPointType
106   GetMinIntegrationStep();
107
108   virtual
109   vtkFloatingPointType
110   GetMinStepLength();
111
112   virtual
113   vtkFloatingPointType
114   GetMaxStepLength();
115
116   virtual
117   vtkFloatingPointType
118   GetMinPropagationTime();
119
120   virtual
121   vtkFloatingPointType
122   GetMaxPropagationTime();
123
124   virtual
125   vtkFloatingPointType
126   GetBasePropagationTime();
127
128 public:
129   virtual
130   vtkDataSet* 
131   InsertCustomPL();
132
133   virtual
134   void
135   Init();
136
137   virtual
138   void
139   Build();
140
141   virtual
142   void
143   Update();
144
145   //! Gets memory size used by the instance (bytes).
146   virtual
147   unsigned long int
148   GetMemorySize();
149
150   virtual
151   void
152   SetMapScale(vtkFloatingPointType theMapScale = 1.0);
153
154 public:
155   static
156   vtkFloatingPointType
157   GetMaxIntegrationStep(vtkDataSet* theDataSet);
158
159   static
160   vtkFloatingPointType
161   GetMinIntegrationStep(vtkDataSet* theDataSet, 
162                         vtkFloatingPointType thePercents);
163   static
164   vtkFloatingPointType
165   GetBaseIntegrationStep(vtkDataSet* theDataSet, 
166                          vtkFloatingPointType thePercents);
167   
168   static 
169   vtkFloatingPointType
170   GetMinPropagationTime(vtkDataSet* theDataSet, 
171                         vtkFloatingPointType thePercents);
172
173   static
174   vtkFloatingPointType
175   GetMaxPropagationTime(vtkDataSet* theDataSet);
176
177   static
178   vtkFloatingPointType
179   GetBasePropagationTime(vtkDataSet* theDataSet);
180
181   static
182   vtkFloatingPointType
183   GetMinStepLength(vtkDataSet* theDataSet, 
184                    vtkFloatingPointType thePercents);
185
186   static
187   vtkFloatingPointType
188   GetMaxStepLength(vtkDataSet* theDataSet);
189
190   static
191   vtkFloatingPointType
192   GetBaseStepLength(vtkDataSet* theDataSet, 
193                     vtkFloatingPointType thePercents);
194
195   static
196   vtkFloatingPointType
197   GetVelocityCoeff(vtkDataSet* theDataSet);
198
199   static
200   size_t
201   IsPossible(vtkPointSet* theDataSet);
202
203 protected:
204   VISU_StreamLinesPL();
205
206   virtual
207   ~VISU_StreamLinesPL();
208
209   virtual
210   void
211   DoShallowCopy(VISU_PipeLine *thePipeLine,
212                 bool theIsCopyInput);
213
214   static 
215   vtkFloatingPointType
216   GetNecasseryMemorySize(vtkIdType theNbOfPoints, 
217                          vtkFloatingPointType theStepLength, 
218                          vtkFloatingPointType thePropogationTime, 
219                          vtkFloatingPointType thePercents);
220
221   static
222   size_t
223   FindPossibleParams(vtkDataSet* theDataSet, 
224                      vtkFloatingPointType& theStepLength, 
225                      vtkFloatingPointType& thePropogationTime, 
226                      vtkFloatingPointType& thePercents);
227   
228   static 
229   vtkFloatingPointType
230   CorrectIntegrationStep(vtkFloatingPointType theStep, 
231                          vtkDataSet* theDataSet, 
232                          vtkFloatingPointType thePercents);
233
234   static 
235   vtkFloatingPointType
236   CorrectPropagationTime(vtkFloatingPointType thePropagationTime, 
237                          vtkDataSet* theDataSet, 
238                          vtkFloatingPointType thePercents);
239
240   static
241   vtkFloatingPointType
242   CorrectStepLength(vtkFloatingPointType theStep, 
243                     vtkDataSet* theDataSet, 
244                     vtkFloatingPointType thePercents);
245
246   static
247   vtkFloatingPointType
248   GetUsedPointsDefault();
249
250   vtkStreamLine* myStream;
251   vtkPointSet* mySource;
252   VTKViewer_CellCenters* myCenters;
253   VTKViewer_GeometryFilter *myGeomFilter;
254   VISU_MaskPointsFilter *myPointsFilter;
255   vtkFloatingPointType myPercents;
256
257 private:
258   VISU_StreamLinesPL(const VISU_StreamLinesPL&);  // Not implemented.
259   void operator=(const VISU_StreamLinesPL&);  // Not implemented.
260 };
261
262
263 #endif
264