mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Add extra octree functionality
+ Make intersection and nearest functions functors. This makes adding different intersection and nearest routines easier. + treeDataPrimitivePatch takes its tolerance as a constructor argument + Make treeDataTriSurface a typedef of treeDataPrimitivePatch Conflicts: src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C src/meshTools/indexedOctree/treeDataTriSurface.C
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -80,6 +80,56 @@ class treeDataCell
|
||||
|
||||
public:
|
||||
|
||||
|
||||
class findNearestOp
|
||||
{
|
||||
const indexedOctree<treeDataCell>& tree_;
|
||||
|
||||
public:
|
||||
|
||||
findNearestOp(const indexedOctree<treeDataCell>& tree);
|
||||
|
||||
void operator()
|
||||
(
|
||||
const labelUList& indices,
|
||||
const point& sample,
|
||||
|
||||
scalar& nearestDistSqr,
|
||||
label& minIndex,
|
||||
point& nearestPoint
|
||||
) const;
|
||||
|
||||
void operator()
|
||||
(
|
||||
const labelUList& indices,
|
||||
const linePointRef& ln,
|
||||
|
||||
treeBoundBox& tightest,
|
||||
label& minIndex,
|
||||
point& linePoint,
|
||||
point& nearestPoint
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
class findIntersectOp
|
||||
{
|
||||
const indexedOctree<treeDataCell>& tree_;
|
||||
|
||||
public:
|
||||
|
||||
findIntersectOp(const indexedOctree<treeDataCell>& tree);
|
||||
|
||||
bool operator()
|
||||
(
|
||||
const label index,
|
||||
const point& start,
|
||||
const point& end,
|
||||
point& intersectionPoint
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// Declare name of the class and its debug switch
|
||||
ClassName("treeDataCell");
|
||||
|
||||
@ -173,49 +223,6 @@ public:
|
||||
const label index,
|
||||
const point& sample
|
||||
) const;
|
||||
|
||||
//- Calculates nearest (to sample) point in shape.
|
||||
// Returns actual point and distance (squared)
|
||||
void findNearest
|
||||
(
|
||||
const labelUList& indices,
|
||||
const point& sample,
|
||||
|
||||
scalar& nearestDistSqr,
|
||||
label& nearestIndex,
|
||||
point& nearestPoint
|
||||
) const;
|
||||
|
||||
//- Calculates nearest (to line) point in shape.
|
||||
// Returns point and distance (squared)
|
||||
void findNearest
|
||||
(
|
||||
const labelUList& indices,
|
||||
const linePointRef& ln,
|
||||
|
||||
treeBoundBox& tightest,
|
||||
label& minIndex,
|
||||
point& linePoint,
|
||||
point& nearestPoint
|
||||
) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"treeDataCell::findNearest"
|
||||
"(const labelUList&, const linePointRef&, ..)"
|
||||
);
|
||||
}
|
||||
|
||||
//- Calculate intersection of shape with ray. Sets result
|
||||
// accordingly
|
||||
bool intersects
|
||||
(
|
||||
const label index,
|
||||
const point& start,
|
||||
const point& end,
|
||||
point& result
|
||||
) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user