Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
967aee6
Stream_support: Fix for Epeck
afabri Sep 18, 2025
6c4aeab
Document the named parameter point_map and use it in the issue
afabri Sep 19, 2025
7d4852a
trailing whitespace
afabri Sep 19, 2025
316c455
Fix Default for the point_map type
afabri Sep 19, 2025
d7cfacc
Add Property_map to dependencies
afabri Sep 19, 2025
b668fb4
Fix grammar
MaelRL Sep 22, 2025
5c058a8
Fix missing \relates \ingroup for some property maps
MaelRL Sep 22, 2025
561ec37
Remove extra space between NP entries
MaelRL Sep 22, 2025
0cf9d43
Convert internally to double as required by file format. Document the…
afabri Sep 26, 2025
61cf55e
Convert internally to double as required by file format. Document the…
afabri Sep 26, 2025
39fe8b3
convert directly to Simple_cartesian<float>
afabri Sep 26, 2025
bdee283
Fix dependencies
afabri Sep 26, 2025
fad48f7
Fix dependencies
afabri Sep 26, 2025
92dc53c
Undo change
afabri Sep 29, 2025
a9a60b5
Fix plugin
afabri Sep 29, 2025
806e65f
undo
afabri Sep 29, 2025
18f1f65
Fix plugin
afabri Oct 1, 2025
0ffa81d
fix warnings
soesau Oct 8, 2025
c43058d
Changes after Mael's comments
afabri Oct 14, 2025
358a588
Deal with binary VTP for non-double kernel
afabri Oct 14, 2025
8215abd
fix compilation and warnings
sloriot Oct 15, 2025
67349cc
include for boost range
sloriot Oct 15, 2025
62a9c9e
cleanup
afabri Oct 15, 2025
5d82eed
Update Stream_support/include/CGAL/IO/STL.h
afabri Oct 21, 2025
4acccc2
Fix in doc of STL_extension
afabri Oct 21, 2025
4c27d08
Apply suggestions from code review
afabri Oct 22, 2025
8623f28
Use internal::construct_normal_of_STL_face()
afabri Oct 22, 2025
5050b54
robustify normal computation for STL
afabri Oct 30, 2025
1dc3903
merge cgal/main
afabri Nov 13, 2025
ba17e0b
cleanup an example
afabri Nov 13, 2025
eb992b3
Fix missing I/O function links
MaelRL Nov 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ a newline character and each coordinate separated by a white
space. Other formats available are 'OFF', 'PLY' and 'LAS'. \cgal
provides functions to read such formats:

- `read_XYZ()`
- `read_OFF()`
- `read_PLY()`
- `read_PLY_with_properties()` to read additional PLY properties
- `read_LAS()`
- `read_LAS_with_properties()` to read additional LAS properties
- `CGAL::IO::read_XYZ()`
- `CGAL::IO::read_OFF()`
- `CGAL::IO::read_PLY()`
- `CGAL::IO::read_PLY_with_properties()` to read additional PLY properties
- `CGAL::IO::read_LAS()`
- `CGAL::IO::read_LAS_with_properties()` to read additional LAS properties

\cgal also provides a dedicated container `CGAL::Point_set_3` to
handle point sets with additional properties such as normal
Expand Down
2 changes: 1 addition & 1 deletion Kernel_23/doc/Kernel_23/CGAL/Cartesian_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Cartesian_converter<>();
/// @{

