1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025418: Debug output to be limited to OCC development environment

Macros ending on "DEB" are replaced by OCCT_DEBUG across OCCT code; new macros described in documentation.
Macros starting with DEB are changed to start with "OCCT_DEBUG_".
Some code cleaned.
This commit is contained in:
abv
2014-10-28 12:41:04 +03:00
committed by bugmaster
parent a507ffd9d7
commit 0797d9d30a
700 changed files with 3932 additions and 4250 deletions

View File

@@ -54,39 +54,6 @@
#include <TNaming_TranslateTool.hxx>
#include <TopLoc_Datum3D.hxx>
#define BUC60862
#ifdef DEB
//#define MDTV_DEB
//#define MDTV_DEB_FSET
#endif
#ifdef MDTV_DEB
#include <BRepTools.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfOrientedShapeShape.hxx>
static void WriteS(const TopoDS_Shape& shape,
const Standard_CString filename)
{
char buf[256];
if(strlen(filename) > 256) return;
#if defined WNT
strcpy_s (buf, filename);
#else
strcpy (buf, filename);
#endif
char* p = buf;
while (*p) {
if(*p == ':')
*p = '-';
p++;
}
ofstream save (buf);
if(!save)
cout << "File " << buf << " was not created: rdstate = " << save.rdstate() << endl;
save << "DBRep_DrawableShape" << endl << endl;
if(!shape.IsNull()) BRepTools::Write(shape, save);
save.close();
}
#endif
//=======================================================================
//function : MapShapes
//purpose : TNaming
@@ -746,8 +713,6 @@ Standard_OStream& TNaming::Print (const TNaming_NameType NAME, Standard_OStream
return s;
}
#ifdef BUC60862
//=======================================================================
//function : Print
//purpose : Prints UsedShapes.
@@ -756,7 +721,7 @@ Standard_OStream& TNaming::Print (const TNaming_NameType NAME, Standard_OStream
Standard_OStream& TNaming::Print (const TDF_Label& ACCESS, Standard_OStream& s) {
Handle(TNaming_UsedShapes) US;
if (!ACCESS.Root().FindAttribute(TNaming_UsedShapes::GetID(), US)) {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout<<"TNaming::Print(US): Bad access"<<endl;
#endif
return s;
@@ -764,8 +729,6 @@ Standard_OStream& TNaming::Print (const TDF_Label& ACCESS, Standard_OStream& s)
return US->Dump(s);
}
#endif
//=======================================================================
//function : BuildMapIn
//purpose :
@@ -779,7 +742,7 @@ static void BuildMapIn(const TopoDS_Shape& Context, const TopAbs_ShapeEnum StopT
else
aType = (TopAbs_ShapeEnum)(Context.ShapeType()+1);
for (TopExp_Explorer exp(Context,aType); exp.More(); exp.Next()) {
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG
if(!Map.Bind(exp.Current(), Context))
cout << "Not bind = " <<exp.Current().ShapeType() <<endl;
else
@@ -812,7 +775,7 @@ static void BuildMapC0(const TopoDS_Shape& Context, const TopoDS_Shape& C0, cons
TopoDS_Iterator anIt(Context);
while(anIt.More()) {
const TopoDS_Shape& aKey = anIt.Value();
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG
if(!Map.Bind(aKey, C0))
cout << "Not bind = " <<aKey.ShapeType() <<endl;
#else
@@ -836,14 +799,10 @@ static void BuildMapC0(const TopoDS_Shape& Context, const TopoDS_Shape& C0, cons
static void BuildMap(const TopoDS_Shape& Context, const TopAbs_ShapeEnum StopType,
TopTools_DataMapOfOrientedShapeShape& Map)
{
#ifdef MDTV_DEB
TCollection_AsciiString Nam("Cnt_");
Standard_Integer i = 0;
#endif
TopoDS_Iterator anIt(Context);
while(anIt.More()) {
const TopoDS_Shape& aKey = anIt.Value();
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG
if(!Map.Bind(aKey, Context))
cout << "Not bind = " <<aKey.ShapeType() <<endl;
#else
@@ -866,7 +825,7 @@ TopoDS_Shape TNaming::FindUniqueContext(const TopoDS_Shape& Selection, const Top
{
TopTools_DataMapOfOrientedShapeShape aMap;
BuildMap(Context, Selection.ShapeType(), aMap);
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG
TopTools_DataMapIteratorOfDataMapOfOrientedShapeShape it (aMap);
for (;it.More();it.Next()) {
cout <<"FindUniqueContext: Key - " <<it.Key().ShapeType()<< " " << it.Key().TShape() <<" OR = " <<it.Key().Orientation() <<
@@ -934,7 +893,7 @@ TopoDS_Shape TNaming::FindUniqueContextSet(const TopoDS_Shape& Selection, const
aCmp = it.Value();
}
if(n == 1) {
#ifdef MDTV_DEB_FSET
#ifdef OCCT_DEBUG_FSET
cout << "FindUniqueContextSet: n = " << n <<endl;
#endif
return aCmp;

View File

@@ -127,7 +127,7 @@ void TNaming_CopyShape::Translate( const TopoDS_Shape& aShape,
aResult.Orientation(aShape.Orientation());
aResult.Location(TNaming_CopyShape::Translate(aShape.Location(), aMap));
TrTool->UpdateShape(aShape,aResult);
// #ifdef DEB
// #ifdef OCCT_DEBUG
// if(fShar) {
// cout << "=== Shareable shape ===" << endl;
// cout << "aShape Type = " <<(aShape.TShape())->DynamicType() << endl;

View File

@@ -27,7 +27,7 @@
#include <TDF_ChildIterator.hxx>
//#define MDTV_DEB_IDF
#ifdef MDTV_DEB_IDF
#ifdef OCCT_DEBUG_IDF
#include <TCollection_AsciiString.hxx>
#include <TDF_Tool.hxx>
#include <BRepTools.hxx>
@@ -111,7 +111,7 @@ void TNaming_Identifier::Init(const TopoDS_Shape& Context)
AncestorIdentification(Localizer, Context);
return;
}
#ifdef MDTV_DEB_IDF
#ifdef OCCT_DEBUG_IDF
TCollection_AsciiString entry;
TDF_Tool::Entry(NS->Label(), entry);
cout << "Identifier:: (S) Label = " << entry <<endl;
@@ -305,7 +305,7 @@ Standard_Boolean IsImported(const Handle(TNaming_NamedShape)& NS)
if (!it.More()) return 0;
it.Next(); if (!it.More()) return 0;
//plus d un shape.
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<"WARNING IMPORTED"<<endl;
#endif
return 1;

View File

@@ -38,9 +38,9 @@
#include <TopExp_Explorer.hxx>
#define OCC351
#ifdef DEB
#ifdef OCCT_DEBUG
//#define MDTV_DEB_SC
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
#include <TDF_Tool.hxx>
#include <TDF_MapIteratorOfLabelMap.hxx>
@@ -110,7 +110,7 @@ void TNaming_Localizer::FindFeaturesInAncestors
const TopoDS_Shape& Context,
TopTools_MapOfShape& AncInFeature)
{
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
LWrite(S, "Localizer_S.brep");
LWrite(Context, "Localizer_Context.brep");
#endif
@@ -118,14 +118,14 @@ void TNaming_Localizer::FindFeaturesInAncestors
const TopTools_IndexedDataMapOfShapeListOfShape& Anc = Ancestors(Context,S.ShapeType());
if (Anc.Contains(S)) {
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
cout <<"Localizer: S in ancestor" <<endl;
#endif
const TopTools_ListOfShape& L = Anc.FindFromKey(S);
TopTools_ListIteratorOfListOfShape itL(L);
for (; itL.More(); itL.Next()) {
const TopoDS_Shape& AS = itL.Value();
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
LWrite(AS, "Localizer_AS.brep");
#endif
Handle(TNaming_NamedShape) NS = TNaming_Tool::NamedShape(AS,myUS->Label());
@@ -137,7 +137,7 @@ void TNaming_Localizer::FindFeaturesInAncestors
FindFeaturesInAncestors (AS, Context, AncInFeature);
}
else {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<" TNaming_Localization : Failure in the research of ancetres in TDF"<<endl;
#endif
}
@@ -145,7 +145,7 @@ void TNaming_Localizer::FindFeaturesInAncestors
}
else {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<" TNaming_Localization : S n est pas dans le solide"<<endl;//S is not in the solid
#endif
}
@@ -213,7 +213,7 @@ const TopTools_IndexedDataMapOfShapeListOfShape& TNaming_Localizer::Ancestors
TopTools_IndexedDataMapOfShapeListOfShape& Anc = itA.Value();
TopExp_Explorer exp(In,TS);
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
if (!exp.More()) cout <<" TNaming_Localization : Construction ancetres impossible"<<endl;
#endif
const TopoDS_Shape& SS = exp.Current();
@@ -232,7 +232,7 @@ const TopTools_IndexedDataMapOfShapeListOfShape& TNaming_Localizer::Ancestors
TopExp::MapShapesAndAncestors(In, TS, TA, Anc);
}
else {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<" TNaming_Localization : Construction ancetres impossible"<<endl;
#endif
}
@@ -256,7 +256,7 @@ const TopTools_IndexedDataMapOfShapeListOfShape& TNaming_Localizer::Ancestors
TopExp::MapShapesAndAncestors(In, TS, TA, myAncestors.First());
}
else {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<" TNaming_Localization : Construction ancetres impossible"<<endl;
#endif
}
@@ -280,7 +280,7 @@ Standard_Boolean TNaming_Localizer::IsNew (const TopoDS_Shape& S,
return Standard_True;
}
}
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<"TNaming_Localizer:IsNewInLab : Shape n est pas dans le Label."<<endl;
#endif
return Standard_False;
@@ -334,7 +334,7 @@ void TNaming_Localizer::GoBack (const TopoDS_Shape& S,
LBNS.Append (TNaming_Tool::NamedShape(it.Shape(),Lab));
}
else {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<"TNaming_Localizer: Shape modifie sans avoir ete cree"<<endl;
#endif
}
@@ -482,7 +482,7 @@ void TNaming_Localizer::Backward (const Handle(TNaming_NamedShape)& NS,
//purpose :
//=======================================================================
#ifdef DEB
#ifdef OCCT_DEBUG
/*static Standard_Boolean StoreValid (const TopoDS_Shape& S,
const TopTools_MapOfShape& ShapeOfSol,
TopAbs_ShapeEnum TargetType,
@@ -553,7 +553,7 @@ void TNaming_Localizer::FindNeighbourg (const TopoDS_Shape& Sol,
const TopTools_IndexedDataMapOfShapeListOfShape& Anc = Ancestors(Sol,TS);
// szy 30.03.10 to process case when Candidate is of type Vertex
// if (TA == TopAbs_VERTEX) {
//#ifdef DEB
//#ifdef OCCT_DEBUG
// cout <<"construction voisins des vertex impossible"<<endl;
//#endif
// return;
@@ -605,7 +605,7 @@ void TNaming_Localizer::Init(const Handle(TNaming_UsedShapes)& US,
//purpose :
//=======================================================================
#ifdef DEB
#ifdef OCCT_DEBUG
/*static void Explode (TNaming_ShapesSet& Res,
TopAbs_ShapeEnum TS,
TNaming_ShapesSet& ResGoodType)
@@ -734,7 +734,7 @@ void TNaming_Localizer::FindShapeContext (const Handle(TNaming_NamedShape)& NS,
TopoDS_Shape& SC)
{
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
LWrite(S, "FSC_Sel.brep"); LPrintEntry( NS->Label());
#endif
TopTools_ListOfShape aList;
@@ -748,7 +748,7 @@ void TNaming_Localizer::FindShapeContext (const Handle(TNaming_NamedShape)& NS,
Standard_Boolean found = 0;
for(;it.More();it.Next()) {
SC = it.Value();
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
LWrite(SC, "FSC_OldShape.brep");
#endif
if (SC.IsNull()) continue;
@@ -757,7 +757,7 @@ void TNaming_Localizer::FindShapeContext (const Handle(TNaming_NamedShape)& NS,
for (TopExp_Explorer exp(SC,S.ShapeType()); exp.More(); exp.Next()) {
if (exp.Current().IsSame(S)) {
found = 1;
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
cout << "Find Context shape = " << SC.TShape() << "ShapeType = " << SC.ShapeType() <<endl;
#endif
break;
@@ -772,12 +772,12 @@ void TNaming_Localizer::FindShapeContext (const Handle(TNaming_NamedShape)& NS,
if (!SC.IsNull()) {
Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(SC,Father);
if (!aNS.IsNull()) {
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
cout << "FindShapeContext: ";LPrintEntry(aNS->Label());
#endif
if (aNS->Label().Father().FindAttribute(TNaming_NamedShape::GetID(),aNS)) {
TopoDS_Shape aShape;
#ifdef MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
LWriteNSOnLabel(aNS, "FSC");
#endif
TNaming_Iterator anIter(aNS->Label());

View File

@@ -69,7 +69,7 @@
#define BUC60925
#define OCC352
#ifdef DEB_DBGTOOLS_WRITE
#ifdef OCCT_DEBUG_DBGTOOLS_WRITE
//#define OCC355
#define MDTV_DEB
#define MDTV_DEB_OR
@@ -82,12 +82,12 @@
#define MDTV_DEB_ARG
#define MDTV_DEB_SHELL
#endif
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG
#include <TCollection_AsciiString.hxx>
#include <TDF_Tool.hxx>
#include <BRepTools.hxx>
#endif
#ifdef DEB
#ifdef OCCT_DEBUG
#include <TCollection_AsciiString.hxx>
#include <TDF_Tool.hxx>
#include <TDF_ChildIterator.hxx>
@@ -110,7 +110,7 @@ void PrintEntries(const TDF_LabelMap& map)
cout << "LabelEntry = "<< entry << endl;
}
}
#ifdef DEB_DBGTOOLS_WRITE
#ifdef OCCT_DEBUG_DBGTOOLS_WRITE
//=======================================================================
static void DbgTools_Write(const TopoDS_Shape& shape,
const Standard_CString filename)
@@ -176,14 +176,14 @@ static Standard_Boolean ValidArgs(const TNaming_ListOfNamedShape& Args)
for (;it.More();it.Next()) {
const Handle(TNaming_NamedShape)& aNS = it.Value();
if(aNS.IsNull()) {
#ifdef MDTV_DEB_ARG
#ifdef OCCT_DEBUG_ARG
cout << "ValidArgs:: NS (Naming argument) is NULL" <<endl;
#endif
return Standard_False;
}
else
if(aNS->IsEmpty()) {
#ifdef MDTV_DEB_ARG
#ifdef OCCT_DEBUG_ARG
TCollection_AsciiString entry;
TDF_Tool::Entry(aNS->Label(), entry);
cout << "ValidArgs:: Empty NS, Label = " << entry <<endl;
@@ -192,7 +192,7 @@ static Standard_Boolean ValidArgs(const TNaming_ListOfNamedShape& Args)
}
else
if(!aNS->IsValid()) {
#ifdef MDTV_DEB_ARG
#ifdef OCCT_DEBUG_ARG
TCollection_AsciiString entry;
TDF_Tool::Entry(aNS->Label(), entry);
cout << "ValidArgs::Not valid NS Label = " << entry <<endl;
@@ -508,14 +508,14 @@ static Standard_Boolean FindModifUntil (TNaming_NewShapeIterator& it,
const TopoDS_Shape& S,
const Handle(TNaming_NamedShape)& Context)
{
#ifdef MDTV_DEB_MODUN
#ifdef OCCT_DEBUG_MODUN
if(!Context.IsNull())
PrintEntry(Context->Label());
#endif
Standard_Boolean found = Standard_False;
for (; it.More(); it.Next()) {
if (!it.Shape().IsNull()) {
#ifdef MDTV_DEB_MODUN
#ifdef OCCT_DEBUG_MODUN
if(!it.NamedShape().IsNull())
PrintEntry(it.NamedShape()->Label());
#endif
@@ -543,7 +543,7 @@ static void SearchModifUntil (const TDF_LabelMap& /*Valid*/,
TopTools_MapOfShape& theMS)
{
#ifdef MDTV_DEB_MODUN
#ifdef OCCT_DEBUG_MODUN
DbgTools_WriteNSOnLabel(Target, "SMUntil_"); // Target <== generated
Standard_Integer i = 0;
TCollection_AsciiString aGen1("Gens_New_"), aGen2("Gented_Old_"), Und("_");
@@ -552,7 +552,7 @@ static void SearchModifUntil (const TDF_LabelMap& /*Valid*/,
Standard_Boolean found = Standard_False;
for (TNaming_ListIteratorOfListOfNamedShape it(theListOfGenerators); it.More(); it.Next()) {
const Handle(TNaming_NamedShape)& aNS = it.Value();
#ifdef MDTV_DEB_MODUN
#ifdef OCCT_DEBUG_MODUN
i++;
Standard_Integer j = 0;
#endif
@@ -560,7 +560,7 @@ static void SearchModifUntil (const TDF_LabelMap& /*Valid*/,
const TopoDS_Shape& S = itL.NewShape();
found = Standard_False;
#ifdef MDTV_DEB_MODUN
#ifdef OCCT_DEBUG_MODUN
j++;
Standard_Integer k = 0;
TCollection_AsciiString aNam1 = aGen1 + i + Und + j + ".brep";
@@ -570,7 +570,7 @@ static void SearchModifUntil (const TDF_LabelMap& /*Valid*/,
TNaming_Iterator itC (Target);
for (; itC.More(); itC.Next()) { // <- generated
const TopoDS_Shape& OS = itC.OldShape();
#ifdef MDTV_DEB_MODUN
#ifdef OCCT_DEBUG_MODUN
k++;
TCollection_AsciiString aNam2 = aGen2 + i + Und + j + Und + k + ".brep";
DbgTools_Write(OS, aNam2.ToCString());
@@ -579,7 +579,7 @@ static void SearchModifUntil (const TDF_LabelMap& /*Valid*/,
if (OS.IsSame(S)) {
theMS.Add(S);
found = Standard_True;
#ifdef MDTV_DEB_MODUN
#ifdef OCCT_DEBUG_MODUN
cout << aNam2 << " is Same with " << aNam1 <<endl;
#endif
break;
@@ -617,7 +617,7 @@ static Standard_Boolean ModifUntil (const TDF_Label& L,
#endif
TNaming_NamingTool::BuildDescendants (Stop, Forbiden); // fills Forbidden from Stop
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
cout <<"Regenerating ModifUntil => ";
PrintEntry(L);
DbgTools_WriteNSOnLabel(Args.Last(), "ModifUntil-");
@@ -625,7 +625,7 @@ static Standard_Boolean ModifUntil (const TDF_Label& L,
#endif
// all last modifications of the last argument
TNaming_NamingTool::CurrentShape (Valid, Forbiden,Args.Last(),MS);
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
Standard_Integer i(0);
TopTools_MapIteratorOfMapOfShape it(MS);
TCollection_AsciiString aNam("ModifUnti_MS_");
@@ -635,7 +635,7 @@ static Standard_Boolean ModifUntil (const TDF_Label& L,
for (TopTools_MapIteratorOfMapOfShape itM(MS); itM.More(); itM.Next()) {
const TopoDS_Shape& S = itM.Key();
B.Select(S,S);
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
TCollection_AsciiString aName = aNam + ++i + ext;
DbgTools_Write(S, aName.ToCString()) ;
cout << aName.ToCString() << " TS = " << S.TShape()->This() <<endl;
@@ -717,7 +717,7 @@ static Standard_Boolean Intersection (const TDF_Label& L,
TopTools_MapOfShape MS;
TDF_LabelMap Forbiden;
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
if(!Stop.IsNull() && !Stop->Get().IsNull()) {
DbgTools_Write(Stop->Get(), "Ints_Stop.brep");
PrintEntry(Stop->Label());
@@ -729,7 +729,7 @@ static Standard_Boolean Intersection (const TDF_Label& L,
TNaming_NamingTool::BuildDescendants (Stop, Forbiden); // <==<1>
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
cout << "Intersection:: Valid Map: "<<endl;
PrintEntries(Valid);
cout << "Intersection:: Forbidden Map: "<<endl;
@@ -740,7 +740,7 @@ static Standard_Boolean Intersection (const TDF_Label& L,
TopoDS_Shape CS = MakeShape(MS);
TNaming_ShapesSet S(CS,ShapeType); // <==<2>
aListOfAnc.Append(CS);
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
if(!CS.IsNull())
DbgTools_Write(CS, "Int_CS_1.brep");
Standard_Integer i=2;
@@ -754,7 +754,7 @@ static Standard_Boolean Intersection (const TDF_Label& L,
TNaming_NamingTool::CurrentShape (Valid,Forbiden,it.Value(),MS);
CS = MakeShape(MS);
aListOfAnc.Append(CS);
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
TCollection_AsciiString aName = aNam + i++ + ext;
DbgTools_Write(CS, aName.ToCString()) ;
cout <<"Argument " << i << " at ";
@@ -763,7 +763,7 @@ static Standard_Boolean Intersection (const TDF_Label& L,
TNaming_ShapesSet OS(CS,ShapeType);
S.Filter(OS); //<<===<3.2>
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
Standard_Integer j = 1;
TCollection_AsciiString aNam2("SSMap_"), aName3;
TopTools_MapIteratorOfMapOfShape itm(S.Map());
@@ -774,7 +774,7 @@ static Standard_Boolean Intersection (const TDF_Label& L,
#endif
}
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
aNam = "Int_S_";
i =1;
#endif
@@ -797,7 +797,7 @@ static Standard_Boolean Intersection (const TDF_Label& L,
break;
}
}
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
cout <<"Kept: indxE = " << indxE <<" maxENum = " << nbE << " indxW = " <<indxW << " nbW = " <<nbW<<endl;
#endif
Standard_Integer aNbW(0), aCaseW(0);
@@ -838,14 +838,14 @@ static Standard_Boolean Intersection (const TDF_Label& L,
}
}
if(!isOK)
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
for (TopTools_MapIteratorOfMapOfShape itM(S.Map()); itM.More(); itM.Next(),i++) {
#else
for (TopTools_MapIteratorOfMapOfShape itM(S.Map()); itM.More(); itM.Next()) {
#endif
const TopoDS_Shape& S1 = itM.Key();
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
TCollection_AsciiString aName = aNam + i + ext;
DbgTools_Write(S1, aName.ToCString()) ;
#endif
@@ -943,7 +943,7 @@ static Standard_Boolean Union (const TDF_Label& L,
if(isOr)
KeepInList(CS,ShapeType,aListS);
TNaming_ShapesSet S(CS,ShapeType);//fill internal map of shapeset by shapes of the specified type
#ifdef MDTV_DEB_UNN
#ifdef OCCT_DEBUG_UNN
TCollection_AsciiString entry;
TDF_Tool::Entry(it.Value()->Label(), entry);
TCollection_AsciiString Nam("Arg_");
@@ -953,7 +953,7 @@ static Standard_Boolean Union (const TDF_Label& L,
#endif
it.Next();
for (; it.More(); it.Next()) {
#ifdef MDTV_DEB_UNN
#ifdef OCCT_DEBUG_UNN
TDF_Tool::Entry(it.Value()->Label(), entry);
#endif
MS.Clear();
@@ -964,7 +964,7 @@ static Standard_Boolean Union (const TDF_Label& L,
TNaming_ShapesSet OS(CS,ShapeType);
S.Add(OS); //concatenate both shapesets
#ifdef MDTV_DEB_UNN
#ifdef OCCT_DEBUG_UNN
ii++;
TCollection_AsciiString aNm = Nam + entry + "_" + ii + ".brep";
DbgTools_Write(CS, aNm.ToCString());
@@ -983,7 +983,7 @@ static Standard_Boolean Union (const TDF_Label& L,
MS.Clear();
TNaming_NamingTool::CurrentShape (Valid, Forbiden, CNS, MS);
aContext = MakeShape(MS);
#ifdef MDTV_DEB_UNN
#ifdef OCCT_DEBUG_UNN
TCollection_AsciiString anEntry;
TDF_Tool::Entry(ContextLabel, anEntry);
cout << "UNION: Context Label = " << anEntry << endl;
@@ -1000,7 +1000,7 @@ static Standard_Boolean Union (const TDF_Label& L,
TopExp_Explorer anExpl(aContext, ShapeType);
for(;anExpl.More(); anExpl.Next())
aList.Append(anExpl.Current());
#ifdef MDTV_DEB_UNN
#ifdef OCCT_DEBUG_UNN
cout <<"UNION: ShapeType = " << ShapeType << " List ext = " << aList.Extent()<<endl;
TopAbs_ShapeEnum aTyp = TopAbs_SHAPE;
TopTools_MapIteratorOfMapOfShape it1 (S.Map());
@@ -1018,7 +1018,7 @@ static Standard_Boolean Union (const TDF_Label& L,
TopTools_ListIteratorOfListOfShape itl(aList);
for(;itl.More();itl.Next()) {
aCand = itl.Value();
#ifdef MDTV_DEB_UNN
#ifdef OCCT_DEBUG_UNN
DbgTools_Write(aCand, "Cand.brep");
#endif
Standard_Integer num = S.Map().Extent();
@@ -1036,7 +1036,7 @@ static Standard_Boolean Union (const TDF_Label& L,
}
TNaming_Builder B(L);
#ifdef MDTV_DEB_UNN
#ifdef OCCT_DEBUG_UNN
if(!ContextLabel.IsNull()) {
if(found) cout << "UNION: Shape is found in Context" <<endl;
else cout << "UNION: Shape is NOT found in Context" <<endl;
@@ -1058,7 +1058,7 @@ static Standard_Boolean Union (const TDF_Label& L,
aCompoundBuilder.Add(aCompound,itL.Value());
}
TopoDS_Shape aShape = ShapeWithType(aCompound,ShapeType);
#ifdef MDTV_DEB_UNN
#ifdef OCCT_DEBUG_UNN
DbgTools_Write(aShape, "Union_Selected.brep");
DbgTools_Write(aCompound, "Union_Compound.brep");
#endif
@@ -1139,7 +1139,7 @@ static Standard_Boolean Generated (const TDF_Label& L,
#endif
TDF_Label LabelOfGeneration = Args.First()->Label();
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
DbgTools_Write(Args.First()->Get(), "Generated.brep") ;
#endif
// Nouvell valeurs des generateurs dans l attribut de generation
@@ -1147,7 +1147,7 @@ static Standard_Boolean Generated (const TDF_Label& L,
TNaming_ListOfNamedShape aGenerators;
aGenerators.Assign(Args);
aGenerators.RemoveFirst();
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
DbgTools_Write(aGenerators.First()->Get(), "Generators.brep") ;
#endif
SearchModifUntil (Valid, Args.First(), aGenerators, aMS);
@@ -1156,7 +1156,7 @@ static Standard_Boolean Generated (const TDF_Label& L,
L.FindAttribute(TNaming_Naming::GetID(),aNaming);
if(!aNaming.IsNull())
aSelection = aNaming->GetName().Shape();
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
DbgTools_Write(aSelection, "G_Selection.brep") ;
cout << "Generated::SearchModifUntil aMS.Extent() = " << aMS.Extent() <<endl;
DbgTools_Write(aMS, "SearchModifUntil_Result");
@@ -1167,7 +1167,7 @@ static Standard_Boolean Generated (const TDF_Label& L,
if(!anOldNS.IsNull())
aVer = anOldNS->Version();
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
Standard_Integer i = 0, j=1;
TCollection_AsciiString aNam2("Gen_New_");
TCollection_AsciiString aNam1("Gen_Old_");
@@ -1178,7 +1178,7 @@ static Standard_Boolean Generated (const TDF_Label& L,
TNaming_DataMapOfShapeMapOfShape aDM;
for (TopTools_MapIteratorOfMapOfShape itMS(aMS); itMS.More(); itMS.Next()) {
const TopoDS_Shape& OS = itMS.Key();
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
TCollection_AsciiString aName = aNam1 + ++i + ext;
DbgTools_Write(OS, aName.ToCString()) ;
Standard_Integer j=0;
@@ -1188,7 +1188,7 @@ static Standard_Boolean Generated (const TDF_Label& L,
if (itNew.Label() == LabelOfGeneration) {
aMapDM.Add(itNew.Shape());
aList.Append(itNew.Shape());//szy 21.10.03
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
TCollection_AsciiString aName = aNam2 + i + "_" + ++j + ext;
DbgTools_Write(itNew.Shape(), aName.ToCString()) ;
#endif
@@ -1232,16 +1232,16 @@ static Standard_Boolean Generated (const TDF_Label& L,
Standard_Boolean found = Standard_False;
TopoDS_Shape aShape = FindShape(aDM);
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
if(!aShape.IsNull())
DbgTools_Write(aShape, "G_FindShape.brep") ;
#endif
if(!aShape.IsNull()) found = Standard_True;
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
cout << "Generated ==>aGenerators.Extent() = " <<aGenerators.Extent() <<" aMS.Extent()= " <<aMS.Extent()<<endl;
#endif
if(found) {
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
cout << "Generated ==> Shape is found!" <<endl;
#endif
TopTools_ListOfShape aLM;
@@ -1249,7 +1249,7 @@ static Standard_Boolean Generated (const TDF_Label& L,
Standard_Boolean a1NB = Standard_False;
if(aGenerators.Extent() != aMS.Extent()) { //missed generators
aHas = Standard_True;//has lost generatos
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
cout << "Generated ==> has lost generatos!" <<endl;
#endif
for (TNaming_ListIteratorOfListOfNamedShape itg(aGenerators); itg.More(); itg.Next()) {
@@ -1309,7 +1309,7 @@ static Standard_Boolean Generated (const TDF_Label& L,
}
} else
{ //not found
#ifdef MDTV_DEB_GEN
#ifdef OCCT_DEBUG_GEN
cout << "Generated ==> Shape is NOT found! Probably Compound will be built" <<endl;
#endif
@@ -1347,7 +1347,7 @@ static Standard_Boolean Identity (const TDF_Label& L,
TopTools_MapOfShape MS;
TDF_LabelMap Forbiden;
TNaming_NamingTool::CurrentShape (Valid,Forbiden,A,MS);
#ifdef MDTV_DEB_SOL2
#ifdef OCCT_DEBUG_SOL2
//TCollection_AsciiString entry;
//TDF_Tool::Entry(L, entry);
//TDF_Tool::Entry(A->Label(), entry);
@@ -1359,7 +1359,7 @@ static Standard_Boolean Identity (const TDF_Label& L,
#else
const TopoDS_Shape& S = itM.Key();
#endif
#ifdef MDTV_DEB_SOL2
#ifdef OCCT_DEBUG_SOL2
//TopAbs_Orientation Or = S.Orientation();
#endif
B.Select(S,S);
@@ -1395,7 +1395,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
//----------------------------------------
Handle(TNaming_NamedShape) Cand = Args.First(); //collection of candidates
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
Standard_Integer i = 1;
TCollection_AsciiString aNam("Cand_");
TCollection_AsciiString ext(".brep");
@@ -1409,7 +1409,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
TopTools_MapOfShape SCand;
TNaming_NamingTool::CurrentShape (Valid, Forbiden,Cand,SCand);//fills SCand with last modifications of Cand. CandNS should be at the same level (before) as NS of FilterByNBS
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
TCollection_AsciiString aNam2("SCand");
DbgTools_Write(SCand, aNam2.ToCString());
cout <<"SCand Extent = " << SCand.Extent() << " Expected ShapeType = " << ShapeType << endl;
@@ -1423,7 +1423,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
if (ShapeType == TopAbs_EDGE) TC = TopAbs_VERTEX;
if (ShapeType == TopAbs_VERTEX) TC = TopAbs_VERTEX; // szy 31.03.10 - to process case when Candidate is of type Vertex
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
i=1;
aNam = "Boundaries";
#endif
@@ -1447,7 +1447,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
else //#
for (TopExp_Explorer exp(S,TC); exp.More(); exp.Next()) { //put boundaries of each candidate (from SCand) to the Boundaries map
Boundaries.Add (exp.Current());
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
TCollection_AsciiString aName = aNam + i++ + ext;
DbgTools_Write(exp.Current(), aName.ToCString()) ;
#endif
@@ -1456,7 +1456,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
TNaming_ListIteratorOfListOfNamedShape it(Args);
it.Next();
Standard_Boolean Keep = 1;
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
cout <<"Args number = " << Args.Extent() <<endl;
i=1;
aNam = "Boundaries";
@@ -1469,14 +1469,14 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
// of each neighbor.
const Handle(TNaming_NamedShape)& NSVois = it.Value(); //neighbor
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
DbgTools_WriteNSOnLabel(NSVois, "Next_Neighbor_") ;
#endif
TopTools_MapOfShape SVois;
TNaming_NamingTool::CurrentShape (Valid, Forbiden,NSVois,SVois); // fills SVois with last modifications of NSVois
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
TCollection_AsciiString aNam2("SVois");
DbgTools_Write(SVois, aNam2.ToCString());
#endif
@@ -1486,7 +1486,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
for (TopExp_Explorer exp1(Vois,TC); exp1.More(); exp1.Next()) { //7
if (Boundaries.Contains(exp1.Current())) {
Connected = Standard_True; // has common boundaries with candidate shape
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
DbgTools_Write(Vois, "Neighbor_Connected.brep");
#endif
break;
@@ -1502,7 +1502,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
if (Keep) {
B.Select (S,S);
isDone = Standard_True;
#ifdef MDTV_DEB_FNB
#ifdef OCCT_DEBUG_FNB
DbgTools_Write(S, "FilterByNbs_Sel.brep") ;
#endif
}
@@ -1513,7 +1513,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L,
//=======================================================================
static const TopoDS_Shape FindSubShapeInAncestor(const TopoDS_Shape& Selection, const TopoDS_Shape& Context )
{
#ifdef MDTV_DEB_OR_AG
#ifdef OCCT_DEBUG_OR_AG
DbgTools_Write(Selection, "Orientation_Selection.brep");
DbgTools_Write(Context, "Orientation_Context.brep");
TopExp_Explorer expl1(Context, Selection.ShapeType());
@@ -1531,7 +1531,7 @@ static const TopoDS_Shape FindSubShapeInAncestor(const TopoDS_Shape& Selection,
if(Selection.ShapeType() != TopAbs_COMPOUND) {
TopExp_Explorer anExpl(Context, Selection.ShapeType());
for(;anExpl.More(); anExpl.Next()) {
#ifdef MDTV_DEB_OR_AG
#ifdef OCCT_DEBUG_OR_AG
cout <<"FindSubShape: = " <<anExpl.Current().ShapeType() << " TS = " <<anExpl.Current().TShape()->This() << endl;
DbgTools_Write(anExpl.Current(), "Orientation_Current.brep");
#endif
@@ -1608,7 +1608,7 @@ static Standard_Boolean ORientation (const TDF_Label& L,
else {
isSplit = Standard_True;
S = MakeShape(MS);
#ifdef MDTV_DEB_OR
#ifdef OCCT_DEBUG_OR
for(Standard_Integer i=1;it.More();it.Next(), i++) {
TCollection_AsciiString aNam("OR_Selection_");
TCollection_AsciiString aName = aNam + i + ".brep";
@@ -1621,7 +1621,7 @@ static Standard_Boolean ORientation (const TDF_Label& L,
TNaming_Builder B(L);
if(S.IsNull())
return Standard_False;
#ifdef MDTV_DEB_OR
#ifdef OCCT_DEBUG_OR
DbgTools_Write(S, "Orientation_S.brep");
#endif
@@ -1636,7 +1636,7 @@ static Standard_Boolean ORientation (const TDF_Label& L,
TopTools_MapOfShape MSC;
if(aSList.Extent() == 0) {
const Handle(TNaming_NamedShape)& Anc = Args.Last();
#ifdef MDTV_DEB_OR
#ifdef OCCT_DEBUG_OR
cout << "### ORIENTATION: Ancestor ";
PrintEntry(Anc->Label());
#endif
@@ -1656,7 +1656,7 @@ static Standard_Boolean ORientation (const TDF_Label& L,
if(i == Index && it.Value().IsSame(S)) {
CS = it.Value();
found = Standard_True;
#ifdef MDTV_DEB_OR
#ifdef OCCT_DEBUG_OR
cout << "ORIENTATION => ORDER = " << i <<endl;
#endif
break;
@@ -1667,7 +1667,7 @@ static Standard_Boolean ORientation (const TDF_Label& L,
} else
CS = FindSubShapeInAncestor(S, AS);
// <=== end 21.10.2009
#ifdef MDTV_DEB_OR
#ifdef OCCT_DEBUG_OR
cout << "ORIENTATION: Selection" <<" TShape = " <<CS.TShape() <<" Orientation = " << CS.Orientation() <<endl;
cout << "ORIENTATION: Context " << "ShapeType = "<<AS.ShapeType() << " TShape = " <<AS.TShape() <<endl;
DbgTools_Write(AS, "Orientation_Cnt.brep");
@@ -1723,7 +1723,7 @@ static Standard_Boolean ORientation (const TDF_Label& L,
return Standard_False;
}
else {
#ifdef MDTV_DEB_OR
#ifdef OCCT_DEBUG_OR
DbgTools_Write(Arr->Value(1,2), "Ancestor.brep");
#endif
if(!Aggregation(S, Arr->Value(1,2), B)) {
@@ -1743,7 +1743,7 @@ static Standard_Boolean ORientation (const TDF_Label& L,
return Standard_False;
}
else {
#ifdef MDTV_DEB_OR
#ifdef OCCT_DEBUG_OR
DbgTools_Write(AC, "Aggregation.brep");
#endif
if(!Aggregation(S, AC, B)) {
@@ -1778,7 +1778,7 @@ static Standard_Boolean WireIN(const TDF_Label& L,
if (MS.Extent() != 1) return aResult;
TopTools_MapIteratorOfMapOfShape itM(MS);
const TopoDS_Shape& aCF = itM.Key() ;
#ifdef MDTV_DEB_WIN
#ifdef OCCT_DEBUG_WIN
cout <<"MS Extent = " <<MS.Extent() <<endl;
DbgTools_Write(aCF, "Context_Face.brep");
#endif
@@ -1804,7 +1804,7 @@ static Standard_Boolean WireIN(const TDF_Label& L,
TopoDS_Shape CS = MakeShape(MS);
TNaming_ShapesSet aSet(CS,TopAbs_EDGE);//fill internal map of shapeset by shapes of the specified type
#ifdef MDTV_DEB_WIN
#ifdef OCCT_DEBUG_WIN
TCollection_AsciiString entry;
TDF_Tool::Entry(it.Value()->Label(), entry);
TCollection_AsciiString Nam("Arg_");
@@ -1814,7 +1814,7 @@ static Standard_Boolean WireIN(const TDF_Label& L,
#endif
it.Next();
for (; it.More(); it.Next()) {
#ifdef MDTV_DEB_WIN
#ifdef OCCT_DEBUG_WIN
TDF_Tool::Entry(it.Value()->Label(), entry);
#endif
MS.Clear();
@@ -1823,7 +1823,7 @@ static Standard_Boolean WireIN(const TDF_Label& L,
TNaming_ShapesSet OS(CS,TopAbs_EDGE);
aSet.Add(OS); //concatenate both shapesets
#ifdef MDTV_DEB_WIN
#ifdef OCCT_DEBUG_WIN
ii++;
TCollection_AsciiString aNm = Nam + entry + "_" + ii + ".brep";
DbgTools_Write(CS, aNm.ToCString());
@@ -1831,7 +1831,7 @@ static Standard_Boolean WireIN(const TDF_Label& L,
#endif
}
#ifdef MDTV_DEB_WIN
#ifdef OCCT_DEBUG_WIN
cout <<"WIREIN: " << " Internal Map ext = " << aSet.Map().Extent()<<endl;
TopTools_MapIteratorOfMapOfShape it1 (aSet.Map());
for (int i=1;it1.More();it1.Next(),i++) {
@@ -1849,7 +1849,7 @@ static Standard_Boolean WireIN(const TDF_Label& L,
for (TopoDS_Iterator itF(aCF); itF.More(); itF.Next()) {// find the expected wire in the face
const TopoDS_Shape& S = itF.Value();//wire
if(!S.IsNull()) {
#ifdef MDTV_DEB_WIN
#ifdef OCCT_DEBUG_WIN
DbgTools_Write(S, "WireIN_S.brep");
cout <<"WIREIN: ShapeType = " << S.ShapeType() << " TS = " << S.TShape()->This() <<endl;
#endif
@@ -1915,7 +1915,7 @@ static Standard_Boolean ShellIN(const TDF_Label& L,
if (MS.Extent() != 1) return aResult;
TopTools_MapIteratorOfMapOfShape itM(MS);
const TopoDS_Shape& aCSO = itM.Key() ;
#ifdef MDTV_DEB_SHELL
#ifdef OCCT_DEBUG_SHELL
cout <<"MS Extent = " <<MS.Extent() <<endl;
DbgTools_Write(aCSO, "Context_Solid.brep");
#endif
@@ -1926,7 +1926,7 @@ static Standard_Boolean ShellIN(const TDF_Label& L,
if(!anOuterShell.IsNull()) {
B.Select(anOuterShell, anOuterShell);
aResult = Standard_True;
#ifdef MDTV_DEB_SHELL
#ifdef OCCT_DEBUG_SHELL
cout << "Outer Shell case" <<endl;
PrintEntry(L);
DbgTools_Write(anOuterShell, "ShellOut_S.brep");
@@ -1950,7 +1950,7 @@ static Standard_Boolean ShellIN(const TDF_Label& L,
TopoDS_Shape CS = MakeShape(MS);
TNaming_ShapesSet aSet(CS,TopAbs_FACE);//fill internal map of shapeset by shapes of the specified type
#ifdef MDTV_DEB_SHELL
#ifdef OCCT_DEBUG_SHELL
TCollection_AsciiString entry;
TDF_Tool::Entry(it.Value()->Label(), entry);
TCollection_AsciiString Nam("Arg_");
@@ -1960,7 +1960,7 @@ static Standard_Boolean ShellIN(const TDF_Label& L,
#endif
it.Next();
for (; it.More(); it.Next()) {
#ifdef MDTV_DEB_SHELL
#ifdef OCCT_DEBUG_SHELL
TDF_Tool::Entry(it.Value()->Label(), entry);
#endif
MS.Clear();
@@ -1969,7 +1969,7 @@ static Standard_Boolean ShellIN(const TDF_Label& L,
TNaming_ShapesSet OS(CS,TopAbs_FACE);
aSet.Add(OS); //concatenate both shapesets
#ifdef MDTV_DEB_SHELL
#ifdef OCCT_DEBUG_SHELL
ii++;
TCollection_AsciiString aNm = Nam + entry + "_" + ii + ".brep";
DbgTools_Write(CS, aNm.ToCString());
@@ -1977,7 +1977,7 @@ static Standard_Boolean ShellIN(const TDF_Label& L,
#endif
}
#ifdef MDTV_DEB_SHELL
#ifdef OCCT_DEBUG_SHELL
cout <<"SHELLIN: " << " Internal Map ext = " << aSet.Map().Extent()<<endl;
TopTools_MapIteratorOfMapOfShape it1 (aSet.Map());
for (int i=1;it1.More();it1.Next(),i++) {
@@ -1995,7 +1995,7 @@ static Standard_Boolean ShellIN(const TDF_Label& L,
for (TopoDS_Iterator itS(aCSO); itS.More(); itS.Next()) {// find the expected shell in the solid
const TopoDS_Shape& S = itS.Value();//shell
if(!S.IsNull()) {
#ifdef MDTV_DEB_SHELL
#ifdef OCCT_DEBUG_SHELL
DbgTools_Write(S, "ShellIN_S.brep");
cout <<"SHELLIN: ShapeType = " << S.ShapeType() << " TS = " << S.TShape()->This() <<endl;
#endif
@@ -2039,7 +2039,7 @@ static Standard_Boolean ShellIN(const TDF_Label& L,
}
return aResult;
}
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
//=======================================================================
static Standard_CString NameTypeToString (const TNaming_NameType Type)
{
@@ -2071,7 +2071,7 @@ Standard_Boolean TNaming_Name::Solve(const TDF_Label& aLab,
const TDF_LabelMap& Valid) const
{
Standard_Boolean Done = 0;
#ifdef MDTV_DEB_WIN
#ifdef OCCT_DEBUG_WIN
PrintEntry(aLab);
#endif
try {
@@ -2128,7 +2128,7 @@ Standard_Boolean TNaming_Name::Solve(const TDF_Label& aLab,
}
case TNaming_WIREIN:
{
#ifdef MDTV_DEB_WIN
#ifdef OCCT_DEBUG_WIN
cout << "Name::Solve: NameType = " << myType << " ";
PrintEntry(aLab);
#endif
@@ -2137,7 +2137,7 @@ Standard_Boolean TNaming_Name::Solve(const TDF_Label& aLab,
}
case TNaming_SHELLIN:
{
#ifdef MDTV_DEB_SHELL
#ifdef OCCT_DEBUG_SHELL
cout << "Name::Solve: NameType = " << myType << " ";
PrintEntry(aLab);
#endif
@@ -2146,7 +2146,7 @@ case TNaming_SHELLIN:
}
}
} catch (...) {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout << "Name::Solve: EXCEPTION==> NameType = " << NameTypeToString(myType) << " ";
PrintEntry(aLab);
#endif

View File

@@ -256,7 +256,7 @@ static void RemoveNode(Standard_Boolean MapExist ,
void TNaming_NamedShape::Clear()
{
if (Label().IsNull()) {
#ifdef DEB_BUILDER
#ifdef OCCT_DEBUG_BUILDER
cout << "attention etat fantomatique" << endl;
#endif
return;
@@ -665,7 +665,7 @@ void TNaming_Builder::Generated(const TopoDS_Shape& newShape)
TNaming_RefShape* pns;
if (myShapes->myMap.IsBound(newShape)) {
#ifdef DEB_BUILDER
#ifdef OCCT_DEBUG_BUILDER
cout <<"TNaming_Builder::Generate : the shape is already in the attribute"<<endl;
#endif
pns = myShapes->myMap.ChangeFind(newShape);
@@ -706,7 +706,7 @@ void TNaming_Builder::Delete(const TopoDS_Shape& oldShape)
if (myShapes->myMap.IsBound(oldShape))
pos = myShapes->myMap.ChangeFind(oldShape);
else {
#ifdef DEB_BUILDER
#ifdef OCCT_DEBUG_BUILDER
cout <<"TNaming_Builder::Delete : the shape is not in the data"<<endl;
#endif
pos = new TNaming_RefShape(oldShape);
@@ -732,7 +732,7 @@ void TNaming_Builder::Generated(const TopoDS_Shape& oldShape,
}
if (oldShape.IsSame(newShape)) {
#ifdef DEB_BUILDER
#ifdef OCCT_DEBUG_BUILDER
cout <<"TNaming_Builder::Generate : oldShape IsSame newShape"<<endl;
#endif
return;
@@ -775,7 +775,7 @@ void TNaming_Builder::Modify(const TopoDS_Shape& oldShape,
}
if (oldShape.IsSame(newShape)) {
#ifdef DEB_BUILDER
#ifdef OCCT_DEBUG_BUILDER
cout <<"TNaming_Builder::Modify : oldShape IsSame newShape"<<endl;
#endif
return;
@@ -885,7 +885,7 @@ TNaming_Iterator::TNaming_Iterator(const TDF_Label& Lab,
}
else {
myNode = 0L;
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<"TNaming_Iterator : No Shape for this label"<<endl;
#endif
}
@@ -1457,7 +1457,7 @@ Standard_Boolean TNaming_Tool::HasLabel (const TDF_Label& access,
if (access.Root().FindAttribute(TNaming_UsedShapes::GetID(),US)) {
return (US->Map().IsBound(S));
}
#ifdef MDTV_DEB_HASL
#ifdef OCCT_DEBUG_HASL
cout << "##==> Sub-Shape has no Label!" <<endl;
#endif
return Standard_False;

View File

@@ -76,15 +76,12 @@ typedef TNaming_DataMapOfShapeMapOfShape::Iterator TNaming_DataMapIteratorOfData
//#define MDTV_DEB_NBS
//#define MDTV_DEB_71
//#define MDTV_DEB_WIN
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG
#include <TDF_MapIteratorOfLabelMap.hxx>
#include <TCollection_AsciiString.hxx>
#include <TDF_Tool.hxx>
#include <BRepTools.hxx>
#include <TNaming_Tool.hxx>
#include <DbgTools.hxx>
#endif
#ifdef DEB
#include <TDF_Tool.hxx>
#include <TDF_MapIteratorOfLabelMap.hxx>
@@ -156,7 +153,7 @@ Standard_Boolean TNaming_Naming::Solve (TDF_LabelMap& Valid)
{
Handle(TNaming_Naming) subname;
for (TDF_ChildIterator it (Label(),Standard_False); it.More(); it.Next()) {
#ifdef MDTV_DEB_NBS
#ifdef OCCT_DEBUG_NBS
TCollection_AsciiString anEntry;
TDF_Tool::Entry(it.Value(), anEntry);
cout << "TNaming_Naming::Solve: Label to be solved = " << anEntry << endl;
@@ -167,7 +164,7 @@ Standard_Boolean TNaming_Naming::Solve (TDF_LabelMap& Valid)
}
}
}
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
TDF_MapIteratorOfLabelMap anItr(Valid);
cout << "TNaming_Naming::Solve:: Valid label Map" << endl;
for (; anItr.More(); anItr.Next()) {
@@ -277,7 +274,7 @@ static Standard_Boolean GetShapeEvolutions(const TopoDS_Shape& the
{
Handle(TNaming_NamedShape) aTarget = TNaming_Tool::NamedShape(theTarget,theSource->Label());
if (!aTarget.IsNull()) {
#ifdef MDTV_DEB_71
#ifdef OCCT_DEBUG_71
cout <<"GetShapeEvolutions: target NS = ";
Print_Entry(aTarget->Label());
cout <<"GetShapeEvolutions: Source NS = ";
@@ -290,7 +287,7 @@ static Standard_Boolean GetShapeEvolutions(const TopoDS_Shape& the
TNaming_Iterator anIter(aTarget);
for(;anIter.More();anIter.Next()) { // check all appropriate old shapes of target
#ifdef MDTV_DEB_71
#ifdef OCCT_DEBUG_71
if(!anIter.OldShape().IsNull()) {
Write(anIter.OldShape(), "Target_OldS.brep");
cout <<"Target OldS TS =" <<anIter.OldShape().TShape()->This() <<endl;
@@ -320,7 +317,7 @@ static Handle(TNaming_NamedShape) CompareInModification (const Handle(TNaming_Na
{
Handle(TNaming_NamedShape) aResult;
if (S.IsNull() || NS.IsNull()) return aResult;
#ifdef MDTV_DEB_71
#ifdef OCCT_DEBUG_71
cout <<"CompareInModification: parent NS = ";
Print_Entry(NS->Label());
Write(S, "CompareInM_S.brep");
@@ -332,7 +329,7 @@ static Handle(TNaming_NamedShape) CompareInModification (const Handle(TNaming_Na
for(;anIt.More() && aSource.IsNull();anIt.Next()) {
if (!anIt.NewShape().IsNull()) {
aSource = TNaming_Tool::NamedShape(anIt.NewShape(),NS->Label());
#ifdef MDTV_DEB_71
#ifdef OCCT_DEBUG_71
TCollection_AsciiString aNam("CompareInM_Source");
WriteNSOnLabel(aSource,aNam);
#endif
@@ -381,7 +378,7 @@ static Standard_Boolean FillSMap(const TopoDS_Shape& S, TopTools_MapOfShape& MS)
TopoDS_Iterator it(S);
for (; it.More(); it.Next()) {
const TopAbs_ShapeEnum aType = it.Value().ShapeType();
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
cout <<"TestSolution_FillMap: S_Type = :" << it.Value().ShapeType() <<" TShape = " << it.Value().TShape()->This() <<endl;
#endif
if(aType > TopAbs_COMPSOLID) {
@@ -416,7 +413,7 @@ static Standard_Boolean Compare (const Handle(TNaming_NamedShape)& NS,
TopTools_MapOfShape MS;
if (!Stop.IsNull()) TNaming_NamingTool::BuildDescendants(Stop,Forbiden);
TNaming_NamingTool::CurrentShape(MDF.GetValid(),Forbiden,NS,MS);
#ifdef MDTV_DEB_NBS
#ifdef OCCT_DEBUG_NBS
Write(S, "Compare_S.brep");
cout << "S: TShape = " <<S.TShape()->This() <<endl;
Standard_Integer i =1;
@@ -447,7 +444,7 @@ static Standard_Boolean TestSolution(const TNaming_Scope& MDF,
if (NS.IsNull()) return Standard_False;
TopoDS_Shape Res = MDF.CurrentShape(NS);// last modification of NS taken into account Valid map
if(S.IsNull() || Res.IsNull()) return Standard_False;
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
Write(S, "TSol_S.brep");
Write(Res, "TSol_Res.brep");
#endif
@@ -617,7 +614,7 @@ static Standard_Boolean IsMultipleCase(const TopoDS_Shape& S,
if(aMS.Extent())
aDMM.Bind(it.Key(), aMS);
} else {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout << "Key is not BOUND!" <<endl;
#endif
return Standard_False;
@@ -678,7 +675,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
Standard_Integer aLev(Lev);
TopTools_MapOfShape Neighbourg;
Localizer.FindNeighbourg (Context,S,Neighbourg);
#ifdef MDTV_DEB_NBS
#ifdef OCCT_DEBUG_NBS
//DbgTools::DisplayShape(Context, F, Quantity_NOC_GREEN);
//DbgTools::DisplayShape(S, F, Quantity_NOC_BLUE1);
Write(Context, "FNBS_Context.brep");
@@ -690,7 +687,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
Standard_Boolean isIn = Standard_False;
TNaming_Iterator anIter(NS);
for(;anIter.More();anIter.Next()) {
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG
//DbgTools::DisplayShape(anIter.NewShape(), F, Quantity_NOC_RED);
#endif
if (anIter.NewShape().IsSame(S)) {
@@ -716,12 +713,12 @@ static Standard_Boolean Filter (const TDF_Label& F,
if (Neighbourg.IsEmpty()) {
#ifdef TNAMING_DEB
#ifdef OCCT_DEBUG
cout <<"FindNeighbourg: impossible"<<endl;
#endif
return 0;
} else {
#ifdef MDTV_DEB_NBS
#ifdef OCCT_DEBUG_NBS
Write(Neighbourg, "Neighbourgs");
#endif
aLev++;
@@ -751,7 +748,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
TNaming_ListIteratorOfListOfNamedShape itA(aName.Arguments());
for (; itA.More(); itA.Next(), ij++) {
const TopoDS_Shape& aFace = TNaming_Tool::CurrentShape(itA.Value());
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
Write(aFace, "First_Face.brep");
cout <<"Selection TS = " << S.TShape()->This() <<endl;
#endif
@@ -760,7 +757,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
TopoDS_Iterator it(aFace);
for (;it.More();it.Next(),i++) {
nbW++;
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
Write(it.Value(), "First_Wire.brep");
#endif
if(!isFound) {
@@ -768,7 +765,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
TopoDS_Iterator it2(it.Value());
for (;it2.More();it2.Next(),j++) {
nbE++;
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
Write(it2.Value(), "First_Wire.brep");
cout <<"Edge TS = " << it2.Value().TShape()->This() <<endl;
#endif
@@ -820,7 +817,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
theName.Type(TNaming_FILTERBYNEIGHBOURGS);
theName.Append(NS);
theName.StopNamedShape (Until);
#ifdef MDTV_DEB_NBS
#ifdef OCCT_DEBUG_NBS
cout << "FilterByNBS: ";
Print_Entry(NF->Label());
cout <<"AppendNS = " ;
@@ -836,7 +833,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
const TopoDS_Shape& aS = itN.Key();
Handle (TNaming_NamedShape) aNS =
BuildName(NF->Label(), MDF, aS, Context, Stop, 1);
#ifdef MDTV_DEB_NBS
#ifdef OCCT_DEBUG_NBS
const TopoDS_Shape& aS2 = aNS->Get();
if(!aS.IsNull())
cout << "Shape arg type = " << aS.ShapeType() <<" TSH = " << aS.TShape()->This()<<endl;
@@ -857,7 +854,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
if(allowChild && !aSNS.IsNull() && aS.ShapeType() != aSNS.ShapeType() &&
aSNS.ShapeType() == TopAbs_COMPOUND)
{ // aLev < 3
#ifdef MDTV_DEB_NBS
#ifdef OCCT_DEBUG_NBS
cout <<"Father label = ";
Print_Entry(aNS->Label().Father());
Write(aS,"SelectionS.brep");
@@ -892,7 +889,7 @@ static Standard_Boolean Filter (const TDF_Label& F,
// Check du filtre.
//-----------------
if (Compare (NS,MDF,Stop,S)) return 1;
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG
cout <<"TNaming_Naming::Name Filter insufficient"<<endl;
#endif
return 0;
@@ -931,7 +928,7 @@ static Handle(TNaming_NamedShape) BuildNameInNS (const TDF_Label&
// <Context> is Ident.NamedShapeOfGeneration() ==
TDF_Label Father = Context->Label().Father();
Father.FindAttribute(TNaming_NamedShape::GetID(),NewStop);
#ifdef MDTV_DEB_INNS
#ifdef OCCT_DEBUG_INNS
if(!Stop.IsNull())
{cout <<" Stop NS : "; Print_Entry( Stop->Label());}
if(!NewStop.IsNull())
@@ -940,7 +937,7 @@ static Handle(TNaming_NamedShape) BuildNameInNS (const TDF_Label&
cout <<"Father : "; Print_Entry( Father);
#endif
}
#ifdef MDTV_DEB_INNS
#ifdef OCCT_DEBUG_INNS
if(NewStop.IsNull())
cout <<"BuildNameInNS:: NewStop shape is NULL" << endl;
#endif
@@ -965,7 +962,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
// Create an identifier
Standard_Boolean OnlyOne = !Geom;
Standard_Boolean IsGeneration = Standard_False;
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
cout <<"BuildName: F => ";
Print_Entry(F);
cout <<" Selection type = " << Selection.ShapeType() << " TS = " << Selection.TShape()->This() << endl;
@@ -1000,7 +997,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
theName.Shape(Selection);
theName.Orientation(Selection.Orientation());
theName.Type(Ident.Type());
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
cout <<"BuildName: Inserted Naming Att at ";
Print_Entry(Naming->Label());
cout <<" NameType = " << theName.Type() <<endl;
@@ -1019,7 +1016,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
// Renseignement du NamedShape d arret.
//------------------------------------
theName.StopNamedShape (Stop);
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
if(!Stop.IsNull()) {
TCollection_AsciiString Es;
TDF_Tool::Entry(Stop->Label(), Es);
@@ -1033,7 +1030,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
for (Ident.InitArgs(); Ident.MoreArgs(); Ident.NextArg()) {
if (Ident.ArgIsFeature()) {
theName.Append(Ident.FeatureArg());
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
if(!Ident.FeatureArg().IsNull()) {
TCollection_AsciiString E;
TDF_Tool::Entry(Ident.FeatureArg()->Label(), E);
@@ -1042,7 +1039,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
#endif
}
else {
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
cout <<"BuildName: NameType = " <<theName.Type() << " NS ";
Print_Entry(Naming->Label());
cout <<"Ident.ShapeArg() type = " << Ident.ShapeArg().ShapeType() << " TS = " << Ident.ShapeArg().TShape()->This() << endl;
@@ -1059,7 +1056,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
// Reconstruction of Name
//------------------------
Naming->Regenerate(MDF.ChangeValid());
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
TCollection_AsciiString E2;
TDF_Tool::Entry(Naming->Label(), E2);
cout <<"Regenerated Naming Att at Label = "<< E2 << endl;
@@ -1067,7 +1064,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
Naming->Label().FindAttribute(TNaming_NamedShape::GetID(),NS);
if(NS.IsNull()) return NS;
if (MDF.WithValid()) MDF.Valid(NS->Label());
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
if(!NS.IsNull()) {
TCollection_AsciiString E;
TDF_Tool::Entry(NS->Label(), E);
@@ -1106,7 +1103,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
}
} else if (Ident.Type() == TNaming_MODIFUNTIL ||
(Ident.Type() == TNaming_INTERSECTION && Naming->ChangeName().Arguments().Extent() == 1)) {
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
cout <<"BuildName(CompareInModification): NameType = " <<Ident.Type() << " NS ";
Print_Entry(Ident.Type() == TNaming_MODIFUNTIL ? NS->Label() : Naming->ChangeName().Arguments().First()->Label());
cout <<"Selection type = " << Selection.ShapeType() << " TS = " << Selection.TShape()->This() << endl;
@@ -1155,7 +1152,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label& F
}
}
if (MDF.WithValid()) MDF.Valid(NS->Label());
#ifdef MDTV_DEB_MOD
#ifdef OCCT_DEBUG_MOD
if(!NS.IsNull()) {
TCollection_AsciiString E;
TDF_Tool::Entry(NS->Label(), E);
@@ -1378,20 +1375,20 @@ static Standard_Boolean IsOneIn (const TopoDS_Shape& S, const TopoDS_Shape& Cont
//=======================================================================
static Standard_Boolean IsAllIn (const TopoDS_Shape& S, const TopoDS_Shape& Context)
{
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
Write(S, "IsAllIn_Sel.brep");
#endif
Standard_Boolean found(Standard_False);
if(S.IsNull() || Context.IsNull()) return found;
Standard_Integer num1(0), num2(0);
for(TopoDS_Iterator it(S);it.More();it.Next(),num1++) {
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
cout <<"S sub-shape type = " << it.Value().ShapeType() <<endl;
Write (it.Value(), "Sel_ItValue.brep");
#endif
if(it.Value().ShapeType() != TopAbs_COMPOUND)
for (TopExp_Explorer exp(Context,it.Value().ShapeType()); exp.More(); exp.Next()) {
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
cout <<"Context sub-shape type = " << exp.Current().ShapeType() <<endl;
Write(exp.Current(), "Contex_Curnt.brep");
#endif
@@ -1407,7 +1404,7 @@ static Standard_Boolean IsAllIn (const TopoDS_Shape& S, const TopoDS_Shape& Cont
}
if(num1 == num2)
found = Standard_True;
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
else
cout <<"Compound case : selected num1 = " << num1 << " context contains num2 = " << num2 << endl;
#endif
@@ -1445,7 +1442,7 @@ static Standard_Integer RepeatabilityInContext(const TopoDS_Shape& Selection,
}
}
}
#ifdef MDTV_DEB_OR
#ifdef OCCT_DEBUG_OR
cout <<"RepeatabilityInContext: = " <<aNum <<endl;
#endif
return aNum;
@@ -1471,7 +1468,7 @@ static Standard_Boolean HasAncSolid(const TopoDS_Shape& Context,
hasSolid = Standard_True;
TopoDS_Shell anOuterShell;
if(TNaming::OuterShell(TopoDS::Solid(Solid), anOuterShell)) {
#ifdef MDTV_DEB_TSOL
#ifdef OCCT_DEBUG_TSOL
Write(anOuterShell, "OuterShell.brep");
#endif
if(!anOuterShell.IsNull() && anOuterShell.IsEqual(Sh))
@@ -1520,7 +1517,7 @@ static Handle(TNaming_NamedShape) BuildNameShell (const TDF_Label& F,
if(Context.ShapeType() == TopAbs_SOLID) {
for (TopoDS_Iterator it(Context) ; it.More(); it.Next()) {
#ifdef MDTV_DEB_TSOL
#ifdef OCCT_DEBUG_TSOL
Write(it.Value(), "Shell_inSo.brep");
#endif
if(it.Value().IsEqual(Selection)) {
@@ -1549,7 +1546,7 @@ static Handle(TNaming_NamedShape) BuildNameShell (const TDF_Label& F,
// context is not SOLID
//theName.Append(BuildName (Naming->Label(),MDF,aSolid,Context,Stop,Geom));//###########
if(isOuter) {
#ifdef MDTV_DEB_TSOL
#ifdef OCCT_DEBUG_TSOL
Write(aSolid, "foundSolid.brep");
#endif
theName.Index(1);
@@ -1628,7 +1625,7 @@ static void BuildAggregationName (const TDF_Label& F,
theName.Shape(S);
theName.Orientation(S.Orientation());
}
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
cout <<"BuildAggregationName ==> ";
Print_Entry(Naming->Label());
#endif
@@ -1675,7 +1672,7 @@ static void BuildAggregationName (const TDF_Label& F,
}
}
} else {
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
cout << "atomic type is NOT defined ... ==> Aggregation" <<endl;
#endif
BuildAggregationName(aNaming->Label(),MDF, aS, Context,Stop,Geom);
@@ -1711,7 +1708,7 @@ Handle(TNaming_NamedShape) TNaming_Naming::Name (const TDF_Label& F,
{
Handle(TNaming_NamedShape) NS;
if (KeepOrientation) {
#ifdef MDTV_DEB_INNS
#ifdef OCCT_DEBUG_INNS
cout <<"KeepOR = 1: "; Print_Entry(F);
#endif
Standard_Integer aNum = RepeatabilityInContext(S, Context);
@@ -1723,7 +1720,7 @@ Handle(TNaming_NamedShape) TNaming_Naming::Name (const TDF_Label& F,
Handle(TopTools_HArray1OfShape) Arr;
if (UC.IsNull() && S.ShapeType() == TopAbs_COMPOUND) {
UC = TNaming::FindUniqueContextSet(S, Context, Arr);
#ifdef MDTV_DEB_CC
#ifdef OCCT_DEBUG_CC
Write(UC, "UniqueContextSet.brep");
Write(S, "InitialSelection.brep");
if(S.ShapeType()==TopAbs_COMPOUND) {

View File

@@ -22,10 +22,8 @@
#include <TNaming_Tool.hxx>
#include <TNaming_Naming.hxx>
#include <TDF_ChildIterator.hxx>
#ifdef DEB
//#define MDTV_DEB_DESC
//#define MDTV_DEB_APPLY
#ifdef MDTV_DEB_DESC
#ifdef OCCT_DEBUG_DESC
#include <TCollection_AsciiString.hxx>
#include <TDF_Tool.hxx>
#include <BRepTools.hxx>
@@ -53,7 +51,7 @@ static void WriteS(const TopoDS_Shape& shape,
save.close();
}
#endif
#endif
//=======================================================================
//function : IsForbiden
//purpose : ANaming voir NamingTool
@@ -85,7 +83,7 @@ static void LastModif( TNaming_NewShapeIterator& it,
Standard_Boolean YaModif = Standard_False;
for (; it.More(); it.Next()) {
const TDF_Label& Lab = it.Label();
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG_DESC
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry);
cout << "NamingTool:: LastModif LabelEntry = "<< entry << endl;
@@ -111,7 +109,7 @@ static void ApplyOrientation (TopTools_MapOfShape& MS,
const TopAbs_Orientation OrientationToApply)
{
if (!MS.IsEmpty ()) {
#ifdef MDTV_DEB_APPLY
#ifdef OCCT_DEBUG_APPLY
cout <<"OrientationToApply = " <<OrientationToApply <<endl;
TopTools_MapIteratorOfMapOfShape it1(MS);
for (; it1.More(); it1.Next()) {
@@ -141,13 +139,13 @@ void TNaming_NamingTool::CurrentShape(const TDF_LabelMap& Valid,
TopTools_MapOfShape& MS)
{
TDF_Label Lab = Att->Label();
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG_DESC
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry);
cout << "NamingTool:: LabelEntry = "<< entry << endl;
#endif
if (!Valid.IsEmpty() && !Valid.Contains(Lab)) {
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG_DESC
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry);
cout << "NamingTool:: LabelEntry = "<< entry << " is out of Valid map" << endl;
@@ -159,7 +157,7 @@ void TNaming_NamingTool::CurrentShape(const TDF_LabelMap& Valid,
for (; itL.More(); itL.Next()) {
const TopoDS_Shape& S = itL.NewShape();
if (S.IsNull()) continue;
#ifdef MDTV_DEB
#ifdef OCCT_DEBUG_DESC
WriteS(S, "CS_NewShape.brep");
if(itL.OldShape().IsNull())
cout <<"OldShape is Null" <<endl;
@@ -246,7 +244,7 @@ static void MakeDescendants (TNaming_NewShapeIterator& it,
{
for (; it.More(); it.Next()) {
Descendants.Add(it.Label());
#ifdef MDTV_DEB_DESC
#ifdef OCCT_DEBUG_DESC
TCollection_AsciiString entry;
TDF_Tool::Entry(it.Label(), entry);
cout<< "MakeDescendants: Label = " <<entry <<endl;
@@ -264,7 +262,7 @@ void BuildDescendants2 (const Handle(TNaming_NamedShape)& NS, const TDF_Label& F
TNaming_NewShapeIterator it(NS);
for(;it.More();it.Next()) {
if(!it.NamedShape().IsNull()) {
#ifdef MDTV_DEB_DESC
#ifdef OCCT_DEBUG_DESC
TCollection_AsciiString entry;
TDF_Tool::Entry(it.Label(), entry);
cout<< "MakeDescendants2: Label = " <<entry <<endl;
@@ -287,7 +285,7 @@ void TNaming_NamingTool::BuildDescendants (const Handle(TNaming_NamedShape)& NS,
if (NS.IsNull()) return;
Descendants.Add(NS->Label());
TNaming_NewShapeIterator it(NS);
#ifdef MDTV_DEB_DESC
#ifdef OCCT_DEBUG_DESC
TCollection_AsciiString entry;
TDF_Tool::Entry(NS->Label(), entry);
cout<< "MakeDescendants: Label = " <<entry <<endl;
@@ -298,7 +296,7 @@ void TNaming_NamingTool::BuildDescendants (const Handle(TNaming_NamedShape)& NS,
if(!it2.Shape().IsNull()) {
Handle(TNaming_NamedShape) ONS = TNaming_Tool::NamedShape(it2.Shape(), NS->Label());
if(!ONS.IsNull()) {
#ifdef MDTV_DEB_DESC
#ifdef OCCT_DEBUG_DESC
TCollection_AsciiString entry;
TDF_Tool::Entry(ONS->Label(), entry);
cout<< "MakeDescendants_Old: Label = " <<entry <<endl;

View File

@@ -35,7 +35,7 @@
#define OCC351
//#define MDTV_DEB_SEL
#ifdef MDTV_DEB_SEL
#ifdef OCCT_DEBUG_SEL
//#define MDTV_DEB_BNP
#include <TopExp_Explorer.hxx>
#include <TCollection_AsciiString.hxx>
@@ -137,7 +137,7 @@ static Standard_Boolean IsSpecificCase(const TDF_Label& F, const TopoDS_Shape&
TopTools_MapOfOrientedShape shapesOfContext;
MapOfOrientedShapes(Context,shapesOfContext);
Handle(TNaming_NamedShape) CNS = TNaming_Tool::NamedShape(Context, F);
#ifdef MDTV_DEB_BNP
#ifdef OCCT_DEBUG_BNP
PrintEntry (CNS->Label(),0);
#endif
if(!CNS.IsNull()) {
@@ -147,7 +147,7 @@ static Standard_Boolean IsSpecificCase(const TDF_Label& F, const TopoDS_Shape&
// Naming data structure is empty - no sub-shapes under resulting shape
const Handle(TNaming_NamedShape) aNS = FindPrevNDS(CNS); //look to old shape data structure if exist
if(!aNS.IsNull()) {
#ifdef MDTV_DEB_BNP
#ifdef OCCT_DEBUG_BNP
PrintEntry (aNS->Label(),0);
#endif
cit.Initialize(aNS->Label(), TNaming_NamedShape::GetID(), Standard_False);
@@ -160,7 +160,7 @@ static Standard_Boolean IsSpecificCase(const TDF_Label& F, const TopoDS_Shape&
if(!NS.IsNull()) {
TopoDS_Shape aS = TNaming_Tool::CurrentShape(NS);
if(aS.IsNull()) continue;
#ifdef MDTV_DEB_BNP
#ifdef OCCT_DEBUG_BNP
PrintEntry(NS->Label(), 0);
cout <<"ShapeType =" << aS.ShapeType() <<endl;
Write (aS, "BNProblem.brep");
@@ -177,7 +177,7 @@ static Standard_Boolean IsSpecificCase(const TDF_Label& F, const TopoDS_Shape&
TopTools_MapIteratorOfMapOfOrientedShape it(M);
for(;it.More();it.Next()) {
if(!shapesOfContext.Contains(it.Key())) {
#ifdef MDTV_DEB_BNP
#ifdef OCCT_DEBUG_BNP
cout <<"BNProblem: ShapeType in AtomicMap = " << it.Key().ShapeType() << " TShape = " <<it.Key().TShape() <<" OR = " <<it.Key().Orientation() <<endl;
Write (it.Key(), "BNProblem_AtomicMap_Item.brep");
TopTools_MapIteratorOfMapOfOrientedShape itC(shapesOfContext);
@@ -204,7 +204,7 @@ static Standard_Boolean IsSpecificCase2(const TDF_Label& F, const TopoDS_Shape&
if(Selection.ShapeType() == TopAbs_EDGE) {
Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(Selection, F);
if(!aNS.IsNull()) { //presented in DF
#ifdef MDTV_DEB_BNP
#ifdef OCCT_DEBUG_BNP
PrintEntry (aNS->Label(),0);
#endif
const TopoDS_Shape& aS = TNaming_Tool::CurrentShape(aNS);
@@ -347,7 +347,7 @@ Standard_Boolean TNaming_Selector::Select (const TopoDS_Shape& Selection,
selection = Selection;
*/
#ifdef MDTV_DEB_SEL
#ifdef OCCT_DEBUG_SEL
cout << "SELECTION ORIENTATION = " << Selection.Orientation() <<", TShape = " << Selection.TShape() <<endl;
//cout << "SELECTION ORIENTATION = " << selection.Orientation() <<", TShape = " << selection.TShape() <<endl;
PrintEntry(myLabel, 0);
@@ -376,7 +376,7 @@ Standard_Boolean TNaming_Selector::Select (const TopoDS_Shape& Selection,
// mpv: if oldShape for selection is some shape from used map of shapes,
// then naming structure becomes more complex, can be cycles
const TopoDS_Shape& aSelection = TNaming_Tool::CurrentShape(NS); //szy
#ifdef MDTV_DEB_CHECK_TYPE
#ifdef OCCT_DEBUG_CHECK_TYPE
if(!Selection.IsSame(aSelection) && Selection.ShapeType() != TopAbs_COMPOUND) {
TCollection_AsciiString entry;
TDF_Tool::Entry(NS->Label(), entry);
@@ -430,7 +430,7 @@ Standard_Boolean TNaming_Selector::Select (const TopoDS_Shape& Selection,
Standard_Boolean TNaming_Selector::Solve (TDF_LabelMap& Valid) const
{
Handle(TNaming_Naming) name;
#ifdef MDTV_DEB_SEL
#ifdef OCCT_DEBUG_SEL
cout <<"TNaming_Selector::Solve==> ";
PrintEntry(myLabel,0);
#endif

View File

@@ -33,7 +33,7 @@ TNaming_ShapesSet::TNaming_ShapesSet (const TopoDS_Shape& CS,
const TopAbs_ShapeEnum Type)
{
if (CS.IsNull()) return;
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
cout << "ShapeSet: CS TShape = " <<CS.TShape() << " Type = " << Type <<endl;
#endif
if (Type == TopAbs_SHAPE) {
@@ -56,7 +56,7 @@ TNaming_ShapesSet::TNaming_ShapesSet (const TopoDS_Shape& CS,
if (Type > CS.ShapeType()) {
for (TopExp_Explorer exp(CS,Type) ; exp.More(); exp.Next()) {
Add(exp.Current());
#ifdef MDTV_DEB_INT
#ifdef OCCT_DEBUG_INT
cout << "ShapeSet: sub-shape TShape = " <<exp.Current().TShape() <<endl;
#endif
}

View File

@@ -527,7 +527,7 @@ void TNaming_Tool::Collect(const Handle(TNaming_NamedShape)& NS,
// Pour DEBUGGER
#ifdef DEB
#ifdef OCCT_DEBUG
//=======================================================================
//function : TNamingTool_Label
@@ -572,7 +572,7 @@ void TNaming_Tool::FindShape(const TDF_LabelMap& Valid,
// Which type of shape is being expected?
Handle(TNaming_Naming) aNaming;
if (!Arg->FindAttribute(TNaming_Naming::GetID(), aNaming)) {
#ifdef DEB
#ifdef OCCT_DEBUG
// cout<<"TNaming_Tool::FindShape(): Naming attribute hasn't been found attached at the Argument label"<<endl;
#endif
return;
@@ -582,7 +582,7 @@ void TNaming_Tool::FindShape(const TDF_LabelMap& Valid,
TopTools_MapOfShape subShapes;
TopExp_Explorer anExpl(Arg->Get(), (TopAbs_ShapeEnum)((int)(aNaming->GetName().ShapeType()) + 1));
for (; anExpl.More(); anExpl.Next()) subShapes.Add(anExpl.Current());
#ifdef DEB
#ifdef OCCT_DEBUG
// cout<<"TNaming_Tool::FindShape(): Nb of sub shapes = "<<subShapes.Extent()<<endl;
#endif
@@ -591,21 +591,21 @@ void TNaming_Tool::FindShape(const TDF_LabelMap& Valid,
TDF_AttributeMap outRefs;
TDF_Tool::OutReferences(Arg->Label(), outRefs);
if (outRefs.IsEmpty()) {
#ifdef DEB
#ifdef OCCT_DEBUG
// cout<<"TNaming_Tool::FindShape(): No out references have been found"<<endl;
#endif
return;
}
for (TDF_MapIteratorOfAttributeMap itr(outRefs); itr.More(); itr.Next()) {
if (itr.Key()->DynamicType() == STANDARD_TYPE(TNaming_NamedShape)) {
#ifdef DEB
#ifdef OCCT_DEBUG
// Standard_Integer nbExtArgs = extArgs.Extent();
#endif
const Handle(TNaming_NamedShape)& anExtArg = Handle(TNaming_NamedShape)::DownCast(itr.Key());
const Handle(TNaming_NamedShape)& aCurrentExtArg = TNaming_Tool::CurrentNamedShape(anExtArg);
if (!aCurrentExtArg.IsNull() && !aCurrentExtArg->IsEmpty())
extArgs.Append(aCurrentExtArg);
#ifdef DEB
#ifdef OCCT_DEBUG
// if (extArgs.Extent() - 1 == nbExtArgs) {
// cout<<"TNaming_Tool::FindShape(): An external reference has been found at ";
// itr.Key()->Label().EntryDump(cout); cout<<endl;
@@ -624,13 +624,13 @@ void TNaming_Tool::FindShape(const TDF_LabelMap& Valid,
if (anExtArg->Label().Father().IsNull() ||
!anExtArg->Label().Father().FindAttribute(TNaming_NamedShape::GetID(), aContextNS)) {
aContextNS = anExtArg;
// #ifdef DEB
// #ifdef OCCT_DEBUG
// cout<<"TNaming_Tool::FindShape(): A context shape hasn't been found at the father label of the external argument"<<endl;
// #endif
// continue;
}
#ifdef DEB
#ifdef OCCT_DEBUG
// cout<<"TNaming_Tool::FindShape(): Searching in the external reference ";
// aContextNS->Label().EntryDump(cout); cout<<" ";
#endif
@@ -655,7 +655,7 @@ void TNaming_Tool::FindShape(const TDF_LabelMap& Valid,
}
}
if (DoesCoincide == subShapes.Extent()) {
#ifdef DEB
#ifdef OCCT_DEBUG
// cout<<"TNaming_Tool::FindShape(): Found! ";
#endif
S = possibleResult;
@@ -664,13 +664,13 @@ void TNaming_Tool::FindShape(const TDF_LabelMap& Valid,
}
if (!S.IsNull()) break;
#ifdef DEB
#ifdef OCCT_DEBUG
// cout<<endl;
#endif
}
#ifdef DEB
#ifdef OCCT_DEBUG
if (S.IsNull()) {
cout<<"TNaming_Tool::FindShape(): There hasn't been found a sub shape of the context shape coinciding with the sub shapes of naming"<<endl;
}