00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00050 #ifndef __vtkBoxClipDataSet_h
00051 #define __vtkBoxClipDataSet_h
00052
00053 #include "vtkUnstructuredGridAlgorithm.h"
00054
00055 class vtkCell3D;
00056 class vtkCellArray;
00057 class vtkCellData;
00058 class vtkDataArray;
00059 class vtkDataSetAttributes;
00060 class vtkIdList;
00061 class vtkGenericCell;
00062 class vtkPointData;
00063 class vtkPointLocator;
00064 class vtkPoints;
00065
00066 class VTK_GRAPHICS_EXPORT vtkBoxClipDataSet : public vtkUnstructuredGridAlgorithm
00067 {
00068 public:
00069 vtkTypeRevisionMacro(vtkBoxClipDataSet,vtkUnstructuredGridAlgorithm);
00070 void PrintSelf(ostream& os, vtkIndent indent);
00071
00073 static vtkBoxClipDataSet *New();
00074
00076
00079 void SetBoxClip(double xmin, double xmax,
00080 double ymin, double ymax,
00081 double zmin, double zmax);
00082 void SetBoxClip(const double *n0, const double *o0,
00083 const double *n1, const double *o1,
00084 const double *n2, const double *o2,
00085 const double *n3, const double *o3,
00086 const double *n4, const double *o4,
00087 const double *n5, const double *o5);
00089
00090
00092
00094 vtkSetMacro(GenerateClipScalars,int);
00095 vtkGetMacro(GenerateClipScalars,int);
00096 vtkBooleanMacro(GenerateClipScalars,int);
00098
00100
00102 vtkSetMacro(GenerateClippedOutput,int);
00103 vtkGetMacro(GenerateClippedOutput,int);
00104 vtkBooleanMacro(GenerateClippedOutput,int);
00106
00116 vtkUnstructuredGrid *GetClippedOutput();
00117 virtual int GetNumberOfOutputs();
00119
00121
00123 void SetLocator(vtkPointLocator *locator);
00124 vtkGetObjectMacro(Locator,vtkPointLocator);
00126
00129 void CreateDefaultLocator();
00130
00132 unsigned long GetMTime();
00133
00134 vtkGetMacro(Orientation,unsigned int);
00135 vtkSetMacro(Orientation,unsigned int);
00136
00137
00138 static void InterpolateEdge(vtkDataSetAttributes *attributes,
00139 vtkIdType toId,
00140 vtkIdType fromId1, vtkIdType fromId2,
00141 double t);
00142
00143 void MinEdgeF(const unsigned int *id_v, const vtkIdType *cellIds,
00144 unsigned int *edgF );
00145 void PyramidToTetra(const vtkIdType *pyramId, const vtkIdType *cellIds,
00146 vtkCellArray *newCellArray);
00147 void WedgeToTetra(const vtkIdType *wedgeId, const vtkIdType *cellIds,
00148 vtkCellArray *newCellArray);
00149 void CellGrid(vtkIdType typeobj, vtkIdType npts, const vtkIdType *cellIds,
00150 vtkCellArray *newCellArray);
00151 void CreateTetra(vtkIdType npts, const vtkIdType *cellIds,
00152 vtkCellArray *newCellArray);
00153 void ClipBox(vtkPoints *newPoints,vtkGenericCell *cell,
00154 vtkPointLocator *locator, vtkCellArray *tets,vtkPointData *inPD,
00155 vtkPointData *outPD,vtkCellData *inCD,vtkIdType cellId,
00156 vtkCellData *outCD);
00157 void ClipHexahedron(vtkPoints *newPoints, vtkGenericCell *cell,
00158 vtkPointLocator *locator, vtkCellArray *tets,
00159 vtkPointData *inPD, vtkPointData *outPD,
00160 vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD);
00161 void ClipBoxInOut(vtkPoints *newPoints, vtkGenericCell *cell,
00162 vtkPointLocator *locator, vtkCellArray **tets,
00163 vtkPointData *inPD, vtkPointData *outPD,
00164 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
00165 void ClipHexahedronInOut(vtkPoints *newPoints,vtkGenericCell *cell,
00166 vtkPointLocator *locator, vtkCellArray **tets,
00167 vtkPointData *inPD, vtkPointData *outPD,
00168 vtkCellData *inCD, vtkIdType cellId,
00169 vtkCellData **outCD);
00170
00171 void ClipBox2D(vtkPoints *newPoints, vtkGenericCell *cell,
00172 vtkPointLocator *locator, vtkCellArray *tets,
00173 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
00174 vtkIdType cellId, vtkCellData *outCD);
00175 void ClipBoxInOut2D(vtkPoints *newPoints,vtkGenericCell *cell,
00176 vtkPointLocator *locator, vtkCellArray **tets,
00177 vtkPointData *inPD, vtkPointData *outPD,
00178 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
00179 void ClipHexahedron2D(vtkPoints *newPoints,vtkGenericCell *cell,
00180 vtkPointLocator *locator, vtkCellArray *tets,
00181 vtkPointData *inPD, vtkPointData *outPD,
00182 vtkCellData *inCD, vtkIdType cellId,
00183 vtkCellData *outCD);
00184 void ClipHexahedronInOut2D(vtkPoints *newPoints, vtkGenericCell *cell,
00185 vtkPointLocator *locator, vtkCellArray **tets,
00186 vtkPointData *inPD, vtkPointData *outPD,
00187 vtkCellData *inCD,vtkIdType cellId,
00188 vtkCellData **outCD);
00189
00190 void ClipBox1D(vtkPoints *newPoints, vtkGenericCell *cell,
00191 vtkPointLocator *locator, vtkCellArray *lines,
00192 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
00193 vtkIdType cellId, vtkCellData *outCD);
00194 void ClipBoxInOut1D(vtkPoints *newPoints, vtkGenericCell *cell,
00195 vtkPointLocator *locator, vtkCellArray **lines,
00196 vtkPointData *inPD, vtkPointData *outPD,
00197 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
00198 void ClipHexahedron1D(vtkPoints *newPoints, vtkGenericCell *cell,
00199 vtkPointLocator *locator, vtkCellArray *lines,
00200 vtkPointData *inPD, vtkPointData *outPD,
00201 vtkCellData *inCD, vtkIdType cellId,
00202 vtkCellData *outCD);
00203 void ClipHexahedronInOut1D(vtkPoints *newPoints, vtkGenericCell *cell,
00204 vtkPointLocator *locator, vtkCellArray **lines,
00205 vtkPointData *inPD, vtkPointData *outPD,
00206 vtkCellData *inCD, vtkIdType cellId,
00207 vtkCellData **outCD);
00208
00209 void ClipBox0D(vtkGenericCell *cell,
00210 vtkPointLocator *locator, vtkCellArray *verts,
00211 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
00212 vtkIdType cellId, vtkCellData *outCD);
00213 void ClipBoxInOut0D(vtkGenericCell *cell,
00214 vtkPointLocator *locator, vtkCellArray **verts,
00215 vtkPointData *inPD, vtkPointData *outPD,
00216 vtkCellData *inCD,
00217 vtkIdType cellId, vtkCellData **outCD);
00218 void ClipHexahedron0D(vtkGenericCell *cell,
00219 vtkPointLocator *locator, vtkCellArray *verts,
00220 vtkPointData *inPD, vtkPointData *outPD,
00221 vtkCellData *inCD,
00222 vtkIdType cellId, vtkCellData *outCD);
00223 void ClipHexahedronInOut0D(vtkGenericCell *cell,
00224 vtkPointLocator *locator, vtkCellArray **verts,
00225 vtkPointData *inPD, vtkPointData *outPD,
00226 vtkCellData *inCD,
00227 vtkIdType cellId, vtkCellData **outCD);
00228 protected:
00229 vtkBoxClipDataSet();
00230 ~vtkBoxClipDataSet();
00231
00232 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00233 virtual int FillInputPortInformation(int port, vtkInformation *info);
00234
00235 vtkPointLocator *Locator;
00236 int GenerateClipScalars;
00237
00238 int GenerateClippedOutput;
00239
00240
00241
00242 double BoundBoxClip[3][2];
00243 unsigned int Orientation;
00244 double PlaneNormal[6][3];
00245 double PlanePoint[6][3];
00246
00247 private:
00248 vtkBoxClipDataSet(const vtkBoxClipDataSet&);
00249 void operator=(const vtkBoxClipDataSet&);
00250 };
00251
00252 #endif