ENH: Add findAllNearestEdges to conformationSurfaces (calls extendedFeatureEdgeMesh)

This commit is contained in:
laurence
2012-01-17 16:19:33 +00:00
parent c618e6a9d3
commit 34e088b228
2 changed files with 53 additions and 1 deletions

View File

@ -729,6 +729,48 @@ void Foam::conformationSurfaces::findEdgeNearestByType
}
}
void Foam::conformationSurfaces::findAllNearestEdges
(
const point& sample,
const scalar searchRadiusSqr,
List<List<pointIndexHit> >& edgeHitsByFeature,
List<label>& featuresHit
) const
{
// Initialise
//featuresHit.setSize(features_.size());
//featuresHit = -1;
//edgeHitsByFeature.setSize(features_.size());
// Work arrays
List<pointIndexHit> hitInfo(extendedFeatureEdgeMesh::nEdgeTypes);
forAll(features_, testI)
{
features_[testI].allNearestFeatureEdges
(
sample,
searchRadiusSqr,
hitInfo
);
bool anyHit = false;
forAll(hitInfo, hitI)
{
if (hitInfo[hitI].hit())
{
anyHit = true;
}
}
if (anyHit)
{
edgeHitsByFeature.append(hitInfo);
featuresHit.append(testI);
}
}
}
void Foam::conformationSurfaces::writeFeatureObj(const fileName& prefix) const
{

View File

@ -270,7 +270,17 @@ public:
const point& sample,
scalar nearestDistSqr,
List<pointIndexHit>& edgeHit,
List<label>& featureHit
List<label>& featuresHit
) const;
//- Find the nearest points on each feature edge that is within
// a given distance from the sample point
void findAllNearestEdges
(
const point& sample,
const scalar searchRadiusSqr,
List<List<pointIndexHit> >& edgeHitsByFeature,
List<label>& featuresHit
) const;
//- Find which patch is intersected by the line from one point to