VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkExtractCTHPart.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 =========================================================================*/ 00042 #ifndef __vtkExtractCTHPart_h 00043 #define __vtkExtractCTHPart_h 00044 00045 #include "vtkFiltersParallelModule.h" // For export macro 00046 #include "vtkMultiBlockDataSetAlgorithm.h" 00047 00048 class vtkAppendPolyData; 00049 class vtkContourFilter; 00050 class vtkDataArray; 00051 class vtkDataSet; 00052 class vtkDataSetSurfaceFilter; 00053 class vtkDoubleArray; 00054 class vtkExtractCTHPartInternal; 00055 class vtkImageData; 00056 class vtkCompositeDataSet; 00057 class vtkMultiProcessController; 00058 class vtkPlane; 00059 class vtkPolyData; 00060 class vtkRectilinearGrid; 00061 class vtkUniformGrid; 00062 class vtkUnsignedCharArray; 00063 class vtkExtractCTHPartFragments; 00064 00065 //#define EXTRACT_USE_IMAGE_DATA 1 00066 00067 class VTKFILTERSPARALLEL_EXPORT vtkExtractCTHPart : public vtkMultiBlockDataSetAlgorithm 00068 { 00069 public: 00070 static vtkExtractCTHPart *New(); 00071 vtkTypeMacro(vtkExtractCTHPart,vtkMultiBlockDataSetAlgorithm); 00072 void PrintSelf(ostream& os, vtkIndent indent); 00073 00075 00076 void AddVolumeArrayName(const char*); 00077 void RemoveVolumeArrayNames(); 00078 int GetNumberOfVolumeArrayNames(); 00079 const char* GetVolumeArrayName(int idx); 00081 00083 00086 void SetController(vtkMultiProcessController* controller); 00087 vtkGetObjectMacro(Controller,vtkMultiProcessController); 00089 00091 00092 vtkSetMacro(Capping, bool); 00093 vtkGetMacro(Capping, bool); 00094 vtkBooleanMacro(Capping, bool); 00096 00098 00101 vtkSetMacro(GenerateTriangles, bool); 00102 vtkGetMacro(GenerateTriangles, bool); 00103 vtkBooleanMacro(GenerateTriangles, bool); 00105 00107 00110 vtkSetMacro(RemoveGhostCells, bool); 00111 vtkGetMacro(RemoveGhostCells, bool); 00112 vtkBooleanMacro(RemoveGhostCells, bool); 00114 00116 00117 void SetClipPlane(vtkPlane *clipPlane); 00118 vtkGetObjectMacro(ClipPlane, vtkPlane); 00120 00122 unsigned long GetMTime(); 00123 00125 00127 vtkSetClampMacro(VolumeFractionSurfaceValue, double, 0.0, 1.0); 00128 vtkGetMacro(VolumeFractionSurfaceValue, double); 00130 00131 protected: 00132 vtkExtractCTHPart(); 00133 ~vtkExtractCTHPart(); 00134 00135 virtual int FillInputPortInformation(int port, vtkInformation *info); 00136 virtual int RequestData( 00137 vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00138 00141 bool ComputeGlobalBounds(vtkCompositeDataSet *input); 00142 00144 00146 bool ExtractContour( 00147 vtkPolyData* output, vtkCompositeDataSet* input, const char*arrayName); 00149 00150 void ExecuteFaceQuads(vtkDataSet *input, 00151 vtkPolyData *output, 00152 int maxFlag, 00153 int originExtents[3], 00154 int ext[6], 00155 int aAxis, 00156 int bAxis, 00157 int cAxis); 00158 00160 00162 int IsGhostFace(int axis0, 00163 int maxFlag, 00164 int dims[3], 00165 vtkUnsignedCharArray *ghostArray); 00167 00168 void TriggerProgressEvent(double val); 00169 00170 int VolumeFractionType; 00171 double VolumeFractionSurfaceValue; 00172 double VolumeFractionSurfaceValueInternal; 00173 bool GenerateTriangles; 00174 bool Capping; 00175 bool RemoveGhostCells; 00176 vtkPlane *ClipPlane; 00177 vtkMultiProcessController *Controller; 00178 private: 00179 vtkExtractCTHPart(const vtkExtractCTHPart&); // Not implemented. 00180 void operator=(const vtkExtractCTHPart&); // Not implemented. 00181 00182 class VectorOfFragments; 00183 00185 00187 template <class T> 00188 bool ExtractClippedContourOnBlock( 00189 vtkExtractCTHPart::VectorOfFragments& fragments, T* input, const char* arrayName); 00191 00193 00195 template <class T> 00196 bool ExtractContourOnBlock( 00197 vtkExtractCTHPart::VectorOfFragments& fragments, T* input, const char* arrayName); 00199 00201 00203 template <class T> 00204 void ExtractExteriorSurface( 00205 vtkExtractCTHPart::VectorOfFragments& fragments, T* input); 00207 00209 00210 void ExecuteCellDataToPointData( 00211 vtkDataArray *cellVolumeFraction, vtkDoubleArray *pointVolumeFraction, const int *dims); 00213 00214 double ProgressShift; 00215 double ProgressScale; 00216 00217 class ScaledProgress; 00218 friend class ScaledProgress; 00219 vtkExtractCTHPartInternal* Internals; 00220 }; 00221 #endif