SFCGAL
Public Member Functions | Protected Attributes | List of all members
SFCGAL::PreparedGeometry Class Reference

A PreparedGeometry is a shell around a SFCGAL::Geometry. More...

#include <PreparedGeometry.h>

Inheritance diagram for SFCGAL::PreparedGeometry:

Public Member Functions

 PreparedGeometry ()
 Default constructor. More...
 
 PreparedGeometry (std::unique_ptr< Geometry > &&geometry, srid_t srid=0)
 Constructor. More...
 
 PreparedGeometry (Geometry *geometry, srid_t srid=0)
 Constructor. More...
 
virtual ~PreparedGeometry ()
 
const Geometrygeometry () const
 Geometry accessors. More...
 
Geometrygeometry ()
 
void resetGeometry (Geometry *geom)
 Geometry setter. More...
 
const srid_tSRID () const
 SRID read only accessor. More...
 
srid_tSRID ()
 SRID accessor. More...
 
const Envelopeenvelope () const
 Envelope accessor (using cache) More...
 
void invalidateCache ()
 Resets the cache. More...
 
std::string asEWKT (const int &numDecimals=- 1) const
 Convert to an extended WKT (with SRID) More...
 
template<class Archive >
void save (Archive &ar, const unsigned int) const
 Serializer. More...
 
template<class Archive >
void load (Archive &ar, const unsigned int)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Attributes

std::unique_ptr< Geometry_geometry
 
srid_t _srid
 
boost::optional< Envelope_envelope
 

Detailed Description

A PreparedGeometry is a shell around a SFCGAL::Geometry.

It is used to store annex data, like SRID or cached computations

It is noncopyable since it stores a std::unique_ptr<SFCGAL::Geometry>

Constructor & Destructor Documentation

◆ PreparedGeometry() [1/3]

SFCGAL::PreparedGeometry::PreparedGeometry ( )

Default constructor.

◆ PreparedGeometry() [2/3]

SFCGAL::PreparedGeometry::PreparedGeometry ( std::unique_ptr< Geometry > &&  geometry,
srid_t  srid = 0 
)

Constructor.

Parameters
geometrypointer to the underlying SFCGAL::Geometry. Takes ownership

◆ PreparedGeometry() [3/3]

SFCGAL::PreparedGeometry::PreparedGeometry ( Geometry geometry,
srid_t  srid = 0 
)

Constructor.

Parameters
geometrypointer to the underlying SFCGAL::Geometry. Takes ownership

◆ ~PreparedGeometry()

SFCGAL::PreparedGeometry::~PreparedGeometry ( )
virtual

Member Function Documentation

◆ asEWKT()

std::string SFCGAL::PreparedGeometry::asEWKT ( const int &  numDecimals = - 1) const

Convert to an extended WKT (with SRID)

Parameters
numDecimalsnumber of decimals, -1 for keeping the exact rational representation, if possible

◆ envelope()

const Envelope & SFCGAL::PreparedGeometry::envelope ( ) const

Envelope accessor (using cache)

◆ geometry() [1/2]

Geometry & SFCGAL::PreparedGeometry::geometry ( )

◆ geometry() [2/2]

const Geometry & SFCGAL::PreparedGeometry::geometry ( ) const

Geometry accessors.

◆ invalidateCache()

void SFCGAL::PreparedGeometry::invalidateCache ( )

Resets the cache.

◆ load()

template<class Archive >
void SFCGAL::PreparedGeometry::load ( Archive &  ar,
const unsigned int   
)
inline

◆ resetGeometry()

void SFCGAL::PreparedGeometry::resetGeometry ( Geometry geom)

Geometry setter.

◆ save()

template<class Archive >
void SFCGAL::PreparedGeometry::save ( Archive &  ar,
const unsigned int   
) const
inline

Serializer.

◆ serialize()

template<class Archive >
void SFCGAL::PreparedGeometry::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

◆ SRID() [1/2]

srid_t& SFCGAL::PreparedGeometry::SRID ( )
inline

SRID accessor.

◆ SRID() [2/2]

const srid_t& SFCGAL::PreparedGeometry::SRID ( ) const
inline

SRID read only accessor.

Member Data Documentation

◆ _envelope

boost::optional<Envelope> SFCGAL::PreparedGeometry::_envelope
mutableprotected

◆ _geometry

std::unique_ptr<Geometry> SFCGAL::PreparedGeometry::_geometry
protected

◆ _srid

srid_t SFCGAL::PreparedGeometry::_srid
protected