SFCGAL  1.3.0
Public Types | Public Member Functions | List of all members
SFCGAL::detail::GeometrySet< Dim > Class Template Reference

A GeometrySet represents a set of CGAL primitives. More...

#include <GeometrySet.h>

Public Types

typedef std::set< CollectionElement< typename Point_d< Dim >::Type > > PointCollection
 
typedef std::set< CollectionElement< typename Segment_d< Dim >::Type > > SegmentCollection
 
typedef std::list< CollectionElement< typename Surface_d< Dim >::Type > > SurfaceCollection
 
typedef std::list< CollectionElement< typename Volume_d< Dim >::Type > > VolumeCollection
 

Public Member Functions

 GeometrySet ()
 
 GeometrySet (const Geometry &g)
 Construct a GeometrySet from a SFCGAL::Geometry. More...
 
 GeometrySet (const typename TypeForDimension< Dim >::Point &g, int flags=0)
 Construct a GeometrySet from a Point. More...
 
 GeometrySet (const typename TypeForDimension< Dim >::Segment &g, int flags=0)
 Construct a GeometrySet from a Segment. More...
 
 GeometrySet (const typename TypeForDimension< Dim >::Surface &g, int flags=0)
 Construct a GeometrySet from a Surface. More...
 
 GeometrySet (const typename TypeForDimension< Dim >::Volume &g, int flags=0)
 Construct a GeometrySet from a Volume. More...
 
void merge (const GeometrySet< Dim > &g)
 Add primitives from another set. More...
 
void addGeometry (const Geometry &g)
 Add a geometry by decomposing it into CGAL primitives. More...
 
void addPrimitive (const PrimitiveHandle< Dim > &p)
 add a primitive from a PrimitiveHandle to the set More...
 
void addPrimitive (const CGAL::Object &o, bool pointsAsRing=false)
 add a primitive from a CGAL::Object to the set pointsAsRing : if set to true, build a polygon if o is a vector of points More...
 
void addPrimitive (const typename TypeForDimension< Dim >::Point &g, int flags=0)
 add a point to the set More...
 
template<class IT >
void addPoints (IT ibegin, IT iend)
 
void collectPoints (const PrimitiveHandle< Dim > &b)
 collect all points of b and add them to the point list More...
 
void addPrimitive (const typename TypeForDimension< Dim >::Segment &g, int flags=0)
 add a segment to the set More...
 
template<class IT >
void addSegments (IT ibegin, IT iend)
 
void addPrimitive (const typename TypeForDimension< Dim >::Surface &g, int flags=0)
 add a surface to the set More...
 
template<class IT >
void addSurfaces (IT ibegin, IT iend)
 
void addPrimitive (const typename TypeForDimension< Dim >::Volume &g, int flags=0)
 add a volume to the set More...
 
template<class IT >
void addVolumes (IT ibegin, IT iend)
 
int dimension () const
 Get the maximum geometry dimension of the set -1 : empty 0 : there are points 1 : there are segments 2 : there are surfaces 3 : there are volumes. More...
 
void addBoundary (const typename TypeForDimension< Dim >::Surface &surface)
 Add the boundary (segments) of a surface. More...
 
void addBoundary (const typename TypeForDimension< Dim >::Volume &volume)
 Add the boundary (surfaces) of a volume. More...
 
void computeBoundingBoxes (typename HandleCollection< Dim >::Type &handles, typename BoxCollection< Dim >::Type &boxes) const
 Compute all bounding boxes and handles of the set. More...
 
PointCollectionpoints ()
 
const PointCollectionpoints () const
 
SegmentCollectionsegments ()
 
const SegmentCollectionsegments () const
 
SurfaceCollectionsurfaces ()
 
const SurfaceCollectionsurfaces () const
 
VolumeCollectionvolumes ()
 
const VolumeCollectionvolumes () const
 
bool hasPoints () const
 Returns true if the set holds points. More...
 
bool hasSegments () const
 Returns true if the set holds segments. More...
 
bool hasSurfaces () const
 Returns true if the set holds surfaces. More...
 
bool hasVolumes () const
 Returns true if the set holds volumes. More...
 
std::auto_ptr< Geometryrecompose () const
 convert the set to a SFCGAL::Geometry More...
 
void filterCovered (GeometrySet< Dim > &output) const
 Filter (remove) primitives that are already covered by others. More...
 
template<>
void addPrimitive (const PrimitiveHandle< 2 > &p)
 
template<>
void addPrimitive (const PrimitiveHandle< 3 > &p)
 
template<>
void addPrimitive (const CGAL::Object &o, bool pointsAsRing)
 
template<>
void addPrimitive (const CGAL::Object &o, bool pointsAsRing)
 
template<>
void addPrimitive (const TypeForDimension< 2 >::Surface &p, int flags)
 
