Subject: CGAL users discussion list
List archive
- From: "S K BOSE" <>
- To: <>
- Subject: RE: [cgal-discuss] Operator Overloading problem for Vector in Gmpzf Kernel
- Date: Mon, 4 Oct 2010 11:13:39 +0530
Dear All,
Here is my small extracted code. I want to use both Polyhedron_3 and Nef
Polyhedra.
#include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Nef_polyhedron_3.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
typedef Kernel::Point_3 Point_3;
typedef Polyhedron::Facet_iterator Facet_iterator;
typedef Polyhedron::Halfedge_around_facet_circulator HF_circulator;
typedef Kernel::Vector_3 Vector;
int main() {
Point_3 p( 1.0, 0.0, 0.0);
Point_3 q( 0.0, 1.0, 0.0);
Point_3 r( 0.0, 0.0, 1.0);
Point_3 s( 0.0, 0.0, 0.0);
Polyhedron P;
P.make_tetrahedron( p, q, r, s);
Nef_polyhedron N(P);
//...........do some boolean operation
if(N.is_simple())
N.convert_to_Polyhedron(P);
Facet_iterator f;
for(f = P.facets_begin(); f != P.facets_end();f++)
{
HF_circulator he = f->facet_begin();
HF_circulator end = he;
CGAL_For_all(he,end)
{
const Point_3& prev = he->prev()->vertex()->point();
const Point_3& curr = he->vertex()->point();
const Point_3& next = he->next()->vertex()->point();
//Vector n = CGAL::cross_product(next-curr,prev-curr);
// n = n / CGAL::sqrt(n.squared_length());
Vector n = CGAL::unit_normal(prev,curr,next);
}
}
}
a) If I use "Exact_predicates_exact_constructions_kernel_with_sqrt", it
gives error in decomposer(h.b(),num,denom) from Nef_S2/Normalizing.h like
1>G:\cgal\CGAL-3.7-beta1\include\CGAL/Nef_S2/Normalizing.h(306) : error
C2064: term does not evaluate to a function taking 3 arguments
1>G:\cgal\CGAL-3.7-beta1\include\CGAL/Nef_S2/Normalizing.h(307) : error
C2676: binary '*=' : 'CGAL::Null_tag' does not define this operator or a
conversion to a type acceptable to the predefined operator
....................
...................
b) If I use "Exact_predicates_exact_constructions_kernel", it gives the same
old problem as I was getting with homogeneous
G:\cgal\CGAL-3.7-beta1\include\CGAL/Kernel/function_objects.h(1878) : error
C2678: binary '/' : no operator found which takes a left-hand operand of
type 'CGAL::Vector_3<R_>' (or there is no acceptable conversion) -----
c) If I use "Exact_predicates_inexact_constructions_kernel", it gives
G:\cgal\CGAL-3.7-beta1\include\CGAL/Nef_3/Bounding_box_3.h(89) : error
C2039: 'lo' : is not a member of 'CGAL::Box_intersection_d::Box_d<NT_,N>'
In this context what should be my kernel. My compiler is Microsoft Visual
Studio 2005
With regards,
Bose
Original Message-----
From: Marc Glisse
[mailto:]
Sent: Tuesday, September 21, 2010 7:01 PM
To:
Subject: RE: [cgal-discuss] Operator Overloading problem for Vector in Gmpzf
Kernel
On Tue, 21 Sep 2010, S K BOSE wrote:
> Thanks for reply. As Marc mentioned it is the problem for homogeneous
> Vector, But if I use Exact_predicates_exact_constructions_kernel (which I
> feel it is Cartesian) it gives same problem. Same problem for Gmpq kernel
> also (as what Bernd suggested).
If you really need sqrt, you want either an approximate kernel
(Exact_predicates_inexact_constructions_kernel may work) or an exact
kernel that can handle it
(Exact_predicates_exact_constructions_kernel_with_sqrt).
--
Marc Glisse
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- RE: [cgal-discuss] Operator Overloading problem for Vector in Gmpzf Kernel, S K BOSE, 10/04/2010
- RE: [cgal-discuss] Operator Overloading problem for Vector in Gmpzf Kernel, Marc Glisse, 10/04/2010
- RE: [cgal-discuss] Operator Overloading problem for Vector in Gmpzf Kernel, S K BOSE, 10/04/2010
- RE: [cgal-discuss] Operator Overloading problem for Vector in Gmpzf Kernel, Marc Glisse, 10/04/2010
Archive powered by MHonArc 2.6.16.