OGS
MeshLib::CoordinateSystem Class Referencefinal

Detailed Description

Coordinate systems.

Definition at line 33 of file MeshLib/CoordinateSystem.h.

#include <CoordinateSystem.h>

Public Member Functions

 CoordinateSystem (unsigned char coord)
 User provided coordinate system.
 CoordinateSystem (const Element &ele)
 Decides for a given element.
 CoordinateSystem (const GeoLib::AABB &bbox)
 Decides a coordinate system from a bounding box.
unsigned char getType () const
 get this coordinate type
unsigned getDimension () const
 get dimension size
bool hasX () const
 has X dimension
bool hasY () const
 has Y dimension
bool hasZ () const
 has z dimension

Private Attributes

unsigned char _type

Constructor & Destructor Documentation

◆ CoordinateSystem() [1/3]

MeshLib::CoordinateSystem::CoordinateSystem ( unsigned char coord)
inlineexplicit

User provided coordinate system.

Definition at line 37 of file MeshLib/CoordinateSystem.h.

37: _type(coord) {}

References _type.

Referenced by CoordinateSystem().

◆ CoordinateSystem() [2/3]

MeshLib::CoordinateSystem::CoordinateSystem ( const Element & ele)
explicit

Decides for a given element.

Definition at line 43 of file MeshLib/CoordinateSystem.cpp.

44{
45 GeoLib::AABB const aabb(ele.getNodes(),
46 ele.getNodes() + ele.getNumberOfNodes());
47 CoordinateSystem const bboxCoordSys(getCoordinateSystem(aabb));
48 if (bboxCoordSys.getDimension() >= ele.getDimension())
49 {
50 _type = bboxCoordSys.getType();
51 }
52 else
53 { // e.g. zero volume elements
54 if (ele.getDimension() >= 1)
55 {
57 }
58 if (ele.getDimension() >= 2)
59 {
61 }
62 if (ele.getDimension() == 3)
63 {
65 }
66 }
67}
CoordinateSystem(unsigned char coord)
User provided coordinate system.
unsigned char getCoordinateSystem(GeoLib::AABB const &bbox)

References CoordinateSystem(), _type, getDimension(), MeshLib::Element::getDimension(), MeshLib::Element::getNodes(), MeshLib::Element::getNumberOfNodes(), getType(), MeshLib::CoordinateSystemType::X, MeshLib::CoordinateSystemType::Y, and MeshLib::CoordinateSystemType::Z.

◆ CoordinateSystem() [3/3]

MeshLib::CoordinateSystem::CoordinateSystem ( const GeoLib::AABB & bbox)
explicit

Decides a coordinate system from a bounding box.

Definition at line 69 of file MeshLib/CoordinateSystem.cpp.

71{
72}

References _type.

Member Function Documentation

◆ getDimension()

unsigned MeshLib::CoordinateSystem::getDimension ( ) const
inline

get dimension size

Definition at line 49 of file MeshLib/CoordinateSystem.h.

50 {
51 if (hasZ())
52 {
53 return 3;
54 }
55 if (hasY())
56 {
57 return 2;
58 }
59
60 return 1;
61 }
bool hasY() const
has Y dimension
bool hasZ() const
has z dimension

References hasY(), and hasZ().

Referenced by CoordinateSystem().

◆ getType()

unsigned char MeshLib::CoordinateSystem::getType ( ) const
inline

get this coordinate type

Definition at line 46 of file MeshLib/CoordinateSystem.h.

46{ return _type; }

References _type.

Referenced by CoordinateSystem().

◆ hasX()

bool MeshLib::CoordinateSystem::hasX ( ) const
inline

has X dimension

Definition at line 64 of file MeshLib/CoordinateSystem.h.

64{ return (_type & CoordinateSystemType::type::X) != 0; }

References _type, and MeshLib::CoordinateSystemType::X.

◆ hasY()

bool MeshLib::CoordinateSystem::hasY ( ) const
inline

has Y dimension

Definition at line 67 of file MeshLib/CoordinateSystem.h.

67{ return (_type & CoordinateSystemType::type::Y) != 0; }

References _type, and MeshLib::CoordinateSystemType::Y.

Referenced by getDimension().

◆ hasZ()

bool MeshLib::CoordinateSystem::hasZ ( ) const
inline

has z dimension

Definition at line 70 of file MeshLib/CoordinateSystem.h.

70{ return (_type & CoordinateSystemType::type::Z) != 0; }

References _type, and MeshLib::CoordinateSystemType::Z.

Referenced by getDimension().

Member Data Documentation

◆ _type

unsigned char MeshLib::CoordinateSystem::_type
private

The documentation for this class was generated from the following files: