Salome HOME
SMH: 3.0.0 preparation - merged and adopted version (POLYWORK+HEAD)
[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 using namespace std;
34
35 class vtkPointSet;
36 class vtkCellCenters;
37 class VTKViewer_GeometryFilter;
38 class VISU_UsedPointsFilter;
39
40 class VISU_StreamLinesPL : public VISU_DeformedShapePL{
41 protected:
42   VISU_StreamLinesPL();
43   VISU_StreamLinesPL(const VISU_StreamLinesPL&);
44 public:
45   vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL);
46   static VISU_StreamLinesPL* New();
47   virtual ~VISU_StreamLinesPL();
48   virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
49
50   virtual int SetParams(float theIntStep, 
51                         float thePropogationTime,
52                         float theStepLength,
53                         vtkPointSet* theSource = NULL, 
54                         float thePercents = 0.3,
55                         int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
56                         int isOnlyTry = false);
57   virtual vtkPointSet* GetSource();
58   virtual float GetUsedPoints();
59   virtual float GetIntegrationStep();
60   virtual float GetPropagationTime();
61   virtual float GetStepLength();
62   virtual int GetDirection();
63
64   virtual vtkDataSet* GetStreamerSource();
65   virtual float GetVelocityCoeff();
66
67   virtual float GetMaxIntegrationStep();
68   virtual float GetMinIntegrationStep();
69
70   virtual float GetMinStepLength();
71   virtual float GetMaxStepLength();
72
73   virtual float GetMinPropagationTime();
74   virtual float GetMaxPropagationTime();
75   virtual float GetBasePropagationTime();
76
77 public:
78   virtual THook* DoHook();
79   virtual void Init();
80   virtual void Update();
81   virtual void SetMapScale(float theMapScale = 1.0);
82
83 public:
84   static float GetMaxIntegrationStep(vtkPointSet* theDataSet);
85   static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
86   static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
87   
88   static float GetMinPropagationTime(vtkPointSet* theDataSet);
89   static float GetMaxPropagationTime(vtkPointSet* theDataSet);
90   static float GetBasePropagationTime(vtkPointSet* theDataSet);
91
92   static float GetMinStepLength(vtkPointSet* theDataSet);
93   static float GetMaxStepLength(vtkPointSet* theDataSet);
94   static float GetBaseStepLength(vtkPointSet* theDataSet);
95
96   static float GetVelocityCoeff(vtkPointSet* theDataSet);
97
98   static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3);
99
100 protected:
101   static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, 
102                                       float thePropogationTime, float thePercents = 0.3);
103   static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, 
104                                 float& thePropogationTime, float& thePercents);
105   
106   static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3);
107   static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet);
108   static float CorrectStepLength(float theStep, vtkPointSet* theDataSet);
109
110   vtkStreamLine* myStream;
111   vtkPointSet* mySource;
112   vtkCellCenters* myCenters;
113   VTKViewer_GeometryFilter *myGeomFilter;
114   VISU_UsedPointsFilter *myPointsFilter;
115   float myPercents;
116 };
117
118
119 #endif
120