SFCGAL 2.3.0
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).
auto reason () const -> const std::string &
 Get the reason why geometry is invalid.

Static Public Member Functions

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

Detailed Description

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

Member Function Documentation

◆ invalid()

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

◆ operator bool()

SFCGAL::Validity::operator bool ( ) const
inline

Convert to bool (check if geometry is valid).

Returns
true if geometry is valid, false otherwise

◆ reason()

auto SFCGAL::Validity::reason ( ) const -> const std::string &
inlinenodiscard

Get the reason why geometry is invalid.

Returns
The reason string (empty if valid)

◆ valid()

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