CGAL/cgal

Problems with CGAL property maps

Opened this issue · 1 comments

Issue Details

  1. The functions CGAL::get_property_map() and CGAL::get_const_property_map() are used in several examples, but they are not documented. These functions call in turn CGAL::get(). I find the call to get() adequate in most places , and not only in the examples. The difference is that if an internal property map does not exist, the former variants return empty maps. Is it possible at all that an internal vertex->point property map does not exist in an instance of Polyhedron_3 or Surface_mesh?

In other words, these functions should be either documented or not used (at least in examples), and perhaps even removed all together.

  1. As mentioned above, the function that should be used instead in most if not all places is get(). This template function is mentioned in the user manual of the BGL package; see Propery Maps. However, it is not documented in the reference manual. (It should, because it is in namespace CGAL.)

  2. The Polyhedron_3 is a model of the concepts FaceListGraph and MutableFaceGraph. One can obtain a vertex->point_3 internal property map using the following sequence:

#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_traits_with_normals_3.h>

using Traits = CGAL::Polyhedron_traits_with_normals_3<Kernel>;
using Mesh = CGAL::Polyhedron_3<Traits>;
Traits traits(kernel);
Mesh mesh(traits);
auto pm = CGAL::get(CGAL::vertex_point, mesh);

I would expect to have a similar mechanism that enables the user to obtain either a face->normal_3 or a face->plane_3 property maps depending on the input mesh Polyhedron_3 instance. This brings me back to the first issue above. It seems that in this case the functions CGAL::get_property_map() and CGAL::get_const_property_map() are useful, because only one map of the two (either ->vector_3 or ->plane_3) can exist.

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits):
  • Compiler:
  • Release or debug mode:
  • Specific flags used (if any):
  • CGAL version: latest
  • Boost version:
  • Other libraries versions if used (Eigen, TBB, etc.):

If the graph type does not have a given internal property (they should be documented), then you can use dynamic properties cf here.