OGS
MeshLib::CoordinateSystem Class Referencefinal

Detailed Description

Coordinate systems.

Definition at line 39 of file 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 43 of file CoordinateSystem.h.

43: _type(coord) {}

◆ CoordinateSystem() [2/3]

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

Decides for a given element.

Definition at line 49 of file CoordinateSystem.cpp.

50{
51 GeoLib::AABB const aabb(ele.getNodes(),
52 ele.getNodes() + ele.getNumberOfNodes());
53 CoordinateSystem const bboxCoordSys(getCoordinateSystem(aabb));
54 if (bboxCoordSys.getDimension() >= ele.getDimension())
55 {
56 _type = bboxCoordSys.getType();
57 }
58 else
59 { // e.g. zero volume elements
60 if (ele.getDimension() >= 1)
61 {
63 }
64 if (ele.getDimension() >= 2)
65 {
67 }
68 if (ele.getDimension() == 3)
69 {
71 }
72 }
73}
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
Definition AABB.h:56
CoordinateSystem(unsigned char coord)
User provided coordinate system.
unsigned char getCoordinateSystem(GeoLib::AABB const &bbox)

References _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 75 of file CoordinateSystem.cpp.

77{
78}

Member Function Documentation

◆ getDimension()

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

get dimension size

Definition at line 55 of file CoordinateSystem.h.

56 {
57 if (hasZ())
58 {
59 return 3;
60 }
61 if (hasY())
62 {
63 return 2;
64 }
65
66 return 1;
67 }
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 52 of file CoordinateSystem.h.

52{ return _type; }

References _type.

Referenced by CoordinateSystem().

◆ hasX()

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

has X dimension

Definition at line 70 of file CoordinateSystem.h.

70{ 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 73 of file CoordinateSystem.h.

73{ 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 76 of file CoordinateSystem.h.

76{ 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

Definition at line 79 of file CoordinateSystem.h.

Referenced by CoordinateSystem(), getType(), hasX(), hasY(), and hasZ().


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