Subject: CGAL users discussion list
List archive
- From: Ramin H <>
- To:
- Subject: [cgal-discuss] volume center of a cell
- Date: Sun, 10 Jan 2010 17:51:37 -0500
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=jpNwRoarAs8qiy73ys+YZygs3Mk6NHAU23mg6QmiE2yWlQO4ljP5+KDClslvr91oHm 5P3qtJoN5rXrNI5bwHMkcBttnCaIU8RhnpB/vwTH1lGAw57RpwaM6GZIjGUfNLXQKXgG iU2TJDYzOabsJZqpF6qwNy7ae3aL3GhAIaz8c=
Hi everyone,
I want to find volume center of a cell from it's four vertices. I am averaging the x, y, and x coordinates and making a new Point_3 object but the compilation fails on:
Point_3 vol_center(x, y, z);
The error message is humongous so I am attaching it as compile_error.txt
The code follows.
What am I doing wrong?
-Ramin
===CODE===
template <typename Function, typename Tr, typename Visitor_>
class Parametric_cell_radius_criterion
: public Abstract_criterion<Tr, Visitor_>
{
typedef typename Tr::Cell_handle Cell_handle;
typedef typename Tr::Geom_traits::FT FT;
// more typedefs...
public:
// Constructor & Destructor ...
protected:
// some methods...
virtual Badness do_is_bad(const Cell_handle& ch) const
{
typedef typename Tr::Point Point_3;
const Point_3& p = ch->vertex(0)->point();
const Point_3& q = ch->vertex(1)->point();
const Point_3& r = ch->vertex(2)->point();
const Point_3& s = ch->vertex(3)->point();
// find volume center
FT x = ( p.x() + q.x() + r.x() + s.x() ) / FT(4.0);
FT y = ( p.y() + q.y() + r.y() + s.y() ) / FT(4.0);
FT z = ( p.z() + q.z() + r.z() + s.z() ) / FT(4.0);
// ===> The following line gives error <===
Point_3 vol_center(x, y, z);
// lablabla ...
}
};
g++ -c -pipe -frounding-math -O3 -O2 -D_REENTRANT -Wall -W -DQT_NO_DEBUG
-DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml
-I/usr/include/qt4 -I/usr/include -I../../CGAL-3.5/include
-I/usr/X11R6/include -I. -o main.o main.cpp
In file included from ./CGAL_Ext/Mesh_cell_parametric_criteria_3.h:8,
from ./CGAL_Ext/Mesh_parametric_criteria_3.h:6,
from main.cpp:7:
./CGAL_Ext/mesh_parametric_cell_criteria.h: In member function ‘typename
CGAL::Mesh_3::Abstract_criterion<Tr, Visitor_>::Badness
CGAL::Mesh_3::Parametric_cell_radius_criterion<Function, Tr,
Visitor_>::do_is_bad(const typename Tr::Cell_handle&) const [with Function =
FT_to_point_function_wrapper<double,
CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > > >, Tr
=
CGAL::Regular_triangulation_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >,
CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >,
CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int> >,
CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int> >,
CGAL::Mesh_3::Robust_intersection_traits_3<K> > >,
CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >, CGAL::Triangulation_ds_vertex_base_3<void> > >,
CGAL::Mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >,
CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int> >,
CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int> >,
CGAL::Mesh_3::Robust_intersection_traits_3<K> > >,
CGAL::Regular_triangulation_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >,
CGAL::Triangulation_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >, CGAL::Triangulation_ds_cell_base_3<void> >,
std::list<CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >, double>,
std::allocator<CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >, double> > > > > > >, Visitor_ =
CGAL::Mesh_3::Cell_criterion_visitor<CGAL::Regular_triangulation_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >,
CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >,
CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int> >,
CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int> >,
CGAL::Mesh_3::Robust_intersection_traits_3<K> > >,
CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >, CGAL::Triangulation_ds_vertex_base_3<void> > >,
CGAL::Mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >,
CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int> >,
CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int> >,
CGAL::Mesh_3::Robust_intersection_traits_3<K> > >,
CGAL::Regular_triangulation_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >,
CGAL::Triangulation_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Regular_triangulation_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<K>
> >, CGAL::Triangulation_ds_cell_base_3<void> >,
std::list<CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >, double>,
std::allocator<CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >, double> > > > > > > >]’:
main.cpp:68: instantiated from here
./CGAL_Ext/mesh_parametric_cell_criteria.h:72: error: no matching function
for call to
‘CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >, double>::Weighted_point(double&, double&, double&)’
../../CGAL-3.5/include/CGAL/Weighted_point.h:43: note: candidates are:
CGAL::Weighted_point<Pt, We>::Weighted_point(const Pt&, const We&) [with Pt =
CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >, We =
double]
../../CGAL-3.5/include/CGAL/Weighted_point.h:37: note:
CGAL::Weighted_point<Pt, We>::Weighted_point(const Pt&) [with Pt =
CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >, We =
double]
../../CGAL-3.5/include/CGAL/Weighted_point.h:33: note:
CGAL::Weighted_point<Pt, We>::Weighted_point() [with Pt =
CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >, We =
double]
../../CGAL-3.5/include/CGAL/Weighted_point.h:28: note:
CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >, double>::Weighted_point(const
CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >, double>&)
make: *** [main.o] Errot 1
- [cgal-discuss] volume center of a cell, Ramin H, 01/10/2010
- Re: [cgal-discuss] volume center of a cell, Sylvain Pion, 01/11/2010
- Re: [cgal-discuss] volume center of a cell, Ramin H, 01/11/2010
- Re: [cgal-discuss] volume center of a cell, Sylvain Pion, 01/11/2010
- Re: [cgal-discuss] volume center of a cell, Ramin H, 01/11/2010
- Re: [cgal-discuss] volume center of a cell, Sylvain Pion, 01/11/2010
Archive powered by MHonArc 2.6.16.