SFCGAL  2.3.0
Public Member Functions | Static Public Member Functions | List of all members
SFCGAL::Validity Struct Reference

the class, convertible to bool, that stores the reason why a geom is invalid More...

#include <Validity.h>

Public Member Functions

 operator bool () const
 Convert to bool (check if geometry is valid) More...
 
auto reason () const -> const std::string &
 Get the reason why geometry is invalid. More...
 

Static Public Member Functions

static auto valid () -> const Validity
 Create a valid geometry status. More...
 
static auto invalid (const std::string &reason) -> const Validity
 Create an invalid geometry status with reason. More...
 

Detailed Description

the class, convertible to bool, that stores the reason why a geom is invalid

Member Function Documentation

static auto SFCGAL::Validity::invalid ( const std::string &  reason) -> const Validity
inlinestatic

Create an invalid geometry status with reason.

Parameters
reasonThe reason why the geometry is invalid
Returns
Invalid geometry status
SFCGAL::Validity::operator bool ( ) const
inline

Convert to bool (check if geometry is valid)

Returns
true if geometry is valid, false otherwise
auto SFCGAL::Validity::reason ( ) const -> const std::string &
inline

Get the reason why geometry is invalid.

Returns
The reason string (empty if valid)
static auto SFCGAL::Validity::valid ( ) -> const Validity
inlinestatic

Create a valid geometry status.

Note
the class has private ctor to force the use of functions valid() and invalid(reason) that are clearer in the code than to remember that "Valid constructed with a reason is invalid"
Returns
Valid geometry status