17 #include <geos/export.h>
18 #include <geos/util/GEOSException.h>
31 enum Ordinate :
unsigned char {
38 enum Ordinates :
unsigned char {
39 XY = Ordinate::X | Ordinate::Y,
40 XYZ = Ordinate::X | Ordinate::Y | Ordinate::Z,
41 XYM = Ordinate::X | Ordinate::Y | Ordinate::M,
42 XYZM = Ordinate::X | Ordinate::Y | Ordinate::Z | Ordinate::M
45 explicit OrdinateSet(Ordinates o) : m_value(o), m_changesAllowed(
true) {}
48 bool m_changesAllowed;
68 void setZ(
bool value) {
69 if (hasZ() != value) {
70 if (m_changesAllowed) {
71 m_value =
static_cast<Ordinates
>(
static_cast<unsigned char>(m_value) ^ Ordinate::Z);
78 void setM(
bool value) {
79 if (hasM() != value) {
80 if (m_changesAllowed){
81 m_value =
static_cast<Ordinates
>(
static_cast<unsigned char>(m_value) ^ Ordinate::M);
89 return static_cast<unsigned char>(m_value) &
static_cast<unsigned char>(Ordinate::Z);
93 return static_cast<unsigned char>(m_value) &
static_cast<unsigned char>(Ordinate::M);
97 return 2 + hasZ() + hasM();
100 bool changesAllowed()
const {
101 return m_changesAllowed;
104 void setChangesAllowed(
bool allowed) {
105 m_changesAllowed = allowed;
109 return this->m_value == other.m_value;
113 return !(*
this == other);
Utility class to manipulate a set of flags indicating whether X, Y, Z, or M dimensions are present....
Definition: OrdinateSet.h:29
Base class for all GEOS exceptions.
Definition: GEOSException.h:37
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25