Cleaned up

This commit is contained in:
Efi Fogel 2024-01-30 01:07:33 +02:00
parent b25a697fd6
commit 83be94646e
1 changed files with 86 additions and 115 deletions

View File

@ -1,84 +1,64 @@
namespace CGAL { namespace CGAL {
/*! /*! \ingroup PkgEnvelope3Ref
\ingroup PkgEnvelope3Ref *
* The class `Env_surface_data_traits_3` is a model of the `EnvelopeTraits_3`
The class `Env_surface_data_traits_3` is a model of the `EnvelopeTraits_3` concept * concept and serves as a decorator class that allows the extension of the
and serves as a decorator class that allows the extension of the surfaces * surfaces defined by the base traits-class (the `Traits` parameter), which
defined by the base traits-class (the `Traits` parameter), which serves * serves as a geometric traits-class (a model of the `EnvelopeTraits_3`
as a geometric traits-class (a model of the `EnvelopeTraits_3` concept), * concept), with extraneous (non-geometric) data fields.
with extraneous (non-geometric) data fields. *
* The traits-class decorator extends the `Surface_3` and the
The traits-class decorator extends the `Surface_3` and the * `Xy_monotone_surface_3` types as detailed below. Each `Surface_3` object is
`Xy_monotone_surface_3` types as detailed below. * associated with a single data field of type `SData`, and each
Each `Surface_3` object is associated with a single data field of type * `Xy_monotone_surface_3` object is associated with a single data field of type
`SData`, and each `Xy_monotone_surface_3` object is associated with * `XyData`. When a surface is subdivided into \f$ xy\f$-monotone surfaces, its
a single data field of type `XyData`. When a surface is * data field is converted using the conversion functor, which is specified by
subdivided into \f$ xy\f$-monotone surfaces, its data field is converted using * the `Cnv` template-parameter, and the resulting objects is copied to all
the conversion functor, which is specified by the `Cnv` template-parameter, * `Xy_monotone_surface_3` objects induced by this surface. The conversion
and the resulting objects is copied to all `Xy_monotone_surface_3` objects * functor should provide an operator with the following prototype:
induced by this surface. The conversion functor should provide an operator with *
the following prototype: * `XyData operator() (const SData& d) const;`
*
`XyData operator() (const SData& d) const;` * By default, the two data types are the same, so the conversion operator
* is trivial and just copies the data object:
By default, the two data types are the same, so the conversion operator *
is trivial and just copies the data object: * <TABLE><TR>
* <TD>`SData` =</TD>
<TABLE><TR><TD> * <TD>`XyData`</TD>
`SData` = * </TR>
</TD> * <TR>
<TD> * <TD>`Cnv` =</TD>
`XyData` * <TD>`_Default_convert_functor<SData,XyData>`</TD>
</TD></TR> * </TR></TABLE>
<TR><TD> *
`Cnv` = * \cgalModels{EnvelopeTraits_3}
</TD> *
<TD> */
`_Default_convert_functor<SData,XyData>` template <typename Traits, typename XyData, typename SData, typename Cnv>
</TD></TR>
</TABLE>
\cgalModels{EnvelopeTraits_3}
*/
template< typename Traits, typename XyData, typename SData, typename Cnv >
class Env_surface_data_traits_3 : public Traits { class Env_surface_data_traits_3 : public Traits {
public: public:
/// \name Types /// \name Types
/// @{ /// @{
/*! //! the base traits-class.
the base traits-class. typedef Traits Base_traits_3;
*/
typedef Traits Base_traits_3;
/*! //! the base surface.
the base surface. typedef typename Base_traits_3::Surface_3 Base_surface_3;
*/
typedef typename Base_traits_3::Surface_3 Base_surface_3;
/*! //! the base \f$ xy\f$-monotone surface surface.
the base \f$ xy\f$-monotone surface surface. typedef typename Base_traits_3::Xy_monotone_surface_3 Base_xy_monotone_surface_3;
*/
typedef typename Base_traits_3::Xy_monotone_surface_3 Base_xy_monotone_surface_3;
/*! //! the conversion functor.
the conversion functor. typedef Cnv Convert;
*/
typedef Cnv Convert;
/*! //! the type of data associated with surfaces.
the type of data associated with surfaces. typedef SData Surface_data;
*/
typedef SData Surface_data;
/*!
the type of data associated with \f$ xy\f$-monotone surfaces.
*/
typedef XyData Xy_monotone_surface_data;
//! the type of data associated with \f$ xy\f$-monotone surfaces.
typedef XyData Xy_monotone_surface_data;
/// The `Surface_3` class nested within the surface-data traits /// The `Surface_3` class nested within the surface-data traits
/// extends the `Base_traits_3::Surface_3` type with an extra data field. /// extends the `Base_traits_3::Surface_3` type with an extra data field.
@ -87,38 +67,33 @@ typedef XyData Xy_monotone_surface_data;
/// \name Creation /// \name Creation
/// @{ /// @{
/*! /*! default constructor.
default constructor.
*/ */
Surface_3 (); Surface_3();
/*! /*! constructs surface from the given `base` surface with uninitialized
constructs surface from the given `base` surface with uninitialized * data field.
data field.
*/ */
Surface_3 (const Base_surface_3& base); Surface_3(const Base_surface_3& base);
/*! /*! constructs surface from the given `base` surface with an attached
constructs surface from the given `base` surface with an attached * `data` field.
`data` field.
*/ */
Surface_3 (const Base_surface_3& base, const Surface_data& data); Surface_3(const Base_surface_3& base, const Surface_data& data);
/// @} /// @}
/// \name Access Functions /// \name Access Functions
/// @{ /// @{
/*! /*! returns the data field (a non-const version, which returns a reference
returns the data field (a non-const version, which returns a reference * to the data object, is also available).
to the data object, is also available).
*/ */
const Surface_data& data () const; const Surface_data& data () const;
/*! /*! sets the data field.
sets the data field.
*/ */
void set_data (const Surface_data& data); void set_env_data (const Surface_data& data);
/// @} /// @}
}; };
@ -131,22 +106,19 @@ typedef XyData Xy_monotone_surface_data;
/// \name Creation /// \name Creation
/// @{ /// @{
/*! /*! default constructor.
default constructor.
*/ */
Xy_monotone_surface_3 (); Xy_monotone_surface_3 ();
/*! /*! constructs an \f$ xy\f$-monotone surface from the given `base` surface
constructs an \f$ xy\f$-monotone surface from the given `base` surface with * with uninitialized data field.
uninitialized data field.
*/ */
Xy_monotone_surface_3 (const Base_xy_monotone_surface_3& base); Xy_monotone_surface_3(const Base_xy_monotone_surface_3& base);
/*! /*! constructs an \f$ x\f$-monotone surface from the given `base`
constructs an \f$ x\f$-monotone surface from the given `base` \f$ x\f$-monotone * \f$ x\f$-monotone surface with an attached `data` field.
surface with an attached `data` field.
*/ */
Xy_monotone_surface_3 (const Base_xy_monotone_surface_3& base, Xy_monotone_surface_3(const Base_xy_monotone_surface_3& base,
const Xy_monotone_surface_data& data); const Xy_monotone_surface_data& data);
/// @} /// @}
@ -154,21 +126,20 @@ typedef XyData Xy_monotone_surface_data;
/// \name Access Functions /// \name Access Functions
/// @{ /// @{
/*! /*! returns the field (a non-const version, which returns a reference
returns the field (a non-const version, which returns a reference * to the data object, is also available).
to the data object, is also available).
*/ */
const Xy_monotone_surface_data& data () const; const Xy_monotone_surface_data& data() const;
/*! /*! sets the data field.
sets the data field.
*/ */
void set_data (const Xy_monotone_surface_data& data); void set_env_data(const Xy_monotone_surface_data& data);
/// @} /// @}
}; };
/// @} /// @}
}; /* end */ }; /* end */
} /* end namespace CGAL */ } /* end namespace CGAL */