]> SALOME platform Git repositories - modules/visu.git/blob - src/PIPELINE/VISU_StreamLinesPL.hxx
Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / PIPELINE / VISU_StreamLinesPL.hxx
1 //  Copyright (C) 2007-2010  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 vtkCellCenters;
39 class VTKViewer_GeometryFilter;
40 class VISU_MaskPointsFilter;
41 class VISU_StreamLine;
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 = NULL,
65             vtkFloatingPointType thePercents = 0.3,
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 = 0.3);
163   static
164   vtkFloatingPointType
165   GetBaseIntegrationStep(vtkDataSet* theDataSet, 
166                          vtkFloatingPointType thePercents = 0.3);
167   
168   static 
169   vtkFloatingPointType
170   GetMinPropagationTime(vtkDataSet* theDataSet);
171
172   static
173   vtkFloatingPointType
174   GetMaxPropagationTime(vtkDataSet* theDataSet);
175
176   static
177   vtkFloatingPointType
178   GetBasePropagationTime(vtkDataSet* theDataSet);
179
180   static
181   vtkFloatingPointType
182   GetMinStepLength(vtkDataSet* theDataSet);
183
184   static
185   vtkFloatingPointType
186   GetMaxStepLength(vtkDataSet* theDataSet);
187
188   static
189   vtkFloatingPointType
190   GetBaseStepLength(vtkDataSet* theDataSet);
191
192   static
193   vtkFloatingPointType
194   GetVelocityCoeff(vtkDataSet* theDataSet);
195
196   static
197   size_t
198   IsPossible(vtkPointSet* theDataSet, 
199              vtkFloatingPointType thePercents = 0.3);
200
201 protected:
202   VISU_StreamLinesPL();
203
204   virtual
205   ~VISU_StreamLinesPL();
206
207   virtual
208   void
209   DoShallowCopy(VISU_PipeLine *thePipeLine,
210                 bool theIsCopyInput);
211
212   static 
213   vtkFloatingPointType
214   GetNecasseryMemorySize(vtkIdType theNbOfPoints, 
215                          vtkFloatingPointType theStepLength, 
216                          vtkFloatingPointType thePropogationTime, 
217                          vtkFloatingPointType thePercents = 0.3);
218
219   static
220   size_t
221   FindPossibleParams(vtkDataSet* theDataSet, 
222                      vtkFloatingPointType& theStepLength, 
223                      vtkFloatingPointType& thePropogationTime, 
224                      vtkFloatingPointType& thePercents);
225   
226   static 
227   vtkFloatingPointType
228   CorrectIntegrationStep(vtkFloatingPointType theStep, 
229                          vtkDataSet* theDataSet, 
230                          vtkFloatingPointType thePercents = 0.3);
231
232   static 
233   vtkFloatingPointType
234   CorrectPropagationTime(vtkFloatingPointType thePropagationTime, 
235                          vtkDataSet* theDataSet);
236
237   static
238   vtkFloatingPointType
239   CorrectStepLength(vtkFloatingPointType theStep, 
240                     vtkDataSet* theDataSet);
241
242   VISU_StreamLine* myStream;
243   vtkPointSet* mySource;
244   vtkCellCenters* myCenters;
245   VTKViewer_GeometryFilter *myGeomFilter;
246   VISU_MaskPointsFilter *myPointsFilter;
247   vtkFloatingPointType myPercents;
248
249 private:
250   VISU_StreamLinesPL(const VISU_StreamLinesPL&);  // Not implemented.
251   void operator=(const VISU_StreamLinesPL&);  // Not implemented.
252 };
253
254
255 #endif
256