VTK
dox/Filters/General/vtkHyperStreamline.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkHyperStreamline.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00050 #ifndef __vtkHyperStreamline_h
00051 #define __vtkHyperStreamline_h
00052 
00053 #include "vtkFiltersGeneralModule.h" // For export macro
00054 #include "vtkPolyDataAlgorithm.h"
00055 
00056 #define VTK_INTEGRATE_FORWARD 0
00057 #define VTK_INTEGRATE_BACKWARD 1
00058 #define VTK_INTEGRATE_BOTH_DIRECTIONS 2
00059 
00060 #define VTK_INTEGRATE_MAJOR_EIGENVECTOR 0
00061 #define VTK_INTEGRATE_MEDIUM_EIGENVECTOR 1
00062 #define VTK_INTEGRATE_MINOR_EIGENVECTOR 2
00063 
00064 
00065 class vtkHyperArray;
00066 
00067 class VTKFILTERSGENERAL_EXPORT vtkHyperStreamline : public vtkPolyDataAlgorithm
00068 {
00069 public:
00070   vtkTypeMacro(vtkHyperStreamline,vtkPolyDataAlgorithm);
00071   void PrintSelf(ostream& os, vtkIndent indent);
00072 
00077   static vtkHyperStreamline *New();
00078 
00082   void SetStartLocation(vtkIdType cellId, int subId, double pcoords[3]);
00083 
00085 
00088   void SetStartLocation(vtkIdType cellId, int subId, double r, double s,
00089                         double t);
00091 
00094   vtkIdType GetStartLocation(int& subId, double pcoords[3]);
00095 
00099   void SetStartPosition(double x[3]);
00100 
00104   void SetStartPosition(double x, double y, double z);
00105 
00108   double *GetStartPosition();
00109 
00111 
00113   vtkSetClampMacro(MaximumPropagationDistance,double,0.0,VTK_DOUBLE_MAX);
00114   vtkGetMacro(MaximumPropagationDistance,double);
00116 
00118 
00125   vtkSetClampMacro(IntegrationEigenvector,int,
00126                    VTK_INTEGRATE_MAJOR_EIGENVECTOR,
00127                    VTK_INTEGRATE_MINOR_EIGENVECTOR);
00128   vtkGetMacro(IntegrationEigenvector,int);
00129   void SetIntegrationEigenvectorToMajor()
00130     {this->SetIntegrationEigenvector(VTK_INTEGRATE_MAJOR_EIGENVECTOR);};
00131   void SetIntegrationEigenvectorToMedium()
00132     {this->SetIntegrationEigenvector(VTK_INTEGRATE_MEDIUM_EIGENVECTOR);};
00133   void SetIntegrationEigenvectorToMinor()
00134     {this->SetIntegrationEigenvector(VTK_INTEGRATE_MINOR_EIGENVECTOR);};
00136 
00138 
00141   void IntegrateMajorEigenvector()
00142     {this->SetIntegrationEigenvectorToMajor();};
00144 
00146 
00149   void IntegrateMediumEigenvector()
00150     {this->SetIntegrationEigenvectorToMedium();};
00152 
00154 
00157   void IntegrateMinorEigenvector()
00158     {this->SetIntegrationEigenvectorToMinor();};
00160 
00162 
00164   vtkSetClampMacro(IntegrationStepLength,double,0.001,0.5);
00165   vtkGetMacro(IntegrationStepLength,double);
00167 
00169 
00172   vtkSetClampMacro(StepLength,double,0.000001,1.0);
00173   vtkGetMacro(StepLength,double);
00175 
00177 
00178   vtkSetClampMacro(IntegrationDirection,int,
00179                   VTK_INTEGRATE_FORWARD,VTK_INTEGRATE_BOTH_DIRECTIONS);
00180   vtkGetMacro(IntegrationDirection,int);
00181   void SetIntegrationDirectionToForward()
00182     {this->SetIntegrationDirection(VTK_INTEGRATE_FORWARD);};
00183   void SetIntegrationDirectionToBackward()
00184     {this->SetIntegrationDirection(VTK_INTEGRATE_BACKWARD);};
00185   void SetIntegrationDirectionToIntegrateBothDirections()
00186     {this->SetIntegrationDirection(VTK_INTEGRATE_BOTH_DIRECTIONS);};
00188 
00190 
00192   vtkSetClampMacro(TerminalEigenvalue,double,0.0,VTK_DOUBLE_MAX);
00193   vtkGetMacro(TerminalEigenvalue,double);
00195 
00197 
00199   vtkSetClampMacro(NumberOfSides,int,3,VTK_INT_MAX);
00200   vtkGetMacro(NumberOfSides,int);
00202 
00204 
00208   vtkSetClampMacro(Radius,double,0.0001,VTK_DOUBLE_MAX);
00209   vtkGetMacro(Radius,double);
00211 
00213 
00215   vtkSetMacro(LogScaling,int);
00216   vtkGetMacro(LogScaling,int);
00217   vtkBooleanMacro(LogScaling,int);
00219 
00220 protected:
00221   vtkHyperStreamline();
00222   ~vtkHyperStreamline();
00223 
00224   // Integrate data
00225   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00226   int BuildTube(vtkDataSet *input, vtkPolyData *output);
00227 
00228   virtual int FillInputPortInformation(int port, vtkInformation *info);
00229 
00230   // Flag indicates where streamlines start from (either position or location)
00231   int StartFrom;
00232 
00233   // Starting from cell location
00234   vtkIdType StartCell;
00235   int StartSubId;
00236   double StartPCoords[3];
00237 
00238   // starting from global x-y-z position
00239   double StartPosition[3];
00240 
00241   //array of hyperstreamlines
00242   vtkHyperArray *Streamers;
00243   int NumberOfStreamers;
00244 
00245   // length of hyperstreamline in absolute distance
00246   double MaximumPropagationDistance;
00247 
00248   // integration direction
00249   int IntegrationDirection;
00250 
00251   // the length (fraction of cell size) of integration steps
00252   double IntegrationStepLength;
00253 
00254   // the length of the tube segments composing the hyperstreamline
00255   double StepLength;
00256 
00257   // terminal propagation speed
00258   double TerminalEigenvalue;
00259 
00260   // number of sides of tube
00261   int NumberOfSides;
00262 
00263   // maximum radius of tube
00264   double Radius;
00265 
00266   // boolean controls whether scaling is clamped
00267   int LogScaling;
00268 
00269   // which eigenvector to use as integration vector field
00270   int IntegrationEigenvector;
00271 private:
00272   vtkHyperStreamline(const vtkHyperStreamline&);  // Not implemented.
00273   void operator=(const vtkHyperStreamline&);  // Not implemented.
00274 };
00275 
00276 #endif