def test_unmark(self): # # Define a HalfEdge # v1 = Vertex((0,0)) v2 = Vertex((0,1)) h_edge = HalfEdge(v1,v2) # # Mark it with a specific flag # h_edge.mark(1) self.assertTrue(h_edge.is_marked(1),'HalfEdge should be marked.') # # Unmark it # h_edge.unmark(1) self.assertFalse(h_edge.is_marked(),'HalfEdge should be marked.') self.assertFalse(h_edge.is_marked(1),'HalfEdge should be marked.')
def test_mark(self): # # Define a HalfEdge # v1 = Vertex((0,0)) v2 = Vertex((0,1)) h_edge = HalfEdge(v1,v2) # # Mark it # h_edge.mark(1) self.assertTrue(h_edge.is_marked(1),'HalfEdge should be marked.') # # Mark when initializing # h_edge = HalfEdge(v1, v2, flag=1) self.assertTrue(h_edge.is_marked(1),'HalfEdge should be marked.') # # Split and mark recursively # h_edge.split() h_edge.mark(flag=1, recursive=True) for child in h_edge.get_children(): self.assertTrue(child.is_marked(1),'HalfEdge should be marked.')