Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
triangle2D Class Reference

2-D triangle and queries More...

Inheritance diagram for triangle2D:
Inheritance graph
[legend]
Collaboration diagram for triangle2D:
Collaboration graph
[legend]

Public Member Functions

 triangle2D (const vector2D &a, const vector2D &b, const vector2D &c, const bool orient=false)
 
 triangle2D (const vector &a3d, const vector &b3d, const vector &c3d, const vector &axis1, const vector &axis2, const bool orient=false)
 
label order () const
 
label snapClosePoints (const triangle2D &triB)
 
void interArea (const triangle2D &triB, vector2D &centre, scalar &area) const
 
scalar interArea (const triangle2D &triB) const
 
bool overlaps (const triangle2D &triB) const
 
scalar area () const noexcept
 
vector2D centre () const
 
bool contains (const triangle2D &tri) const
 
bool isSame (const triangle2D &triB) const
 
bool pointInside (const vector2D &p) const
 
- Public Member Functions inherited from FixedList< vector2D, 3 >
void writeEntry (const word &keyword, Ostream &os) const
 
 FixedList ()=default
 
 FixedList (const T &val)
 
 FixedList (const Foam::zero)
 
 FixedList (const T list[N])
 
 FixedList (const FixedList< T, N > &list)
 
 FixedList (FixedList< T, N > &&list)
 
 FixedList (std::initializer_list< T > list)
 
 FixedList (const UList< T > &list)
 
 FixedList (const FixedList< T, AnyNum > &list, const FixedList< label, N > &indices)
 
 FixedList (const UList< T > &list, const FixedList< label, N > &indices)
 
 FixedList (const SLList< T > &list)
 
 FixedList (Istream &is)
 
autoPtr< FixedList< T, N > > clone () const
 
const Tcdata () const noexcept
 
Tdata () noexcept
 
const char * cdata_bytes () const noexcept
 
char * data_bytes () noexcept
 
Tfirst () noexcept
 
const Tfirst () const noexcept
 
Tlast () noexcept
 
const Tlast () const noexcept
 
label fcIndex (const label i) const
 
const TfcValue (const label i) const
 
TfcValue (const label i)
 
label rcIndex (const label i) const
 
const TrcValue (const label i) const
 
TrcValue (const label i)
 
void checkStart (const label start) const
 
void checkSize (const label size) const
 
void checkIndex (const label i) const
 
bool uniform () const
 
label find (const T &val, label pos=0) const
 
label rfind (const T &val, label pos=-1) const
 
bool found (const T &val, label pos=0) const
 
void resize (const label n)
 
void resize_nocopy (const label n)
 
void setSize (const label n)
 
void fill (const T &val)
 
void fill (const Foam::zero)
 
void moveFirst (const label i)
 
void moveLast (const label i)
 
void swapFirst (const label i)
 
void swapLast (const label i)
 
void transfer (FixedList< T, N > &list)
 
Toperator[] (const label i)
 
const Toperator[] (const label i) const
 
void operator= (const T list[N])
 
void operator= (const UList< T > &list)
 
void operator= (const SLList< T > &list)
 
void operator= (std::initializer_list< T > list)
 
void operator= (const T &val)
 
void operator= (const Foam::zero)
 
void operator= (const FixedList< T, N > &list)
 
void operator= (FixedList< T, N > &&list)
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
void swap (FixedList< T, N > &other)
 
bool operator== (const FixedList< T, N > &list) const
 
bool operator!= (const FixedList< T, N > &list) const
 
bool operator< (const FixedList< T, N > &list) const
 
bool operator> (const FixedList< T, N > &list) const
 
bool operator<= (const FixedList< T, N > &list) const
 
bool operator>= (const FixedList< T, N > &list) const
 
IstreamreadList (Istream &is)
 
OstreamwriteList (Ostream &os, const label shortLen=0) const
 

Static Public Member Functions

static void writeOBJ (Ostream &os, const triangle2D &tri, label offset)
 
static label nClosePoints (const triangle2D &triA, const triangle2D &triB)
 
static scalar area (const vector2D &a, const vector2D &b, const vector2D &c)
 
static bool lineSegmentIntersectionPoint (const vector2D &lp1, const vector2D &lp2, const vector2D &sp1, const vector2D &sp2, vector2D &intersection)
 
static bool lineIntersectionPoint (const vector2D &a, const vector2D &b, const vector2D &c, const vector2D &d, vector2D &intersection)
 
static bool lineIntersects (const vector2D &a, const vector2D &b, const vector2D &c, const vector2D &d)
 
- Static Public Member Functions inherited from FixedList< vector2D, 3 >
static const FixedList< T, N > & null ()
 
static std::streamsize size_bytes () noexcept
 
static std::streamsize byteSize ()
 
static constexpr bool empty () noexcept
 
static constexpr label size () noexcept
 
static constexpr unsigned max_size () noexcept
 

Static Public Attributes

static int debug = 0
 
static scalar relTol = 1e-8
 
static scalar absTol = 1e-10
 

Additional Inherited Members

