VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBoxClipDataSet.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 =========================================================================*/ 00015 /*---------------------------------------------------------------------------- 00016 Copyright (c) Sandia Corporation 00017 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 00018 ----------------------------------------------------------------------------*/ 00019 00050 #ifndef vtkBoxClipDataSet_h 00051 #define vtkBoxClipDataSet_h 00052 00053 #include "vtkFiltersGeneralModule.h" // For export macro 00054 #include "vtkUnstructuredGridAlgorithm.h" 00055 00056 class vtkCell3D; 00057 class vtkCellArray; 00058 class vtkCellData; 00059 class vtkDataArray; 00060 class vtkDataSetAttributes; 00061 class vtkIdList; 00062 class vtkGenericCell; 00063 class vtkPointData; 00064 class vtkIncrementalPointLocator; 00065 class vtkPoints; 00066 00067 class VTKFILTERSGENERAL_EXPORT vtkBoxClipDataSet : public vtkUnstructuredGridAlgorithm 00068 { 00069 public: 00070 vtkTypeMacro(vtkBoxClipDataSet,vtkUnstructuredGridAlgorithm); 00071 void PrintSelf(ostream& os, vtkIndent indent); 00072 00076 static vtkBoxClipDataSet *New(); 00077 00079 00082 void SetBoxClip(double xmin, double xmax, 00083 double ymin, double ymax, 00084 double zmin, double zmax); 00085 void SetBoxClip(const double *n0, const double *o0, 00086 const double *n1, const double *o1, 00087 const double *n2, const double *o2, 00088 const double *n3, const double *o3, 00089 const double *n4, const double *o4, 00090 const double *n5, const double *o5); 00092 00093 00095 00097 vtkSetMacro(GenerateClipScalars,int); 00098 vtkGetMacro(GenerateClipScalars,int); 00099 vtkBooleanMacro(GenerateClipScalars,int); 00101 00103 00105 vtkSetMacro(GenerateClippedOutput,int); 00106 vtkGetMacro(GenerateClippedOutput,int); 00107 vtkBooleanMacro(GenerateClippedOutput,int); 00109 00119 vtkUnstructuredGrid *GetClippedOutput(); 00120 virtual int GetNumberOfOutputs(); 00122 00124 00126 void SetLocator(vtkIncrementalPointLocator *locator); 00127 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); 00129 00132 void CreateDefaultLocator(); 00133 00135 unsigned long GetMTime(); 00136 00138 00140 vtkGetMacro(Orientation,unsigned int); 00141 vtkSetMacro(Orientation,unsigned int); 00143 00144 00145 static void InterpolateEdge(vtkDataSetAttributes *attributes, 00146 vtkIdType toId, 00147 vtkIdType fromId1, vtkIdType fromId2, 00148 double t); 00149 00150 void MinEdgeF(const unsigned int *id_v, const vtkIdType *cellIds, 00151 unsigned int *edgF ); 00152 void PyramidToTetra(const vtkIdType *pyramId, const vtkIdType *cellIds, 00153 vtkCellArray *newCellArray); 00154 void WedgeToTetra(const vtkIdType *wedgeId, const vtkIdType *cellIds, 00155 vtkCellArray *newCellArray); 00156 void CellGrid(vtkIdType typeobj, vtkIdType npts, const vtkIdType *cellIds, 00157 vtkCellArray *newCellArray); 00158 void CreateTetra(vtkIdType npts, const vtkIdType *cellIds, 00159 vtkCellArray *newCellArray); 00160 void ClipBox(vtkPoints *newPoints,vtkGenericCell *cell, 00161 vtkIncrementalPointLocator *locator, vtkCellArray *tets,vtkPointData *inPD, 00162 vtkPointData *outPD,vtkCellData *inCD,vtkIdType cellId, 00163 vtkCellData *outCD); 00164 void ClipHexahedron(vtkPoints *newPoints, vtkGenericCell *cell, 00165 vtkIncrementalPointLocator *locator, vtkCellArray *tets, 00166 vtkPointData *inPD, vtkPointData *outPD, 00167 vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD); 00168 void ClipBoxInOut(vtkPoints *newPoints, vtkGenericCell *cell, 00169 vtkIncrementalPointLocator *locator, vtkCellArray **tets, 00170 vtkPointData *inPD, vtkPointData *outPD, 00171 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); 00172 void ClipHexahedronInOut(vtkPoints *newPoints,vtkGenericCell *cell, 00173 vtkIncrementalPointLocator *locator, vtkCellArray **tets, 00174 vtkPointData *inPD, vtkPointData *outPD, 00175 vtkCellData *inCD, vtkIdType cellId, 00176 vtkCellData **outCD); 00177 00178 void ClipBox2D(vtkPoints *newPoints, vtkGenericCell *cell, 00179 vtkIncrementalPointLocator *locator, vtkCellArray *tets, 00180 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, 00181 vtkIdType cellId, vtkCellData *outCD); 00182 void ClipBoxInOut2D(vtkPoints *newPoints,vtkGenericCell *cell, 00183 vtkIncrementalPointLocator *locator, vtkCellArray **tets, 00184 vtkPointData *inPD, vtkPointData *outPD, 00185 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); 00186 void ClipHexahedron2D(vtkPoints *newPoints,vtkGenericCell *cell, 00187 vtkIncrementalPointLocator *locator, vtkCellArray *tets, 00188 vtkPointData *inPD, vtkPointData *outPD, 00189 vtkCellData *inCD, vtkIdType cellId, 00190 vtkCellData *outCD); 00191 void ClipHexahedronInOut2D(vtkPoints *newPoints, vtkGenericCell *cell, 00192 vtkIncrementalPointLocator *locator, vtkCellArray **tets, 00193 vtkPointData *inPD, vtkPointData *outPD, 00194 vtkCellData *inCD,vtkIdType cellId, 00195 vtkCellData **outCD); 00196 00197 void ClipBox1D(vtkPoints *newPoints, vtkGenericCell *cell, 00198 vtkIncrementalPointLocator *locator, vtkCellArray *lines, 00199 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, 00200 vtkIdType cellId, vtkCellData *outCD); 00201 void ClipBoxInOut1D(vtkPoints *newPoints, vtkGenericCell *cell, 00202 vtkIncrementalPointLocator *locator, vtkCellArray **lines, 00203 vtkPointData *inPD, vtkPointData *outPD, 00204 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); 00205 void ClipHexahedron1D(vtkPoints *newPoints, vtkGenericCell *cell, 00206 vtkIncrementalPointLocator *locator, vtkCellArray *lines, 00207 vtkPointData *inPD, vtkPointData *outPD, 00208 vtkCellData *inCD, vtkIdType cellId, 00209 vtkCellData *outCD); 00210 void ClipHexahedronInOut1D(vtkPoints *newPoints, vtkGenericCell *cell, 00211 vtkIncrementalPointLocator *locator, vtkCellArray **lines, 00212 vtkPointData *inPD, vtkPointData *outPD, 00213 vtkCellData *inCD, vtkIdType cellId, 00214 vtkCellData **outCD); 00215 00216 void ClipBox0D(vtkGenericCell *cell, 00217 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00218 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, 00219 vtkIdType cellId, vtkCellData *outCD); 00220 void ClipBoxInOut0D(vtkGenericCell *cell, 00221 vtkIncrementalPointLocator *locator, vtkCellArray **verts, 00222 vtkPointData *inPD, vtkPointData *outPD, 00223 vtkCellData *inCD, 00224 vtkIdType cellId, vtkCellData **outCD); 00225 void ClipHexahedron0D(vtkGenericCell *cell, 00226 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00227 vtkPointData *inPD, vtkPointData *outPD, 00228 vtkCellData *inCD, 00229 vtkIdType cellId, vtkCellData *outCD); 00230 void ClipHexahedronInOut0D(vtkGenericCell *cell, 00231 vtkIncrementalPointLocator *locator, vtkCellArray **verts, 00232 vtkPointData *inPD, vtkPointData *outPD, 00233 vtkCellData *inCD, 00234 vtkIdType cellId, vtkCellData **outCD); 00235 protected: 00236 vtkBoxClipDataSet(); 00237 ~vtkBoxClipDataSet(); 00238 00239 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00240 virtual int FillInputPortInformation(int port, vtkInformation *info); 00241 00242 vtkIncrementalPointLocator *Locator; 00243 int GenerateClipScalars; 00244 00245 int GenerateClippedOutput; 00246 00247 //double MergeTolerance; 00248 00249 double BoundBoxClip[3][2]; 00250 unsigned int Orientation; 00251 double PlaneNormal[6][3]; //normal of each plane 00252 double PlanePoint[6][3]; //point on the plane 00253 00254 private: 00255 vtkBoxClipDataSet(const vtkBoxClipDataSet&); // Not implemented. 00256 void operator=(const vtkBoxClipDataSet&); // Not implemented. 00257 }; 00258 00259 #endif