VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
GbTriFaceMesh3D Class Reference

#include <GbTriFaceMesh3D.h>

Inheritance diagram for GbTriFaceMesh3D:
GbObject3D ObObject UbObservable

Classes

class  TriFace
 
class  Vertex
 

Public Types

enum  KDTREE_SPLITAGORITHM { KDTREE_SAHPLIT , KDTREE_SPATIALSPLIT }
 

Public Member Functions

 GbTriFaceMesh3D ()
 
 GbTriFaceMesh3D (std::string name, std::vector< Vertex > *nodes, std::vector< TriFace > *triangles, KDTREE_SPLITAGORITHM splitAlg=KDTREE_SAHPLIT, bool removeRedundantNodes=true)
 
 ~GbTriFaceMesh3D () override
 
GbTriFaceMesh3D * clone () override
 
void finalize () override
 
std::string toString () override
 
std::vector< Vertex > * getNodes ()
 
std::vector< TriFace > * getTriangles ()
 
void setTransferViaFilename (bool transferViaFilename, std::string filename, double transX1, double transX2, double transX3)
 
void readMeshFromSTLFileASCII (std::string filename, bool removeRedundantNodes)
 
void readMeshFromSTLFileBinary (std::string filename, bool removeRedundantNodes)
 
double getX1Minimum () override
 
double getX1Maximum () override
 
double getX1Centroid () override
 
double getX2Minimum () override
 
double getX2Maximum () override
 
double getX2Centroid () override
 
double getX3Minimum () override
 
double getX3Centroid () override
 
double getX3Maximum () override
 
void calculateValues ()
 
double getVolume ()
 
void deleteRedundantNodes ()
 
UbTupleDouble6 calculateMomentOfInertia (double rhoP)
 
UbTupleDouble3 calculateCenterOfGravity ()
 
void setCenterCoordinates (const double &x1, const double &x2, const double &x3) override
 
void setCenterCoordinates (const UbTupleDouble3 &) override
 
void scale (const double &sx1, const double &sx2, const double &sx3) override
 
void rotate (const double &alpha, const double &beta, const double &gamma) override
 
void rotateAroundPoint (const double &px1, const double &px2, const double &px3, const double &alpha, const double &beta, const double &gamma)
 
void translate (const double &x1, const double &x2, const double &x3) override
 
bool isPointInGbObject3D (const double &x1, const double &x2, const double &x3) override
 
bool isPointInGbObject3D (const double &x1, const double &x2, const double &x3, int counter)
 
bool isPointInGbObject3D (const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary) override
 
GbLine3D * createClippedLine3D (GbPoint3D &point1, GbPoint3D &point2) override
 
std::vector< GbTriangle3D * > getSurfaceTriangleSet () override
 
void addSurfaceTriangleSet (std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt3 > &triangles) override
 
std::vector< GbTriFaceMesh3D::TriFace * > getTrianglesForVertex (Vertex *vertex)
 
void setKdTreeSplitAlgorithm (KDTREE_SPLITAGORITHM mode)
 
KDTREE_SPLITAGORITHM getKdTreeSplitAlgorithm ()
 
kd_tree::Tree< double > * getKdTree ()
 
kd_tree::Tree< double > * ensureKdTree ()
 
virtual UbTuple< std::string, std::string > writeMesh (std::string filename, WbWriter *writer, bool writeNormals=false, std::vector< std::string > *datanames=NULL, std::vector< std::vector< double > > *nodedata=NULL)
 
void writeMeshPly (const std::string &filename)
 
bool intersectLine (const double &p1_x1, const double &p1_x2, const double &p1_x3, const double &p2_x1, const double &p2_x2, const double &p2_x3)
 
virtual bool isPointInGbObject3D (GbPoint3D *p)
 
virtual bool isPointInGbObject3D (const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary)=0
 
virtual bool isPointInGbObject3D (const double &x1, const double &x2, const double &x3)=0
 
- Public Member Functions inherited from GbObject3D
virtual ~GbObject3D ()=default
 
double getLengthX1 ()
 
double getLengthX2 ()
 
double getLengthX3 ()
 
virtual void setCenterX1Coordinate (const double &)
 
virtual void setCenterX2Coordinate (const double &)
 
virtual void setCenterX3Coordinate (const double &)
 
virtual bool isCellInsideGbObject3D (const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b)
 
virtual bool isCellCuttingGbObject3D (const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b)
 
virtual bool isCellInsideOrCuttingGbObject3D (const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b)
 
virtual double getCellVolumeInsideGbObject3D (const double &, const double &, const double &, const double &, const double &, const double &)
 
virtual bool isInsideCell (const double &minX1, const double &minX2, const double &minX3, const double &maxX1, const double &maxX2, const double &maxX3)
 
virtual bool hasRaytracing ()
 
virtual bool raytracingSupportsPointsInside ()
 
virtual double getIntersectionRaytraceFactor (const double &, const double &, const double &, const double &, const double &, const double &)
 
