Commit f443931e authored by laurence's avatar laurence
Browse files

ENH: Make set an autoPtr. Remove flip switch.

parent 9f61b912
......@@ -761,7 +761,7 @@ int main(int argc, char *argv[])
// Either construct features from surface & featureAngle or read set.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
surfaceFeatures set(surf);
autoPtr<surfaceFeatures> set;
scalar includedAngle = -1;
......@@ -781,7 +781,7 @@ int main(int argc, char *argv[])
Info<< nl << "Reading existing feature edges from file "
<< featureEdgeFile << endl;
set = surfaceFeatures(surf, eMesh.points(), eMesh.edges());
set.set(new surfaceFeatures(surf, eMesh.points(), eMesh.edges()));
}
else if (extractionMethod == "extractFromSurface")
{
......@@ -796,7 +796,7 @@ int main(int argc, char *argv[])
Info<< nl << "Constructing feature set from included angle "
<< includedAngle << endl;
set = surfaceFeatures(surf, includedAngle);
set.set(new surfaceFeatures(surf, includedAngle));
}
else
{
......@@ -807,16 +807,6 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
Info<< nl
<< "Initial feature set:" << nl
<< " feature points : " << set.featurePoints().size() << nl
<< " feature edges : " << set.featureEdges().size() << nl
<< " of which" << nl
<< " region edges : " << set.nRegionEdges() << nl
<< " external edges : " << set.nExternalEdges() << nl
<< " internal edges : " << set.nInternalEdges() << nl
<< endl;
// Trim set
// ~~~~~~~~
......@@ -838,7 +828,7 @@ int main(int argc, char *argv[])
Info<< "Removing features with number of edges < "
<< minElem << endl;
set.trimFeatures(minLen, minElem);
set().trimFeatures(minLen, minElem);
}
}
......@@ -847,7 +837,7 @@ int main(int argc, char *argv[])
// ~~~~~~
// Convert to marked edges, points
List<surfaceFeatures::edgeStatus> edgeStat(set.toStatus());
List<surfaceFeatures::edgeStatus> edgeStat(set().toStatus());
if (surfaceDict.isDict("subsetFeatures"))
{
......@@ -940,6 +930,16 @@ int main(int argc, char *argv[])
surfaceFeatures newSet(surf);
newSet.setFromStatus(edgeStat);
Info<< nl
<< "Initial feature set:" << nl
<< " feature points : " << newSet.featurePoints().size() << nl
<< " feature edges : " << newSet.featureEdges().size() << nl
<< " of which" << nl
<< " region edges : " << newSet.nRegionEdges() << nl
<< " external edges : " << newSet.nExternalEdges() << nl
<< " internal edges : " << newSet.nInternalEdges() << nl
<< endl;
//if (writeObj)
//{
// newSet.writeObj("final");
......@@ -956,17 +956,10 @@ int main(int argc, char *argv[])
if (surfaceDict.isDict("addFeatures"))
{
const dictionary& subsetDict = surfaceDict.subDict
(
"addFeatures"
);
const word addFeName = subsetDict["name"];
const word addFeName = surfaceDict.subDict("addFeatures")["name"];
Info<< "Adding (without merging) features from " << addFeName
<< nl << endl;
const Switch flip = subsetDict["flip"];
extendedFeatureEdgeMesh addFeMesh
(
IOobject
......@@ -982,14 +975,6 @@ int main(int argc, char *argv[])
Info<< "Read " << addFeMesh.name() << nl;
writeStats(addFeMesh, Info);
if (flip)
{
Info<< "Flipping " << addFeMesh.name() << endl;
addFeMesh.flipNormals();
Info<< "After flipping " << addFeMesh.name() << nl;
writeStats(addFeMesh, Info);
}
feMesh.add(addFeMesh);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment