Pārlūkot izejas kodu

- Ifc: code cleanup, remove various non-needed variables as pointed out by gcc.

Alexander Gessler 12 gadi atpakaļ
vecāks
revīzija
232e69dc2a
2 mainītis faili ar 6 papildinājumiem un 13 dzēšanām
  1. 3 6
      code/IFCGeometry.cpp
  2. 3 7
      code/IFCOpenings.cpp

+ 3 - 6
code/IFCGeometry.cpp

@@ -137,8 +137,6 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m
 
 
 	const size_t outer_polygon_size = *outer_polygon_it;
 	const size_t outer_polygon_size = *outer_polygon_it;
 	const IfcVector3& master_normal = normals[std::distance(begin, outer_polygon_it)];
 	const IfcVector3& master_normal = normals[std::distance(begin, outer_polygon_it)];
-	const IfcVector3& master_normal_norm = IfcVector3(master_normal).Normalize();
-
 
 
 	// Generate fake openings to meet the interface for the quadrulate
 	// Generate fake openings to meet the interface for the quadrulate
 	// algorithm. It boils down to generating small boxes given the
 	// algorithm. It boils down to generating small boxes given the
@@ -329,8 +327,7 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv
 	}
 	}
 
 
 	const std::vector<IfcVector3>& in = result.verts;
 	const std::vector<IfcVector3>& in = result.verts;
-	const size_t size=in.size();
-
+	
 	const unsigned int cnt_segments = 16;
 	const unsigned int cnt_segments = 16;
 	const IfcFloat deltaAngle = AI_MATH_TWO_PI/cnt_segments;
 	const IfcFloat deltaAngle = AI_MATH_TWO_PI/cnt_segments;
 
 
@@ -476,12 +473,12 @@ IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVect
 	IfcVector3 nor; 
 	IfcVector3 nor; 
 
 
 	// The input polygon is arbitrarily shaped, therefore we might need some tries
 	// The input polygon is arbitrarily shaped, therefore we might need some tries
-	// until we find a suitable normal. Note that Newells algorithm would give
+	// until we find a suitable normal. Note that Newell's algorithm would give
 	// a more robust result, but this variant also gives us a suitable first
 	// a more robust result, but this variant also gives us a suitable first
 	// axis for the 2D coordinate space on the polygon plane, exploiting the
 	// axis for the 2D coordinate space on the polygon plane, exploiting the
 	// fact that the input polygon is nearly always a quad.
 	// fact that the input polygon is nearly always a quad.
 	bool done = false;
 	bool done = false;
-	size_t base = 0, i, j;
+	size_t i, j;
 	for (i = 0; !done && i < s-2; done || ++i) {
 	for (i = 0; !done && i < s-2; done || ++i) {
 		for (j = i+1; j < s-1; ++j) {
 		for (j = i+1; j < s-1; ++j) {
 			nor = -((out[i]-any_point)^(out[j]-any_point));
 			nor = -((out[i]-any_point)^(out[j]-any_point));

+ 3 - 7
code/IFCOpenings.cpp

@@ -603,7 +603,6 @@ bool IntersectingLineSegments(const IfcVector2& n0, const IfcVector2& n1,
 	const IfcVector2& m0, const IfcVector2& m1,
 	const IfcVector2& m0, const IfcVector2& m1,
 	IfcVector2& out0, IfcVector2& out1)
 	IfcVector2& out0, IfcVector2& out1)
 {
 {
-	const IfcVector2& m0_to_m1 = m1 - m0;
 	const IfcVector2& n0_to_n1 = n1 - n0;
 	const IfcVector2& n0_to_n1 = n1 - n0;
 
 
 	const IfcVector2& n0_to_m0 = m0 - n0;
 	const IfcVector2& n0_to_m0 = m0 - n0;
@@ -898,14 +897,13 @@ size_t CloseWindows(ContourVector& contours,
 
 
 			ai_assert((*it).skiplist.size() == (*it).contour.size());
 			ai_assert((*it).skiplist.size() == (*it).contour.size());
 
 
-			SkipList::const_iterator skipbegin = (*it).skiplist.begin(), skipend = (*it).skiplist.end();
+			SkipList::const_iterator skipbegin = (*it).skiplist.begin();
 
 
 			curmesh.verts.reserve(curmesh.verts.size() + (*it).contour.size() * 4);
 			curmesh.verts.reserve(curmesh.verts.size() + (*it).contour.size() * 4);
 			curmesh.vertcnt.reserve(curmesh.vertcnt.size() + (*it).contour.size());
 			curmesh.vertcnt.reserve(curmesh.vertcnt.size() + (*it).contour.size());
 
 
 			// XXX this algorithm is really a bit inefficient - both in terms
 			// XXX this algorithm is really a bit inefficient - both in terms
 			// of constant factor and of asymptotic runtime.
 			// of constant factor and of asymptotic runtime.
-			size_t vstart = curmesh.verts.size();
 			std::vector<bool>::const_iterator skipit = skipbegin;
 			std::vector<bool>::const_iterator skipit = skipbegin;
 
 
 			IfcVector3 start0;
 			IfcVector3 start0;
@@ -991,10 +989,10 @@ size_t CloseWindows(ContourVector& contours,
 					}
 					}
 				}
 				}
 			}
 			}
-
+			/*
 			BOOST_FOREACH(TempOpening* opening, refs) {
 			BOOST_FOREACH(TempOpening* opening, refs) {
 				//opening->wallPoints.clear();
 				//opening->wallPoints.clear();
-			}
+			}*/
 
 
 		}
 		}
 		else {
 		else {
@@ -1146,7 +1144,6 @@ bool GenerateOpenings(std::vector<TempOpening>& openings,
 	bool generate_connection_geometry,
 	bool generate_connection_geometry,
 	const IfcVector3& wall_extrusion_axis)
 	const IfcVector3& wall_extrusion_axis)
 {
 {
-	std::vector<IfcVector3>& out = curmesh.verts;
 	OpeningRefVector contours_to_openings;
 	OpeningRefVector contours_to_openings;
 
 
 	// Try to derive a solid base plane within the current surface for use as 
 	// Try to derive a solid base plane within the current surface for use as 
@@ -1175,7 +1172,6 @@ bool GenerateOpenings(std::vector<TempOpening>& openings,
 	IfcVector3 wall_extrusion_axis_norm = wall_extrusion_axis;
 	IfcVector3 wall_extrusion_axis_norm = wall_extrusion_axis;
 	wall_extrusion_axis_norm.Normalize();
 	wall_extrusion_axis_norm.Normalize();
 
 
-	size_t c = 0;
 	BOOST_FOREACH(TempOpening& opening,openings) {
 	BOOST_FOREACH(TempOpening& opening,openings) {
 
 
 		// extrusionDir may be 0,0,0 on case where the opening mesh is not an
 		// extrusionDir may be 0,0,0 on case where the opening mesh is not an