template<>
void addPrimitive (const TypeForDimension< 3 >::Surface &p, int flags)
 
template<>
void addPrimitive (const TypeForDimension< 2 >::Volume &, int)
 
template<>
void addPrimitive (const TypeForDimension< 3 >::Volume &p, int flags)
 
template<>
bool hasSurfaces () const
 
template<>
bool hasSurfaces () const
 
template<>
bool hasVolumes () const
 
template<>
bool hasVolumes () const
 
template<>
void addBoundary (const TypeForDimension< 2 >::Surface &surface)
 
template<>
void addBoundary (const TypeForDimension< 3 >::Surface &)
 
template<>
int dimension () const
 
template<>
int dimension () const
 

Detailed Description

template<int Dim>
class SFCGAL::detail::GeometrySet< Dim >

A GeometrySet represents a set of CGAL primitives.

Primitive are either of dimension 0 (points), dimension 1 (segments), dimension 2 (surfaces, a.k.a. polygon or triangles) or dimension 3 (polyhedron)

Member Typedef Documentation

template<int Dim>
typedef std::set<CollectionElement<typename Point_d<Dim>::Type> > SFCGAL::detail::GeometrySet< Dim >::PointCollection
template<int Dim>
typedef std::set<CollectionElement<typename Segment_d<Dim>::Type> > SFCGAL::detail::GeometrySet< Dim >::SegmentCollection
template<int Dim>
typedef std::list<CollectionElement<typename Surface_d<Dim>::Type> > SFCGAL::detail::GeometrySet< Dim >::SurfaceCollection
template<int Dim>
typedef std::list<CollectionElement<typename Volume_d<Dim>::Type> > SFCGAL::detail::GeometrySet< Dim >::VolumeCollection

Constructor & Destructor Documentation

template<int Dim>
SFCGAL::detail::GeometrySet< Dim >::GeometrySet ( )
template<int Dim>
SFCGAL::detail::GeometrySet< Dim >::GeometrySet ( const Geometry g)

Construct a GeometrySet from a SFCGAL::Geometry.

template<int Dim>
SFCGAL::detail::GeometrySet< Dim >::GeometrySet ( const typename TypeForDimension< Dim >::Point g,
int  flags = 0 
)

Construct a GeometrySet from a Point.

template<int Dim>
SFCGAL::detail::GeometrySet< Dim >::GeometrySet ( const typename TypeForDimension< Dim >::Segment &  g,
int  flags = 0 
)

Construct a GeometrySet from a Segment.

template<int Dim>
SFCGAL::detail::GeometrySet< Dim >::GeometrySet ( const typename TypeForDimension< Dim >::Surface g,
int  flags = 0 
)

Construct a GeometrySet from a Surface.

template<int Dim>
SFCGAL::detail::GeometrySet< Dim >::GeometrySet ( const typename TypeForDimension< Dim >::Volume &  g,
int  flags = 0 
)

Construct a GeometrySet from a Volume.

Member Function Documentation

template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addBoundary ( const typename TypeForDimension< Dim >::Surface surface)

Add the boundary (segments) of a surface.

template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addBoundary ( const typename TypeForDimension< Dim >::Volume &  volume)

Add the boundary (surfaces) of a volume.

template<>
void SFCGAL::detail::GeometrySet< 2 >::addBoundary ( const TypeForDimension< 2 >::Surface surface)
template<>
void SFCGAL::detail::GeometrySet< 3 >::addBoundary ( const TypeForDimension< 3 >::Surface )
template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addGeometry ( const Geometry g)

Add a geometry by decomposing it into CGAL primitives.

template<int Dim>
template<class IT >
void SFCGAL::detail::GeometrySet< Dim >::addPoints ( IT  ibegin,
IT  iend 
)
inline
template<>
void SFCGAL::detail::GeometrySet< 2 >::addPrimitive ( const PrimitiveHandle< 2 > &  p)
template<>
void SFCGAL::detail::GeometrySet< 3 >::addPrimitive ( const PrimitiveHandle< 3 > &  p)
template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addPrimitive ( const PrimitiveHandle< Dim > &  p)

add a primitive from a PrimitiveHandle to the set

template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addPrimitive ( const CGAL::Object &  o,
bool  pointsAsRing = false 
)

add a primitive from a CGAL::Object to the set pointsAsRing : if set to true, build a polygon if o is a vector of points

template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addPrimitive ( const typename TypeForDimension< Dim >::Point g,
int  flags = 0 
)

add a point to the set

template<>
void SFCGAL::detail::GeometrySet< 3 >::addPrimitive ( const CGAL::Object &  o,
bool  pointsAsRing 
)
template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addPrimitive ( const typename TypeForDimension< Dim >::Segment &  g,
int  flags = 0 
)

