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