- Public Types inherited from FixedList< vector2D, 3 >
typedef T value_type
 
typedef Tpointer
 
typedef Treference
 
typedef Titerator
 
typedef label size_type
 
typedef label difference_type
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
- Public Attributes inherited from FixedList< vector2D, 3 >
const typedef Tconst_pointer
 
const typedef Tconst_reference
 
const typedef Tconst_iterator
 
- Protected Member Functions inherited from FixedList< vector2D, 3 >
void writeEntry (Ostream &os) const
 

Detailed Description

2-D triangle and queries

Source files

Definition at line 48 of file triangle2D.H.

Constructor & Destructor Documentation

◆ triangle2D() [1/2]

triangle2D ( const vector2D a,
const vector2D b,
const vector2D c,
const bool  orient = false 
)

◆ triangle2D() [2/2]

triangle2D ( const vector a3d,
const vector b3d,
const vector c3d,
const vector axis1,
const vector axis2,
const bool  orient = false 
)

Definition at line 65 of file triangle2D.C.

Member Function Documentation

◆ order()

Foam::label order ( ) const
inline

Definition at line 192 of file triangle2DI.H.

References Foam::mag(), and Foam::sign().

Referenced by triangle2D::interArea().

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

◆ writeOBJ()

void writeOBJ ( Ostream os,
const triangle2D tri,
label  offset 
)
inlinestatic

Definition at line 26 of file triangle2DI.H.

References Foam::endl(), Foam::nl, and os().

Here is the call graph for this function:

◆ nClosePoints()

Foam::label nClosePoints ( const triangle2D triA,
const triangle2D triB 
)
inlinestatic

Definition at line 45 of file triangle2DI.H.

References forAll, and Foam::stringOps::match().

Here is the call graph for this function:

◆ area() [1/2]

Foam::scalar area ( const vector2D a,
const vector2D b,
const vector2D c 
)
inlinestatic

Definition at line 72 of file triangle2DI.H.

References Foam::constant::physicoChemical::b, Foam::constant::universal::c, and Vector2D< Cmpt >::perp().

Here is the call graph for this function:

◆ lineSegmentIntersectionPoint()

bool lineSegmentIntersectionPoint ( const vector2D lp1,
const vector2D lp2,
const vector2D sp1,
const vector2D sp2,
vector2D intersection 
)
inlinestatic

Definition at line 94 of file triangle2DI.H.

References Foam::expressions::patchExpr::debug, Foam::endl(), Foam::mag(), Foam::nl, os(), Vector2D< Cmpt >::perp(), s, Vector2D< Cmpt >::x(), and Vector2D< Cmpt >::y().

Here is the call graph for this function:

◆ lineIntersectionPoint()

bool lineIntersectionPoint ( const vector2D a,
const vector2D b,
const vector2D c,
const vector2D d,
vector2D intersection 
)
inlinestatic

◆ lineIntersects()

bool lineIntersects ( const vector2D a,
const vector2D b,
const vector2D c,
const vector2D d 
)
inlinestatic

Definition at line 163 of file triangle2DI.H.

References Foam::constant::physicoChemical::b, Foam::constant::universal::c, DebugInfo, and Foam::endl().

Here is the call graph for this function:

◆ snapClosePoints()

Foam::label snapClosePoints ( const triangle2D triB)

Definition at line 86 of file triangle2D.C.

References forAll, Vector2D< Cmpt >::isClose(), and Foam::stringOps::match().

Referenced by faceAreaWeightAMI2D::storeInterArea().

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

◆ interArea() [1/2]

void interArea ( const triangle2D triB,
vector2D centre,
scalar &  area 
) const

◆ interArea() [2/2]

Foam::scalar interArea ( const triangle2D triB) const

Definition at line 258 of file triangle2D.C.

References Foam::fieldTypes::area, and Foam::Zero.

◆ overlaps()

bool overlaps ( const triangle2D triB) const

Definition at line 269 of file triangle2D.C.

References triangle2D::contains(), and Foam::j1().

Here is the call graph for this function:

◆ area() [2/2]

Foam::scalar area ( ) const
inlinenoexcept

Definition at line 186 of file triangle2DI.H.

◆ centre()

Foam::vector2D centre ( ) const
inline

Definition at line 85 of file triangle2DI.H.

◆ contains()

bool contains ( const triangle2D tri) const
inline

Definition at line 198 of file triangle2DI.H.

Referenced by triangle2D::overlaps().

Here is the caller graph for this function:

◆ isSame()

bool isSame ( const triangle2D triB) const
inline

Definition at line 207 of file triangle2DI.H.

◆ pointInside()

bool pointInside ( const vector2D p) const
inline

Definition at line 218 of file triangle2DI.H.

References p.

Member Data Documentation

◆ debug

int debug = 0
static

Definition at line 63 of file triangle2D.H.

◆ relTol

Foam::scalar relTol = 1e-8
static

Definition at line 66 of file triangle2D.H.

◆ absTol

Foam::scalar absTol = 1e-10
static

Definition at line 69 of file triangle2D.H.


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