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