- Public Member Functions inherited from ObObject
 ObObject ()=default
 
 ObObject (const std::string &name)
 
 ~ObObject () override=default
 
virtual std::string getName ()
 
void setName (std::string name)
 
- Public Member Functions inherited from UbObservable
virtual ~UbObservable ()
 
virtual void addObserver (UbObserver *observer)
 
virtual void removeObserver (UbObserver *observer)
 
virtual void removeAllObservers ()
 
virtual bool isObservedBy (UbObserver *observer)
 
virtual void notifyObserversObjectChanged ()
 
std::list< UbObserver * > * getObserverList ()
 

Protected Member Functions

void init ()
 
- Protected Member Functions inherited from UbObservable
 UbObservable ()=default
 
 UbObservable (const UbObservable &)
 
UbObservable & operator= (const UbObservable &)
 

Protected Attributes

KDTREE_SPLITAGORITHM kdtreeSplitAlg
 
std::vector< Vertex > * nodes
 
std::vector< TriFace > * triangles
 
std::string filename
 
bool transferViaFilename { false }
 
double transX1 { 0.0 }
 
double transX2 { 0.0 }
 
double transX3 { 0.0 }
 
double x1min
 
double x1max
 
double x2min
 
double x2max
 
double x3min
 
double x3max
 
double x1center
 
double x2center
 
double x3center
 
bool consistent { false }
 
bool buildVertTriRelationMap { false }
 
std::multimap< Vertex *, TriFace * > relationVertTris
 
kd_tree::Tree< double > * kdTree = nullptr
 

Detailed Description

This Class provides the triangular meshes. Note, that up to now no methods for checking consistency are included. in this context this class describes facettes from an 3D-object !!!

Definition at line 70 of file GbTriFaceMesh3D.h.

Member Enumeration Documentation

◆ KDTREE_SPLITAGORITHM

Enumerator
KDTREE_SAHPLIT 
KDTREE_SPATIALSPLIT 

Definition at line 268 of file GbTriFaceMesh3D.h.

Constructor & Destructor Documentation

◆ GbTriFaceMesh3D()

GbTriFaceMesh3D::GbTriFaceMesh3D ( std::string  name,
std::vector< Vertex > *  nodes,
std::vector< TriFace > *  triangles,
KDTREE_SPLITAGORITHM  splitAlg = KDTREE_SAHPLIT,
bool  removeRedundantNodes = true 
)

Member Function Documentation

◆ finalize()

void GbTriFaceMesh3D::finalize ( )
inlineoverridevirtual

Implements GbObject3D.

Definition at line 277 of file GbTriFaceMesh3D.h.

◆ getKdTree()

kd_tree::Tree< double > * GbTriFaceMesh3D::getKdTree ( )
inline

Definition at line 388 of file GbTriFaceMesh3D.h.

◆ getKdTreeSplitAlgorithm()

KDTREE_SPLITAGORITHM GbTriFaceMesh3D::getKdTreeSplitAlgorithm ( )
inline

Definition at line 387 of file GbTriFaceMesh3D.h.

◆ getX1Centroid()

double GbTriFaceMesh3D::getX1Centroid ( )
inlineoverridevirtual

Returns the centroid x1 coordinate of this 3D object.

Returns
the centroid x1 coordinate of this 3D object

Implements GbObject3D.

Definition at line 311 of file GbTriFaceMesh3D.h.

◆ getX1Maximum()

double GbTriFaceMesh3D::getX1Maximum ( )
inlineoverridevirtual

Returns the maximum x1 coordinate of this 3D object.

Returns
the maximum x1 coordinate of this 3D object

Implements GbObject3D.

Definition at line 305 of file GbTriFaceMesh3D.h.

◆ getX1Minimum()

double GbTriFaceMesh3D::getX1Minimum ( )
inlineoverridevirtual

Returns the minimum x1 coordinate of this 3D object.

Returns
the minimum x1 coordinate of this 3D object

Implements GbObject3D.

Definition at line 299 of file GbTriFaceMesh3D.h.

◆ getX2Centroid()

double GbTriFaceMesh3D::getX2Centroid ( )
inlineoverridevirtual

Returns the centroid x2 coordinate of this 3D object.

Returns
the centroid x2 coordinate of this 3D object

Implements GbObject3D.

Definition at line 330 of file GbTriFaceMesh3D.h.

◆ getX2Maximum()

double GbTriFaceMesh3D::getX2Maximum ( )
inlineoverridevirtual

Returns the maximum x2 coordinate of this 3D object.

Returns
the maximum x2 coordinate of this 3D object

Implements GbObject3D.

Definition at line 324 of file GbTriFaceMesh3D.h.

◆ getX2Minimum()

double GbTriFaceMesh3D::getX2Minimum ( )
inlineoverridevirtual

Returns the minimum x2 coordinate of this 3D object.

Returns
the minimum x2 coordinate of this 3D object

Implements GbObject3D.

Definition at line 318 of file GbTriFaceMesh3D.h.

◆ getX3Centroid()

double GbTriFaceMesh3D::getX3Centroid ( )
inlineoverridevirtual

