Public Member Functions | Static Public Attributes | Private Attributes | Friends
meshOctreeCubeCoordinates Class Reference
Inheritance diagram for meshOctreeCubeCoordinates:
Inheritance graph
[legend]

Public Member Functions

 meshOctreeCubeCoordinates ()
 Null constructor. More...
 
 meshOctreeCubeCoordinates (const label posX, const label posY, const label posZ, const direction level)
 Construct from coordinates and level. More...
 
 meshOctreeCubeCoordinates (const meshOctreeCubeCoordinates &)
 copy constructor More...
 
 ~meshOctreeCubeCoordinates ()
 
direction level () const
 return level More...
 
label posX () const
 return x, y, z coordinates More...
 
label posY () const
 
label posZ () const
 
meshOctreeCubeCoordinates refineForPosition (const label) const
 return the coordinates of child cube at the given position More...
 
meshOctreeCubeCoordinates reduceLevelBy (const direction diff) const
 
meshOctreeCubeCoordinates reduceToLevel (const direction) const
 return the coordinates of the parent at the given level More...
 
meshOctreeCubeCoordinates increaseToLevelMin (const direction l) const
 return the minimal coordinates of the child at the given level More...
 
meshOctreeCubeCoordinates increaseToLevelMax (const direction l) const
 return the maximal coordinates of the child at the given level More...
 
void cubeBox (const boundBox &, point &, point &) const
 return min and max points More...
 
void vertices (const boundBox &, FixedList< point, 8 > &) const
 calculate vertices More...
 
point centre (const boundBox &) const
 return centre More...
 
scalar size (const boundBox &) const
 return size More...
 
void edgeVertices (const boundBox &, FixedList< FixedList< point, 2 >, 12 > &) const
 edges of the cube More...
 
bool intersectsTriangle (const triSurf &, const boundBox &, const label) const
 check if the surface triangle intersects the cube More...
 
bool intersectsTriangleExact (const triSurf &, const boundBox &, const label) const
 
bool isVertexInside (const boundBox &, const point &) const
 is a vertex inside the cube More...
 
bool isPositionInside (const meshOctreeCubeCoordinates &) const
 
void neighbourRange (meshOctreeCubeCoordinates &minCoord, meshOctreeCubeCoordinates &maxCoord) const
 
bool intersectsLine (const boundBox &, const point &, const point &) const
 check if the cube intersects a line More...
 
meshOctreeCubeCoordinates operator+ (const meshOctreeCubeCoordinates &) const
 
void operator= (const meshOctreeCubeCoordinates &)
 
bool operator== (const meshOctreeCubeCoordinates &) const
 
bool operator!= (const meshOctreeCubeCoordinates &) const
 
bool operator<= (const meshOctreeCubeCoordinates &) const
 comparison of Morton codes More...
 
bool operator>= (const meshOctreeCubeCoordinates &) const
 
bool operator< (const meshOctreeCubeCoordinates &) const
 
bool operator> (const meshOctreeCubeCoordinates &) const
 

Static Public Attributes

static const label edgeNodes_ [12][2]
 edge nodes for an octree cube More...
 
static const label faceNodes_ [6][4]
 cube nodes making each face More...
 
static const label nodeFaces_ [8][3]
 node-faces addressing for the cube More...
 
static const label faceEdges_ [6][4]
 face-edges addressing for the octree cube More...
 
static const label edgeFaces_ [12][2]
 edge-faces addressing for the octree cube More...
 
static const label oppositeFace_ [6] = {1, 0, 3, 2, 5, 4}
 return the opposite face of each cube face More...
 

Private Attributes

label posX_
 coordinates in the octree structure More...
 
label posY_
 
label posZ_
 
direction level_
 cube level in the octree structure More...
 

Friends

Istreamoperator>> (Istream &, meshOctreeCubeCoordinates &)
 
Ostreamoperator<< (Ostream &, const meshOctreeCubeCoordinates &)
 

Detailed Description

Definition at line 55 of file meshOctreeCubeCoordinates.H.

Constructor & Destructor Documentation

◆ meshOctreeCubeCoordinates() [1/3]

Null constructor.

Definition at line 38 of file meshOctreeCubeCoordinatesI.H.

◆ meshOctreeCubeCoordinates() [2/3]

meshOctreeCubeCoordinates ( const label  posX,
const label  posY,
const label  posZ,
const direction  level 
)
inlineexplicit

Construct from coordinates and level.

Definition at line 47 of file meshOctreeCubeCoordinatesI.H.

◆ meshOctreeCubeCoordinates() [3/3]

copy constructor

Definition at line 61 of file meshOctreeCubeCoordinatesI.H.

◆ ~meshOctreeCubeCoordinates()

Definition at line 108 of file meshOctreeCubeCoordinates.H.

