OGS
CoordinateSystem.h
Go to the documentation of this file.
1
10#pragma once
11
12namespace GeoLib
13{
14class AABB;
15}
16
17namespace MeshLib
18{
19class Element;
20
25{
26 enum type
27 {
28 X = 0x01,
29 Y = 0x02,
30 Z = 0x04
31 };
32};
33
40{
41public:
43 explicit CoordinateSystem(unsigned char coord) : _type(coord) {}
44
46 explicit CoordinateSystem(const Element& ele);
47
49 explicit CoordinateSystem(const GeoLib::AABB& bbox);
50
52 unsigned char getType() const { return _type; }
53
55 unsigned getDimension() const
56 {
57 if (hasZ())
58 {
59 return 3;
60 }
61 if (hasY())
62 {
63 return 2;
64 }
65
66 return 1;
67 }
68
70 bool hasX() const { return (_type & CoordinateSystemType::type::X) != 0; }
71
73 bool hasY() const { return (_type & CoordinateSystemType::type::Y) != 0; }
74
76 bool hasZ() const { return (_type & CoordinateSystemType::type::Z) != 0; }
77
78private:
79 unsigned char _type;
80};
81
82} // namespace MeshLib
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
Definition AABB.h:56
unsigned char getType() const
get this coordinate type
CoordinateSystem(unsigned char coord)
User provided coordinate system.
bool hasY() const
has Y dimension
unsigned getDimension() const
get dimension size
bool hasX() const
has X dimension
bool hasZ() const
has z dimension
Coordinate system type.