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 vtkIncrementalPointLocator;
00064 class vtkPoints;
00065
00066 class VTK_GRAPHICS_EXPORT vtkBoxClipDataSet : public vtkUnstructuredGridAlgorithm
00067 {
00068 public:
00069 vtkTypeMacro(vtkBoxClipDataSet,vtkUnstructuredGridAlgorithm);
00070 void PrintSelf(ostream& os, vtkIndent indent);
00071
00075 static vtkBoxClipDataSet *New();
00076
00078
00081 void SetBoxClip(double xmin, double xmax,
00082 double ymin, double ymax,
00083 double zmin, double zmax);
00084 void SetBoxClip(const double *n0, const double *o0,
00085 const double *n1, const double *o1,
00086 const double *n2, const double *o2,
00087 const double *n3, const double *o3,
00088 const double *n4, const double *o4,
00089 const double *n5, const double *o5);
00091
00092
00094
00096 vtkSetMacro(GenerateClipScalars,int);
00097 vtkGetMacro(GenerateClipScalars,int);
00098 vtkBooleanMacro(GenerateClipScalars,int);
00100
00102
00104 vtkSetMacro(GenerateClippedOutput,int);
00105 vtkGetMacro(GenerateClippedOutput,int);
00106 vtkBooleanMacro(GenerateClippedOutput,int);
00108
00118 vtkUnstructuredGrid *GetClippedOutput();
00119 virtual int GetNumberOfOutputs();
00121
00123
00125 void SetLocator(vtkIncrementalPointLocator *locator);
00126 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00128
00131 void CreateDefaultLocator();
00132
00134 unsigned long GetMTime();
00135
00137
00139 vtkGetMacro(Orientation,unsigned int);
00140 vtkSetMacro(Orientation,unsigned int);
00142
00143
00144 static void InterpolateEdge(vtkDataSetAttributes *attributes,
00145 vtkIdType toId,
00146 vtkIdType fromId1, vtkIdType fromId2,
00147 double t);
00148
00149 void MinEdgeF(const unsigned int *id_v, const vtkIdType *cellIds,
00150 unsigned int *edgF );
00151 void PyramidToTetra(const vtkIdType *pyramId, const vtkIdType *cellIds,
00152 vtkCellArray *newCellArray);
00153 void WedgeToTetra(const vtkIdType *wedgeId, const vtkIdType *cellIds,
00154 vtkCellArray *newCellArray);
00155 void CellGrid(vtkIdType typeobj, vtkIdType npts, const vtkIdType *cellIds,
00156 vtkCellArray *newCellArray);
00157 void CreateTetra(vtkIdType npts, const vtkIdType *cellIds,
00158 vtkCellArray *newCellArray);
00159 void ClipBox(vtkPoints *newPoints,vtkGenericCell *cell,
00160 vtkIncrementalPointLocator *locator, vtkCellArray *tets,vtkPointData *inPD,
00161 vtkPointData *outPD,vtkCellData *inCD,vtkIdType cellId,
00162 vtkCellData *outCD);
00163 void ClipHexahedron(vtkPoints *newPoints, vtkGenericCell *cell,
00164 vtkIncrementalPointLocator *locator, vtkCellArray *tets,
00165 vtkPointData *inPD, vtkPointData *outPD,
00166 vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD);
00167 void ClipBoxInOut(vtkPoints *newPoints, vtkGenericCell *cell,
00168 vtkIncrementalPointLocator *locator, vtkCellArray **tets,
00169 vtkPointData *inPD, vtkPointData *outPD,
00170 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
00171 void ClipHexahedronInOut(vtkPoints *newPoints,vtkGenericCell *cell,
00172 vtkIncrementalPointLocator *locator, vtkCellArray **tets,
00173 vtkPointData *inPD, vtkPointData *outPD,
00174 vtkCellData *inCD, vtkIdType cellId,
00175 vtkCellData **outCD);
00176
00177 void ClipBox2D(vtkPoints *newPoints, vtkGenericCell *cell,
00178 vtkIncrementalPointLocator *locator, vtkCellArray *tets,
00179 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
00180 vtkIdType cellId, vtkCellData *outCD);
00181 void ClipBoxInOut2D(vtkPoints *newPoints,vtkGenericCell *cell,
00182 vtkIncrementalPointLocator *locator, vtkCellArray **tets,
00183 vtkPointData *inPD, vtkPointData *outPD,
00184 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
00185 void ClipHexahedron2D(vtkPoints *newPoints,vtkGenericCell *cell,
00186 vtkIncrementalPointLocator *locator, vtkCellArray *tets,
00187 vtkPointData *inPD, vtkPointData *outPD,
00188 vtkCellData *inCD, vtkIdType cellId,
00189 vtkCellData *outCD);
00190 void ClipHexahedronInOut2D(vtkPoints *newPoints, vtkGenericCell *cell,
00191 vtkIncrementalPointLocator *locator, vtkCellArray **tets,
00192 vtkPointData *inPD, vtkPointData *outPD,
00193 vtkCellData *inCD,vtkIdType cellId,
00194 vtkCellData **outCD);
00195
00196 void ClipBox1D(vtkPoints *newPoints, vtkGenericCell *cell,
00197 vtkIncrementalPointLocator *locator, vtkCellArray *lines,
00198 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
00199 vtkIdType cellId, vtkCellData *outCD);
00200 void ClipBoxInOut1D(vtkPoints *newPoints, vtkGenericCell *cell,
00201 vtkIncrementalPointLocator *locator, vtkCellArray **lines,
00202 vtkPointData *inPD, vtkPointData *outPD,
00203 vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
00204 void ClipHexahedron1D(vtkPoints *newPoints, vtkGenericCell *cell,
00205 vtkIncrementalPointLocator *locator, vtkCellArray *lines,
00206 vtkPointData *inPD, vtkPointData *outPD,
00207 vtkCellData *inCD, vtkIdType cellId,
00208 vtkCellData *outCD);
00209 void ClipHexahedronInOut1D(vtkPoints *newPoints, vtkGenericCell *cell,
00210 vtkIncrementalPointLocator *locator, vtkCellArray **lines,
00211 vtkPointData *inPD, vtkPointData *outPD,
00212 vtkCellData *inCD, vtkIdType cellId,
00213 vtkCellData **outCD);
00214
00215 void ClipBox0D(vtkGenericCell *cell,
00216 vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00217 vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
00218 vtkIdType cellId, vtkCellData *outCD);
00219 void ClipBoxInOut0D(vtkGenericCell *cell,
00220 vtkIncrementalPointLocator *locator, vtkCellArray **verts,
00221 vtkPointData *inPD, vtkPointData *outPD,
00222 vtkCellData *inCD,
00223 vtkIdType cellId, vtkCellData **outCD);
00224 void ClipHexahedron0D(vtkGenericCell *cell,
00225 vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00226 vtkPointData *inPD, vtkPointData *outPD,
00227 vtkCellData *inCD,
00228 vtkIdType cellId, vtkCellData *outCD);
00229 void ClipHexahedronInOut0D(vtkGenericCell *cell,
00230 vtkIncrementalPointLocator *locator, vtkCellArray **verts,
00231 vtkPointData *inPD, vtkPointData *outPD,
00232 vtkCellData *inCD,
00233 vtkIdType cellId, vtkCellData **outCD);
00234 protected:
00235 vtkBoxClipDataSet();
00236 ~vtkBoxClipDataSet();
00237
00238 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00239 virtual int FillInputPortInformation(int port, vtkInformation *info);
00240
00241 vtkIncrementalPointLocator *Locator;
00242 int GenerateClipScalars;
00243
00244 int GenerateClippedOutput;
00245
00246
00247
00248 double BoundBoxClip[3][2];
00249 unsigned int Orientation;
00250 double PlaneNormal[6][3];
00251 double PlanePoint[6][3];
00252
00253 private:
00254 vtkBoxClipDataSet(const vtkBoxClipDataSet&);
00255 void operator=(const vtkBoxClipDataSet&);
00256 };
00257
00258 #endif