/*!
returns a `K2::Point_2` which coordinates are those of `p`,
returns a `K2::Point_2` whose coordinates are those of `p`,
converted by `NTConverter`.
*/
K2::Point_2 operator()(const K1::Point_2&p);
Expand Down
24 changes: 16 additions & 8 deletions Property_map/include/CGAL/property_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ make_OR_property_map(const PM1& pm1, const PM2& pm2)
/// \cgalModels{ReadablePropertyMap}
///
/// \tparam InputIterator an input iterator
/// \endcond
template<class InputIterator>
struct Input_iterator_property_map{
typedef InputIterator key_type;
Expand All @@ -119,6 +118,8 @@ struct Input_iterator_property_map{
get(Input_iterator_property_map<InputIterator>, const InputIterator& it){ return *it; }
};

/// \endcond

#ifdef DOXYGEN_RUNNING
/// \ingroup PkgPropertyMapRef
/// Property map that composes two property maps,
Expand Down Expand Up @@ -274,8 +275,8 @@ struct Compose_property_map<KeyMap, ValueMap, boost::lvalue_property_map_tag>
};
#endif
/// \ingroup PkgPropertyMapRef
/// \relates Compose_property_map
/// returns `Compose_property_maps<KeyMap, ValueMap>(km,vm)`
/// \relates Compose_property_map
template <class KeyMap, class ValueMap>
Compose_property_map<KeyMap, ValueMap>
make_compose_property_map(const KeyMap& km, const ValueMap& vm)
Expand Down Expand Up @@ -304,8 +305,8 @@ struct Dereference_property_map
reference operator[](const Iter_& it) const { return *it; }
};

/// \ingroup PkgPropertyMapRef
/// Free function to create a `Dereference_property_map` property map.
///
/// \relates Dereference_property_map
template <class Iter> // Type convertible to `key_type`
Dereference_property_map<typename CGAL::value_type_traits<Iter>::type>
Expand Down Expand Up @@ -371,8 +372,8 @@ struct Identity_property_map_no_lvalue
};
/// \endcond

/// \ingroup PkgPropertyMapRef
/// Free function to create a `Identity_property_map` property map.
///
/// \relates Identity_property_map
template <class T> // Key and value type
Identity_property_map<T>
Expand Down Expand Up @@ -409,8 +410,8 @@ struct First_of_pair_property_map
/// @}
};

/// \ingroup PkgPropertyMapRef
/// Free function to create a `First_of_pair_property_map` property map.
///
/// \relates First_of_pair_property_map
template <class Pair> // Pair type
First_of_pair_property_map<Pair>
Expand Down Expand Up @@ -449,8 +450,8 @@ struct Second_of_pair_property_map
/// @}
};

/// \ingroup PkgPropertyMapRef
/// Free function to create a Second_of_pair_property_map property map.
///
/// \relates Second_of_pair_property_map
template <class Pair> // Pair type
Second_of_pair_property_map<Pair>
Expand Down Expand Up @@ -509,8 +510,8 @@ struct Nth_of_tuple_property_map<N,std::tuple<T...> >
friend void put(const Self&, key_type& k, const value_type& v) { std::get<N>(k) = v; }
};

/// \ingroup PkgPropertyMapRef
/// Free function to create a Nth_of_tuple_property_map property map.
///
/// \relates Nth_of_tuple_property_map
template <int N, class Tuple> // Tuple type
Nth_of_tuple_property_map<N, Tuple>
Expand Down Expand Up @@ -563,6 +564,7 @@ struct Pointer_property_map{
/// This function is a shortcut to the recommended replacement:
/// `boost::make_iterator_property_map(<pointer>, boost::typed_identity_property_map<std::size_t>())`
/// Note that the property map is a mutable `LvaluePropertyMap` with `std::size_t` as key.
/// \relates Pointer_property_map
template <class T>
inline
typename Pointer_property_map<T>::type
Expand All @@ -574,6 +576,7 @@ make_property_map(T* pointer)
/// \ingroup PkgPropertyMapRef
/// equivalent to `make_property_map(&v[0])`
/// Note that `v` must not be modified while using the property map created
/// \relates Pointer_property_map
template <class T>
inline
typename Pointer_property_map<T>::type
Expand All @@ -587,6 +590,7 @@ make_property_map(std::vector<T>& v)

/// \ingroup PkgPropertyMapRef
/// Non-mutable version
/// \relates Pointer_property_map
template <class T>
inline
typename Pointer_property_map<T>::const_type
Expand All @@ -598,6 +602,7 @@ make_property_map(const T* pointer)
/// \ingroup PkgPropertyMapRef
/// equivalent to `make_property_map(&v[0])`
/// Note that `v` must not be modified while using the property map created
/// \relates Pointer_property_map
template <class T>
inline
typename Pointer_property_map<T>::const_type
Expand Down Expand Up @@ -674,6 +679,7 @@ struct Boolean_property_map

/// \ingroup PkgPropertyMapRef
/// returns `Boolean_property_map<Set>(set_)`
/// \relates Boolean_property_map
template <class Set>
Boolean_property_map<Set>
make_boolean_property_map(Set& set_)
Expand Down Expand Up @@ -716,6 +722,7 @@ struct Cartesian_converter_property_map

/// \ingroup PkgPropertyMapRef
/// returns `Cartesian_converter_property_map<GeomObject, Vpm>(vpm)`
/// \relates Cartesian_converter_property_map
template<class GeomObject, class Vpm>
Cartesian_converter_property_map<GeomObject, Vpm>
make_cartesian_converter_property_map(Vpm vpm)
Expand Down Expand Up @@ -765,8 +772,8 @@ class Random_access_property_map
};

