-
Notifications
You must be signed in to change notification settings - Fork 16
/
NonManifoldSurfaceChecker.cpp
69 lines (49 loc) · 1.79 KB
/
NonManifoldSurfaceChecker.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "NonManifoldSurfaceChecker.h"
NonManifoldSurfaceChecker::NonManifoldSurfaceChecker()
{
m_surface = NULL;
}
NonManifoldSurfaceChecker::~NonManifoldSurfaceChecker()
{
}
void NonManifoldSurfaceChecker::SetSurface(vtkPolyData* surface)
{
m_surface = surface;
}
void NonManifoldSurfaceChecker::Update()
{
if (m_surface == NULL)
cerr << "NonManifoldSurfaceChecker error: Surface not set";
//else
//{
// vtkSmartPointer<vtkvmtkNeighborhood> neighborhoods = vtkSmartPointer<vtkvmtkNeighborhood>::New();
// neighborhoods->
// SetNeighborhoodTypeToPolyDataManifoldNeighborhood();
// neighborhoods->SetDataSet(m_surface);
// neighborhoods->Build();
//}
// self.NonManifoldEdgesFound = 0
// self.Report = ''
// self.NonManifoldEdgePointIds.Initialize()
// neighborhoods = vtkvmtk.vtkvmtkNeighborhoods()
// neighborhoods.SetNeighborhoodTypeToPolyDataManifoldNeighborhood()
// neighborhoods.SetDataSet(self.Surface)
// neighborhoods.Build()
// neighborCellIds = vtk.vtkIdList()
// cellPointIds = vtk.vtkIdList()
// self.Surface.BuildCells()
// self.Surface.BuildLinks(0)
// numberOfNonManifoldEdges = 0
// for i in range(neighborhoods.GetNumberOfNeighborhoods()) :
// neighborhood = neighborhoods.GetNeighborhood(i)
// for j in range(neighborhood.GetNumberOfPoints()) :
// neighborId = neighborhood.GetPointId(j)
// if (i<neighborId) :
// neighborCellIds.Initialize()
// self.Surface.GetCellEdgeNeighbors(-1, i, neighborId, neighborCellIds)
// if (neighborCellIds.GetNumberOfIds()>2) :
// numberOfNonManifoldEdges = numberOfNonManifoldEdges + 1
// self.Report = self.Report + "Non-manifold edge found" + str(i) + ' ' + str(neighborId) + '.\n'
// self.NonManifoldEdgePointIds.InsertNextId(i)
//self.NonManifoldEdgePointIds.InsertNextId(neighborId)
}