/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
inline CGAL::indexedVertex::indexedVertex()
:
Vb(),
index_(INTERNAL_POINT),
type_(INTERNAL_POINT)
{}
template
inline CGAL::indexedVertex::indexedVertex(const Point& p)
:
Vb(p),
index_(INTERNAL_POINT),
type_(INTERNAL_POINT)
{}
template
inline CGAL::indexedVertex::indexedVertex
(
const Point& p,
const int index,
const int& type
)
:
Vb(p),
index_(index),
type_(type)
{}
template
inline CGAL::indexedVertex::indexedVertex(const Point& p, Face_handle f)
:
Vb(f, p),
index_(INTERNAL_POINT),
type_(INTERNAL_POINT)
{}
template
inline CGAL::indexedVertex::indexedVertex(Face_handle f)
:
Vb(f),
index_(INTERNAL_POINT),
type_(INTERNAL_POINT)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
inline int& CGAL::indexedVertex::index()
{
return index_;
}
template
inline int CGAL::indexedVertex::index() const
{
return index_;
}
template
inline int& CGAL::indexedVertex::type()
{
return type_;
}
template
inline int CGAL::indexedVertex::type() const
{
return type_;
}
template
inline bool CGAL::indexedVertex::farPoint() const
{
return type_ == FAR_POINT;
}
template
inline bool CGAL::indexedVertex::internalPoint() const
{
return type_ <= INTERNAL_POINT;
}
template
inline bool CGAL::indexedVertex::nearBoundary() const
{
return type_ == NEAR_BOUNDARY_POINT;
}
template
inline void CGAL::indexedVertex::setNearBoundary()
{
type_ = NEAR_BOUNDARY_POINT;
}
template
inline bool CGAL::indexedVertex::mirrorPoint() const
{
return type_ == MIRROR_POINT;
}
template
inline bool CGAL::indexedVertex::pairPoint() const
{
return type_ >= 0;
}
template
inline bool CGAL::indexedVertex::ppMaster() const
{
if (type_ > index_)
{
return true;
}
else
{
return false;
}
}
template
inline bool CGAL::indexedVertex::ppSlave() const
{
if (type_ >= 0 && type_ < index_)
{
return true;
}
else
{
return false;
}
}
template
inline bool CGAL::indexedVertex::internalOrBoundaryPoint() const
{
return internalPoint() || ppMaster();
}
template
inline bool CGAL::indexedVertex::nearOrOnBoundary() const
{
return pairPoint() || mirrorPoint() || nearBoundary();
}
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
template
bool CGAL::pointPair
(
const indexedVertex& v0,
const indexedVertex& v1
)
{
return v0.index_ == v1.type_ || v1.index_ == v0.type_;
}
template
bool CGAL::boundaryTriangle
(
const indexedVertex& v0,
const indexedVertex& v1,
const indexedVertex& v2
)
{
return (v0.pairPoint() && pointPair(v1, v2))
|| (v1.pairPoint() && pointPair(v2, v0))
|| (v2.pairPoint() && pointPair(v0, v1));
}
template
bool CGAL::outsideTriangle
(
const indexedVertex& v0,
const indexedVertex& v1,
const indexedVertex& v2
)
{
return (v0.farPoint() || v0.ppSlave())
|| (v1.farPoint() || v1.ppSlave())
|| (v2.farPoint() || v2.ppSlave());
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //