Subject: CGAL users discussion list
List archive
- From: Sterpa <>
- To:
- Subject: [cgal-discuss] Line_2 problem
- Date: Fri, 12 Jun 2009 16:21:06 +0200 (CEST)
I've made this class:
class Node {
Point_2 v_ij;
Line_2 l_i; // l_i is above l_j at the left of v_ij
Line_2 l_j;
public:
Node(Point_2 p, Line_2 i, Line_2 j) {
l_i = i;
l_j = j;
v_ij = Point_2(p.x(), p.y());
Point_2 tmp (v_ij.x()-1, v_ij.y());
if(CGAL::compare_y_at_x(tmp, l_i, l_j) ==
CGAL::SMALLER) {
Line_2 l_k = l_i;
l_i = l_j;
l_j = l_k;
}
}
Node(Line_2 i, Line_2 j) {
v_ij = intersection(i, j);
Node(v_ij, i, j);
}
Point_2 point() const {
return v_ij;
}
Line_2 i() const {
return l_i;
}
Line_2 j() const {
return l_j;
}
bool operator==(const Node& x) const;
};
Now I've this for statement:
while(it2 != D1.end()) {
cout << *it1 << *it2 << "==" << endl;
Node n = Node(*it1, *it2);
cout << n.i() << n.j() << "==" << endl;
V1.push_back(n);
it2++;
}
The problem is I got two different values after create the object, how can I
solve this?
- [cgal-discuss] Line_2 problem, Sterpa, 06/12/2009
Archive powered by MHonArc 2.6.16.