// Created on: 2002-04-25 // Created by: Michael PONIKAROV // Copyright (c) 2002-2012 OPEN CASCADE SAS // // The content of this file is subject to the Open CASCADE Technology Public // License Version 6.5 (the "License"). You may not use the content of this file // except in compliance with the License. Please obtain a copy of the License // at http://www.opencascade.org and read it completely before using this file. // // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. // // The Original Code and all software distributed under the License is // distributed on an "AS IS" basis, without warranty of any kind, and the // Initial Developer hereby disclaims all such warranties, including without // limitation, any warranties of merchantability, fitness for a particular // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static const char* EvolutionString(TNaming_Evolution theEvolution) { switch(theEvolution){ case TNaming_PRIMITIVE : return "PRIMITIVE"; case TNaming_GENERATED : return "GENERATED"; case TNaming_MODIFY : return "MODIFY"; case TNaming_DELETE : return "DELETE"; case TNaming_SELECTED : return "SELECTED"; case TNaming_REPLACE : return "MODIFY"; } return "UNKNOWN_Evolution"; } static Standard_Integer GetNewShapes (Draw_Interpretor& di, Standard_Integer nb, const char** arg) { if (nb==3 || nb==4) { TDF_Label aLabel; if (!QADNaming::Entry(arg, aLabel)) return 1; Handle(TNaming_NamedShape) aNS; if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) { di<<"Label has no NamedShape"<<"\n"; return 1; } di<Evolution()); TNaming_Iterator anIter(aNS); Standard_Integer a; char aName[200]; for(a=1;anIter.More();anIter.Next(),a++) { if (anIter.NewShape().IsNull()) a--; else if (nb==4) { Sprintf(aName,"%s_%d",arg[3],a); DBRep::Set (aName,anIter.NewShape()); } } di<<" "<Evolution()); TNaming_Iterator anIter(aNS); Standard_Integer a; char aName[200]; for(a=1;anIter.More();anIter.Next(),a++) { if (anIter.OldShape().IsNull()) a--; else if (nb==4) { Sprintf(aName,"%s_%d",arg[3],a); DBRep::Set (aName,anIter.OldShape()); } } di<<" "<Root(),aName,0); } } else { di<<"Usage: GetAllNewShapes df entry/shape [res]"<<"\n"; return 1; } di<Root(),aName,0); } } else { di<<"Usage: GetAllNewShapes df entry/shape [res]"<<"\n"; return 1; } di<Root()); for(;anIter.More();anIter.Next()) { if (!anIter.Label().IsNull()) { TCollection_AsciiString Name; TDF_Tool::Entry(anIter.Label(),Name); if (aResult != 0) aRes=aRes+Name+" "; else aRes=Name; aResult++; } } } else { di<<"Usage: GetSameShapes df shape"<<"\n"; return 1; } di<