Modified nearestFeatureEdge arguments to take standard, sample, distSqr, pointHitIndex. Querying object will use the edge index to lookup supplementary information.

This commit is contained in:
graham
2009-04-23 18:22:08 +01:00
parent 423ed7be7e
commit cf10cbbd6f
2 changed files with 9 additions and 27 deletions

View File

@ -117,6 +117,7 @@ Foam::featureEdgeMesh::featureEdgeMesh(const IOobject& io)
}
}
Foam::featureEdgeMesh::featureEdgeMesh
(
const surfaceFeatures& sFeat,
@ -618,36 +619,19 @@ Foam::featureEdgeMesh::edgeStatus Foam::featureEdgeMesh::classifyEdge
void Foam::featureEdgeMesh::nearestFeatureEdge
(
const pointField& samples,
scalarField searchDistSqr,
labelList& edgeLabel,
pointField& edgePoint,
List<vectorField>& adjacentNormals
const scalarField& searchDistSqr,
List<pointIndexHit>& info
) const
{
edgeLabel.setSize(samples.size());
edgePoint.setSize(samples.size());
adjacentNormals.setSize(samples.size());
info.setSize(samples.size());
forAll(samples, i)
{
const point& sample = samples[i];
pointIndexHit pHit = edgeTree().findNearest
info[i] = edgeTree().findNearest
(
sample,
samples[i],
searchDistSqr[i]
);
if (!pHit.hit())
{
edgeLabel[i] = -1;
}
else
{
edgeLabel[i] = pHit.index();
edgePoint[i] = pHit.hitPoint();
adjacentNormals[i] = edgeNormals(edgeLabel[i]);
}
}
}

View File

@ -224,10 +224,8 @@ public:
void nearestFeatureEdge
(
const pointField& samples,
scalarField searchDistSqr,
labelList& edgeLabel,
pointField& edgePoint,
List<vectorField>& adjacentNormals
const scalarField& searchDistSqr,
List<pointIndexHit>& info
) const;
// Access
@ -279,7 +277,7 @@ public:
// Write
//- Write all components of the featureEdgeMesh as obj files
void writeObj(const fileName& fName) const;
void writeObj(const fileName& prefix) const;
// //- ReadData function required for regIOobject read operation
// virtual bool readData(Istream&);