Implements GbObject3D.

Definition at line 343 of file GbTriFaceMesh3D.h.

◆ getX3Maximum()

double GbTriFaceMesh3D::getX3Maximum ( )
inlineoverridevirtual

Returns the maximum x2 coordinate of this 3D object.

Returns
the maximum x2 coordinate of this 3D object

Implements GbObject3D.

Definition at line 349 of file GbTriFaceMesh3D.h.

◆ getX3Minimum()

double GbTriFaceMesh3D::getX3Minimum ( )
inlineoverridevirtual

Returns the minimum x2 coordinate of this 3D object.

Returns
the minimum x2 coordinate of this 3D object

Implements GbObject3D.

Definition at line 337 of file GbTriFaceMesh3D.h.

◆ isPointInGbObject3D() [1/3]

virtual bool GbObject3D::isPointInGbObject3D ( const double &  x1,
const double &  x2,
const double &  x3 
)
virtual

Implements GbObject3D.

◆ isPointInGbObject3D() [2/3]

virtual bool GbObject3D::isPointInGbObject3D ( const double &  x1,
const double &  x2,
const double &  x3,
bool &  pointIsOnBoundary 
)
virtual

Implements GbObject3D.

◆ isPointInGbObject3D() [3/3]

bool GbObject3D::isPointInGbObject3D ( GbPoint3D *  p)
virtual

Reimplemented from GbObject3D.

Definition at line 153 of file GbObject3D.cpp.

◆ setTransferViaFilename()

void GbTriFaceMesh3D::setTransferViaFilename ( bool  transferViaFilename,
std::string  filename,
double  transX1,
double  transX2,
double  transX3 
)
inline

Definition at line 287 of file GbTriFaceMesh3D.h.

Member Data Documentation

◆ buildVertTriRelationMap

bool GbTriFaceMesh3D::buildVertTriRelationMap { false }
protected

Definition at line 429 of file GbTriFaceMesh3D.h.

◆ consistent

bool GbTriFaceMesh3D::consistent { false }
protected

Definition at line 427 of file GbTriFaceMesh3D.h.

◆ filename

std::string GbTriFaceMesh3D::filename
protected

Definition at line 411 of file GbTriFaceMesh3D.h.

◆ kdTree

kd_tree::Tree<double>* GbTriFaceMesh3D::kdTree = nullptr
protected

Definition at line 432 of file GbTriFaceMesh3D.h.

◆ kdtreeSplitAlg

KDTREE_SPLITAGORITHM GbTriFaceMesh3D::kdtreeSplitAlg
protected

Definition at line 405 of file GbTriFaceMesh3D.h.

◆ nodes

std::vector<Vertex>* GbTriFaceMesh3D::nodes
protected

Definition at line 408 of file GbTriFaceMesh3D.h.

◆ relationVertTris

std::multimap<Vertex *, TriFace *> GbTriFaceMesh3D::relationVertTris
protected

Definition at line 430 of file GbTriFaceMesh3D.h.

◆ transferViaFilename

bool GbTriFaceMesh3D::transferViaFilename { false }
protected

Definition at line 412 of file GbTriFaceMesh3D.h.

◆ transX1

double GbTriFaceMesh3D::transX1 { 0.0 }
protected

Definition at line 413 of file GbTriFaceMesh3D.h.

◆ transX2

double GbTriFaceMesh3D::transX2 { 0.0 }
protected

Definition at line 414 of file GbTriFaceMesh3D.h.

◆ transX3

double GbTriFaceMesh3D::transX3 { 0.0 }
protected

Definition at line 415 of file GbTriFaceMesh3D.h.

◆ triangles

std::vector<TriFace>* GbTriFaceMesh3D::triangles
protected

Definition at line 409 of file GbTriFaceMesh3D.h.

◆ x1center

double GbTriFaceMesh3D::x1center
protected

Definition at line 423 of file GbTriFaceMesh3D.h.

◆ x1max

double GbTriFaceMesh3D::x1max
protected

Definition at line 418 of file GbTriFaceMesh3D.h.

◆ x1min

double GbTriFaceMesh3D::x1min
protected

Definition at line 417 of file GbTriFaceMesh3D.h.

◆ x2center

double GbTriFaceMesh3D::x2center
protected

Definition at line 424 of file GbTriFaceMesh3D.h.

◆ x2max

double GbTriFaceMesh3D::x2max
protected

Definition at line 420 of file GbTriFaceMesh3D.h.

◆ x2min

double GbTriFaceMesh3D::x2min
protected

Definition at line 419 of file GbTriFaceMesh3D.h.

◆ x3center

double GbTriFaceMesh3D::x3center
protected

Definition at line 425 of file GbTriFaceMesh3D.h.

◆ x3max

double GbTriFaceMesh3D::x3max
protected

Definition at line 422 of file GbTriFaceMesh3D.h.

◆ x3min

double GbTriFaceMesh3D::x3min
protected

Definition at line 421 of file GbTriFaceMesh3D.h.


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