Type and typename fixes

This commit is contained in:
Efi Fogel 2015-05-06 00:40:52 +03:00
parent 48ad84344f
commit 39f1e22dad
5 changed files with 24 additions and 30 deletions

View File

@ -1117,7 +1117,7 @@ public:
*/ */
Bbox_2 bbox() const Bbox_2 bbox() const
{ {
const Kernel& kernel = *this; Kernel kernel;
Segment_2 seg = kernel.construct_segment_2_object()(this->ps, this->pt); Segment_2 seg = kernel.construct_segment_2_object()(this->ps, this->pt);
return (kernel.construct_bbox_2_object() (seg)); return (kernel.construct_bbox_2_object() (seg));
} }

View File

@ -146,9 +146,9 @@ private:
const Polygon_with_holes_2& pgnwh2, const Polygon_with_holes_2& pgnwh2,
Segment_list& reduced_convolution) const Segment_list& reduced_convolution) const
{ {
for (int x = 0; x < 1+pgnwh1.number_of_holes(); ++x) for (std::size_t x = 0; x < 1+pgnwh1.number_of_holes(); ++x)
{ {
for (int y = 0; y < 1+pgnwh2.number_of_holes(); ++y) for (std::size_t y = 0; y < 1+pgnwh2.number_of_holes(); ++y)
{ {
if ((x != 0) && (y != 0)) if ((x != 0) && (y != 0))
{ {
@ -163,16 +163,17 @@ private:
else { else {
typename Polygon_with_holes_2::Hole_const_iterator it1 = typename Polygon_with_holes_2::Hole_const_iterator it1 =
pgnwh1.holes_begin(); pgnwh1.holes_begin();
for (int count = 0; count < x-1; count++) { it1++; } for (std::size_t count = 0; count < x-1; count++) { it1++; }
pgn1 = *it1; pgn1 = *it1;
} }
if (y == 0) { if (y == 0) {
pgn2 = pgnwh2.outer_boundary(); pgn2 = pgnwh2.outer_boundary();
} else { }
else {
typename Polygon_with_holes_2::Hole_const_iterator it2 = typename Polygon_with_holes_2::Hole_const_iterator it2 =
pgnwh2.holes_begin(); pgnwh2.holes_begin();
for (int count = 0; count < y-1; count++) { it2++; } for (std::size_t count = 0; count < y-1; count++) { it2++; }
pgn2 = *it2; pgn2 = *it2;
} }
@ -189,8 +190,8 @@ private:
void build_reduced_convolution(const Polygon_2& pgn1, const Polygon_2& pgn2, void build_reduced_convolution(const Polygon_2& pgn1, const Polygon_2& pgn2,
Segment_list& reduced_convolution) const Segment_list& reduced_convolution) const
{ {
unsigned int n1 = pgn1.size(); std::size_t n1 = pgn1.size();
unsigned int n2 = pgn2.size(); std::size_t n2 = pgn2.size();
// Init the direcions of both polygons // Init the direcions of both polygons
std::vector<Direction_2> p1_dirs = directions_of_polygon(pgn1); std::vector<Direction_2> p1_dirs = directions_of_polygon(pgn1);
@ -290,9 +291,9 @@ private:
std::vector<Direction_2> directions_of_polygon(const Polygon_2& p) const std::vector<Direction_2> directions_of_polygon(const Polygon_2& p) const
{ {
std::vector<Direction_2> directions; std::vector<Direction_2> directions;
unsigned int n = p.size(); std::size_t n = p.size();
for (unsigned int i = 0; i < n-1; ++i) for (std::size_t i = 0; i < n-1; ++i)
{ {
directions.push_back(f_direction(f_vector(p[i], p[i+1]))); directions.push_back(f_direction(f_vector(p[i], p[i+1])));
} }
@ -432,7 +433,7 @@ private:
if (ear.has_on_bounded_side(q)) if (ear.has_on_bounded_side(q))
{ {
FT distance = squared_distance(q, v); FT distance = squared_distance(q, v);
if (min_distance == -1 || distance < min_distance) if ((min_distance == -1) || (distance < min_distance))
{ {
min_distance = distance; min_distance = distance;
min_q = q; min_q = q;
@ -457,7 +458,7 @@ private:
const Polygon_with_holes_2& p) const const Polygon_with_holes_2& p) const
{ {
Polygon_2 p1; Polygon_2 p1;
for(unsigned int i = 0; i< p.outer_boundary().size(); ++i) for (std::size_t i = 0; i< p.outer_boundary().size(); ++i)
{ {
p1.push_back(p.outer_boundary().vertex(i)); p1.push_back(p.outer_boundary().vertex(i));
} }
@ -468,7 +469,7 @@ private:
while(it != p.holes_end()) while(it != p.holes_end())
{ {
Polygon_2 p2; Polygon_2 p2;
for(unsigned int i = 0; i< (*it).size(); ++i) for (std::size_t i = 0; i< (*it).size(); ++i)
{ {
p2.push_back((*it).vertex(i)); p2.push_back((*it).vertex(i));
} }

View File

@ -307,7 +307,6 @@ minkowski_sum_2(const Polygon_2<Kernel_, Container_>& pgn1,
Minkowski_sum_by_decomposition_2<DecompositionStrategy_, Minkowski_sum_by_decomposition_2<DecompositionStrategy_,
Container_>::Traits_2& traits) Container_>::Traits_2& traits)
{ {
typedef Kernel_ Kernel;
typedef Container_ Container; typedef Container_ Container;
typedef DecompositionStrategy_ Decomposition_strategy; typedef DecompositionStrategy_ Decomposition_strategy;

View File

@ -172,15 +172,12 @@ int main(int argc, char* argv[])
compare = true; compare = true;
reference = result; reference = result;
int n = result.outer_boundary().size(); std::size_t n = result.outer_boundary().size();
typename Polygon_with_holes_2::Hole_const_iterator it = result.holes_begin(); Polygon_with_holes_2::Hole_const_iterator it = result.holes_begin();
while(it != result.holes_end()) while(it != result.holes_end()) n += (*it++).size();
{
n += (*it).size();
++it;
}
std::cout << std::endl << "Result has " << n << " vertices and " << result.number_of_holes() << " holes."; std::cout << std::endl << "Result has " << n << " vertices and "
<< result.number_of_holes() << " holes.";
} }
std::cout << std::endl; std::cout << std::endl;
} }

View File

@ -121,15 +121,12 @@ int main(int argc, char* argv[])
compare = true; compare = true;
reference = result; reference = result;
int n = result.outer_boundary().size(); std::size_t n = result.outer_boundary().size();
typename Polygon_with_holes_2::Hole_const_iterator it = result.holes_begin(); Polygon_with_holes_2::Hole_const_iterator it = result.holes_begin();
while(it != result.holes_end()) while(it != result.holes_end()) n += (*it++).size();
{
n += (*it).size();
++it;
}
std::cout << std::endl << "Result has " << n << " vertices and " << result.number_of_holes() << " holes."; std::cout << std::endl << "Result has " << n << " vertices and "
<< result.number_of_holes() << " holes.";
} }
std::cout << std::endl; std::cout << std::endl;
} }