Skip to content
Snippets Groups Projects
Commit f443931e authored by laurence's avatar laurence
Browse files

ENH: Make set an autoPtr. Remove flip switch.

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