0030945: JT Import, JtProperty_LateLoaded - expose type of Deferred object
[occt.git] / src / XDEDRAW / XDEDRAW_Shapes.cxx
CommitLineData
b311480e 1// Created on: 2000-08-04
2// Created by: Pavel TELKOV
973c2be1 3// Copyright (c) 2000-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
7fd59977 16
42cf5bc1 17#include <BRep_Builder.hxx>
7fd59977 18#include <DBRep.hxx>
19#include <DDocStd.hxx>
42cf5bc1 20#include <Draw.hxx>
7fd59977 21#include <gp_Trsf.hxx>
42cf5bc1 22#include <TCollection_AsciiString.hxx>
07f20646 23#include <TDataStd_NamedData.hxx>
42cf5bc1 24#include <TDF_AttributeSequence.hxx>
7fd59977 25#include <TDF_Label.hxx>
26#include <TDF_LabelSequence.hxx>
42cf5bc1 27#include <TDF_Tool.hxx>
7fd59977 28#include <TDocStd_Document.hxx>
42cf5bc1 29#include <TopoDS_Compound.hxx>
30#include <TopoDS_Shape.hxx>
31#include <TopTools_SequenceOfShape.hxx>
7fd59977 32#include <XCAFDoc_DocumentTool.hxx>
42cf5bc1 33#include <XCAFDoc_GraphNode.hxx>
7fd59977 34#include <XCAFDoc_Location.hxx>
42cf5bc1 35#include <XCAFDoc_ShapeTool.hxx>
36#include <XDEDRAW_Shapes.hxx>
7fd59977 37
38#include <stdio.h>
7fd59977 39//=======================================================================
40// Section: Work with shapes
41//=======================================================================
7fd59977 42static Standard_Integer addShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
43{
44 if (argc<3) {
586db386 45 di<<"Use: "<<argv[0]<<" DocName Shape [int makeAssembly (1/0)]\n";
7fd59977 46 return 1;
47 }
48 Handle(TDocStd_Document) Doc;
49 DDocStd::GetDocument(argv[1], Doc);
586db386 50 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 51
85831628 52 TopoDS_Shape aShape = DBRep::Get(argv[2]);
53 if (aShape.IsNull())
54 {
55 std::cout << "Syntax error: shape '" << argv[2] << "' is undefined\n";
56 return 1;
57 }
58
7fd59977 59 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
60 Standard_Boolean makeAssembly = Standard_True;
91322f44 61 if ( argc==4 && Draw::Atoi(argv[3]) == 0 ) makeAssembly = Standard_False;
7fd59977 62 TDF_Label aLabel;
63 aLabel = myAssembly->AddShape(aShape, makeAssembly);
586db386 64 if (aLabel.IsNull()) di<<"Null Label\n";
7fd59977 65 TCollection_AsciiString Entry;
66 TDF_Tool::Entry(aLabel, Entry);
67 di << Entry.ToCString();
68 return 0;
69}
70
71static Standard_Integer newShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
72{
73 if (argc!=2) {
586db386 74 di<<"Use: "<<argv[0]<<" DocName \n";
7fd59977 75 return 1;
76 }
77 Handle(TDocStd_Document) Doc;
78 TDF_Label aLabel;
79 DDocStd::GetDocument(argv[1], Doc);
586db386 80 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 81
82 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
83//XCAFDoc_ShapeTool myAssembly;
84// myAssembly.Init(Doc);
85 aLabel=myAssembly->NewShape();
86 // di<<"New Shape at ChildTag"<<aLabel.Tag()<<"\n";
87 TCollection_AsciiString Entry;
88 TDF_Tool::Entry(aLabel, Entry);
89 di << Entry.ToCString();
90 return 0;
91}
92
93static Standard_Integer setShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
94{
95 if (argc!=4) {
586db386 96 di<<"Use: "<<argv[0]<<" DocName Label Shape \n";
7fd59977 97 return 1;
98 }
99 Handle(TDocStd_Document) Doc;
100 DDocStd::GetDocument(argv[1], Doc);
586db386 101 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 102
103 TDF_Label aLabel;
104 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
105 TopoDS_Shape aShape;
586db386 106 // if (aLabel.IsNull()) di<<"Null Label\n";
7fd59977 107 aShape = DBRep::Get(argv[3]);
108// XCAFDoc_ShapeTool myAssembly;
109// myAssembly.Init(Doc);
110 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
9baa8534 111 myAssembly->SetShape(aLabel, aShape);
7fd59977 112 return 0;
113}
114
115static Standard_Integer getShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
116{
117 if (argc!=4) {
586db386 118 di<<"Use: "<<argv[0]<<" Result DocName Label\n";
7fd59977 119 return 1;
120 }
121 Handle(TDocStd_Document) Doc;
122 DDocStd::GetDocument(argv[2], Doc);
586db386 123 if ( Doc.IsNull() ) { di << argv[2] << " is not a document\n"; return 1; }
7fd59977 124
125 TDF_Label aLabel;
126 TDF_Tool::Label(Doc->GetData(), argv[3], aLabel);
586db386 127 if (aLabel.IsNull()) {di<<"No such Label\n"; return 1;}
7fd59977 128 TopoDS_Shape aShape;
129// XCAFDoc_ShapeTool myAssembly;
130// myAssembly.Init(Doc);
131 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
132 aShape = myAssembly->GetShape(aLabel);
133 Standard_CString name1 = argv[1];
134 DBRep::Set(name1, aShape);
135
136 return 0;
137}
138
139static Standard_Integer removeShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
140{
a7aa1465 141 if (argc != 3 && argc != 4)
142 {
586db386 143 di<<"Use: "<<argv[0]<<" DocName Label [int removeCompletely (1/0)]\n";
7fd59977 144 return 1;
145 }
146 Handle(TDocStd_Document) Doc;
147 DDocStd::GetDocument(argv[1], Doc);
586db386 148 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 149
150 TDF_Label aLabel;
151 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
586db386 152 if (aLabel.IsNull()) {di<<"No such Label\n"; return 1;}
7fd59977 153 TopoDS_Shape aShape;
154// XCAFDoc_ShapeTool myAssembly;
155// myAssembly.Init(Doc);
156 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
a7aa1465 157 Standard_Boolean removeCompletely = Standard_True;
91322f44 158 if ( argc == 4 && Draw::Atoi(argv[3]) == 0 )
a7aa1465 159 removeCompletely = Standard_False;
160 myAssembly->RemoveShape(aLabel, removeCompletely);
7fd59977 161
162 return 0;
163}
164
165static Standard_Integer findShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
166{
7783ba11 167 if (argc < 3) {
168 di << "Use: " << argv[0] << " DocName Shape [0/1]\n";
7fd59977 169 return 1;
170 }
171 Handle(TDocStd_Document) Doc;
172 DDocStd::GetDocument(argv[1], Doc);
586db386 173 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 174
175 TDF_Label aLabel;
176 TopoDS_Shape aShape;
177 aShape = DBRep::Get(argv[2]);
178// XCAFDoc_ShapeTool myAssembly;
179// myAssembly.Init(Doc);
180 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
7783ba11 181 Standard_Boolean findInstance = ((argc == 4) && argv[3][0] == '1');
182 aLabel = myAssembly->FindShape(aShape, findInstance);
7fd59977 183 TCollection_AsciiString Entry;
184 TDF_Tool::Entry(aLabel, Entry);
185 di << Entry.ToCString();
186 //di<<"Label with Shape is "<<Entry<<"\n";
187 return 0;
188}
189
f277ba37 190static Standard_Integer findSubShape(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
191{
192 if (argc != 4) {
193 di << "Use: " << argv[0] << " DocName Shape ParentLabel\n";
194 return 1;
195 }
196 Handle(TDocStd_Document) aDoc;
197 DDocStd::GetDocument(argv[1], aDoc);
198 if (aDoc.IsNull()) {
199 di << argv[1] << " is not a document\n";
200 return 1;
201 }
202
203 TopoDS_Shape aShape;
204 aShape = DBRep::Get(argv[2]);
205
206 TDF_Label aParentLabel;
207 TDF_Tool::Label(aDoc->GetData(), argv[3], aParentLabel);
208
209 TDF_Label aLabel;
210 Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
211 aShapeTool->FindSubShape(aParentLabel, aShape, aLabel);
212
213 TCollection_AsciiString anEntry;
214 TDF_Tool::Entry(aLabel, anEntry);
215 di << anEntry.ToCString();
216 return 0;
217}
218
7783ba11 219static Standard_Integer findMainShape(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
220{
221 if (argc != 3) {
222 di << "Use: " << argv[0] << " DocName SubShape\n";
223 return 1;
224 }
225 Handle(TDocStd_Document) aDoc;
226 DDocStd::GetDocument(argv[1], aDoc);
227 if (aDoc.IsNull()) {
228 di << argv[1] << " is not a document\n";
229 return 1;
230 }
231
232 TopoDS_Shape aShape;
233 aShape = DBRep::Get(argv[2]);
234
235 Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
236 TDF_Label aLabel = aShapeTool->FindMainShape(aShape);
237
238 TCollection_AsciiString anEntry;
239 TDF_Tool::Entry(aLabel, anEntry);
240 di << anEntry.ToCString();
241 return 0;
242}
243
244
f277ba37 245static Standard_Integer addSubShape(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
246{
247 if (argc != 4) {
248 di << "Use: " << argv[0] << " DocName Shape ParentLabel\n";
249 return 1;
250 }
251 Handle(TDocStd_Document) aDoc;
252 DDocStd::GetDocument(argv[1], aDoc);
253 if (aDoc.IsNull()) { di << argv[1] << " is not a document\n"; return 1; }
254
255 TopoDS_Shape aShape;
256 aShape = DBRep::Get(argv[2]);
257
258 TDF_Label aParentLabel;
259 TDF_Tool::Label(aDoc->GetData(), argv[3], aParentLabel);
260
261 TDF_Label aLabel;
262 Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
263 aLabel = aShapeTool->AddSubShape(aParentLabel, aShape);
264
265 TCollection_AsciiString anEntry;
266 TDF_Tool::Entry(aLabel, anEntry);
267 di << anEntry.ToCString();
268 return 0;
269}
270
7fd59977 271static Standard_Integer labelInfo (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
272{
273 if (argc!=3) {
586db386 274 di<<"Use: "<<argv[0]<<" DocName Label \n";
7fd59977 275 return 1;
276 }
277 Handle(TDocStd_Document) Doc;
278 DDocStd::GetDocument(argv[1], Doc);
586db386 279 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 280
281 TDF_Label aLabel;
282 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
283// XCAFDoc_ShapeTool myAssembly;
284// myAssembly.Init(Doc);
285 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
286 TCollection_AsciiString Entry;
287
288 if ( myAssembly->IsShape(aLabel) ) {
586db386 289 //di<<"There are a TopLevelShape\n";
7fd59977 290 Entry="There are a TopLevelShape";
291 di << Entry.ToCString();
292 }
293 if ( myAssembly->IsComponent(aLabel) ) {
586db386 294 //di<<"There are a Component\n";
7fd59977 295 Entry="There are a Component";
296 di << Entry.ToCString();
297 }
298 if ( myAssembly->IsAssembly(aLabel) ) {
586db386 299 //di<<"There are an Assembly\n";
7fd59977 300 Entry="There are an Assembly";
301 di << Entry.ToCString();
302 }
303 if ( myAssembly->IsFree(aLabel) ) {
586db386 304 //di<<"This Shape don't used\n";
7fd59977 305 Entry="This Shape don't used";
306 di << Entry.ToCString();
307 }
308 return 0;
309}
310
311static Standard_Integer getUsers (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
312{
313 if (argc<3) {
586db386 314 di<<"Use: "<<argv[0]<<" Doc Label [withSubChilds(int)]\n";
7fd59977 315 return 1;
316 }
317 Standard_Boolean getsubchilds = Standard_False;
91322f44 318 if ( (argc==4) && ( Draw::Atoi(argv[3])==1 ) ) getsubchilds = Standard_True;
7fd59977 319
320 Handle(TDocStd_Document) Doc;
321 DDocStd::GetDocument(argv[1], Doc);
586db386 322 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 323
324 TDF_Label aLabel;
325 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
326 TDF_LabelSequence labseq;
327 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
328 TCollection_AsciiString Entry;
329 Entry=myAssembly->GetUsers(aLabel, labseq, getsubchilds);
330 di << Entry.ToCString();
586db386 331 //di<<myAssembly->GetUsers(aLabel, labseq, getsubchilds)<<" assemblies use this component\n";
7fd59977 332 return 0;
333}
334
335static Standard_Integer nbComponents (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
336{
337 if (argc<3) {
586db386 338 di<<"Use: "<<argv[0]<<" Doc Label [withSubChilds(int)]\n";
7fd59977 339 return 1;
340 }
341 Standard_Boolean getsubchilds = Standard_False;
91322f44 342 if ( (argc==4) && ( Draw::Atoi(argv[3])==1 ) ) getsubchilds = Standard_True;
7fd59977 343 Handle(TDocStd_Document) Doc;
344 DDocStd::GetDocument(argv[1], Doc);
586db386 345 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 346
347 TDF_Label aLabel;
348 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
349 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
350// XCAFDoc_ShapeTool myAssembly->
351// myAssembly->Init(Doc);
352 //di<<"This assembly has ";
353 TCollection_AsciiString Entry;
354 Entry=myAssembly->NbComponents( aLabel, getsubchilds);
355 di << Entry.ToCString();
586db386 356 //di<<" components\n";
357 //di<<"This assembly has "<<myAssembly->NbComponents( aLabel, getsubchilds )<<" components\n";
7fd59977 358
359 return 0;
360}
361
362static Standard_Integer addComponent (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
363{
364 if (argc!=4) {
586db386 365 di<<"Use: "<<argv[0]<<" DocName Label Shape \n";
7fd59977 366 return 1;
367 }
368 Handle(TDocStd_Document) Doc;
369 DDocStd::GetDocument(argv[1], Doc);
586db386 370 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 371
372 TDF_Label aLabel;
373 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
374 TopoDS_Shape aShape;
375 aShape = DBRep::Get(argv[3]);
376 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
377// XCAFDoc_ShapeTool myAssembly->
378// myAssembly->Init(Doc);
379 myAssembly->AddComponent(aLabel, aShape);
380 TCollection_AsciiString Entry;
381 TDF_Tool::Entry(aLabel, Entry);
382 di << Entry.ToCString();
383
384 return 0;
385}
386
387static Standard_Integer removeComponent (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
388{
389 if (argc!=3) {
586db386 390 di<<"Use: "<<argv[0]<<" DocName Label \n";
7fd59977 391 return 1;
392 }
393 Handle(TDocStd_Document) Doc;
394 DDocStd::GetDocument(argv[1], Doc);
586db386 395 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 396
397 TDF_Label aLabel;
398 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
399 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
400// XCAFDoc_ShapeTool myAssembly->
401// myAssembly->Init(Doc);
402 myAssembly->RemoveComponent(aLabel);
403 return 0;
404}
405
406static Standard_Integer getReferredShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
407{
408 if (argc!=3) {
586db386 409 di<<"Use: "<<argv[0]<<" DocName Label \n";
7fd59977 410 return 1;
411 }
412 Handle(TDocStd_Document) Doc;
413 DDocStd::GetDocument(argv[1], Doc);
586db386 414 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 415
416 TDF_Label aLabel, RootLabel;
417 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
418 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
419// XCAFDoc_ShapeTool myAssembly->
420// myAssembly->Init(Doc);
421 myAssembly->GetReferredShape(aLabel, RootLabel);
422
423 TCollection_AsciiString Entry;
424 TDF_Tool::Entry(RootLabel, Entry);
425 //di<<"Label with Shape is ";
426 di << Entry.ToCString();
427 return 0;
428}
429
430static Standard_Integer getTopLevelShapes (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
431{
432 if (argc!=2) {
586db386 433 di<<"Use: "<<argv[0]<<" DocName \n";
7fd59977 434 return 1;
435 }
436 Handle(TDocStd_Document) Doc;
437 DDocStd::GetDocument(argv[1], Doc);
586db386 438 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 439
440 TDF_Label aLabel;
441 TDF_LabelSequence Labels;
442
443 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
444// XCAFDoc_ShapeTool myAssembly->
445// myAssembly->Init(Doc);
446 myAssembly->GetShapes(Labels);
447 TCollection_AsciiString Entry;
448 if (Labels.Length() >= 1) {
449 for ( Standard_Integer i = 1; i<= Labels.Length(); i++) {
450 aLabel = Labels.Value(i);
451 TDF_Tool::Entry( aLabel, Entry);
452 di << Entry.ToCString() << " ";
453 }
454 }
455 return 0;
456}
457
458static Standard_Integer getFreeShapes (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
459{
460 if (argc <2) {
586db386 461 di<<"Use: "<<argv[0]<<" DocName [shape_prefix]\n";
7fd59977 462 return 1;
463 }
464
465 Handle(TDocStd_Document) Doc;
466 DDocStd::GetDocument(argv[1], Doc);
586db386 467 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 468
469 TDF_LabelSequence Labels;
470 Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
471 STool->GetFreeShapes(Labels);
472 if ( Labels.Length() <=0 ) {
586db386 473 di << "Document " << argv[1] << " contain no shapes\n";
7fd59977 474 return 0;
475 }
476
477 if ( argc ==2 ) {
478 for ( Standard_Integer i = 1; i<= Labels.Length(); i++) {
479 TCollection_AsciiString Entry;
480 TDF_Tool::Entry( Labels.Value(i), Entry);
481 di << Entry.ToCString() << " ";
482 }
483 }
484 else if ( Labels.Length() ==1 ) {
485 TopoDS_Shape S = STool->GetShape ( Labels.Value(1) );
486 DBRep::Set ( argv[2], S );
487 di << argv[2];
488 }
489 else {
490 for ( Standard_Integer i = 1; i<= Labels.Length(); i++) {
491 TopoDS_Shape S = STool->GetShape ( Labels.Value(i) );
492 char string[260];
91322f44 493 Sprintf ( string, "%s_%d", argv[2], i );
7fd59977 494 DBRep::Set ( string, S );
495 di << string << " ";
496 }
497 }
498 return 0;
499}
500
501static Standard_Integer getOneShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
502{
503 if (argc!=3) {
586db386 504 di<<"Use: "<<argv[0]<<" shape DocName \n";
7fd59977 505 return 1;
506 }
507
508 Handle(TDocStd_Document) Doc;
509 DDocStd::GetDocument(argv[2], Doc);
586db386 510 if ( Doc.IsNull() ) { di << argv[2] << " is not a document\n"; return 1; }
7fd59977 511
512 TDF_LabelSequence Labels;
513 Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
514 STool->GetFreeShapes(Labels);
515 if ( Labels.Length() <=0 ) {
586db386 516 di << "Document " << argv[2] << " contain no shapes\n";
7fd59977 517 return 0;
518 }
519
520 if ( Labels.Length() ==1 ) {
521 TopoDS_Shape S = STool->GetShape ( Labels.Value(1) );
522 DBRep::Set ( argv[1], S );
523 }
524 else {
525 TopoDS_Compound C;
526 BRep_Builder B;
527 B.MakeCompound ( C );
528 for ( Standard_Integer i = 1; i<= Labels.Length(); i++) {
529 TopoDS_Shape S = STool->GetShape ( Labels.Value(i) );
530 B.Add ( C, S );
531 }
532 DBRep::Set ( argv[1], C );
533 }
534 di << argv[1];
535 return 0;
536}
537
538//=======================================================================
539//function : XDumpLocation
540//purpose : Dump Transformation() of XCAFDoc_Location attribute
541//=======================================================================
542static Standard_Integer XDumpLocation (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
543{
544 if (argc != 3)
545 {
586db386 546 di << "Use: " << argv[0] << " Doc Label \n";
7fd59977 547 return 1;
548 }
549 Handle(TDocStd_Document) Doc;
550 DDocStd::GetDocument(argv[1], Doc);
551 if (Doc.IsNull())
552 {
586db386 553 di << argv[1] << " is not a document\n";
7fd59977 554 return 1;
555 }
556
557 TDF_Label aLabel;
558 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
559
560 Handle(XCAFDoc_Location) aLoc;
561 if (!aLabel.FindAttribute(XCAFDoc_Location::GetID(), aLoc))
562 {
586db386 563 di << "Label " << argv[2] << " doesn't contain XCAFDoc_Location attribute\n";
7fd59977 564 return 1;
565 }
566
567 TopLoc_Location aTopLoc = aLoc->Get();
568 gp_Trsf aTrsf = aTopLoc.Transformation();
569
570 di << "Transformation (3 rows * 4 columns matrix):";
571 for (int i = 1; i <= 3; i++) // row number
572 {
573 di << " (";
574 for (int j = 1; j <= 4; j++) // column number
575 {
576 if (j > 1) di << ",";
577 di << TCollection_AsciiString(aTrsf.Value(i,j)).ToCString();
578 }
579 di << ")";
580 }
581
582 return 0;
583}
584
585static Standard_Integer setSHUO (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
586{
587 if (argc < 4)
588 {
586db386 589 di << "Use: " << argv[0] << " Doc UU_Label NU_Label \n";
7fd59977 590 return 1;
591 }
592 Handle(TDocStd_Document) Doc;
593 DDocStd::GetDocument(argv[1], Doc);
586db386 594 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 595
596 TDF_LabelSequence aLabSeq;
597 for (Standard_Integer i = 3; i <= argc; i++) {
598 TDF_Label L;
599 TDF_Tool::Label(Doc->GetData(), argv[i - 1], L);
600 if (!L.IsNull())
601 aLabSeq.Append( L );
602 else
603 di << argv[i - 1] << " is null label" << "\n";
604 }
605 if (aLabSeq.Length() < 2) {
586db386 606 di << "Error: couldnot set SHUO between on less then 2 labels\n";
7fd59977 607 }
608 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
609 Handle(XCAFDoc_GraphNode) aMainSHUO;
610 myAssembly->SetSHUO( aLabSeq, aMainSHUO );
611 if (aMainSHUO.IsNull()) {
586db386 612 di << "Error: cannot set the SHUO\n";
7fd59977 613 return 1;
614 }
615
616 return 0;
617}
618
619static Standard_Integer getSHUOUpperUsage (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
620{
621 if (argc < 3)
622 {
586db386 623 di << "Use: " << argv[0] << " Doc NU_Label \n";
7fd59977 624 return 1;
625 }
626 Handle(TDocStd_Document) Doc;
627 DDocStd::GetDocument(argv[1], Doc);
586db386 628 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 629 TDF_Label NL;
630 TDF_Tool::Label(Doc->GetData(), argv[2], NL);
631 if (NL.IsNull()) {
632 di << argv[2] << " is null label" << "\n";
633 return 1;
634 }
635 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
636 TDF_LabelSequence labseq;
637 myAssembly->GetSHUOUpperUsage( NL, labseq );
638 TCollection_AsciiString Entry;
639 if (labseq.Length() >= 1) {
640 for ( Standard_Integer i = 1; i<= labseq.Length(); i++) {
641 TDF_Label aLabel = labseq.Value(i);
642 TDF_Tool::Entry( aLabel, Entry);
643 di << Entry.ToCString() << " ";
644 }
645 }
646 return 0;
647}
648
649static Standard_Integer getSHUONextUsage (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
650{
651 if (argc < 3)
652 {
586db386 653 di << "Use: " << argv[0] << " Doc UU_Label \n";
7fd59977 654 return 1;
655 }
656 Handle(TDocStd_Document) Doc;
657 DDocStd::GetDocument(argv[1], Doc);
586db386 658 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 659 TDF_Label UL;
660 TDF_Tool::Label(Doc->GetData(), argv[2], UL);
661 if (UL.IsNull()) {
662 di << argv[2] << " is null label" << "\n";
663 return 1;
664 }
665 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
666 TDF_LabelSequence labseq;
667 myAssembly->GetSHUONextUsage( UL, labseq );
668 TCollection_AsciiString Entry;
669 if (labseq.Length() >= 1) {
670 for ( Standard_Integer i = 1; i<= labseq.Length(); i++) {
671 TDF_Label aLabel = labseq.Value(i);
672 TDF_Tool::Entry( aLabel, Entry);
673 di << Entry.ToCString() << " ";
674 }
675 }
676 return 0;
677}
678
679static Standard_Integer removeSHUO (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
680{
681 if (argc < 3)
682 {
586db386 683 di << "Use: " << argv[0] << " Doc SHUOComponent_Label \n";
7fd59977 684 return 1;
685 }
686 Handle(TDocStd_Document) Doc;
687 DDocStd::GetDocument(argv[1], Doc);
586db386 688 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 689 TDF_Label UL;
690 TDF_Tool::Label(Doc->GetData(), argv[2], UL);
691 if (UL.IsNull()) {
692 di << argv[2] << " is null label" << "\n";
693 return 1;
694 }
695 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
696 myAssembly->RemoveSHUO( UL );
697
698 return 0;
699}
700
701static Standard_Integer hasSHUO (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
702{
703 if (argc < 3)
704 {
586db386 705 di << "Use: " << argv[0] << " Doc SHUO_Label \n";
7fd59977 706 return 1;
707 }
708 Handle(TDocStd_Document) Doc;
709 DDocStd::GetDocument(argv[1], Doc);
586db386 710 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 711 TDF_Label UL;
712 TDF_Tool::Label(Doc->GetData(), argv[2], UL);
713 if (UL.IsNull()) {
714 di << argv[2] << " is null label" << "\n";
715 return 1;
716 }
717 Handle(XCAFDoc_GraphNode) anAttrSHUO;
718 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
719 if (myAssembly->GetSHUO( UL, anAttrSHUO ))
720 di << 1;
721 else
722 di << 0;
723
724 return 0;
725}
726
727static Standard_Integer getAllSHUO (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
728{
729 if (argc < 3)
730 {
586db386 731 di << "Use: " << argv[0] << " Doc SHUO_Label \n";
7fd59977 732 return 1;
733 }
734 Handle(TDocStd_Document) Doc;
735 DDocStd::GetDocument(argv[1], Doc);
586db386 736 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 737 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
738 TDF_Label UL;
739 TDF_Tool::Label(Doc->GetData(), argv[2], UL);
740 if (UL.IsNull()) {
741 di << argv[2] << " is null label" << "\n";
742 return 1;
743 }
744 TDF_AttributeSequence SHUOAttrs;
745 myAssembly->GetAllComponentSHUO( UL, SHUOAttrs );
746 TCollection_AsciiString Entry;
747 if (SHUOAttrs.Length() >= 1) {
748 for ( Standard_Integer i = 1; i<= SHUOAttrs.Length(); i++) {
749 TDF_Label aLabel = SHUOAttrs.Value(i)->Label();
750 TDF_Tool::Entry( aLabel, Entry);
751 di << Entry.ToCString() << " ";
752 }
753 }
754 return 0;
755}
756
757static Standard_Integer findComponent (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
758{
759 if (argc < 3)
760 {
586db386 761 di << "Use: " << argv[0] << " Doc shape \n";
7fd59977 762 return 1;
763 }
764 Handle(TDocStd_Document) Doc;
765 DDocStd::GetDocument(argv[1], Doc);
586db386 766 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 767 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
768 TopoDS_Shape aShape;
769 aShape = DBRep::Get(argv[2]);
770 TDF_LabelSequence labseq;
771 myAssembly->FindComponent( aShape, labseq );
772 TCollection_AsciiString Entry;
773 if (labseq.Length() >= 1) {
774 for ( Standard_Integer i = 1; i<= labseq.Length(); i++) {
775 TDF_Label aLabel = labseq.Value(i);
776 TDF_Tool::Entry( aLabel, Entry);
777 di << Entry.ToCString() << " ";
778 }
779 }
780 return 0;
781}
782
783static Standard_Integer getStyledComponent (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
784{
785 if (argc < 4)
786 {
586db386 787 di << "Use: " << argv[0] << " Doc res SHUO_label \n";
7fd59977 788 return 1;
789 }
790 Handle(TDocStd_Document) Doc;
791 DDocStd::GetDocument(argv[1], Doc);
586db386 792 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 793 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
794 TopoDS_Shape aShape;
795 TDF_Label aLabel;
796 TDF_Tool::Label(Doc->GetData(), argv[3], aLabel);
797 Handle(XCAFDoc_GraphNode) SHUO;
798 if (myAssembly->GetSHUO( aLabel, SHUO ))
799 aShape = myAssembly->GetSHUOInstance( SHUO );
800
801 if (aShape.IsNull()) {
586db386 802 di << "cannot get component\n";
7fd59977 803 return 1;
804 }
805 DBRep::Set ( argv[2], aShape );
806 di << argv[2];
807 return 0;
808}
809
810static Standard_Integer getAllStyledComponents (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
811{
812 if (argc < 4)
813 {
586db386 814 di << "Use: " << argv[0] << " Doc res SHUO_label \n";
7fd59977 815 return 1;
816 }
817 Handle(TDocStd_Document) Doc;
818 DDocStd::GetDocument(argv[1], Doc);
586db386 819 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 820 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
821 TopTools_SequenceOfShape aShapes;
822 TDF_Label aLabel;
823 TDF_Tool::Label(Doc->GetData(), argv[3], aLabel);
824 Handle(XCAFDoc_GraphNode) SHUO;
825 if (myAssembly->GetSHUO( aLabel, SHUO ))
826 if (myAssembly->GetAllSHUOInstances(SHUO, aShapes)) {
827 TopoDS_Compound aShape;
828 BRep_Builder B;
829 B.MakeCompound(aShape);
830 for (Standard_Integer jj = 1; jj <= aShapes.Length(); jj++) {
831 TopoDS_Shape aCurShape = aShapes.Value(jj);
832 B.Add( aShape, aCurShape );
833 }
834 DBRep::Set ( argv[2], aShape );
835 di << argv[2];
836 }
837
838 return 0;
839}
840
841static Standard_Integer findSHUO (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
842{
843 if (argc < 4)
844 {
586db386 845 di << "Use: " << argv[0] << " Doc labels \n";
7fd59977 846 return 1;
847 }
848 Handle(TDocStd_Document) Doc;
849 DDocStd::GetDocument(argv[1], Doc);
586db386 850 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 851 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
852 TDF_LabelSequence aLabSeq;
853 for (Standard_Integer i = 3; i <= argc; i++) {
854 TDF_Label L;
855 TDF_Tool::Label(Doc->GetData(), argv[i - 1], L);
856 if (!L.IsNull())
857 aLabSeq.Append( L );
858 else
859 di << argv[i - 1] << " is null label" << "\n";
860 }
861 if (aLabSeq.Length() < 2) {
586db386 862 di << "Error: couldnot find SHUO between on less then 2 labels\n";
7fd59977 863 }
864 Handle(XCAFDoc_GraphNode) SHUO;
865 myAssembly->FindSHUO( aLabSeq, SHUO );
866 if (SHUO.IsNull()) {
586db386 867 di << "cannot find SHUO\n";
7fd59977 868 return 1;
869 }
870 TCollection_AsciiString Entry;
871 TDF_Tool::Entry( SHUO->Label(), Entry);
872 di << Entry.ToCString() << " ";
873
874 return 0;
875}
876
877static Standard_Integer setStyledComponent (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
878{
879 if (argc < 3)
880 {
586db386 881 di << "Use: " << argv[0] << " Doc shape \n";
7fd59977 882 return 1;
883 }
884 Handle(TDocStd_Document) Doc;
885 DDocStd::GetDocument(argv[1], Doc);
586db386 886 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
7fd59977 887 Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
888 TopoDS_Shape aShape;
889 aShape = DBRep::Get(argv[2]);
890 if (aShape.IsNull()) {
586db386 891 di << "Shape " << argv[2] << " is null\n";
7fd59977 892 return 1;
893 }
894 Handle(XCAFDoc_GraphNode) aSHUOAttr;
895 aSHUOAttr = myAssembly->SetInstanceSHUO( aShape );
896 if (aSHUOAttr.IsNull()) {
897 di << "Error: cannot set a SHUO structure for indicated component" << "\n";
898 return 1;
899 }
900 TCollection_AsciiString Entry;
901 TDF_Tool::Entry( aSHUOAttr->Label(), Entry);
902 di << Entry.ToCString() << " ";
903
904 return 0;
905}
acc909a8 906
907static Standard_Integer updateAssemblies(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
908{
909 if (argc != 2)
910 {
911 di << "Use: " << argv[0] << " Doc\n";
912 return 1;
913 }
914
915 // Get XDE document
916 Handle(TDocStd_Document) aDoc;
917 DDocStd::GetDocument(argv[1], aDoc);
918 if ( aDoc.IsNull() )
919 return 1;
920
921 // Get XDE shape tool
922 Handle(XCAFDoc_ShapeTool)
923 aShapeTool = XCAFDoc_DocumentTool::ShapeTool( aDoc->Main() );
924
925 // Update assemblies
926 aShapeTool->UpdateAssemblies();
927
928 return 0;
929}
930
07f20646 931static Standard_Integer XGetProperties(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
932{
933 if (argc != 3)
934 {
935 std::cout << "Syntax error: wrong number of arguments\nUse: " << argv[0] << " Doc Label\n";
936 return 1;
937 }
938
939 Handle(TDocStd_Document) aDoc;
940 DDocStd::GetDocument(argv[1], aDoc);
941 if (aDoc.IsNull())
942 {
943 std::cout << "Syntax error: " << argv[1] << " is not a document\n";
944 return 1;
945 }
946
947 TDF_Label aLabel;
948 TDF_Tool::Label(aDoc->GetData(), argv[2], aLabel);
949
950 // Get XDE shape tool
951 Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
952
953 Handle(TDataStd_NamedData) aNamedData = aShapeTool->GetNamedProperties(aLabel);
954
955 if (aNamedData.IsNull())
956 {
957 di << argv[2] << " has no properties\n";
958 return 0;
959 }
960
5a8d30b8 961 aNamedData->LoadDeferredData();
07f20646 962 if (aNamedData->HasIntegers())
963 {
964 TColStd_DataMapOfStringInteger anIntProperties = aNamedData->GetIntegersContainer();
965 for (TColStd_DataMapIteratorOfDataMapOfStringInteger anIter(anIntProperties); anIter.More(); anIter.Next())
966 {
967 di << anIter.Key() << " : " << anIter.Value() << "\n";
968 }
969 }
970 if (aNamedData->HasReals())
971 {
972 TDataStd_DataMapOfStringReal aRealProperties = aNamedData->GetRealsContainer();
973 for (TDataStd_DataMapIteratorOfDataMapOfStringReal anIter(aRealProperties); anIter.More(); anIter.Next())
974 {
975 di << anIter.Key() << " : " << anIter.Value() << "\n";
976 }
977 }
978 if (aNamedData->HasStrings())
979 {
980 TDataStd_DataMapOfStringString aStringProperties = aNamedData->GetStringsContainer();
981 for (TDataStd_DataMapIteratorOfDataMapOfStringString anIter(aStringProperties); anIter.More(); anIter.Next())
982 {
983 di << anIter.Key() << " : " << anIter.Value() << "\n";
984 }
985 }
986
987 return 0;
988}
989
7fd59977 990//=======================================================================
991//function : InitCommands
992//purpose :
993//=======================================================================
994
995void XDEDRAW_Shapes::InitCommands(Draw_Interpretor& di)
996{
7fd59977 997 static Standard_Boolean initactor = Standard_False;
c48e2889 998 if (initactor)
999 {
1000 return;
1001 }
1002 initactor = Standard_True;
7fd59977 1003
1004 //=====================================
1005 // Work with shapes
1006 //=====================================
1007
1008 Standard_CString g = "XDE shape's commands";
1009
1010 di.Add ("XAddShape","Doc Shape [makeAssembly = 1]\t: Add shape (or assembly) to Document",
1011 __FILE__, addShape, g);
1012
1013 di.Add ("XNewShape","Doc \t: Create new empty top-level shape",
1014 __FILE__, newShape, g);
1015
1016 di.Add ("XSetShape","Doc Label Shape \t: Set shape at indicated label",
1017 __FILE__, setShape, g);
1018
1019 di.Add ("XGetShape","Result Doc Label \t: Put shape from tree to Result",
1020 __FILE__, getShape, g);
1021
1022 di.Add ("XRemoveShape","Doc Label \t: Remove shape from document",
1023 __FILE__, removeShape, g);
1024
7783ba11 1025 di.Add ("XFindShape","Doc Shape [findInstance (0/1), 0 by default]\t: Find and print label with indicated top-level shape",
7fd59977 1026 __FILE__, findShape, g);
1027
f277ba37 1028 di.Add("XFindSubShape", "Doc Shape ParentLabel \t: Find subshape under given parent shape label",
1029 __FILE__, findSubShape, g);
1030
7783ba11 1031 di.Add("XFindMainShape", "Doc SubShape \t: Find main shape for given subshape",
1032 __FILE__, findMainShape, g);
1033
f277ba37 1034 di.Add("XAddSubShape", "Doc Shape ParentLabel \t: Add subshape under given parent shape label",
1035 __FILE__, addSubShape, g);
1036
7fd59977 1037 di.Add ("XLabelInfo","Doc Label \t: Print information about object at following label",
1038 __FILE__, labelInfo, g);
1039
1040 di.Add ("XGetUsers","Doc Label [withSubChilds(int)] \t: Print number of assemblies that use shape at following label",
1041 __FILE__, getUsers, g);
1042
1043 di.Add ("XNbComponents","Doc Label [withSubChilds(int)] \t: Print number of component of assembly ",
1044 __FILE__, nbComponents, g);
1045
1046 di.Add ("XAddComponent","Doc Label Shape \t: Add component shape to assembly",
1047 __FILE__, addComponent, g);
1048
1049 di.Add ("XRemoveComponent","Doc Label \t: Remove component from components label",
1050 __FILE__, removeComponent, g);
1051
1052 di.Add ("XGetReferredShape","Doc Label \t: Print label, that contain a top-level shape, that corresponds shape at following label",
1053 __FILE__, getReferredShape, g);
1054
1055 di.Add ("XGetTopLevelShapes","Doc \t: Print labels, that contain a top-level shapes",
1056 __FILE__, getTopLevelShapes, g);
1057
1058 di.Add ("XGetFreeShapes","Doc [shape_prefix]\t: Print labels or create DRAW shapes for all free shapes in the Doc",
1059 __FILE__, getFreeShapes, g);
1060
1061 di.Add ("XGetOneShape","shape Doc \t: Put all free shapes of the Doc into signle DRAW shape",
1062 __FILE__, getOneShape, g);
1063
1064 di.Add ("XDumpLocation","Doc Label \t: Dump Transformation() of XCAFDoc_Location attribute",
1065 __FILE__, XDumpLocation, g);
1066
1067 di.Add ("XSetSHUO","Doc UU_Label [ multi-level labels ] NU_Label \t: sets the SHUO structure between UpperUsage and NextUsage",
1068 __FILE__, setSHUO, g);
1069
1070 di.Add ("XGetUU_SHUO","Doc NU_Label \t: prints the UpperUsages of indicated NextUsage",
1071 __FILE__, getSHUOUpperUsage, g);
1072
1073 di.Add ("XGetNU_SHUO","Doc UU_Label \t: prints the NextUsages of indicated UpperUsage",
1074 __FILE__, getSHUONextUsage, g);
1075
1076 di.Add ("XRemoveSHUO","Doc SHUO_Label \t: remove SHUO of indicated component",
1077 __FILE__, removeSHUO, g);
1078
1079 di.Add ("XIsHasSHUO","Doc SHUO_Label \t: remove SHUO of indicated component",
1080 __FILE__, hasSHUO, g);
1081
1082 di.Add ("XGetAllSHUO","Doc Comp_Label \t: remove SHUO of indicated component",
1083 __FILE__, getAllSHUO, g);
1084
1085 di.Add ("XFindComponent","Doc Shape \t: prints sequence of labels of assembly path",
1086 __FILE__, findComponent, g);
1087
1088 di.Add ("XGetSHUOInstance","Doc res SHUO_Label \t: returns SHUO_styled shape",
1089 __FILE__, getStyledComponent, g);
1090
1091 di.Add ("XGetAllSHUOInstances","Doc res SHUO_Label \t: returns SHUO_styled shapes as compound",
1092 __FILE__, getAllStyledComponents, g);
1093
1094 di.Add ("XFindSHUO","Doc labels of SHUO structure \t: prints label of SHUO that found by labels structure",
1095 __FILE__, findSHUO, g);
1096
1097 di.Add ("XSetInstanceSHUO","Doc shape \t: sets the SHUO structure for indicated component",
1098 __FILE__, setStyledComponent, g);
1099
acc909a8 1100 di.Add ("XUpdateAssemblies","Doc \t: updates assembly compounds",
1101 __FILE__, updateAssemblies, g);
07f20646 1102
1103 di.Add("XGetProperties", "Doc Label \t: prints named properties assigned to the Label",
1104 __FILE__, XGetProperties, g);
7fd59977 1105}