Commits

Lazar Sumar  committed 84be82b

Securing code.

  • Participants
  • Parent commits 68914c6
  • Branches old_approach

Comments (0)

Files changed (3)

File MeshSimplification/HEdge.h

 extern map<int, HE_face*> faces;
 extern int fi;
 
+extern int nv, np, ne;
+
 extern map<pair<int, int>, HE_edge*> pair_map;
 
 extern vector<HE_vert> last_decimated;

File MeshSimplification/decimation.cpp

 int is_triangle_inside(HE_vert* vert, HE_vert* v1, HE_vert* v2, HE_vert* v3) {
 	double alpha;
 
-	alpha = line_intersect(v3, v1, v2, vert);
+	try {
+		alpha = line_intersect(v3, v1, v2, vert);
+	} catch (ParallelException& e) {
+		return false;
+	}
 
 	return alpha > 0.0;
 }

File MeshSimplification/main.cpp

 	glBegin(GL_TRIANGLES);
 	for(; it != faces.end(); it++){
 			face = it->second;
+			if (face->index >= np) {
+				glColor3f(0., 0.,1.);
+			} else {
+				glColor3f(1., 0.,0.);
+			}
 			
 			if (face != NULL) {
 				edge1 = face->edge;
 		}
 	}
 
-	display_boundary(last_boundary, Vector3(.0, .1, .0));
-	display_boundary(last_decimated, Vector3(.0, .0, .1));
+	//display_boundary(last_boundary, Vector3(.0, .1, .0));
+	//display_boundary(last_decimated, Vector3(.0, .0, .1));
 
 	glFlush();
 	glutSwapBuffers();