mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0028403: Avoid useless calls to BRepTools::Write()
Useless writes of intermediate shapes to hardcoded paths are removed in samples\mfc\standard\02_Modeling\src\ModelingDoc.cpp Methods IGESBRep::WriteShape(), XSControl_Utils::WriteShape() are deleted; BRepTools::Write() can be used instead. Method TopOpeBRepBuild_Tools::DumpMapOfShapeWithState() is moved to where it is used -- TopOpeBRepBuild_Builder1_1.cxx as static function (commented out). Unused DRAW command OCC18612 is removed. Upgrade Guide is corrected to avoid Doxygen warnings.
This commit is contained in:
@@ -85,7 +85,6 @@ static TopTools_MapOfShape theUnkStateVer;
|
||||
|
||||
extern Standard_Boolean GLOBAL_faces2d;
|
||||
|
||||
//modified by NIZNHY-PKV Mon Dec 16 11:38:55 2002 f
|
||||
//=======================================================================
|
||||
//function : ~TopOpeBRepBuild_Builder1
|
||||
//purpose :
|
||||
@@ -96,7 +95,116 @@ TopOpeBRepBuild_Builder1::~TopOpeBRepBuild_Builder1()
|
||||
theUsedVertexMap.Clear();
|
||||
theUnkStateVer.Clear();
|
||||
}
|
||||
//modified by NIZNHY-PKV Mon Dec 16 11:38:59 2002 t
|
||||
|
||||
/*
|
||||
namespace {
|
||||
|
||||
void DumpMapOfShapeWithState (const Standard_Integer iP,
|
||||
const TopOpeBRepDS_IndexedDataMapOfShapeWithState& aMapOfShapeWithState)
|
||||
{
|
||||
static Standard_Integer cnt=0;
|
||||
TCollection_AsciiString aFName1 ("/DEBUG/TOPOPE/"), postfix;
|
||||
|
||||
Standard_CString ShapeType [9] = {"COMPO", "COMPS", "SOLID", "SHELL", "FACE ", "WIRE ", "EDGE ", "VERTX"};
|
||||
Standard_CString ShapeState[4] = {"IN ", "OUT", "ON ", "UNKNOWN"};
|
||||
|
||||
printf("\n\n********************************\n");
|
||||
printf("* *\n");
|
||||
Standard_Integer i, n=aMapOfShapeWithState.Extent();
|
||||
if (!iP) {
|
||||
printf("* Object comparing with TOOL *\n");
|
||||
postfix=TCollection_AsciiString("Obj");
|
||||
}
|
||||
|
||||
else {
|
||||
printf("* Tool comparing with Object *\n");
|
||||
postfix=TCollection_AsciiString("Tool");
|
||||
}
|
||||
|
||||
printf("* *\n");
|
||||
printf("********************************\n");
|
||||
printf("*** aMapOfShapeWithState.Extent()=%d\n", n);
|
||||
printf(" C O N T E N T S\n");
|
||||
|
||||
TCollection_AsciiString aFName;
|
||||
aFName+=aFName1;
|
||||
aFName+=postfix;
|
||||
|
||||
for (i=1; i<=n; i++) {
|
||||
TCollection_AsciiString aI(i), aName;;
|
||||
aName+=aFName; aName+=aI;
|
||||
|
||||
const TopoDS_Shape& aShape=aMapOfShapeWithState.FindKey(i);
|
||||
const TopOpeBRepDS_ShapeWithState& aShapeWithState=
|
||||
aMapOfShapeWithState.FindFromIndex(i);
|
||||
|
||||
BRepTools::Write (aShape, aName.ToCString());
|
||||
|
||||
TCollection_AsciiString ann;
|
||||
ann+=postfix; ann+=aI;
|
||||
|
||||
printf("Key: %-8s , " , ann.ToCString());
|
||||
printf("%s, ", ShapeType[aShape.ShapeType()]);
|
||||
if (!iP)
|
||||
printf("State comp.with Tool=%s\n", ShapeState[aShapeWithState.State()]);
|
||||
|
||||
else
|
||||
printf("State comp.with Obj =%s\n", ShapeState[aShapeWithState.State()]);
|
||||
|
||||
if (aShapeWithState.IsSplitted()) {
|
||||
|
||||
const TopTools_ListOfShape& aListOfShape=aShapeWithState.Part(TopAbs_IN);
|
||||
TopTools_ListIteratorOfListOfShape anIt(aListOfShape);
|
||||
for (;anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Shape& aS=anIt.Value();
|
||||
|
||||
TCollection_AsciiString cn(cnt), prefix("_S_"), sn;
|
||||
sn+=aFName; sn+=prefix; sn+=cn;
|
||||
BRepTools::Write (aS, sn.ToCString());
|
||||
|
||||
TCollection_AsciiString an;//=postfix+prefix+cn;
|
||||
an+=postfix; an+=prefix; an+=cn;
|
||||
printf(" -> Splitted Part IN : %s\n", an.ToCString());
|
||||
cnt++;
|
||||
}
|
||||
|
||||
const TopTools_ListOfShape& aListOfShapeOut=aShapeWithState.Part(TopAbs_OUT);
|
||||
anIt.Initialize (aListOfShapeOut);
|
||||
for (;anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Shape& aS=anIt.Value();
|
||||
|
||||
TCollection_AsciiString cn(cnt), prefix("_S_"), sn;//=aFName+prefix+cn;
|
||||
sn+=aFName; sn+=prefix; sn+=cn;
|
||||
BRepTools::Write (aS, sn.ToCString());
|
||||
|
||||
TCollection_AsciiString an;//=postfix+prefix+cn;
|
||||
an+=postfix; an+=prefix; an+=cn;
|
||||
printf(" -> Splitted Part OUT: %-s\n", an.ToCString());
|
||||
cnt++;
|
||||
}
|
||||
|
||||
const TopTools_ListOfShape& aListOfShapeOn=aShapeWithState.Part(TopAbs_ON);
|
||||
anIt.Initialize (aListOfShapeOn);
|
||||
for (;anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Shape& aS=anIt.Value();
|
||||
|
||||
TCollection_AsciiString cn(cnt), prefix("_S_"), sn;//=aFName+prefix+cn;
|
||||
sn+=aFName; sn+=prefix; sn+=cn;
|
||||
BRepTools::Write (aS, sn.ToCString());
|
||||
|
||||
TCollection_AsciiString an;//=postfix+prefix+cn;
|
||||
an+=postfix; an+=prefix; an+=cn;
|
||||
printf(" -> Splitted Part ON : %s\n", an.ToCString());
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
cnt=0;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
*/
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformShapeWithStates
|
||||
@@ -252,8 +360,8 @@ TopOpeBRepBuild_Builder1::~TopOpeBRepBuild_Builder1()
|
||||
TopOpeBRepDS_IndexedDataMapOfShapeWithState& aMapOfShapeWithStateTool=
|
||||
aDS.ChangeMapOfShapeWithStateTool();
|
||||
|
||||
TopOpeBRepBuild_Tools::DumpMapOfShapeWithState(0, aMapOfShapeWithStateObj);
|
||||
TopOpeBRepBuild_Tools::DumpMapOfShapeWithState(1, aMapOfShapeWithStateTool);
|
||||
DumpMapOfShapeWithState(0, aMapOfShapeWithStateObj);
|
||||
DumpMapOfShapeWithState(1, aMapOfShapeWithStateTool);
|
||||
*/
|
||||
|
||||
// Phase#2 Phase ON
|
||||
|
@@ -76,116 +76,6 @@
|
||||
//define parameter division number as 10*e^(-PI) = 0.43213918
|
||||
const Standard_Real PAR_T = 0.43213918;
|
||||
|
||||
//=======================================================================
|
||||
//function TopOpeBRepBuild_Tools::DumpMapOfShapeWithState
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TopOpeBRepBuild_Tools::DumpMapOfShapeWithState(const Standard_Integer iP,
|
||||
const TopOpeBRepDS_IndexedDataMapOfShapeWithState&
|
||||
aMapOfShapeWithState)
|
||||
{
|
||||
static Standard_Integer cnt=0;
|
||||
TCollection_AsciiString aFName1 ("/DEBUG/TOPOPE/"), postfix;
|
||||
|
||||
Standard_CString ShapeType [9] = {"COMPO", "COMPS", "SOLID", "SHELL", "FACE ", "WIRE ", "EDGE ", "VERTX"};
|
||||
Standard_CString ShapeState[4] = {"IN ", "OUT", "ON ", "UNKNOWN"};
|
||||
|
||||
printf("\n\n********************************\n");
|
||||
printf("* *\n");
|
||||
Standard_Integer i, n=aMapOfShapeWithState.Extent();
|
||||
if (!iP) {
|
||||
printf("* Object comparing with TOOL *\n");
|
||||
postfix=TCollection_AsciiString("Obj");
|
||||
}
|
||||
|
||||
else {
|
||||
printf("* Tool comparing with Object *\n");
|
||||
postfix=TCollection_AsciiString("Tool");
|
||||
}
|
||||
|
||||
printf("* *\n");
|
||||
printf("********************************\n");
|
||||
printf("*** aMapOfShapeWithState.Extent()=%d\n", n);
|
||||
printf(" C O N T E N T S\n");
|
||||
|
||||
TCollection_AsciiString aFName;
|
||||
aFName+=aFName1;
|
||||
aFName+=postfix;
|
||||
|
||||
for (i=1; i<=n; i++) {
|
||||
TCollection_AsciiString aI(i), aName;;
|
||||
aName+=aFName; aName+=aI;
|
||||
|
||||
const TopoDS_Shape& aShape=aMapOfShapeWithState.FindKey(i);
|
||||
const TopOpeBRepDS_ShapeWithState& aShapeWithState=
|
||||
aMapOfShapeWithState.FindFromIndex(i);
|
||||
|
||||
BRepTools::Write (aShape, aName.ToCString());
|
||||
|
||||
TCollection_AsciiString ann;
|
||||
ann+=postfix; ann+=aI;
|
||||
|
||||
printf("Key: %-8s , " , ann.ToCString());
|
||||
printf("%s, ", ShapeType[aShape.ShapeType()]);
|
||||
if (!iP)
|
||||
printf("State comp.with Tool=%s\n", ShapeState[aShapeWithState.State()]);
|
||||
|
||||
else
|
||||
printf("State comp.with Obj =%s\n", ShapeState[aShapeWithState.State()]);
|
||||
|
||||
if (aShapeWithState.IsSplitted()) {
|
||||
|
||||
const TopTools_ListOfShape& aListOfShape=aShapeWithState.Part(TopAbs_IN);
|
||||
TopTools_ListIteratorOfListOfShape anIt(aListOfShape);
|
||||
for (;anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Shape& aS=anIt.Value();
|
||||
|
||||
TCollection_AsciiString cn(cnt), prefix("_S_"), sn;
|
||||
sn+=aFName; sn+=prefix; sn+=cn;
|
||||
BRepTools::Write (aS, sn.ToCString());
|
||||
|
||||
TCollection_AsciiString an;//=postfix+prefix+cn;
|
||||
an+=postfix; an+=prefix; an+=cn;
|
||||
printf(" -> Splitted Part IN : %s\n", an.ToCString());
|
||||
cnt++;
|
||||
}
|
||||
|
||||
const TopTools_ListOfShape& aListOfShapeOut=aShapeWithState.Part(TopAbs_OUT);
|
||||
anIt.Initialize (aListOfShapeOut);
|
||||
for (;anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Shape& aS=anIt.Value();
|
||||
|
||||
TCollection_AsciiString cn(cnt), prefix("_S_"), sn;//=aFName+prefix+cn;
|
||||
sn+=aFName; sn+=prefix; sn+=cn;
|
||||
BRepTools::Write (aS, sn.ToCString());
|
||||
|
||||
TCollection_AsciiString an;//=postfix+prefix+cn;
|
||||
an+=postfix; an+=prefix; an+=cn;
|
||||
printf(" -> Splitted Part OUT: %-s\n", an.ToCString());
|
||||
cnt++;
|
||||
}
|
||||
|
||||
const TopTools_ListOfShape& aListOfShapeOn=aShapeWithState.Part(TopAbs_ON);
|
||||
anIt.Initialize (aListOfShapeOn);
|
||||
for (;anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Shape& aS=anIt.Value();
|
||||
|
||||
TCollection_AsciiString cn(cnt), prefix("_S_"), sn;//=aFName+prefix+cn;
|
||||
sn+=aFName; sn+=prefix; sn+=cn;
|
||||
BRepTools::Write (aS, sn.ToCString());
|
||||
|
||||
TCollection_AsciiString an;//=postfix+prefix+cn;
|
||||
an+=postfix; an+=prefix; an+=cn;
|
||||
printf(" -> Splitted Part ON : %s\n", an.ToCString());
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
cnt=0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function TopOpeBRepBuild_Tools::FindState
|
||||
//purpose :
|
||||
|
@@ -49,8 +49,6 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT static void DumpMapOfShapeWithState (const Standard_Integer iP, const TopOpeBRepDS_IndexedDataMapOfShapeWithState& aMapOfShapeWithState);
|
||||
|
||||
Standard_EXPORT static void FindState (const TopoDS_Shape& aVertex, const TopAbs_State aState, const TopAbs_ShapeEnum aShapeEnum, const TopTools_IndexedDataMapOfShapeListOfShape& aMapVertexEdges, TopTools_MapOfShape& aMapProcessedVertices, TopOpeBRepDS_DataMapOfShapeState& aMapVs);
|
||||
|
||||
Standard_EXPORT static void PropagateState (const TopOpeBRepDS_DataMapOfShapeState& aSplEdgesState, const TopTools_IndexedMapOfShape& anEdgesToRestMap, const TopAbs_ShapeEnum aShapeEnum1, const TopAbs_ShapeEnum aShapeEnum2, TopOpeBRepTool_ShapeClassifier& aShapeClassifier, TopOpeBRepDS_IndexedDataMapOfShapeWithState& aMapOfShapeWithState, const TopTools_MapOfShape& anUnkStateShapes);
|
||||
|
Reference in New Issue
Block a user