Salome HOME
6e9bc4138fc3e8ca0743ad22ad855c1ed6545189
[modules/visu.git] / src / PIPELINE / VISU_StreamLinesPL.hxx
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 // File:    VISU_PipeLine.hxx
24 // Author:  Alexey PETROV
25 // Module : VISU
26
27 #ifndef VISU_StreamLinesPL_HeaderFile
28 #define VISU_StreamLinesPL_HeaderFile
29
30 #include "VISU_DeformedShapePL.hxx"
31 #include <vtkStreamLine.h>
32
33 class vtkPointSet;
34 class vtkCellCenters;
35 class SALOME_GeometryFilter;
36 class VISU_UsedPointsFilter;
37
38 class VISU_StreamLinesPL : public VISU_DeformedShapePL{
39 protected:
40   VISU_StreamLinesPL();
41   VISU_StreamLinesPL(const VISU_StreamLinesPL&);
42 public:
43   vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL);
44   static VISU_StreamLinesPL* New();
45   virtual ~VISU_StreamLinesPL();
46   virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
47
48   virtual int SetParams(float theIntStep, 
49                         float thePropogationTime,
50                         float theStepLength,
51                         vtkPointSet* theSource = NULL, 
52                         float thePercents = 0.3,
53                         int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
54                         int isOnlyTry = false);
55   virtual vtkPointSet* GetSource();
56   virtual float GetUsedPoints();
57   virtual float GetIntegrationStep();
58   virtual float GetPropagationTime();
59   virtual float GetStepLength();
60   virtual int GetDirection();
61
62   virtual vtkDataSet* GetStreamerSource();
63   virtual float GetVelocityCoeff();
64
65   virtual float GetMaxIntegrationStep();
66   virtual float GetMinIntegrationStep();
67
68   virtual float GetMinStepLength();
69   virtual float GetMaxStepLength();
70
71   virtual float GetMinPropagationTime();
72   virtual float GetMaxPropagationTime();
73   virtual float GetBasePropagationTime();
74
75 public:
76   virtual THook* DoHook();
77   virtual void Init();
78   virtual void Update();
79   virtual void SetMapScale(float theMapScale = 1.0);
80
81 public:
82   static float GetMaxIntegrationStep(vtkPointSet* theDataSet);
83   static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
84   static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
85   
86   static float GetMinPropagationTime(vtkPointSet* theDataSet);
87   static float GetMaxPropagationTime(vtkPointSet* theDataSet);
88   static float GetBasePropagationTime(vtkPointSet* theDataSet);
89
90   static float GetMinStepLength(vtkPointSet* theDataSet);
91   static float GetMaxStepLength(vtkPointSet* theDataSet);
92   static float GetBaseStepLength(vtkPointSet* theDataSet);
93
94   static float GetVelocityCoeff(vtkPointSet* theDataSet);
95
96   static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3);
97
98 protected:
99   static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, 
100                                       float thePropogationTime, float thePercents = 0.3);
101   static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, 
102                                 float& thePropogationTime, float& thePercents);
103   
104   static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3);
105   static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet);
106   static float CorrectStepLength(float theStep, vtkPointSet* theDataSet);
107
108   vtkStreamLine* myStream;
109   vtkPointSet* mySource;
110   vtkCellCenters* myCenters;
111   SALOME_GeometryFilter *myGeomFilter;
112   VISU_UsedPointsFilter *myPointsFilter;
113   float myPercents;
114 };
115
116
117 #endif
118