0025418: Debug output to be limited to OCC development environment
[occt.git] / src / IGESCAFControl / IGESCAFControl_Reader.cxx
1 // Created on: 2000-08-16
2 // Created by: Andrey BETENEV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <TDF_Label.hxx>
17 #include <IGESCAFControl_Reader.ixx>
18 #include <TopoDS_Shape.hxx>
19 #include <XCAFDoc_ShapeTool.hxx>
20 #include <XSControl_TransferReader.hxx>
21 #include <XCAFDoc_ColorTool.hxx>
22 #include <IGESData_IGESEntity.hxx>
23 #include <Transfer_Binder.hxx>
24 #include <TransferBRep.hxx>
25 #include <Quantity_Color.hxx>
26 #include <IGESCAFControl.hxx>
27 #include <IGESGraph_Color.hxx>
28 #include <Interface_InterfaceModel.hxx>
29 #include <Transfer_TransientProcess.hxx>
30 #include <XCAFDoc_DocumentTool.hxx>
31 #include <TopoDS_Iterator.hxx>
32 #include <TopTools_MapOfShape.hxx>
33 #include <TCollection_ExtendedString.hxx>
34 #include <TDataStd_Name.hxx>
35 #include <XCAFDoc_LayerTool.hxx>
36 #include <IGESData_LevelListEntity.hxx>
37 #include <TCollection_HAsciiString.hxx>
38 #include <XCAFDoc_ShapeMapTool.hxx>
39 #include <IGESBasic_SubfigureDef.hxx>
40 #include <TopoDS_Compound.hxx>
41 #include <BRep_Builder.hxx>
42
43 //=======================================================================
44 //function : IGESCAFControl_Reader
45 //purpose  : 
46 //=======================================================================
47
48 IGESCAFControl_Reader::IGESCAFControl_Reader () :
49        myColorMode( Standard_True ),
50        myNameMode ( Standard_True ),
51        myLayerMode( Standard_True )
52 {
53 }
54
55
56 //=======================================================================
57 //function : IGESCAFControl_Reader
58 //purpose  : 
59 //=======================================================================
60
61 IGESCAFControl_Reader::IGESCAFControl_Reader (const Handle(XSControl_WorkSession)& WS,
62                                               const Standard_Boolean scratch)
63 {
64   SetWS (WS,scratch);
65   myColorMode = Standard_True;
66   myNameMode = Standard_True;
67   myLayerMode = Standard_True;
68 }
69
70
71 //=======================================================================
72 //function : Transfer
73 //purpose  : basic working method
74 //=======================================================================
75 static void checkColorRange (Standard_Real& theCol)
76 {
77   if ( theCol < 0. ) theCol = 0.;
78   if ( theCol > 100. ) theCol = 100.;
79 }
80
81 static inline Standard_Boolean IsComposite (const TopoDS_Shape& theShape)
82 {
83   if( theShape.ShapeType() == TopAbs_COMPOUND)
84   {
85     if(!theShape.Location().IsIdentity())
86       return Standard_True;
87     TopoDS_Iterator anIt( theShape, Standard_False, Standard_False );
88     
89     for (; anIt.More() ; anIt.Next()) 
90     {
91       if( IsComposite (anIt.Value()))
92         return Standard_True;
93     }
94
95   }
96   return Standard_False;
97 }
98
99 //=======================================================================
100 //function : AddCompositeShape
101 //purpose  : Recursively adds composite shapes (TopoDS_Compounds) into the XDE document.
102 //           If the compound does not contain nested compounds then adds it
103 //           as no-assembly (i.e. no individual labels for sub-shapes), as this
104 //           combination is often encountered in IGES (e.g. Group of Trimmed Surfaces).
105 //           If the compound does contain nested compounds then adds it as an
106 //           assembly.
107 //           The construction happens bottom-up, i.e. the most deep sub-shapes are added
108 //           first.
109 //           If theIsTop is False (in a recursive call) then sub-shapes are added without
110 //           a location. This is to ensure that no extra label in the XDE document is
111 //           created for an instance (as otherwise, XDE will consider it as a free
112 //           shape). Correct location and instance will be created when adding a parent
113 //           compound.
114 //           theMap is used to avoid visiting the same compound.
115 //=======================================================================
116 static void AddCompositeShape (const Handle(XCAFDoc_ShapeTool)& theSTool,
117                                const TopoDS_Shape& theShape,
118                                Standard_Boolean theConsiderLoc,
119                                TopTools_MapOfShape& theMap)
120 {
121   TopoDS_Shape aShape = theShape;
122   TopLoc_Location aLoc = theShape.Location();
123   if (!theConsiderLoc && !aLoc.IsIdentity())
124     aShape.Location( TopLoc_Location() );
125   if (!theMap.Add (aShape)) 
126     return;
127
128   TopoDS_Iterator anIt( theShape, Standard_False, Standard_False );
129   Standard_Boolean aHasCompositeSubShape = Standard_False;
130   TopoDS_Compound aSimpleShape;
131   BRep_Builder aB;
132   aB.MakeCompound( aSimpleShape);
133   TopoDS_Compound aCompShape;
134   aB.MakeCompound( aCompShape);
135   Standard_Integer nbSimple = 0;
136
137   for (; anIt.More(); anIt.Next()) {
138     const TopoDS_Shape& aSubShape = anIt.Value();
139     if (IsComposite (aSubShape)) {
140       aHasCompositeSubShape = Standard_True;
141       AddCompositeShape( theSTool, aSubShape,Standard_False ,theMap );
142       aB.Add( aCompShape, aSubShape);
143     }
144     else
145     {
146       aB.Add(aSimpleShape, aSubShape);
147       nbSimple++;
148     }
149   }
150   //case of hybrid shape
151   if( nbSimple && aHasCompositeSubShape)
152   {
153     theSTool->AddShape( aSimpleShape,  Standard_False, Standard_False  );
154     TopoDS_Compound aNewShape;
155     BRep_Builder aB;
156     aB.MakeCompound(aNewShape);
157     aB.Add(aNewShape, aSimpleShape);
158     aB.Add(aNewShape,aCompShape);
159     //if (!aLoc.IsIdentity())
160     //  aNewShape.Location(aLoc );
161     aNewShape.Orientation(theShape.Orientation());
162     theSTool->AddShape( aNewShape,  aHasCompositeSubShape, Standard_False  );
163   }
164   else
165     theSTool->AddShape( aShape,  aHasCompositeSubShape, Standard_False  );
166   return;
167 }
168
169 Standard_Boolean IGESCAFControl_Reader::Transfer (Handle(TDocStd_Document) &doc)
170 {
171   // read all shapes
172   Standard_Integer num;// = NbRootsForTransfer();
173   //if ( num <=0 ) return Standard_False;
174   //for ( Standard_Integer i=1; i <= num; i++ ) {
175   //  TransferOneRoot ( i );
176   //}
177   
178   TransferRoots(); // replaces the above
179   num = NbShapes();
180   if ( num <=0 ) return Standard_False;
181
182   // and insert them to the document
183   Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( doc->Main() );
184   if(STool.IsNull()) return Standard_False;
185   Standard_Integer i;
186   for(i=1; i<=num; i++) {
187     TopoDS_Shape sh = Shape ( i );
188     // ---- HERE -- to add check [ assembly / hybrid model ]
189     if( !IsComposite (sh))
190       STool->AddShape( sh, Standard_False );
191     else {
192       TopTools_MapOfShape aMap;
193       AddCompositeShape( STool, sh,Standard_True, aMap );
194       
195     }
196   }
197   
198   // added by skl 13.10.2003
199   Handle(Interface_InterfaceModel) Model = WS()->Model();
200   //WS()->TransferReader()->SetTransientProcess(TransientProcess());
201   Handle(XSControl_TransferReader) TR = WS()->TransferReader();
202   Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
203   Standard_Boolean IsCTool = Standard_True;
204   Handle(XCAFDoc_ColorTool) CTool = XCAFDoc_DocumentTool::ColorTool(doc->Main());
205   if(CTool.IsNull()) IsCTool = Standard_False;
206   Standard_Boolean IsLTool = Standard_True;
207   Handle(XCAFDoc_LayerTool) LTool = XCAFDoc_DocumentTool::LayerTool(doc->Main());
208   if(LTool.IsNull()) IsLTool = Standard_False;
209
210   Standard_Integer nb = Model->NbEntities();
211   for(i=1; i<=nb; i++) {
212     Handle(IGESData_IGESEntity) ent = Handle(IGESData_IGESEntity)::DownCast ( Model->Value(i) );
213     if ( ent.IsNull() ) continue;
214     Handle(Transfer_Binder) binder = TP->Find ( ent );
215     if ( binder.IsNull() ) continue;
216     TopoDS_Shape S = TransferBRep::ShapeResult (binder);
217     if ( S.IsNull() ) continue;
218
219     Standard_Boolean IsColor = Standard_False;
220     Quantity_Color col;
221     if( GetColorMode() && IsCTool ) {
222       // read colors
223       if(ent->DefColor()==IGESData_DefValue ||
224          ent->DefColor()==IGESData_DefReference) {
225         // color is assigned
226         // decode color and set to document
227         IsColor = Standard_True;
228         if ( ent->DefColor() == IGESData_DefValue ) {
229           col = IGESCAFControl::DecodeColor ( ent->RankColor() );
230         }
231         else {
232           Handle(IGESGraph_Color) color = Handle(IGESGraph_Color)::DownCast ( ent->Color() );
233           if ( color.IsNull() ) {
234 #ifdef OCCT_DEBUG
235             cout << "Error: Unrecognized type of color definition" << endl;
236 #endif
237             IsColor = Standard_False;
238           }
239           else {
240             Standard_Real r, g, b;
241             color->RGBIntensity ( r, g, b );
242             checkColorRange ( r );
243             checkColorRange ( g );
244             checkColorRange ( b );
245             col.SetValues ( 0.01*r, 0.01*g, 0.01*b, Quantity_TOC_RGB );
246           }
247         }
248       }
249     }
250
251     TDF_Label L;
252
253     Standard_Boolean IsFound;
254     if(IsColor) {
255       CTool->AddColor(col);
256       IsFound = STool->SearchUsingMap(S,L,Standard_False,Standard_True);
257     }
258     else {
259       IsFound = STool->SearchUsingMap(S,L,Standard_False,Standard_False);
260     }
261     if(!IsFound) {
262       if(IsColor) {
263         for (TopoDS_Iterator it(S); it.More(); it.Next()) {
264           if(STool->SearchUsingMap(it.Value(),L,Standard_False,Standard_True)) {
265             CTool->SetColor(L,col,XCAFDoc_ColorGen);
266             if( GetLayerMode() && IsLTool ) {
267               // read layers
268               // set a layers to the document
269               IGESData_DefList aDeflist = ent->DefLevel();
270               switch (aDeflist) {
271               case IGESData_DefOne : {
272                 TCollection_ExtendedString aLayerName ( ent->Level() );
273                 LTool->SetLayer( L, aLayerName );
274                 break;
275               }
276               case IGESData_DefSeveral : {
277                 Handle(IGESData_LevelListEntity) aLevelList = ent->LevelList();
278                 Standard_Integer layerNb = aLevelList->NbLevelNumbers();
279                 for ( Standard_Integer ilev = 1; ilev <= layerNb; ilev++ ) {
280                   TCollection_ExtendedString aLayerName ( aLevelList->LevelNumber(ilev) );
281                   LTool->SetLayer( L, aLayerName );
282                 }
283                 break;
284               }
285                 default : break;
286               }
287             }
288           }
289         }
290       }
291     }
292     else {
293       if(IsColor) {
294         CTool->SetColor(L,col,XCAFDoc_ColorGen);
295       }
296       if(GetNameMode()) {
297         // read names
298         if(ent->HasName()) {
299           TCollection_AsciiString string = ent->NameValue()->String();
300           string.LeftAdjust();
301           string.RightAdjust();
302           TCollection_ExtendedString str(string);
303           TDataStd_Name::Set(L,str);
304         }
305       }
306       if( GetLayerMode() && IsLTool ) {
307         // read layers
308         // set a layers to the document
309         IGESData_DefList aDeflist = ent->DefLevel();
310         switch (aDeflist) {
311         case IGESData_DefOne : {
312           TCollection_ExtendedString aLayerName ( ent->Level() );
313           LTool->SetLayer( L, aLayerName );
314           break;
315         }
316         case IGESData_DefSeveral : {
317           Handle(IGESData_LevelListEntity) aLevelList = ent->LevelList();
318           Standard_Integer layerNb = aLevelList->NbLevelNumbers();
319           for ( Standard_Integer ilev = 1; ilev <= layerNb; ilev++ ) {
320             TCollection_ExtendedString aLayerName ( aLevelList->LevelNumber(ilev) );
321             LTool->SetLayer( L, aLayerName );
322           }
323           break;
324         }
325           default : break;
326         }
327       }
328     }
329
330     //Checks that current entity is a subfigure
331     Handle(IGESBasic_SubfigureDef) aSubfigure = Handle(IGESBasic_SubfigureDef)::DownCast (ent);
332     if (GetNameMode() && !aSubfigure.IsNull() && STool->Search (S, L, Standard_True, Standard_True))
333     {
334       //In this case we attach subfigure name to the label, instead of default "COMPOUND"
335       Handle(TCollection_HAsciiString) aName = aSubfigure->Name();
336       aName->LeftAdjust();
337       aName->RightAdjust();
338       TCollection_ExtendedString anExtStrName (aName->ToCString());
339       TDataStd_Name::Set (L, anExtStrName);
340     }
341
342   }
343
344   CTool->ReverseChainsOfTreeNodes();
345
346   // end added by skl 13.10.2003
347
348   // read colors
349 //  if ( GetColorMode() )
350 //    ReadColors ( doc );
351   
352   // read names
353 //  if ( GetNameMode() )
354 //    ReadNames ( doc );
355   
356   // read layers
357 //  if ( GetLayerMode() )
358 //    ReadLayers ( doc );
359     
360
361   return Standard_True;
362 }
363   
364
365 //=======================================================================
366 //function : Perform
367 //purpose  : 
368 //=======================================================================
369
370 Standard_Boolean IGESCAFControl_Reader::Perform (const Standard_CString filename,
371                                                  Handle(TDocStd_Document) &doc)
372 {
373   if ( ReadFile ( filename ) != IFSelect_RetDone ) return Standard_False;
374   return Transfer ( doc );
375 }
376   
377
378 //=======================================================================
379 //function : Perform
380 //purpose  : 
381 //=======================================================================
382
383 Standard_Boolean IGESCAFControl_Reader::Perform (const TCollection_AsciiString &filename,
384                                                  Handle(TDocStd_Document) &doc)
385 {
386   if ( ReadFile ( filename.ToCString() ) != IFSelect_RetDone ) return Standard_False;
387   return Transfer ( doc );
388 }
389
390
391 //=======================================================================
392 //function : ReadColors
393 //purpose  : 
394 //=======================================================================
395
396 Standard_Boolean IGESCAFControl_Reader::ReadColors (Handle(TDocStd_Document)& Doc) const
397 {
398
399   Handle(Interface_InterfaceModel) Model = WS()->Model();
400
401   //WS()->TransferReader()->SetTransientProcess(TransientProcess()); // !!!!!!!!!
402   
403   Handle(XSControl_TransferReader) TR = WS()->TransferReader();
404   Handle(Transfer_TransientProcess) TP = /*TransientProcess();*/TR->TransientProcess();
405   Handle(XCAFDoc_ColorTool) CTool = XCAFDoc_DocumentTool::ColorTool( Doc->Main() );
406 /*
407   Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( Doc->Main() );
408   if ( STool.IsNull() ) return Standard_False;
409   Handle(XCAFDoc_ShapeMapTool) SMTool = XCAFDoc_ShapeMapTool::Set(STool->Label());
410   SMTool->ComputeMaps();
411
412   Standard_Integer nb = Model->NbEntities();
413   for (Standard_Integer i = 1; i <= nb; i ++) {
414     Handle(IGESData_IGESEntity) ent = Handle(IGESData_IGESEntity)::DownCast ( Model->Value(i) );
415     if ( ent.IsNull() ) continue;
416     if ( ent->DefColor() != IGESData_DefValue && 
417          ent->DefColor() != IGESData_DefReference ) continue; // no color assigned
418
419     // find tartet shape
420     Handle(Transfer_Binder) binder = TP->Find ( ent );
421     if ( binder.IsNull() ) continue;
422     TopoDS_Shape S = TransferBRep::ShapeResult (binder);
423     if ( S.IsNull() ) continue;
424
425     // decode color and set to document
426     Quantity_Color col;
427     if ( ent->DefColor() == IGESData_DefValue ) {
428       col = IGESCAFControl::DecodeColor ( ent->RankColor() );
429     }
430     else {
431       Handle(IGESGraph_Color) color = Handle(IGESGraph_Color)::DownCast ( ent->Color() );
432       if ( color.IsNull() ) {
433         cout << "Error: Unrecognized type of color definition" << endl;
434         continue;
435       }
436       
437       Standard_Real r, g, b;
438       color->RGBIntensity ( r, g, b );
439       col.SetValues ( 0.01*r, 0.01*g, 0.01*b, Quantity_TOC_RGB );
440     }
441     
442     TDF_Label L;
443     cout<<"i="<<i<<endl;
444     if(SMTool->Search(S,L)) {
445       cout<<"      find Instance"<<endl;
446       CTool->SetColor(L, col, XCAFDoc_ColorGen);
447     }
448     if(L.IsNull()) {
449       cout<<"L1 is Null"<<endl;
450       if(STool->Search(S,L,Standard_False,Standard_False,Standard_True)) {
451         cout<<"     add new label1 :"<<L<<endl;
452         CTool->SetColor(L, col, XCAFDoc_ColorGen);
453       }
454     }
455     if(L.IsNull()) {
456     //else {
457       cout<<"      try to find splitting"<<endl;
458       // may be S is compound of shapes resulting from splitting
459       for (TopoDS_Iterator it(S); it.More(); it.Next()) {
460         //TDF_Label L1;
461         if(!SMTool->Search(it.Value(),L)) continue; //break-?
462         cout<<"      find splitting"<<endl;
463         CTool->SetColor(L, col, XCAFDoc_ColorGen);
464       }
465       if(L.IsNull()) {
466         for (TopoDS_Iterator it(S); it.More(); it.Next()) {
467           if(STool->Search(S,L,Standard_False,Standard_False,Standard_True)) {
468             cout<<"     add new label2 :"<<L<<endl;
469             CTool->SetColor(L, col, XCAFDoc_ColorGen);
470           }
471         }
472       }
473     }
474 //    cout<<"L.Dump():"<<L<<endl;
475 //    if(L.IsNull()) {
476 //      cout<<"L2 is Null"<<endl;
477 //      if(STool->Search(S,L,Standard_False,Standard_False,Standard_True)) {
478 //        cout<<"     add new label2 :"<<L<<endl;
479 //      CTool->SetColor(L, col, XCAFDoc_ColorGen);
480 //      }
481 //    }
482   }
483 */  
484   return Standard_True;
485 }
486
487 //=======================================================================
488 //function : ReadNames
489 //purpose  : 
490 //=======================================================================
491
492 Standard_Boolean IGESCAFControl_Reader::ReadNames (Handle(TDocStd_Document)& /*Doc*/) const
493 {
494   Handle(Interface_InterfaceModel) Model = WS()->Model();
495
496   //WS()->TransferReader()->SetTransientProcess(TransientProcess()); // !!!!!!!!!
497   
498   Handle(XSControl_TransferReader) TR = WS()->TransferReader();
499   Handle(Transfer_TransientProcess) TP = /*TransientProcess();*/TR->TransientProcess();
500 /*
501   Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( Doc->Main() );
502   if ( STool.IsNull() ) return Standard_False;
503   Handle(XCAFDoc_ShapeMapTool) SMTool = XCAFDoc_ShapeMapTool::Set(STool->Label());
504   SMTool->ComputeMaps();
505
506   Standard_Integer nb = Model->NbEntities();
507   for (Standard_Integer i = 1; i <= nb; i ++) {
508     Handle(IGESData_IGESEntity) ent = Handle(IGESData_IGESEntity)::DownCast ( Model->Value(i) );
509     if ( ent.IsNull() || ! ent->HasName() ) continue; //not only Entity Label (f.18) but Name Property also
510
511     // find target shape
512     Handle(Transfer_Binder) binder = TP->Find ( ent );
513     if ( binder.IsNull() ) continue;
514     TopoDS_Shape S = TransferBRep::ShapeResult (binder);
515     if ( S.IsNull() ) continue;
516
517     TDF_Label L;
518     //if ( ! STool->Search ( S, L, Standard_True, Standard_True, Standard_False ) ) continue;
519     if ( ! SMTool->Search ( S, L, Standard_True, Standard_True) ) continue;
520     
521     // set a name to the document
522     TCollection_AsciiString string = ent->NameValue()->String();
523     string.LeftAdjust();
524     string.RightAdjust();
525     TCollection_ExtendedString str ( string );
526     TDataStd_Name::Set ( L, str );
527   }
528 */
529   return Standard_True;
530 }
531
532 //=======================================================================
533 //function : ReadLayers
534 //purpose  : 
535 //=======================================================================
536
537 Standard_Boolean IGESCAFControl_Reader::ReadLayers (Handle(TDocStd_Document)& /*Doc*/) const
538 {
539   Handle(Interface_InterfaceModel) Model = WS()->Model();
540
541   //WS()->TransferReader()->SetTransientProcess(TransientProcess()); // !!!!!!!!!
542   
543   Handle(XSControl_TransferReader) TR = WS()->TransferReader();
544   Handle(Transfer_TransientProcess) TP = /*TransientProcess();*/TR->TransientProcess();
545 /*
546   Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( Doc->Main() );
547   if ( STool.IsNull() ) return Standard_False;
548   Handle(XCAFDoc_ShapeMapTool) SMTool = XCAFDoc_ShapeMapTool::Set(STool->Label());
549   SMTool->ComputeMaps();
550
551   Handle(XCAFDoc_LayerTool) LTool = XCAFDoc_DocumentTool::LayerTool( Doc->Main() );
552   if ( LTool.IsNull() ) return Standard_False;
553
554   Standard_Integer nb = Model->NbEntities();
555   for (Standard_Integer i = 1; i <= nb; i ++) {
556     Handle(IGESData_IGESEntity) ent = Handle(IGESData_IGESEntity)::DownCast ( Model->Value(i) );
557
558     if ( ent.IsNull() ) continue;
559
560     // find target shape
561     Handle(Transfer_Binder) binder = TP->Find ( ent );
562     if ( binder.IsNull() ) continue;
563     TopoDS_Shape S = TransferBRep::ShapeResult (binder);
564     if ( S.IsNull() ) continue;
565
566     TDF_Label L;
567     //if ( ! STool->Search ( S, L, Standard_True, Standard_True, Standard_False ) ) continue;
568     if( !SMTool->Search(S, L, Standard_True, Standard_True) ) continue;
569     
570     // set a layers to the document
571     IGESData_DefList aDeflist = ent->DefLevel();
572     
573     switch (aDeflist) {
574     case IGESData_DefOne : {
575       TCollection_ExtendedString aLayerName ( ent->Level() );
576       LTool->SetLayer( L, aLayerName );
577 #ifdef OCCT_DEBUG
578 //      cout << "Added layer " << aLayerName << endl;
579 #endif
580       break;
581     }
582     case IGESData_DefSeveral : {
583       Handle(IGESData_LevelListEntity) aLevelList = ent->LevelList();
584       Standard_Integer layerNb = aLevelList->NbLevelNumbers();
585       for ( Standard_Integer ilev = 1; ilev <= layerNb; ilev++ ) {
586         TCollection_ExtendedString aLayerName ( aLevelList->LevelNumber(ilev) );
587         LTool->SetLayer( L, aLayerName );
588 #ifdef OCCT_DEBUG
589 //      cout << "Added layer " << aLayerName << endl;
590 #endif
591       }
592       break;
593     }
594       default : break;
595     }
596           
597   }
598 */
599   return Standard_True;
600 }
601
602
603 //=======================================================================
604 //function : SetColorMode
605 //purpose  : 
606 //=======================================================================
607
608 void IGESCAFControl_Reader::SetColorMode (const Standard_Boolean colormode)
609 {
610   myColorMode = colormode;
611 }
612
613 //=======================================================================
614 //function : GetColorMode
615 //purpose  : 
616 //=======================================================================
617
618 Standard_Boolean IGESCAFControl_Reader::GetColorMode () const
619 {
620   return myColorMode;
621 }
622
623 //=======================================================================
624 //function : SetNameMode
625 //purpose  : 
626 //=======================================================================
627
628 void IGESCAFControl_Reader::SetNameMode (const Standard_Boolean namemode)
629 {
630   myNameMode = namemode;
631 }
632
633 //=======================================================================
634 //function : GetNameMode
635 //purpose  : 
636 //=======================================================================
637
638 Standard_Boolean IGESCAFControl_Reader::GetNameMode () const
639 {
640   return myNameMode;
641 }
642
643 //=======================================================================
644 //function : SetLayerMode
645 //purpose  : 
646 //=======================================================================
647
648 void IGESCAFControl_Reader::SetLayerMode (const Standard_Boolean layermode)
649 {
650   myLayerMode = layermode;
651 }
652
653 //=======================================================================
654 //function : GetLayerMode
655 //purpose  : 
656 //=======================================================================
657
658 Standard_Boolean IGESCAFControl_Reader::GetLayerMode () const
659 {
660   return myLayerMode;
661 }
662