diff --git a/src/DNaming/DNaming_SelectionCommands.cxx b/src/DNaming/DNaming_SelectionCommands.cxx index b21d52f69c..8a2039dadb 100755 --- a/src/DNaming/DNaming_SelectionCommands.cxx +++ b/src/DNaming/DNaming_SelectionCommands.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ #include #include #include +#include #include #include @@ -115,7 +117,7 @@ static void DumpNaming (const Handle(TNaming_Naming)& naming, Draw_Interpretor& static Standard_Integer DNaming_Select (Draw_Interpretor& di, Standard_Integer n, const char** a) { if (n > 3) { - Standard_Boolean geometry = (strcmp(a[0],"SelectGeometry")); + Standard_Boolean geometry = !(strcmp(a[0],"SelectGeometry")); Handle(TDF_Data) DF; if(!DDF::GetDF(a[1], DF)) return 1; TDF_Label L; @@ -137,7 +139,51 @@ static Standard_Integer DNaming_Select (Draw_Interpretor& di, Standard_Integer n di << "DNaming_Select : Error" << "\n"; return 1; } +// #define DEB_SELN 1 +//======================================================================= +//function : FillValidMap +//purpose : +//======================================================================= +Standard_Boolean FillValidMap(const TDF_Label& theLabel, TDF_LabelMap& theValidMap) +{ + Standard_Boolean extRefFound = Standard_False; + TDF_AttributeMap anExtMap; +#ifdef DEB_SELN + TCollection_AsciiString entr1; + TDF_Tool::Entry(theLabel, entr1); + cout<<"\tNaming Attribute at = "<< entr1 <Solve(); - //Handle(TNaming_NamedShape) NS; - //if (!L.FindAttribute(TNaming_NamedShape::GetID(),NS)) { - // cout <<"DNaming_DumpSelection : not done" << endl; - // return 1; - //} + DDF::AddLabel(DF,a[2],L); + + Handle(TNaming_Naming) naming; + if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) { + cout <<"DNaming__SolveSelection : not a selection" << endl; + return 1; + } + TDF_LabelMap aValidMap; + if(!FillValidMap(L,aValidMap)) + di << "Valid map is empty" << "\n"; +#ifdef DEB_SELN + cout<<"== Valid Label map =="<Label()); + cout <<"AppendNS = " ; + Print_Entry(NS->Label()); #endif //--------------------- // Naming des voisins. @@ -856,8 +859,14 @@ static Standard_Boolean Filter (const TDF_Label& F, const TopoDS_Shape& aS2 = aNS->Get(); if(!aS.IsNull()) cout << "Shape arg type = " << aS.ShapeType() <<" TSH = " << aS.TShape()->This()<