Member Function Documentation

◆ level()

direction level ( ) const
inline

◆ posX()

label posX ( ) const
inline

◆ posY()

label posY ( ) const
inline

◆ posZ()

label posZ ( ) const
inline

◆ refineForPosition()

meshOctreeCubeCoordinates refineForPosition ( const label  i) const
inline

return the coordinates of child cube at the given position

create new boxes in z-order fashion

Definition at line 95 of file meshOctreeCubeCoordinatesI.H.

Referenced by tetCreatorOctree::createTetsAroundEdges(), meshOctreeModifier::ensureCorrectRegularitySons(), meshOctree::findLeavesForCubeVertex(), and meshOctreeAutomaticRefinement::refineSelectedBoxes().

Here is the caller graph for this function:

◆ reduceLevelBy()

meshOctreeCubeCoordinates reduceLevelBy ( const direction  diff) const
inline

return the coordinates of the parent at the level reduced by the given number of levels

Definition at line 118 of file meshOctreeCubeCoordinatesI.H.

References Foam::diff().

Referenced by meshOctreeCubeCoordinates::isPositionInside().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reduceToLevel()

meshOctreeCubeCoordinates reduceToLevel ( const direction  l) const
inline

return the coordinates of the parent at the given level

Definition at line 134 of file meshOctreeCubeCoordinatesI.H.

References Foam::diff().

Referenced by meshOctreeCubeCoordinates::operator<(), meshOctreeCubeCoordinates::operator<=(), meshOctreeCubeCoordinates::operator>(), and meshOctreeCubeCoordinates::operator>=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ increaseToLevelMin()

meshOctreeCubeCoordinates increaseToLevelMin ( const direction  l) const
inline

return the minimal coordinates of the child at the given level

Definition at line 144 of file meshOctreeCubeCoordinatesI.H.

References Foam::diff().

Here is the call graph for this function:

◆ increaseToLevelMax()

meshOctreeCubeCoordinates increaseToLevelMax ( const direction  l) const
inline

return the maximal coordinates of the child at the given level

Definition at line 159 of file meshOctreeCubeCoordinatesI.H.

References Foam::diff().

Here is the call graph for this function:

◆ cubeBox()

void cubeBox ( const boundBox rootBox,
point min,
point max 
) const
inline

return min and max points

Definition at line 174 of file meshOctreeCubeCoordinatesI.H.

References boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by triSurfaceClassifyEdges::checkOrientation(), meshOctreeCube::leavesInBox(), and meshOctreeCreator::refineBoxesContainedInObjects().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertices()

void vertices ( const boundBox rootBox,
FixedList< point, 8 > &  vrt 
) const

calculate vertices

Definition at line 114 of file meshOctreeCubeCoordinatesIntersections.C.

References boundBox::max(), and boundBox::min().

Referenced by meshOctreeAddressing::createOctreePoints(), tetCreatorOctree::createPointsAndAddressing(), and tetCreatorOctree::selectElements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ centre()

point centre ( const boundBox rootBox) const
inline

◆ size()

scalar size ( const boundBox rootBox) const
inline

◆ edgeVertices()

void edgeVertices ( const boundBox rootBox,
FixedList< FixedList< point, 2 >, 12 > &  e 
) const

edges of the cube

Definition at line 137 of file meshOctreeCubeCoordinatesIntersections.C.

References Foam::e.

◆ intersectsTriangle()

bool intersectsTriangle ( const triSurf surface,
const boundBox rootBox,
const label  tI 
) const

check if the surface triangle intersects the cube

calculate the bound box of the octree cube

calculate the bounding box of the triangle

Definition at line 153 of file meshOctreeCubeCoordinatesIntersections.C.

References Vector< Cmpt >::max, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), and points.

Here is the call graph for this function:

◆ intersectsTriangleExact()

bool intersectsTriangleExact ( const triSurf surface,
const boundBox rootBox,
const label  tI 
) const

check if any of the vertices is in the cube

check if any edges of the triangle intersect the cube

check if any cube edges intersects the triangle

Definition at line 187 of file meshOctreeCubeCoordinatesIntersections.C.

References Foam::help::boundBoxLineIntersection(), Foam::e, edge::end(), forAll, boundBox::max(), boundBox::min(), points, s(), edge::start(), and Foam::help::triLineIntersection().

Referenced by meshOctreeCreator::refineBoxesIntersectingSurfaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isVertexInside()

bool isVertexInside ( const boundBox rootBox,
const point p 
) const

is a vertex inside the cube

Definition at line 244 of file meshOctreeCubeCoordinatesIntersections.C.

References boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), and p.

Referenced by meshOctree::findLeafContainingVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPositionInside()

bool isPositionInside ( const meshOctreeCubeCoordinates cc) const

