1 // File: QADNaming_BuilderCommands.cxx
2 // Created: Thu Apr 25 08:57:09 2002
3 // Author: Michael PONIKAROV
7 #include <QADNaming.hxx>
8 #include <TDF_Label.hxx>
9 #include <Draw_Interpretor.hxx>
10 #include <TNaming_Builder.hxx>
11 #include <TopoDS_Shape.hxx>
14 static Standard_Integer BuildNamedShape (Draw_Interpretor& di,
19 if (!QADNaming::Entry(arg, aLabel)) return 1;
20 char anEvolution = arg[3][0];
21 Standard_Integer a,anInc = (anEvolution == 'P' || anEvolution == 'D') ? 1 : 2;
22 // if (anEvolution == 'G')
23 // for(a=1;arg[3][a]!=0 && arg[3][a]!='\n';a++) if (arg[3][a]=='2') anEvolution = '2';
24 TNaming_Builder aBuilder(aLabel);
25 TopoDS_Shape aShape1,aShape2;
27 for(a = 4;a < nb;a += anInc) {
28 aShape1 = DBRep::Get (arg[a]);
31 di<<"For this type of evolution number of shapes must be even"<<"\n";
34 aShape2 = DBRep::Get(arg[a+1]);
37 switch (anEvolution) {
39 aBuilder.Generated(aShape1);
42 aBuilder.Generated(aShape1,aShape2);
45 aBuilder.Modify(aShape1,aShape2);
48 aBuilder.Delete(aShape1);
51 aBuilder.Replace(aShape1,aShape2);
54 aBuilder.Select(aShape1,aShape2);
57 di<<"Unknown evolution type"<<"\n";
63 // OnlyModif = atoi(arg[3]);
66 di<<"Usage: BuildName df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) shape1 [shape2 ...]"<<"\n";
73 void QADNaming::BuilderCommands(Draw_Interpretor& theCommands)
75 static Standard_Boolean done = Standard_False;
79 const char* g = "Naming builder commands";
81 theCommands.Add("BuildNamedShape",
82 "BuildNamedShape df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) shape1 [shape2 ...]",
83 __FILE__,BuildNamedShape,g);