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 Foam::featureEdgeMesh::featureEdgeMesh
( (
const surfaceFeatures& sFeat, const surfaceFeatures& sFeat,
@ -618,36 +619,19 @@ Foam::featureEdgeMesh::edgeStatus Foam::featureEdgeMesh::classifyEdge
void Foam::featureEdgeMesh::nearestFeatureEdge void Foam::featureEdgeMesh::nearestFeatureEdge
( (
const pointField& samples, const pointField& samples,
scalarField searchDistSqr, const scalarField& searchDistSqr,
labelList& edgeLabel, List<pointIndexHit>& info
pointField& edgePoint,
List<vectorField>& adjacentNormals
) const ) const
{ {
edgeLabel.setSize(samples.size()); info.setSize(samples.size());
edgePoint.setSize(samples.size());
adjacentNormals.setSize(samples.size());
forAll(samples, i) forAll(samples, i)
{ {
const point& sample = samples[i]; info[i] = edgeTree().findNearest
pointIndexHit pHit = edgeTree().findNearest
( (
sample, samples[i],
searchDistSqr[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 void nearestFeatureEdge
( (
const pointField& samples, const pointField& samples,
scalarField searchDistSqr, const scalarField& searchDistSqr,
labelList& edgeLabel, List<pointIndexHit>& info
pointField& edgePoint,
List<vectorField>& adjacentNormals
) const; ) const;
// Access // Access
@ -279,7 +277,7 @@ public:
// Write // Write
//- Write all components of the featureEdgeMesh as obj files //- 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 // //- ReadData function required for regIOobject read operation
// virtual bool readData(Istream&); // virtual bool readData(Istream&);