◆ neighbourRange()

void neighbourRange ( meshOctreeCubeCoordinates minCoord,
meshOctreeCubeCoordinates maxCoord 
) const
inline

return the possible range of neighbour boxes one level higher than the current cube. It is useful for parallel octree

Definition at line 223 of file meshOctreeCubeCoordinatesI.H.

References meshOctreeCubeCoordinates::level_, meshOctreeCubeCoordinates::posX_, meshOctreeCubeCoordinates::posY_, and meshOctreeCubeCoordinates::posZ_.

◆ intersectsLine()

bool intersectsLine ( const boundBox rootBox,
const point s,
const point e 
) const

check if the cube intersects a line

check if the cube contains start point or end point

check for intersections of line with the cube faces

x-min face

x-max face

y-min face

y-max face

z-min face

z-min face

Definition at line 309 of file meshOctreeCubeCoordinatesIntersections.C.

References Foam::e, Foam::mag(), boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), s(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by meshOctreeCreator::refineBoxesIntersectingEdgeMeshes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+()

meshOctreeCubeCoordinates operator+ ( const meshOctreeCubeCoordinates cc) const
inline

◆ operator=()

void operator= ( const meshOctreeCubeCoordinates cc)
inline

◆ operator==()

bool operator== ( const meshOctreeCubeCoordinates cc) const
inline

◆ operator!=()

bool operator!= ( const meshOctreeCubeCoordinates cc) const
inline

◆ operator<=()

bool operator<= ( const meshOctreeCubeCoordinates cc) const
inline

◆ operator>=()

bool operator>= ( const meshOctreeCubeCoordinates cc) const
inline

◆ operator<()

bool operator< ( const meshOctreeCubeCoordinates cc) const
inline

◆ operator>()

bool operator> ( const meshOctreeCubeCoordinates cc) const
inline

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream is,
meshOctreeCubeCoordinates cc 
)
friend

Definition at line 521 of file meshOctreeCubeCoordinatesI.H.

◆ operator<<

Ostream& operator<< ( Ostream os,
const meshOctreeCubeCoordinates cc 
)
friend

Definition at line 546 of file meshOctreeCubeCoordinatesI.H.

Field Documentation

◆ posX_

label posX_
private

◆ posY_

label posY_
private

◆ posZ_

label posZ_
private

◆ level_

direction level_
private

◆ edgeNodes_

const label edgeNodes_
static
Initial value:
=
{
{0, 1},
{2, 3},
{4, 5},
{6, 7},
{0, 2},
{1, 3},
{4, 6},
{5, 7},
{0, 4},
{1, 5},
{2, 6},
{3, 7}
}

edge nodes for an octree cube

Definition at line 70 of file meshOctreeCubeCoordinates.H.

Referenced by tetCreatorOctree::createTetsAroundEdges(), tetCreatorOctree::createTetsAroundSplitEdges(), tetCreatorOctree::createTetsFromFacesWithCentreNode(), meshOctreeAddressing::cubesAroundEdge(), meshOctreeAddressing::findEdgeCentre(), and meshOctree::findNeighboursOverEdge().

◆ faceNodes_

const label faceNodes_
static

◆ nodeFaces_

const label nodeFaces_
static
Initial value:
=
{
{0, 2, 4},
{1, 2, 4},
{0, 3, 4},
{1, 3, 4},
{0, 2, 5},
{1, 2, 5},
{0, 3, 5},
{1, 3, 5}
}

node-faces addressing for the cube

Definition at line 76 of file meshOctreeCubeCoordinates.H.

◆ faceEdges_

const label faceEdges_
static
Initial value:
=
{
{8, 6, 10, 4},
{5, 11, 7, 9},
{0, 9, 2, 8},
{10, 3, 11, 1},
{4, 1, 5, 0},
{2, 7, 3, 6}
}

face-edges addressing for the octree cube

Definition at line 79 of file meshOctreeCubeCoordinates.H.

Referenced by meshOctreeAddressing::createOctreeFaces(), and tetCreatorOctree::createTetsFromFacesWithCentreNode().

◆ edgeFaces_

const label edgeFaces_
static
Initial value:
=
{
{2, 4},
{3, 4},
{2, 5},
{3, 5},
{0, 4},
{1, 4},
{0, 5},
{1, 5},
{0, 2},
{1, 2},
{0, 3},
{1, 3}
}

edge-faces addressing for the octree cube

Definition at line 82 of file meshOctreeCubeCoordinates.H.

Referenced by tetCreatorOctree::createTetsFromFacesWithCentreNode().

◆ oppositeFace_

const label oppositeFace_ = {1, 0, 3, 2, 5, 4}
static

return the opposite face of each cube face

Definition at line 85 of file meshOctreeCubeCoordinates.H.


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