OGS
MeshLib/CoordinateSystem.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#pragma once
5
6
namespace
GeoLib
7
{
8
class
AABB
;
9
}
10
11
namespace
MeshLib
12
{
13
class
Element
;
14
18
struct
CoordinateSystemType
final
19
{
20
enum
type
21
{
22
X
= 0x01,
23
Y
= 0x02,
24
Z
= 0x04
25
};
26
};
27
33
class
CoordinateSystem
final
34
{
35
public
:
37
explicit
CoordinateSystem
(
unsigned
char
coord) :
_type
(coord) {}
38
40
explicit
CoordinateSystem
(
const
Element
& ele);
41
43
explicit
CoordinateSystem
(
const
GeoLib::AABB
& bbox);
44
46
unsigned
char
getType
()
const
{
return
_type
; }
47
49
unsigned
getDimension
()
const
50
{
51
if
(
hasZ
())
52
{
53
return
3;
54
}
55
if
(
hasY
())
56
{
57
return
2;
58
}
59
60
return
1;
61
}
62
64
bool
hasX
()
const
{
return
(
_type
&
CoordinateSystemType::type::X
) != 0; }
65
67
bool
hasY
()
const
{
return
(
_type
&
CoordinateSystemType::type::Y
) != 0; }
68
70
bool
hasZ
()
const
{
return
(
_type
&
CoordinateSystemType::type::Z
) != 0; }
71
72
private
:
73
unsigned
char
_type
;
74
};
75
76
}
// namespace MeshLib
GeoLib::AABB
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
Definition
AABB.h:45
MeshLib::CoordinateSystem::getType
unsigned char getType() const
get this coordinate type
Definition
MeshLib/CoordinateSystem.h:46
MeshLib::CoordinateSystem::CoordinateSystem
CoordinateSystem(unsigned char coord)
User provided coordinate system.
Definition
MeshLib/CoordinateSystem.h:37
MeshLib::CoordinateSystem::hasY
bool hasY() const
has Y dimension
Definition
MeshLib/CoordinateSystem.h:67
MeshLib::CoordinateSystem::_type
unsigned char _type
Definition
MeshLib/CoordinateSystem.h:73
MeshLib::CoordinateSystem::getDimension
unsigned getDimension() const
get dimension size
Definition
MeshLib/CoordinateSystem.h:49
MeshLib::CoordinateSystem::hasX
bool hasX() const
has X dimension
Definition
MeshLib/CoordinateSystem.h:64
MeshLib::CoordinateSystem::hasZ
bool hasZ() const
has z dimension
Definition
MeshLib/CoordinateSystem.h:70
MeshLib::Element
Definition
Element.h:25
GeoLib
Definition
ProjectData.h:25
MeshLib
Definition
ProjectData.h:30
MeshLib::CoordinateSystemType
Coordinate system type.
Definition
MeshLib/CoordinateSystem.h:19
MeshLib::CoordinateSystemType::type
type
Definition
MeshLib/CoordinateSystem.h:21
MeshLib::CoordinateSystemType::X
@ X
Definition
MeshLib/CoordinateSystem.h:22
MeshLib::CoordinateSystemType::Y
@ Y
Definition
MeshLib/CoordinateSystem.h:23
MeshLib::CoordinateSystemType::Z
@ Z
Definition
MeshLib/CoordinateSystem.h:24
MeshLib
CoordinateSystem.h
Generated by
1.14.0