mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: treeDataPoint: work on subset of points
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,6 @@ License
|
||||
#include "treeDataPoint.H"
|
||||
#include "treeBoundBox.H"
|
||||
#include "indexedOctree.H"
|
||||
#include "polyMesh.H"
|
||||
#include "triangleFuncs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -42,6 +41,17 @@ Foam::treeDataPoint::treeDataPoint(const pointField& points)
|
||||
{}
|
||||
|
||||
|
||||
Foam::treeDataPoint::treeDataPoint
|
||||
(
|
||||
const pointField& points,
|
||||
const labelList& pointLabels
|
||||
)
|
||||
:
|
||||
points_(points),
|
||||
pointLabels_(pointLabels)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::pointField Foam::treeDataPoint::points() const
|
||||
@ -69,7 +79,8 @@ bool Foam::treeDataPoint::overlaps
|
||||
const treeBoundBox& cubeBb
|
||||
) const
|
||||
{
|
||||
return cubeBb.contains(points_[index]);
|
||||
label pointI = (pointLabels_.size() ? pointLabels_[index] : index);
|
||||
return cubeBb.contains(points_[pointI]);
|
||||
}
|
||||
|
||||
|
||||
@ -88,8 +99,9 @@ void Foam::treeDataPoint::findNearest
|
||||
forAll(indices, i)
|
||||
{
|
||||
const label index = indices[i];
|
||||
label pointI = (pointLabels_.size() ? pointLabels_[index] : index);
|
||||
|
||||
const point& pt = points_[index];
|
||||
const point& pt = points_[pointI];
|
||||
|
||||
scalar distSqr = magSqr(pt - sample);
|
||||
|
||||
@ -122,8 +134,9 @@ void Foam::treeDataPoint::findNearest
|
||||
forAll(indices, i)
|
||||
{
|
||||
const label index = indices[i];
|
||||
label pointI = (pointLabels_.size() ? pointLabels_[index] : index);
|
||||
|
||||
const point& shapePt = points_[index];
|
||||
const point& shapePt = points_[pointI];
|
||||
|
||||
if (tightest.contains(shapePt))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user