55f02372586379e117f3a791f9a2e7f5645bb762
[occt.git] / src / DPrsStd / DPrsStd_AISPresentationCommands.cxx
1 // Created on: 1998-10-07
2 // Created by: Denis PASCAL
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <DPrsStd.hxx>
18 #include <Draw.hxx>
19 #include <Draw_Appli.hxx>
20 #include <Draw_Interpretor.hxx>
21 #include <Draw_ColorKind.hxx>
22 #include <TCollection_AsciiString.hxx>
23 #include <TDocStd_Document.hxx>
24 #include <TDF_Label.hxx>
25 #include <TDF_Data.hxx> 
26 #include <DDF.hxx>
27 #include <DDocStd.hxx>
28 #include <ViewerTest.hxx>
29
30
31 #include <V3d_View.hxx>
32
33
34 // for AIS
35
36 #include <TPrsStd_AISPresentation.hxx>
37 #include <TPrsStd_AISViewer.hxx>
38 #include <ViewerTest.hxx>
39 #include <AIS_InteractiveContext.hxx> 
40 #include <AIS_InteractiveObject.hxx>
41 #include <AIS_Drawer.hxx> 
42 #include <ViewerTest.hxx>
43 #include <V3d_View.hxx>
44 #include <TCollection_ExtendedString.hxx>
45 #include <Quantity_NameOfColor.hxx>
46 #include <Graphic3d_NameOfMaterial.hxx>
47
48 #include <TDataXtd_Axis.hxx>
49 #include <TDataXtd_Constraint.hxx>
50 #include <TDataXtd_Geometry.hxx>
51 #include <TNaming_NamedShape.hxx>
52 #include <TDataXtd_Plane.hxx>
53 #include <TDataXtd_Point.hxx>
54 #include <Standard_PCharacter.hxx>
55
56 //#include <TSketchStd_Geometry.hxx>
57 //#include <TSketchStd_Edge.hxx>
58
59 //=======================================================================
60 //function : DPrsStd_AISDisplay
61 //purpose  : DDisplay (DOC,entry, not_update)
62 //=======================================================================
63
64 static Standard_Integer DPrsStd_AISDisplay (Draw_Interpretor&,
65                                           Standard_Integer nb, 
66                                           const char** arg) 
67 {   
68        
69   Handle(TDocStd_Document) D;
70   if (!DDocStd::GetDocument(arg[1],D)) return 1; 
71   TDF_Label L;
72   if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;
73   Handle(TPrsStd_AISPresentation) prs;
74   if(!L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) return 1;  
75   if (nb == 3) {
76     prs->Display(Standard_True);
77     TPrsStd_AISViewer::Update(L);
78     return 0;
79   }
80   else {
81     prs->Display();
82     TPrsStd_AISViewer::Update(L);
83     return 0;
84   }
85 }
86
87 //=======================================================================
88 //function : DPrsStd_AISRemove
89 //purpose  : AISRemove (DOC,entry)
90 //=======================================================================
91
92 static Standard_Integer DPrsStd_AISRemove (Draw_Interpretor& di,
93                                            Standard_Integer nb, 
94                                            const char** arg) 
95 {   
96    if (nb == 3) {     
97      Handle(TDocStd_Document) D;
98      if (!DDocStd::GetDocument(arg[1],D)) return 1; 
99      TDF_Label L;
100      if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;
101      Handle(TPrsStd_AISPresentation) P;
102      if(!L.FindAttribute(TPrsStd_AISPresentation::GetID(), P)) return 1;
103      P->Erase(Standard_True);
104      TPrsStd_AISViewer::Update(L);
105      return 0;
106    }
107    di << "DPrsStd_AISRedisplay : Error" << "\n";
108    return 1;
109 }
110
111
112 //=======================================================================
113 //function : DPrsStd_AISErase
114 //purpose  : AISErase (DOC,entry)
115 //=======================================================================
116
117 static Standard_Integer DPrsStd_AISErase (Draw_Interpretor& di,
118                                         Standard_Integer nb, 
119                                         const char** arg) 
120 {   
121   if (nb == 3) {     
122     Handle(TDocStd_Document) D;
123     if (!DDocStd::GetDocument(arg[1],D)) return 1; 
124     TDF_Label L;
125     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;
126     Handle(TPrsStd_AISPresentation) prs;
127     if(!L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) return 1;  
128     prs->Erase();
129     TPrsStd_AISViewer::Update(L);
130     return 0;
131   }
132   di << "DPrsStd_AISErase : Error" << "\n";
133   return 1;
134 }
135
136 //=======================================================================
137 //function : DPrsStd_AISUpdate
138 //purpose  : AISUpdate (DOC,entry)
139 //=======================================================================
140
141 static Standard_Integer DPrsStd_AISUpdate (Draw_Interpretor& di,
142                                          Standard_Integer nb, 
143                                          const char** arg) 
144 {   
145   if (nb == 3) {     
146     Handle(TDocStd_Document) D;
147     if (!DDocStd::GetDocument(arg[1],D)) return 1; 
148     TDF_Label L;
149     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;
150     Handle(TPrsStd_AISPresentation) prs;
151     if(!L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) return 1;  
152     prs->Update();
153     TPrsStd_AISViewer::Update(L);
154     return 0;
155   }
156   di << "DPrsStd_AISUpdate : Error" << "\n";
157   return 1;
158 }
159
160
161 //=======================================================================
162 //function : DPrsStd_AISSet
163 //purpose  : AISSet (DOC,entry, id)
164 //=======================================================================
165
166 static Standard_Integer DPrsStd_AISSet (Draw_Interpretor& di,
167                                         Standard_Integer nb, 
168                                         const char** arg) 
169 {   
170   if (nb == 4) {        
171     Handle(TDocStd_Document) D;
172     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
173     TDF_Label L;
174     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1; 
175     Standard_GUID guid;
176     TCollection_ExtendedString str = arg[3];
177 #ifdef DEB
178     cout << "Inputed parameter > " << str   << endl;
179 #endif
180     if ( str == "A" )  //axis
181       guid = TDataXtd_Axis::GetID();     //"2a96b601-ec8b-11d0-bee7-080009dc3333" 
182     else if( str ==  "C")        //constraint 
183       guid = TDataXtd_Constraint::GetID();    //"2a96b602-ec8b-11d0-bee7-080009dc3333" 
184     else if( str == "NS" )        //namedshape
185       guid = TNaming_NamedShape::GetID();     //"c4ef4200-568f-11d1-8940-080009dc3333" 
186     else if( str == "G" )        //geometry
187       guid = TDataXtd_Geometry::GetID();      //"2a96b604-ec8b-11d0-bee7-080009dc3333"
188     else if( str == "PL" )        //plane
189       guid = TDataXtd_Plane::GetID();    //"2a96b60c-ec8b-11d0-bee7-080009dc3333"
190     else if( str == "PT" )        //point
191       guid = TDataXtd_Point::GetID();    //"2a96b60d-ec8b-11d0-bee7-080009dc3333"
192 //    else if( str == "SG" )        //TSketch_Geometry
193 //      guid = TSketchStd_Geometry::GetID();    //"b3aac909-5b78-11d1-8940-080009dc3333"
194 //    else if( str == "E" )        //TSketch_Edge
195 //      guid = TSketchStd_Edge::GetID();           //"b3aac90a-5b78-11d1-8940-080009dc3333"
196
197     Handle(TPrsStd_AISPresentation) prs= TPrsStd_AISPresentation::Set(L, guid);
198 #ifdef DEB
199     cout << "Driver GUID = ";
200     prs->GetDriverGUID().ShallowDump(cout);
201     cout << "\n";
202 #endif
203     Standard_Character resS[37];
204     Standard_PCharacter presS;
205     presS=resS;
206     guid.ToCString(presS);
207     di<<resS;
208     return 0; 
209   }
210   di << "DPrsStd_AISSet : Error" << "\n";
211   return 1; 
212 }
213
214 //=======================================================================
215 //function : DPrsStd_AISDriver
216 //purpose  : AISDriver (DOC,entry, [ID])
217 //=======================================================================
218
219 static Standard_Integer DPrsStd_AISDriver (Draw_Interpretor& di,
220                                            Standard_Integer nb, 
221                                            const char** arg) 
222 {   
223   if (nb >= 3) {     
224     Handle(TDocStd_Document) D;
225     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
226     TDF_Label L;
227     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1; 
228
229     Standard_GUID guid;
230     Handle(TPrsStd_AISPresentation) prs;
231     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
232       if( nb == 3 ) {
233         guid = prs->GetDriverGUID();
234         Standard_Character str[37];
235         Standard_PCharacter pstr;
236         pstr=str;
237         guid.ToCString( pstr );
238         di << str ;
239         return 0; 
240       }
241       else {
242         TCollection_ExtendedString str = arg[3];
243 #ifdef DEB
244         cout << "Inputed parameter > " << str   << endl;
245 #endif
246         if ( str == "A" )  //axis
247           guid = TDataXtd_Axis::GetID();     //"2a96b601-ec8b-11d0-bee7-080009dc3333" 
248         else if( str ==  "C")        //constraint 
249           guid = TDataXtd_Constraint::GetID();    //"2a96b602-ec8b-11d0-bee7-080009dc3333" 
250         else if( str == "NS" )        //namedshape
251           guid = TNaming_NamedShape::GetID();     //"c4ef4200-568f-11d1-8940-080009dc3333" 
252         else if( str == "G" )        //geometry
253           guid = TDataXtd_Geometry::GetID();      //"2a96b604-ec8b-11d0-bee7-080009dc3333"
254         else if( str == "PL" )        //plane
255           guid = TDataXtd_Plane::GetID();    //"2a96b60c-ec8b-11d0-bee7-080009dc3333"
256         else if( str == "PT" )        //point
257           guid = TDataXtd_Point::GetID();    //"2a96b60d-ec8b-11d0-bee7-080009dc3333"
258 //      else if( str == "SG" )        //TSketch_Geometry
259 //        guid = TSketchStd_Geometry::GetID();    //"b3aac909-5b78-11d1-8940-080009dc3333"
260 //      else if( str == "E" )        //TSketch_Edge
261 //        guid = TSketchStd_Edge::GetID();           //"b3aac90a-5b78-11d1-8940-080009dc3333"
262
263         prs->SetDriverGUID(guid);
264         Standard_Character resS[37];
265         Standard_PCharacter presS;
266         //modified by NIZNHY-PKV Tue Apr 22 16:15:02 2008f
267         presS=resS;
268         //modified by NIZNHY-PKV Tue Apr 22 16:15:05 2008t
269         guid.ToCString( presS );
270         di << resS ;
271         return 0;
272       }
273     }
274   }
275   di << "DPrsStd_AISDriver : Error" << "\n";
276   return 1;  
277 }
278
279 //=======================================================================
280 //function : DPrsStd_AISUnset
281 //purpose  : AISUnset (DOC,entry)
282 //=======================================================================
283
284 static Standard_Integer DPrsStd_AISUnset (Draw_Interpretor& di,
285                                           Standard_Integer nb, 
286                                           const char** arg) 
287 {   
288   if (nb == 3) {     
289     Handle(TDocStd_Document) D;
290     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
291     TDF_Label L;
292     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1; 
293     TPrsStd_AISPresentation::Unset(L);
294     TPrsStd_AISViewer::Update(L);
295     return 0; 
296   }
297   di << "DPrsStd_AISDriver : Error" << "\n";
298   return 1;  
299 }
300
301
302 //=======================================================================
303 //function : DPrsStd_AISTransparency 
304 //purpose  : AISTransparency  (DOC,entry,[real])
305 //=======================================================================
306
307 static Standard_Integer DPrsStd_AISTransparency (Draw_Interpretor& di,
308                                                  Standard_Integer nb, 
309                                                  const char** arg) 
310 {
311   if (nb >= 3 ) {     
312     Handle(TDocStd_Document) D;
313     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
314     TDF_Label L;
315     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;  
316
317     Handle(TPrsStd_AISViewer) viewer;
318     if( !TPrsStd_AISViewer::Find(L, viewer) ) return 1;  
319
320     Handle(TPrsStd_AISPresentation) prs;
321     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
322       if( nb == 4 ) {
323         prs->SetTransparency(Draw::Atof(arg[3]));
324         TPrsStd_AISViewer::Update(L);
325       }
326       else {
327        if (prs->HasOwnTransparency()){ 
328          di << "Transparency = " << prs->Transparency() << "\n";
329          di<<prs->Transparency();
330        }
331        else{
332          di << "DPrsStd_AISTransparency: Warning : Transparency wasn't set" << "\n";
333          di<<(-1);
334        }
335       }
336       return 0;
337     }
338   }
339   di << "DPrsStd_AISTransparency : Error"   << "\n";
340   return 1;
341 }
342
343 //=======================================================================
344 //function : DPrsStd_AISDefaultTransparency
345 //purpose  : AISDefaultTransparency (DOC,entry)
346 //=======================================================================
347
348 static Standard_Integer DPrsStd_AISDefaultTransparency (Draw_Interpretor& di,
349                                                         Standard_Integer nb, 
350                                                         const char** arg) 
351 {   
352   if (nb == 3) {     
353     Handle(TDocStd_Document) D;
354     if (!DDocStd::GetDocument(arg[1],D)) return 1;   
355     TDF_Label L;
356     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;   
357
358     Handle(TPrsStd_AISPresentation) prs;
359     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {    
360       prs->UnsetTransparency();
361       TPrsStd_AISViewer::Update(L);
362       return 0;
363     }
364   }
365   di << "DPrsStd_AISDefaultTransparency : Error"   << "\n";
366   return 1;
367 }
368
369 //=======================================================================
370 //function : DPrsStd_AISColor 
371 //purpose  : AISColor (DOC,entry,[color])
372 //=======================================================================
373
374 static Standard_Integer DPrsStd_AISColor (Draw_Interpretor& di,
375                                           Standard_Integer nb, 
376                                           const char** arg) 
377 {
378   if (nb >= 3) {     
379     Handle(TDocStd_Document) D;
380     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
381     TDF_Label L;
382     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;  
383
384     Handle(TPrsStd_AISViewer) viewer;
385     if( !TPrsStd_AISViewer::Find(L, viewer) ) return 1;  
386
387     Handle(TPrsStd_AISPresentation) prs;
388     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
389       if( nb == 4 ) {
390         prs->SetColor((Quantity_NameOfColor)Draw::Atoi(arg[3]));
391         TPrsStd_AISViewer::Update(L);
392       }
393       else
394        if (prs->HasOwnColor()){ 
395          di << "Color = " << prs->Color() << "\n";
396          di<<prs->Color();
397        }
398        else{
399          di << "DPrsStd_AISColor: Warning : Color wasn't set" << "\n";
400          di<<(-1);
401        }
402       return 0; 
403     }
404   }
405   di << "DPrsStd_AISColor : Error"   << "\n";
406   return 1;
407 }
408
409 //=======================================================================
410 //function : DPrsStd_AISDefaultColor 
411 //purpose  : AISDefaultColor (DOC,entry)
412 //=======================================================================
413
414 static Standard_Integer DPrsStd_AISDefaultColor (Draw_Interpretor& di,
415                                                  Standard_Integer nb, 
416                                                  const char** arg) 
417 {
418   if (nb == 3) {     
419     Handle(TDocStd_Document) D;
420     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
421     TDF_Label L;
422     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;  
423
424     Handle(TPrsStd_AISViewer) viewer;
425     if( !TPrsStd_AISViewer::Find(L, viewer) ) return 1;  
426
427     Handle(TPrsStd_AISPresentation) prs;
428     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
429       prs->UnsetColor();
430       TPrsStd_AISViewer::Update(L);
431       return 0; 
432     }
433   }
434   di << "DPrsStd_AISDefaultColor : Error"   << "\n";
435   return 1;
436 }
437
438 //=======================================================================
439 //function : DPrsStd_AISMaterial
440 //purpose  : AISMaterial (DOC,entry,[material])
441 //=======================================================================
442
443 static Standard_Integer DPrsStd_AISMaterial (Draw_Interpretor& di,
444                                              Standard_Integer nb, 
445                                              const char** arg) 
446 {
447   if (nb >= 3) {     
448     Handle(TDocStd_Document) D;
449     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
450     TDF_Label L;
451     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;  
452
453     Handle(TPrsStd_AISViewer) viewer;
454     if( !TPrsStd_AISViewer::Find(L, viewer) ) return 1;  
455
456     Handle(TPrsStd_AISPresentation) prs;
457     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
458       if( nb == 4 ) {
459         prs->SetMaterial((Graphic3d_NameOfMaterial)Draw::Atoi(arg[3]));
460         TPrsStd_AISViewer::Update(L);
461       }
462       else {
463        if (prs->HasOwnMaterial()){ 
464          di << "Material = " << prs->Material() << "\n";
465          di<<prs->Material();
466        }
467        else{
468          di << "DPrsStd_AISMaterial: Warning : Material wasn't set" << "\n";
469          di<<(-1);
470        }
471       }
472       return 0;
473     }
474   }
475   di << "DPrsStd_AISMaterial : Error"   << "\n";
476   return 1;
477 }
478
479 //=======================================================================
480 //function : DPrsStd_AISDefaultMaterial
481 //purpose  : AISDefaultMaterial (DOC,entry)
482 //=======================================================================
483
484 static Standard_Integer DPrsStd_AISDefaultMaterial (Draw_Interpretor& di,
485                                                     Standard_Integer nb, 
486                                                     const char** arg) 
487 {
488   if (nb == 3) {     
489     Handle(TDocStd_Document) D;
490     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
491     TDF_Label L;
492     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;  
493
494     Handle(TPrsStd_AISViewer) viewer;
495     if( !TPrsStd_AISViewer::Find(L, viewer) ) return 1;  
496
497     Handle(TPrsStd_AISPresentation) prs;
498     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
499       prs->UnsetMaterial();
500       TPrsStd_AISViewer::Update(L);
501       return 0; 
502     }
503   }
504   di << "DPrsStd_AISDefaultMaterial : Error"   << "\n";
505   return 1;
506 }
507
508 //=======================================================================
509 //function : DPrsStd_AISHasOwnColor 
510 //purpose  : AISHasOwnColor (DOC,entry)
511 //return   : Boolean 
512 //=======================================================================
513
514 static Standard_Integer DPrsStd_AISHasOwnColor (Draw_Interpretor& di,
515                                                 Standard_Integer nb, 
516                                                 const char** arg) 
517 {
518   if (nb >= 3) {     
519     if (nb > 3)
520       di << "DPrsStd_AISHasOwnColor : Warning : too many arguments" << "\n";
521
522     Handle(TDocStd_Document) D;
523     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
524     TDF_Label L;
525     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;  
526
527     Handle(TPrsStd_AISViewer) viewer;
528     if( !TPrsStd_AISViewer::Find(L, viewer) ) return 1;  
529
530     Handle(TPrsStd_AISPresentation) prs;
531     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
532       di<<Standard_Integer(prs->HasOwnColor()); 
533       return 0; 
534     }
535
536   }
537   di << "DPrsStd_AISHasOwnColor : Error"   << "\n";
538   return 1;
539 }
540
541
542 //=======================================================================
543 //function : DPrsStd_AISHasOwnMaterial 
544 //purpose  : AISHasOwnMaterial (DOC,entry)
545 //return   : Boolean 
546 //=======================================================================
547
548 static Standard_Integer DPrsStd_AISHasOwnMaterial (Draw_Interpretor& di,
549                                                    Standard_Integer nb, 
550                                                    const char** arg) 
551 {
552   if (nb >= 3) {     
553     if (nb > 3)
554       di << "DPrsStd_AISHasOwnMaterial : Warning : too many arguments" << "\n";
555
556     Handle(TDocStd_Document) D;
557     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
558     TDF_Label L;
559     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;  
560
561     Handle(TPrsStd_AISViewer) viewer;
562     if( !TPrsStd_AISViewer::Find(L, viewer) ) return 1;  
563
564     Handle(TPrsStd_AISPresentation) prs;
565     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
566       di<<Standard_Integer(prs->HasOwnMaterial()); 
567       return 0; 
568     }
569
570   }
571   di << "DPrsStd_AISHasOwnMaterial : Error"   << "\n";
572   return 1;
573 }
574
575
576 //=======================================================================
577 //function : DPrsStd_AISHasOwnTransparency 
578 //purpose  : AISHasOwnColor (DOC,entry)
579 //return   : Boolean 
580 //=======================================================================
581
582 static Standard_Integer DPrsStd_AISHasOwnTransparency (Draw_Interpretor& di,
583                                                        Standard_Integer nb, 
584                                                        const char** arg) 
585 {
586   if (nb >= 3) {     
587     if (nb > 3)
588       di << "DPrsStd_AISHasOwnTransparency : Warning : too many arguments" << "\n";
589
590     Handle(TDocStd_Document) D;
591     if (!DDocStd::GetDocument(arg[1],D)) return 1;  
592     TDF_Label L;
593     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1;  
594
595     Handle(TPrsStd_AISViewer) viewer;
596     if( !TPrsStd_AISViewer::Find(L, viewer) ) return 1;  
597
598     Handle(TPrsStd_AISPresentation) prs;
599     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
600       di<<Standard_Integer(prs->HasOwnTransparency()); 
601       return 0; 
602     }
603
604   }
605   di << "DPrsStd_AISHasOwnTransparency : Error"   << "\n";
606   return 1;
607 }
608
609
610 //=======================================================================
611 //function : AISPresentationCommands
612 //purpose  :
613 //=======================================================================
614
615
616 void DPrsStd::AISPresentationCommands (Draw_Interpretor& theCommands)
617 {  
618   static Standard_Boolean done = Standard_False;
619   if (done) return;
620   done = Standard_True;
621   const char* g = "DPrsStd : standard presentation commands" ;  
622  
623   // standard commands working on AISPresentation
624
625   theCommands.Add ("AISDisplay", 
626                    "AISDisplay (DOC, entry, [not_update])",
627                    __FILE__, DPrsStd_AISDisplay, g);  
628
629   theCommands.Add ("AISErase", 
630                    "AISErase (DOC, entry)",
631                    __FILE__, DPrsStd_AISErase, g);    
632
633   theCommands.Add ("AISUpdate", 
634                    "AISUpdate (DOC, entry)",
635                    __FILE__, DPrsStd_AISUpdate, g);  
636
637   theCommands.Add ("AISSet", 
638                    "AISSet (DOC, entry, ID)",
639                    __FILE__, DPrsStd_AISSet, g);  
640
641   theCommands.Add ("AISDriver", 
642                    "AISDriver (DOC, entry, [ID]) - returns DriverGUID stored in attribute or sets new one",
643                    __FILE__, DPrsStd_AISDriver, g);  
644
645   theCommands.Add ("AISUnset", 
646                    "AISUnset (DOC, entry)",
647                    __FILE__, DPrsStd_AISUnset, g);   
648
649   theCommands.Add ("AISTransparency", 
650                    "AISTransparency (DOC, entry, [real])",
651                    __FILE__, DPrsStd_AISTransparency, g); 
652
653   theCommands.Add ("AISDefaultTransparency", 
654                    "AISDefaultTransparency (DOC, entry)",
655                    __FILE__, DPrsStd_AISDefaultTransparency, g);
656
657   theCommands.Add ("AISHasOwnTransparency", 
658                    "AISHasOwnTransparency (DOC, entry)  |  AISHasOwnTransparency return Boolean",
659                    __FILE__, DPrsStd_AISHasOwnTransparency, g);
660
661   theCommands.Add ("AISDefaultColor", 
662                    "AISDefaultColor (DOC, entry)",
663                    __FILE__, DPrsStd_AISDefaultColor, g);
664
665   theCommands.Add ("AISColor", 
666                    "AISColor (DOC, entry, [color])",
667                    __FILE__, DPrsStd_AISColor, g);
668
669   theCommands.Add ("AISHasOwnColor", 
670                    "AISHasOwnColor (DOC, entry)  |  AISHasOwnColor return Boolean",
671                    __FILE__, DPrsStd_AISHasOwnColor, g);
672
673   theCommands.Add ("AISMaterial", 
674                    "AISMaterial (DOC, entry, [material])",
675                    __FILE__, DPrsStd_AISMaterial, g); 
676
677   theCommands.Add ("AISDefaultMaterial", 
678                    "AISDefaultMaterial (DOC, entry)",
679                    __FILE__, DPrsStd_AISDefaultMaterial, g); 
680
681   theCommands.Add ("AISHasOwnMaterial", 
682                    "AISHasOwnMaterial (DOC, entry)  |  AISHasOwnMaterial return Boolean",
683                    __FILE__, DPrsStd_AISHasOwnMaterial, g);
684
685   theCommands.Add ("AISRemove", 
686                    "AISRemove (DOC, entry)",
687                    __FILE__, DPrsStd_AISRemove, g);
688 }