/// \ingroup PkgPropertyMapRef
/// \relates Random_access_property_map
/// returns `Random_access_property_map<Container>(container)`
/// \relates Random_access_property_map
template <class Container>
Random_access_property_map<Container>
make_random_access_property_map(Container& container)
Expand All @@ -775,6 +782,7 @@ make_random_access_property_map(Container& container)
}

/// \cond SKIP_IN_MANUAL

// Syntaxic sugar for transform_iterator+pmap_to_unary_function
template <typename Iterator, typename Pmap>
typename boost::transform_iterator<CGAL::Property_map_to_unary_function<Pmap>, Iterator>
Expand Down
1 change: 1 addition & 0 deletions STL_Extension/doc/STL_Extension/dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Manual
Miscellany
Number_types
Surface_mesh
Triangulation_3
13 changes: 0 additions & 13 deletions Snap_rounding_2/examples/Snap_rounding_2/snap_rounding_data.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
// Copyright 2009,2014 Max-Planck-Institute Saarbruecken (Germany).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// author(s) : Waqar Khan <[email protected]>


/* Usage
*
* This example converts arbitrary-precision arrangement into fixed-precision using Snap Rounding and by using INPUT DATA FROM A USER SPECIFIED FILE.
Expand Down
1 change: 1 addition & 0 deletions Stream_support/doc/Stream_support/dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Point_set_processing_3
Polygon
Polygon_mesh_processing
Polyhedron
Property_map
SMDS_3
STL_Extension
Surface_mesh
Expand Down
21 changes: 19 additions & 2 deletions Stream_support/include/CGAL/IO/GOCAD.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/iterator.h>
#include <CGAL/Kernel_traits.h>
#include <CGAL/Cartesian_converter.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/use.h>

#include <boost/range/value_type.hpp>
Expand Down Expand Up @@ -295,8 +297,11 @@ bool write_GOCAD(std::ostream& os,
"END_ORIGINAL_COORDINATE_SYSTEM\n"
"TFACE\n";

typedef typename Kernel_traits<typename boost::property_traits<PointMap>::value_type>::type K;
typedef Simple_cartesian<double> SC;
Cartesian_converter<K,SC> conv;
for(std::size_t i=0, end=points.size(); i<end; ++i)
os << "VRTX " << i << " " << get(point_map, points[i]) << "\n";
os << "VRTX " << i << " " << conv(get(point_map, points[i])) << "\n";

for(const Poly& poly : polygons)
{
Expand Down Expand Up @@ -331,8 +336,14 @@ bool write_GOCAD(std::ostream& os,
* \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{point_map}
* \cgalParamDescription{a property map associating points to the elements of the range `points`}
* \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type
* of the iterator of `PointRange` and value type is a model of the concept `Kernel::Point_3`}
* \cgalParamDefault{`CGAL::Identity_property_map<std::iterator_traits<PointRange::iterator>::value_type>`}
* \cgalParamNEnd
* \cgalParamNBegin{stream_precision}
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamDescription{a parameter used to set the precision (i.e., how many digits are generated) of the output stream}
* \cgalParamType{int}
* \cgalParamDefault{the precision of the stream `os`}
* \cgalParamNEnd
Expand Down Expand Up @@ -373,6 +384,12 @@ bool write_GOCAD(std::ostream& os,
* \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{point_map}
* \cgalParamDescription{a property map associating points to the elements of the range `points`}
* \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type
* of the iterator of `PointRange` and value type is a model of the concept `Point_3`}
* \cgalParamDefault{`CGAL::Identity_property_map<std::iterator_traits<PointRange::iterator>::value_type>`}
* \cgalParamNEnd
* \cgalParamNBegin{stream_precision}
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamType{int}
Expand Down
9 changes: 7 additions & 2 deletions Stream_support/include/CGAL/IO/Generic_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#include <CGAL/Named_function_parameters.h>
#include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/Cartesian_converter.h>
#include <CGAL/Simple_cartesian.h>

#include <iostream>
#include <iterator>
Expand Down Expand Up @@ -51,11 +53,14 @@ class Generic_writer

set_stream_precision_from_NP(m_os, np);

typedef typename Kernel_traits<typename boost::property_traits<PointMap>::value_type>::type K;
typedef Simple_cartesian<double> SC;
Cartesian_converter<K,SC> conv;
m_writer.write_header(m_os, points.size(), 0, polygons.size());
for(std::size_t i=0, end=points.size(); i<end; ++i)
{
const typename boost::property_traits<PointMap>::value_type& p = get(point_map, points[i]);
m_writer.write_vertex(to_double(p.x()), to_double(p.y()), to_double(p.z()));
decltype(auto) p = conv(get(point_map, points[i]));
m_writer.write_vertex(p.x(), p.y(), p.z());
}

m_writer.write_facet_header();
Expand Down
12 changes: 12 additions & 0 deletions Stream_support/include/CGAL/IO/OBJ.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ bool read_OBJ(const std::string& fname,
* \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{point_map}
* \cgalParamDescription{a property map associating points to the elements of the range `points`}
* \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type
* of the iterator of `PointRange` and value type is a model of the concept `Point_3`}
* \cgalParamDefault{`CGAL::Identity_property_map<std::iterator_traits<PointRange::iterator>::value_type>`}
* \cgalParamNEnd
* \cgalParamNBegin{stream_precision}
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamType{int}
Expand Down Expand Up @@ -364,6 +370,12 @@ bool write_OBJ(std::ostream& os,
* \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{point_map}
* \cgalParamDescription{a property map associating points to the elements of the range `points`}
* \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type
* of the iterator of `PointRange` and value type is a model of the concept `Kernel::Point_3`}
* \cgalParamDefault{`CGAL::Identity_property_map<std::iterator_traits<PointRange::iterator>::value_type>`}
* \cgalParamNEnd
* \cgalParamNBegin{stream_precision}
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamType{int}
Expand Down
12 changes: 12 additions & 0 deletions Stream_support/include/CGAL/IO/OFF.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ bool read_OFF(const std::string& fname,
* \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{point_map}
* \cgalParamDescription{a property map associating points to the elements of the range`points`}
* \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type
* of the iterator of `PointRange` and value type is a model of the concept `Point_3`}
* \cgalParamDefault{`CGAL::Identity_property_map<std::iterator_traits<PointRange::iterator>::value_type>`}
* \cgalParamNEnd
* \cgalParamNBegin{stream_precision}
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamType{int}
Expand Down Expand Up @@ -308,6 +314,12 @@ bool write_OFF(std::ostream& os,
* \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{point_map}
* \cgalParamDescription{a property map associating points to the elements of the range `points`}
* \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type
* of the iterator of `PointRange` and value type is a model of the concept `Kernel::Point_3`}
* \cgalParamDefault{`CGAL::Identity_property_map<std::iterator_traits<PointRange::iterator>::value_type>`}
* \cgalParamNEnd
* \cgalParamNBegin{stream_precision}
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamType{int}
Expand Down
Loading