0025748: Parallel version of progress indicator
[occt.git] / src / IGESCAFControl / IGESCAFControl_Writer.cxx
1 // Created on: 2000-08-17
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 <IGESCAFControl.hxx>
17 #include <IGESCAFControl_Writer.hxx>
18 #include <IGESData_IGESEntity.hxx>
19 #include <IGESData_IGESModel.hxx>
20 #include <IGESData_NameEntity.hxx>
21 #include <IGESGraph_Color.hxx>
22 #include <IGESGraph_DefinitionLevel.hxx>
23 #include <IGESSolid_Face.hxx>
24 #include <IGESBasic_Name.hxx>
25 #include <Message_ProgressScope.hxx>
26 #include <NCollection_DataMap.hxx>
27 #include <Standard_Transient.hxx>
28 #include <TCollection_AsciiString.hxx>
29 #include <TCollection_HAsciiString.hxx>
30 #include <TCollection_HExtendedString.hxx>
31 #include <TColStd_HSequenceOfExtendedString.hxx>
32 #include <TDataStd_Name.hxx>
33 #include <TDF_ChildIterator.hxx>
34 #include <TDF_Label.hxx>
35 #include <TDF_LabelSequence.hxx>
36 #include <TDocStd_Document.hxx>
37 #include <TopAbs.hxx>
38 #include <TopExp_Explorer.hxx>
39 #include <TopoDS.hxx>
40 #include <TopoDS_Face.hxx>
41 #include <TopoDS_Iterator.hxx>
42 #include <TopoDS_Shape.hxx>
43 #include <TopTools_SequenceOfShape.hxx>
44 #include <Transfer_FinderProcess.hxx>
45 #include <Transfer_TransientListBinder.hxx>
46 #include <TransferBRep.hxx>
47 #include <TransferBRep_ShapeMapper.hxx>
48 #include <XCAFDoc_ColorTool.hxx>
49 #include <XCAFDoc_DocumentTool.hxx>
50 #include <XCAFDoc_LayerTool.hxx>
51 #include <XCAFDoc_ShapeTool.hxx>
52 #include <XCAFPrs.hxx>
53 #include <XCAFPrs_Style.hxx>
54 #include <XSControl_WorkSession.hxx>
55
56 namespace
57 {
58   typedef NCollection_DataMap<TopoDS_Shape, TCollection_ExtendedString> DataMapOfShapeNames;
59
60   void  CollectShapeNames (const TDF_Label& theLabel,
61                            const TopLoc_Location& theLocation,
62                            const Handle(TDataStd_Name)& thePrevName,
63                            DataMapOfShapeNames& theMapOfShapeNames)
64   {
65     Standard_Boolean hasReferredShape = Standard_False;
66     Standard_Boolean hasComponents    = Standard_False;
67     TDF_Label aReferredLabel;
68
69     Handle(TDataStd_Name) aName;
70     theLabel.FindAttribute (TDataStd_Name::GetID(), aName);
71
72     if ( XCAFDoc_ShapeTool::GetReferredShape ( theLabel, aReferredLabel ) )
73     {
74       TopLoc_Location aSubLocation = theLocation.Multiplied ( XCAFDoc_ShapeTool::GetLocation ( theLabel ) );
75       CollectShapeNames (aReferredLabel, aSubLocation, aName, theMapOfShapeNames);
76       hasReferredShape = Standard_True;
77     }
78
79     TDF_LabelSequence aSeq;
80     if (XCAFDoc_ShapeTool::GetComponents (theLabel, aSeq))
81     {
82       for (Standard_Integer anIter = 1; anIter <= aSeq.Length(); anIter++)
83       {
84         CollectShapeNames (aSeq.Value (anIter), theLocation, aName, theMapOfShapeNames );
85       }
86       hasComponents = Standard_True;
87     }
88
89     aSeq.Clear();
90     if (XCAFDoc_ShapeTool::GetSubShapes (theLabel, aSeq))
91     {
92       for (Standard_Integer anIter = 1; anIter <= aSeq.Length(); anIter++)
93       {
94         TopoDS_Shape aShape;
95         if (!XCAFDoc_ShapeTool::GetShape (aSeq.Value (anIter), aShape)) continue;
96         if (!aSeq.Value (anIter).FindAttribute (TDataStd_Name::GetID(), aName)) continue;
97         theMapOfShapeNames.Bind (aShape, aName->Get());
98       }
99     }
100
101     if (!hasReferredShape && !hasComponents)
102     {
103       TopoDS_Shape aShape;
104       if (!XCAFDoc_ShapeTool::GetShape (theLabel, aShape)) return;
105       aShape.Move (theLocation);
106       theMapOfShapeNames.Bind (aShape, thePrevName->Get());
107     }
108   }
109 }
110
111 //=======================================================================
112 //function : IGESCAFControl_Writer
113 //purpose  : 
114 //=======================================================================
115
116 IGESCAFControl_Writer::IGESCAFControl_Writer () :
117        myColorMode( Standard_True ),
118        myNameMode ( Standard_True ),
119        myLayerMode( Standard_True )
120 {
121 }
122
123 //=======================================================================
124 //function : IGESCAFControl_Writer
125 //purpose  : 
126 //=======================================================================
127
128 IGESCAFControl_Writer::IGESCAFControl_Writer (const Handle(XSControl_WorkSession)& WS,
129                                               const Standard_Boolean /*scratch*/ )
130 {
131   // this code does things in a wrong way, it should be vice-versa
132   WS->SetModel ( Model() );
133   WS->SetMapWriter ( TransferProcess() );
134   myColorMode = Standard_True;
135   myNameMode = Standard_True;
136   myLayerMode = Standard_True;
137   
138 //  SetWS (WS,scratch); // this should be the only required command here
139 }
140
141 //=======================================================================
142 //function : Transfer
143 //purpose  : 
144 //=======================================================================
145
146 Standard_Boolean IGESCAFControl_Writer::Transfer (const Handle(TDocStd_Document) &doc,
147                                                   const Message_ProgressRange& theProgress)
148 {  
149   // translate free top-level shapes of the DECAF document
150   Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( doc->Main() );
151   if ( STool.IsNull() ) return Standard_False;
152
153   TDF_LabelSequence labels;
154   STool->GetFreeShapes ( labels );
155   return Transfer (labels, theProgress);
156 }  
157
158 //=======================================================================
159 //function : Transfer
160 //purpose  : 
161 //=======================================================================
162
163 Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_Label& label,
164                                                   const Message_ProgressRange& theProgress)
165 {
166   TDF_LabelSequence labels;
167   labels.Append( label );
168   return Transfer( labels, theProgress );
169 }
170
171 //=======================================================================
172 //function : Transfer
173 //purpose  : 
174 //=======================================================================
175
176 Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_LabelSequence& labels,
177                                                   const Message_ProgressRange& theProgress)
178 {  
179   if ( labels.Length() <=0 ) return Standard_False;
180   Message_ProgressScope aPS(theProgress, "Labels", labels.Length());
181   for ( Standard_Integer i=1; i <= labels.Length() && aPS.More(); i++ )
182   {
183     TopoDS_Shape shape = XCAFDoc_ShapeTool::GetShape ( labels.Value(i) );
184     if ( ! shape.IsNull() ) 
185       AddShape (shape, aPS.Next());
186 //      IGESControl_Writer::Transfer ( shape );
187   }
188   
189   // write colors
190   if ( GetColorMode() )
191     WriteAttributes ( labels );
192
193   // write layers
194   if ( GetLayerMode() )
195     WriteLayers ( labels );
196   
197   // write names
198   if ( GetNameMode() )
199     WriteNames( labels );
200   
201   // refresh graph
202 //  WS()->ComputeGraph ( Standard_True );
203   ComputeModel();
204   
205   return Standard_True;
206 }
207
208 //=======================================================================
209 //function : Perform
210 //purpose  : 
211 //=======================================================================
212
213 Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
214                                                  const Standard_CString filename,
215                                                  const Message_ProgressRange& theProgress)
216 {
217   if ( ! Transfer ( doc, theProgress ) ) return Standard_False;
218   return Write ( filename ) == IFSelect_RetDone;
219 }
220   
221 //=======================================================================
222 //function : Perform
223 //purpose  : 
224 //=======================================================================
225
226 Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
227                                                  const TCollection_AsciiString &filename,
228                                                  const Message_ProgressRange& theProgress)
229 {
230   if ( ! Transfer ( doc, theProgress ) ) return Standard_False;
231   return Write ( filename.ToCString() ) == IFSelect_RetDone;
232 }
233   
234 //=======================================================================
235 //function : WriteAttributes
236 //purpose  : 
237 //=======================================================================
238
239 Standard_Boolean IGESCAFControl_Writer::WriteAttributes (const TDF_LabelSequence& labels) 
240 {
241   // Iterate on labels
242   if ( labels.Length() <=0 ) return Standard_False;
243   for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
244     TDF_Label L = labels.Value(i);
245
246     // collect color settings
247     XCAFPrs_IndexedDataMapOfShapeStyle settings;
248     TopLoc_Location loc;
249     XCAFPrs::CollectStyleSettings ( L, loc, settings );
250     if ( settings.Extent() <=0 ) continue;
251     
252     // get a target shape and try to find corresponding context
253     // (all the colors set under that label will be put into that context)
254     TopoDS_Shape S;
255     if ( ! XCAFDoc_ShapeTool::GetShape ( L, S ) ) continue;
256         
257     // iterate on subshapes and create IGES styles 
258     XCAFPrs_DataMapOfStyleTransient colors;
259     TopTools_MapOfShape Map;
260     const XCAFPrs_Style inherit;
261     MakeColors ( S, settings, colors, Map, inherit );
262   }
263   
264   return Standard_True;
265 }
266
267 //=======================================================================
268 //function : MakeColors
269 //purpose  : 
270 //=======================================================================
271
272 void IGESCAFControl_Writer::MakeColors (const TopoDS_Shape &S, 
273                                         const XCAFPrs_IndexedDataMapOfShapeStyle &settings,
274                                         XCAFPrs_DataMapOfStyleTransient &colors,
275                                         TopTools_MapOfShape &Map,
276                                         const XCAFPrs_Style &inherit) 
277 {
278   // skip already processed shapes
279   if ( ! Map.Add ( S ) ) return;
280   
281   // check if shape has its own style (or inherits from ancestor)
282   XCAFPrs_Style style = inherit;
283   if ( settings.Contains(S) ) {
284     XCAFPrs_Style own = settings.FindFromKey(S);
285     if ( own.IsSetColorCurv() ) style.SetColorCurv ( own.GetColorCurv() );
286     if ( own.IsSetColorSurf() ) style.SetColorSurf ( own.GetColorSurf() );
287     style.SetMaterial (own.Material());
288   }
289   
290   // analyze whether current entity should get a color 
291   Standard_Boolean hasColor = Standard_False;
292   Quantity_Color col;
293   if ( S.ShapeType() == TopAbs_FACE  || S.ShapeType() == TopAbs_SOLID) {
294     if ( style.IsSetColorSurf() ) {
295       hasColor = Standard_True;
296       col = style.GetColorSurf();
297     }
298     else if (!style.Material().IsNull()
299           && !style.Material()->IsEmpty())
300     {
301       hasColor = Standard_True;
302       col = style.Material()->BaseColor().GetRGB();
303     }
304   }
305   else if ( S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE ) {
306     if ( style.IsSetColorCurv() ) {
307       hasColor = Standard_True;
308       col = style.GetColorCurv();
309     }
310   }
311   
312   // if color has to be assigned, try to do this
313   if ( hasColor ) {
314     Handle(IGESGraph_Color) colent;
315     Standard_Integer rank = IGESCAFControl::EncodeColor ( col );
316     if ( ! rank ) {
317       XCAFPrs_Style c; // style used as key in the map
318       c.SetColorSurf ( col );
319       if ( colors.IsBound ( c ) ) {
320         colent = Handle(IGESGraph_Color)::DownCast ( colors.Find(c) );
321       }
322       else {
323         Handle(TCollection_HAsciiString) str = 
324           new TCollection_HAsciiString ( col.StringName ( col.Name() ) );
325         colent = new IGESGraph_Color;
326         NCollection_Vec3<Standard_Real> aColor_sRGB;
327         col.Values (aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB);
328         colent->Init ( aColor_sRGB.r() * 100., aColor_sRGB.g() * 100., aColor_sRGB.b() * 100., str );
329         AddEntity ( colent );
330         colors.Bind ( c, colent );
331       }
332     }
333     Handle(Transfer_FinderProcess) FP = TransferProcess();
334     Handle(IGESData_IGESEntity) ent;
335     Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, S );
336     if ( FP->FindTypedTransient ( mapper, STANDARD_TYPE(IGESData_IGESEntity), ent ) ) {
337       ent->InitColor ( colent, rank );
338       Handle(IGESSolid_Face) ent_f = Handle(IGESSolid_Face)::DownCast(ent);
339       if (!ent_f.IsNull())
340       {
341         if (!ent_f->Surface().IsNull())
342           ent_f->Surface()->InitColor ( colent, rank );
343       }
344     }
345     else {
346       // may be S was splited during shape process
347       Handle(Transfer_Binder) bnd = FP->Find ( mapper );
348       if ( ! bnd.IsNull() ) {
349         Handle(Transfer_TransientListBinder) TransientListBinder =
350           //Handle(Transfer_TransientListBinder)::DownCast( bnd->Next(Standard_True) );
351           Handle(Transfer_TransientListBinder)::DownCast( bnd );
352         Standard_Integer i=0, nb=0;
353         if (! TransientListBinder.IsNull() ) {
354           nb = TransientListBinder->NbTransients();
355           for (i=1; i<=nb; i++) {
356             Handle(Standard_Transient) t = TransientListBinder->Transient(i);
357             ent = Handle(IGESData_IGESEntity)::DownCast(t);
358             if (!ent.IsNull())
359       {
360         ent->InitColor ( colent, rank );
361         Handle(IGESSolid_Face) ent_f = Handle(IGESSolid_Face)::DownCast(ent);
362         if (!ent_f.IsNull())
363         {
364           if (!ent_f->Surface().IsNull())
365             ent_f->Surface()->InitColor ( colent, rank );
366         }
367       }
368           }
369         }
370         /* // alternative: consider recursive mapping S -> compound -> entities
371         else {
372           TopoDS_Shape comp = TransferBRep::ShapeResult(bnd);
373           if ( ! comp.IsNull() && comp.ShapeType() < S.ShapeType() ) 
374             for ( TopoDS_Iterator it(comp); it.More(); it.Next() ) {
375               MakeColors ( it.Value(), settings, colors, Map, style );
376             }
377         }
378         */
379       }
380     }
381   }
382
383   // iterate on subshapes (except vertices :)
384   if ( S.ShapeType() == TopAbs_EDGE ) return;
385   for ( TopoDS_Iterator it(S); it.More(); it.Next() ) {
386     MakeColors ( it.Value(), settings, colors, Map, style );
387   }
388 }
389
390
391 static void AttachLayer (const Handle(Transfer_FinderProcess) &FP,
392                          const Handle(XCAFDoc_LayerTool)& LTool,
393                          const TopoDS_Shape& aSh,
394                          const Standard_Integer localIntName)
395 {
396
397   TopTools_SequenceOfShape shseq;
398   if ( aSh.ShapeType() == TopAbs_COMPOUND ) {
399     TopoDS_Iterator aShIt(aSh);
400     for ( ; aShIt.More(); aShIt.Next() ) {
401       TopoDS_Shape newSh = aShIt.Value();
402       Handle(TColStd_HSequenceOfExtendedString) shLayers = new TColStd_HSequenceOfExtendedString;
403       if (! LTool->GetLayers( newSh, shLayers) || newSh.ShapeType() == TopAbs_COMPOUND )
404         AttachLayer(FP, LTool, newSh, localIntName);
405     }
406     return;
407   } else if ( aSh.ShapeType() == TopAbs_SOLID || aSh.ShapeType() == TopAbs_SHELL ) {
408     for (TopExp_Explorer exp(aSh,TopAbs_FACE) ; exp.More(); exp.Next()) {
409       TopoDS_Face entSh = TopoDS::Face (exp.Current());
410       shseq.Append(entSh);
411     }
412   } else {
413     shseq.Append(aSh);
414   }
415   
416   for (Standard_Integer i = 1; i <= shseq.Length(); i++ ) {
417     TopoDS_Shape localShape = shseq.Value(i);
418     Handle(IGESData_IGESEntity) Igesent;
419     Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, localShape );
420     if ( FP->FindTypedTransient ( mapper, STANDARD_TYPE(IGESData_IGESEntity), Igesent ) ) {
421       Igesent->InitLevel( 0, localIntName );
422     }
423 #ifdef OCCT_DEBUG
424     else std::cout << "Warning: Can't find entity for shape in mapper" << std::endl;
425 #endif
426   }
427 }
428
429
430 static void MakeLayers (const Handle(Transfer_FinderProcess) &FP, 
431                         const Handle(XCAFDoc_ShapeTool)& STool,
432                         const Handle(XCAFDoc_LayerTool)& LTool,
433                         const TDF_LabelSequence& aShapeLabels,
434                         const Standard_Integer localIntName) 
435 {
436   for ( Standard_Integer j = 1; j <= aShapeLabels.Length(); j++ ) {
437     TDF_Label aShapeLabel = aShapeLabels.Value(j);
438     TopoDS_Shape aSh;
439     if ( ! STool->GetShape ( aShapeLabel, aSh ) ) continue;
440     AttachLayer (FP, LTool, aSh, localIntName);
441   }
442 }
443
444
445
446 //=======================================================================
447 //function : WriteLayers
448 //purpose  : 
449 //=======================================================================
450
451 Standard_Boolean IGESCAFControl_Writer::WriteLayers (const TDF_LabelSequence& labels) 
452 {
453   if ( labels.Length() <=0 ) return Standard_False;
454   Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( labels(1) );
455   if ( STool.IsNull() ) return Standard_False;
456   Handle(XCAFDoc_LayerTool) LTool = XCAFDoc_DocumentTool::LayerTool( labels(1) );
457   if ( LTool.IsNull() ) return Standard_False;
458   
459   Standard_Integer globalIntName = 0;
460   TDF_LabelSequence aLayerLabels;
461   LTool->GetLayerLabels( aLayerLabels );
462   
463   Handle(Transfer_FinderProcess) FP = TransferProcess();
464   for ( Standard_Integer i = 1; i <= aLayerLabels.Length(); i++ ){
465     TDF_Label aOneLayerL = aLayerLabels.Value(i);
466     if ( aOneLayerL.IsNull() ) continue;
467     TCollection_ExtendedString localName;
468     LTool->GetLayer(aOneLayerL, localName);
469     Standard_Integer localIntName = 0;
470     TCollection_AsciiString asciiName(localName,'?');
471     if (asciiName.IsIntegerValue() ) {
472       localIntName = asciiName.IntegerValue();
473       if (globalIntName < localIntName) globalIntName = localIntName;
474       
475       TDF_LabelSequence aShapeLabels;
476       LTool->GetShapesOfLayer( aOneLayerL, aShapeLabels );
477       if ( aShapeLabels.Length() <= 0 ) continue;
478       MakeLayers(FP, STool, LTool, aShapeLabels, localIntName);
479     }
480   }
481   
482   for ( Standard_Integer i1 = 1; i1 <= aLayerLabels.Length(); i1++ ) {
483     TDF_Label aOneLayerL = aLayerLabels.Value(i1);
484     if ( aOneLayerL.IsNull() ) continue;
485     TCollection_ExtendedString localName; 
486     LTool->GetLayer(aOneLayerL, localName);
487     Standard_Integer localIntName = 0;
488     TCollection_AsciiString asciiName(localName,'?');
489     if (asciiName.IsIntegerValue() ) continue;
490     TDF_LabelSequence aShapeLabels;
491     LTool->GetShapesOfLayer( aOneLayerL, aShapeLabels );
492     if ( aShapeLabels.Length() <= 0 ) continue;
493     localIntName = ++globalIntName;
494     MakeLayers (FP, STool, LTool, aShapeLabels, localIntName);
495   }
496   
497   return Standard_True;
498 }
499
500
501 //=======================================================================
502 //function : WriteNames
503 //purpose  : 
504 //=======================================================================
505
506 Standard_Boolean IGESCAFControl_Writer::WriteNames (const TDF_LabelSequence& theLabels)
507 {
508   if (theLabels.Length() <= 0) return Standard_False;
509
510   DataMapOfShapeNames aMapOfShapeNames;
511
512   for (Standard_Integer anIter = 1; anIter <= theLabels.Length(); anIter++ )
513   {
514     TDF_Label aLabel = theLabels.Value (anIter);
515
516     TopoDS_Shape aShape;
517     Handle(TDataStd_Name) aName;
518     if (!XCAFDoc_ShapeTool::GetShape (aLabel, aShape)) continue;
519     if (!aLabel.FindAttribute (TDataStd_Name::GetID(), aName)) continue;
520
521     aMapOfShapeNames.Bind (aShape, aName->Get());
522
523     // Collect names for subshapes
524     TopLoc_Location aLocation;
525     CollectShapeNames (aLabel, aLocation, aName, aMapOfShapeNames);
526   }
527
528   for (DataMapOfShapeNames::Iterator anIter (aMapOfShapeNames);
529        anIter.More(); anIter.Next())
530   {
531     const TopoDS_Shape& aShape = anIter.Key();
532     const TCollection_ExtendedString& aName = anIter.Value();
533
534     Handle(Transfer_FinderProcess) aFinderProcess = TransferProcess();
535     Handle(IGESData_IGESEntity) anIGESEntity;
536     Handle(TransferBRep_ShapeMapper) aShapeMapper = TransferBRep::ShapeMapper (aFinderProcess, aShape);
537
538     if (aFinderProcess->FindTypedTransient (aShapeMapper, STANDARD_TYPE(IGESData_IGESEntity), anIGESEntity))
539     {
540       Handle(TCollection_HAsciiString) anAsciiName = new TCollection_HAsciiString ("        ");
541       Standard_Integer aNameLength = 8 - aName.Length();
542       if (aNameLength < 0) aNameLength = 0;
543       for (Standard_Integer aCharPos = 1; aNameLength < 8; aCharPos++, aNameLength++)
544       {
545         anAsciiName->SetValue (aNameLength+1, IsAnAscii (aName.Value (aCharPos)) ? (Standard_Character )aName.Value (aCharPos) : '?');
546       }
547       anIGESEntity->SetLabel (anAsciiName);
548
549       // Set long IGES name using 406 form 15 entity
550       Handle(IGESBasic_Name) aLongNameEntity = new IGESBasic_Name;
551       Handle(TCollection_HExtendedString) aTmpStr = new TCollection_HExtendedString(aName);
552       aLongNameEntity->Init(1, new TCollection_HAsciiString(aTmpStr, '_'));
553
554       anIGESEntity->AddProperty(aLongNameEntity);
555       AddEntity(aLongNameEntity);
556     }
557   }
558
559   return Standard_True;
560 }
561
562 //=======================================================================
563 //function : SetColorMode
564 //purpose  : 
565 //=======================================================================
566
567 void IGESCAFControl_Writer::SetColorMode (const Standard_Boolean colormode)
568 {
569   myColorMode = colormode;
570 }
571
572 //=======================================================================
573 //function : GetColorMode
574 //purpose  : 
575 //=======================================================================
576
577 Standard_Boolean IGESCAFControl_Writer::GetColorMode () const
578 {
579   return myColorMode;
580 }
581
582 //=======================================================================
583 //function : SetNameMode
584 //purpose  : 
585 //=======================================================================
586
587 void IGESCAFControl_Writer::SetNameMode (const Standard_Boolean namemode)
588 {
589   myNameMode = namemode;
590 }
591
592 //=======================================================================
593 //function : GetNameMode
594 //purpose  : 
595 //=======================================================================
596
597 Standard_Boolean IGESCAFControl_Writer::GetNameMode () const
598 {
599   return myNameMode;
600 }
601
602 //=======================================================================
603 //function : SetLayerMode
604 //purpose  : 
605 //=======================================================================
606
607 void IGESCAFControl_Writer::SetLayerMode (const Standard_Boolean layermode)
608 {
609   myLayerMode = layermode;
610 }
611
612 //=======================================================================
613 //function : GetLayerMode
614 //purpose  : 
615 //=======================================================================
616
617 Standard_Boolean IGESCAFControl_Writer::GetLayerMode () const
618 {
619   return myLayerMode;
620 }