add a segment to the set

template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addPrimitive ( const typename TypeForDimension< Dim >::Surface g,
int  flags = 0 
)

add a surface to the set

template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::addPrimitive ( const typename TypeForDimension< Dim >::Volume &  g,
int  flags = 0 
)

add a volume to the set

template<>
void SFCGAL::detail::GeometrySet< 2 >::addPrimitive ( const CGAL::Object &  o,
bool  pointsAsRing 
)
template<>
void SFCGAL::detail::GeometrySet< 2 >::addPrimitive ( const TypeForDimension< 2 >::Surface p,
int  flags 
)
template<>
void SFCGAL::detail::GeometrySet< 3 >::addPrimitive ( const TypeForDimension< 3 >::Surface p,
int  flags 
)
template<>
void SFCGAL::detail::GeometrySet< 2 >::addPrimitive ( const TypeForDimension< 2 >::Volume &  ,
int   
)
template<>
void SFCGAL::detail::GeometrySet< 3 >::addPrimitive ( const TypeForDimension< 3 >::Volume &  p,
int  flags 
)
template<int Dim>
template<class IT >
void SFCGAL::detail::GeometrySet< Dim >::addSegments ( IT  ibegin,
IT  iend 
)
inline
template<int Dim>
template<class IT >
void SFCGAL::detail::GeometrySet< Dim >::addSurfaces ( IT  ibegin,
IT  iend 
)
inline
template<int Dim>
template<class IT >
void SFCGAL::detail::GeometrySet< Dim >::addVolumes ( IT  ibegin,
IT  iend 
)
inline
template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::collectPoints ( const PrimitiveHandle< Dim > &  b)

collect all points of b and add them to the point list

template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::computeBoundingBoxes ( typename HandleCollection< Dim >::Type &  handles,
typename BoxCollection< Dim >::Type &  boxes 
) const

Compute all bounding boxes and handles of the set.

template<int Dim>
int SFCGAL::detail::GeometrySet< Dim >::dimension ( ) const

Get the maximum geometry dimension of the set -1 : empty 0 : there are points 1 : there are segments 2 : there are surfaces 3 : there are volumes.

template<>
int SFCGAL::detail::GeometrySet< 2 >::dimension ( ) const
template<>
int SFCGAL::detail::GeometrySet< 3 >::dimension ( ) const
template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::filterCovered ( GeometrySet< Dim > &  output) const

Filter (remove) primitives that are already covered by others.

template<int Dim>
bool SFCGAL::detail::GeometrySet< Dim >::hasPoints ( ) const

Returns true if the set holds points.

template<int Dim>
bool SFCGAL::detail::GeometrySet< Dim >::hasSegments ( ) const

Returns true if the set holds segments.

template<int Dim>
bool SFCGAL::detail::GeometrySet< Dim >::hasSurfaces ( ) const

Returns true if the set holds surfaces.

template<>
bool SFCGAL::detail::GeometrySet< 2 >::hasSurfaces ( ) const
template<>
bool SFCGAL::detail::GeometrySet< 3 >::hasSurfaces ( ) const
template<int Dim>
bool SFCGAL::detail::GeometrySet< Dim >::hasVolumes ( ) const

Returns true if the set holds volumes.

template<>
bool SFCGAL::detail::GeometrySet< 2 >::hasVolumes ( ) const
template<>
bool SFCGAL::detail::GeometrySet< 3 >::hasVolumes ( ) const
template<int Dim>
void SFCGAL::detail::GeometrySet< Dim >::merge ( const GeometrySet< Dim > &  g)

Add primitives from another set.

template<int Dim>
PointCollection& SFCGAL::detail::GeometrySet< Dim >::points ( )
inline
template<int Dim>
const PointCollection& SFCGAL::detail::GeometrySet< Dim >::points ( ) const
inline
template<int Dim>
std::auto_ptr< Geometry > SFCGAL::detail::GeometrySet< Dim >::recompose ( ) const

convert the set to a SFCGAL::Geometry

template<int Dim>
SegmentCollection& SFCGAL::detail::GeometrySet< Dim >::segments ( )
inline
template<int Dim>
const SegmentCollection& SFCGAL::detail::GeometrySet< Dim >::segments ( ) const
inline
template<int Dim>
SurfaceCollection& SFCGAL::detail::GeometrySet< Dim >::surfaces ( )
inline
template<int Dim>
const SurfaceCollection& SFCGAL::detail::GeometrySet< Dim >::surfaces ( ) const
inline
template<int Dim>
VolumeCollection& SFCGAL::detail::GeometrySet< Dim >::volumes ( )
inline
template<int Dim>
const VolumeCollection& SFCGAL::detail::GeometrySet< Dim >::volumes ( ) const
inline