static int MYDEBUG = 0;
static int MYDEBUG_REMOVE = 0;
#else
- static int MYDEBUG = 1;
- static int MYDEBUG_REMOVE = 1;
+ static int MYDEBUG = 0;
+ static int MYDEBUG_REMOVE = 0;
#endif
/*! \fn static void GetCenter(TInput* theGrid,TCell theptIds,float *center)
}
static vtkConvexPointSet* RemoveAllUnneededPoints(vtkConvexPointSet* convex){
- vtkConvexPointSet* out = vtkConvexPointSet::New();
+ vtkSmartPointer<vtkConvexPointSet> out = vtkConvexPointSet::New();
TUIDS two_points,input_points,out_two_points_ids,removed_points_ids,loc_removed_points_ids;
vtkIdList* aPointIds = convex->GetPointIds();
out->Modified();
out->Initialize();
- return out;
+ return out.GetPointer();
}
void GetPolygonalFaces(vtkUnstructuredGrid* theGrid,int cellId,TCellArray &outputCellArray)
if (theGrid->GetCellType(cellId) == VTK_CONVEX_POINT_SET){
// get vtkCell type = VTK_CONVEX_POINT_SET
if(vtkConvexPointSet* convex_in = static_cast<vtkConvexPointSet*>(theGrid->GetCell(cellId))){
- vtkSmartPointer<vtkConvexPointSet> convex = RemoveAllUnneededPoints(convex_in);
+ vtkConvexPointSet* convex = RemoveAllUnneededPoints(convex_in);
TCellArray f2points;
float convex_center[3]; // convex center point coorinat
int aNbFaces = convex->GetNumberOfFaces();
vtkCellArray *Connectivity = input->GetCells();
if (Connectivity == NULL) {return;}
vtkIdType cellId;
- vtkGenericCell *cell = vtkGenericCell::New();
int i;
int allVisible;
vtkIdType npts = 0;
outputCD->CopyData(cd,cellId,newCellId);
break;
- case VTK_CONVEX_POINT_SET: {
- aCellType = VTK_TRIANGLE;
- numFacePts = 3;
- input->GetCell(cellId,cell);
- for (int j=0; j < cell->GetNumberOfFaces(); j++){
- vtkCell *face = cell->GetFace(j);
- input->GetCellNeighbors(cellId, face->PointIds, cellIds);
- if ( true || cellIds->GetNumberOfIds() <= 0 || myShowInside ) {
- aNewPts[0] = face->PointIds->GetId(0);
- aNewPts[1] = face->PointIds->GetId(1);
- aNewPts[2] = face->PointIds->GetId(2);
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
- outputCD->CopyData(cd,cellId,newCellId);
- }
- }
- break;
- /*
+ case VTK_CONVEX_POINT_SET:{
TCellArray tmpCellArray;
try{
CONVEX_TOOL::GetPolygonalFaces(input,cellId,tmpCellArray); // "VTKViewer_ConvexTool.cxx"
outputCD->CopyData(cd,cellId,newCellId);
}
break;
- */
}
case VTK_TETRA: {
for (faceId = 0; faceId < 4; faceId++)