sampledPlane, plane: standardize the selection of the plane type
This commit is contained in:
parent
fdb4f37148
commit
c6200ea25e
@ -201,14 +201,14 @@ Foam::plane::plane(const dictionary& dict)
|
||||
const dictionary& subDict = dict.subDict("pointAndNormalDict");
|
||||
|
||||
point_ =
|
||||
subDict.found("point")
|
||||
? subDict.lookup("point")
|
||||
: subDict.lookup("basePoint");
|
||||
subDict.found("basePoint")
|
||||
? subDict.lookup("basePoint")
|
||||
: subDict.lookup("point");
|
||||
|
||||
normal_ =
|
||||
subDict.found("normal")
|
||||
? subDict.lookup("normal")
|
||||
: subDict.lookup("normalVector");
|
||||
subDict.found("normalVector")
|
||||
? subDict.lookup("normalVector")
|
||||
: subDict.lookup("normal");
|
||||
|
||||
normal_ /= mag(normal_);
|
||||
}
|
||||
|
@ -118,6 +118,7 @@ protected:
|
||||
//- Construct plane description without cutting
|
||||
cuttingPlane(const plane&);
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Recut mesh with existing planeDesc, restricted to a list of cells
|
||||
|
@ -71,24 +71,12 @@ Foam::sampledPlane::sampledPlane
|
||||
)
|
||||
:
|
||||
sampledSurface(name, mesh, dict),
|
||||
cuttingPlane
|
||||
(
|
||||
plane
|
||||
(
|
||||
dict.found("point")
|
||||
? dict.lookup("point")
|
||||
: dict.lookup("basePoint"),
|
||||
|
||||
dict.found("normal")
|
||||
? dict.lookup("normal")
|
||||
: dict.lookup("normalVector")
|
||||
)
|
||||
),
|
||||
cuttingPlane(plane(dict)),
|
||||
zoneKey_(keyType::null),
|
||||
triangulate_(dict.lookupOrDefault("triangulate", true)),
|
||||
needsUpdate_(true)
|
||||
{
|
||||
// make plane relative to the coordinateSystem (Cartesian)
|
||||
// Make plane relative to the coordinateSystem (Cartesian)
|
||||
// allow lookup from global coordinate systems
|
||||
if (dict.found("coordinateSystem"))
|
||||
{
|
||||
@ -97,7 +85,7 @@ Foam::sampledPlane::sampledPlane
|
||||
point base = cs.globalPosition(planeDesc().refPoint());
|
||||
vector norm = cs.globalVector(planeDesc().normal());
|
||||
|
||||
// assign the plane description
|
||||
// Assign the plane description
|
||||
static_cast<plane&>(*this) = plane(base, norm);
|
||||
}
|
||||
|
||||
@ -127,7 +115,7 @@ bool Foam::sampledPlane::needsUpdate() const
|
||||
|
||||
bool Foam::sampledPlane::expire()
|
||||
{
|
||||
// already marked as expired
|
||||
// Already marked as expired
|
||||
if (needsUpdate_)
|
||||
{
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user