0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / IGESCAFControl / IGESCAFControl_Writer.cxx
CommitLineData
b311480e 1// Created on: 2000-08-17
2// Created by: Andrey BETENEV
973c2be1 3// Copyright (c) 2000-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
7fd59977 16#include <IGESCAFControl.hxx>
42cf5bc1 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>
7fd59977 22#include <IGESGraph_DefinitionLevel.hxx>
42cf5bc1 23#include <IGESSolid_Face.hxx>
6f21399c 24#include <IGESBasic_Name.hxx>
42cf5bc1 25#include <NCollection_DataMap.hxx>
26#include <Standard_Transient.hxx>
7fd59977 27#include <TCollection_AsciiString.hxx>
42cf5bc1 28#include <TCollection_HAsciiString.hxx>
6f21399c 29#include <TCollection_HExtendedString.hxx>
42cf5bc1 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>
7fd59977 37#include <TopExp_Explorer.hxx>
38#include <TopoDS.hxx>
39#include <TopoDS_Face.hxx>
7fd59977 40#include <TopoDS_Iterator.hxx>
42cf5bc1 41#include <TopoDS_Shape.hxx>
7fd59977 42#include <TopTools_SequenceOfShape.hxx>
42cf5bc1 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>
5203f741 54
55namespace
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}
7fd59977 109
110//=======================================================================
111//function : IGESCAFControl_Writer
112//purpose :
113//=======================================================================
114
115IGESCAFControl_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
127IGESCAFControl_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
145Standard_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() );
1db4f07b 149 if ( STool.IsNull() ) return Standard_False;
7fd59977 150
1db4f07b
RL
151 TDF_LabelSequence labels;
152 STool->GetFreeShapes ( labels );
153 return Transfer (labels);
154}
7fd59977 155
7fd59977 156//=======================================================================
1b44ab4b 157//function : Transfer
7fd59977 158//purpose :
159//=======================================================================
160
1b44ab4b 161Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_Label& label)
7fd59977 162{
1b44ab4b 163 TDF_LabelSequence labels;
164 labels.Append( label );
165 return Transfer( labels );
7fd59977 166}
1b44ab4b 167
7fd59977 168//=======================================================================
1db4f07b
RL
169//function : Transfer
170//purpose :
171//=======================================================================
172
173Standard_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//=======================================================================
1b44ab4b 203//function : Perform
204//purpose :
205//=======================================================================
206
207Standard_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
219Standard_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//=======================================================================
7fd59977 227//function : WriteAttributes
228//purpose :
229//=======================================================================
230
1db4f07b 231Standard_Boolean IGESCAFControl_Writer::WriteAttributes (const TDF_LabelSequence& labels)
7fd59977 232{
1db4f07b 233 // Iterate on labels
7fd59977 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
08b183fe 239 XCAFPrs_IndexedDataMapOfShapeStyle settings;
7fd59977 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;
1db4f07b 247 if ( ! XCAFDoc_ShapeTool::GetShape ( L, S ) ) continue;
7fd59977 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
264void IGESCAFControl_Writer::MakeColors (const TopoDS_Shape &S,
08b183fe 265 const XCAFPrs_IndexedDataMapOfShapeStyle &settings,
7fd59977 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;
08b183fe 275 if ( settings.Contains(S) ) {
276 XCAFPrs_Style own = settings.FindFromKey(S);
7fd59977 277 if ( own.IsSetColorCurv() ) style.SetColorCurv ( own.GetColorCurv() );
278 if ( own.IsSetColorSurf() ) style.SetColorSurf ( own.GetColorSurf() );
a4815d55 279 style.SetMaterial (own.Material());
7fd59977 280 }
281
282 // analyze whether current entity should get a color
283 Standard_Boolean hasColor = Standard_False;
284 Quantity_Color col;
06696fd8 285 if ( S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SOLID) {
7fd59977 286 if ( style.IsSetColorSurf() ) {
287 hasColor = Standard_True;
288 col = style.GetColorSurf();
289 }
a4815d55 290 else if (!style.Material().IsNull()
291 && !style.Material()->IsEmpty())
292 {
293 hasColor = Standard_True;
294 col = style.Material()->BaseColor().GetRGB();
295 }
7fd59977 296 }
297 else if ( S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE ) {
298 if ( style.IsSetColorCurv() ) {
299 hasColor = Standard_True;
300 col = style.GetColorCurv();
301 }
302 }
303
304 // if color has to be assigned, try to do this
305 if ( hasColor ) {
306 Handle(IGESGraph_Color) colent;
307 Standard_Integer rank = IGESCAFControl::EncodeColor ( col );
308 if ( ! rank ) {
309 XCAFPrs_Style c; // style used as key in the map
310 c.SetColorSurf ( col );
311 if ( colors.IsBound ( c ) ) {
312 colent = Handle(IGESGraph_Color)::DownCast ( colors.Find(c) );
313 }
314 else {
315 Handle(TCollection_HAsciiString) str =
316 new TCollection_HAsciiString ( col.StringName ( col.Name() ) );
317 colent = new IGESGraph_Color;
ba00aab7 318 NCollection_Vec3<Standard_Real> aColor_sRGB;
319 col.Values (aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB);
320 colent->Init ( aColor_sRGB.r() * 100., aColor_sRGB.g() * 100., aColor_sRGB.b() * 100., str );
7fd59977 321 AddEntity ( colent );
322 colors.Bind ( c, colent );
323 }
324 }
325 Handle(Transfer_FinderProcess) FP = TransferProcess();
326 Handle(IGESData_IGESEntity) ent;
327 Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, S );
328 if ( FP->FindTypedTransient ( mapper, STANDARD_TYPE(IGESData_IGESEntity), ent ) ) {
329 ent->InitColor ( colent, rank );
06696fd8 330 Handle(IGESSolid_Face) ent_f = Handle(IGESSolid_Face)::DownCast(ent);
331 if (!ent_f.IsNull())
332 {
333 if (!ent_f->Surface().IsNull())
334 ent_f->Surface()->InitColor ( colent, rank );
335 }
7fd59977 336 }
337 else {
338 // may be S was splited during shape process
339 Handle(Transfer_Binder) bnd = FP->Find ( mapper );
340 if ( ! bnd.IsNull() ) {
341 Handle(Transfer_TransientListBinder) TransientListBinder =
342 //Handle(Transfer_TransientListBinder)::DownCast( bnd->Next(Standard_True) );
343 Handle(Transfer_TransientListBinder)::DownCast( bnd );
344 Standard_Integer i=0, nb=0;
345 if (! TransientListBinder.IsNull() ) {
346 nb = TransientListBinder->NbTransients();
347 for (i=1; i<=nb; i++) {
348 Handle(Standard_Transient) t = TransientListBinder->Transient(i);
349 ent = Handle(IGESData_IGESEntity)::DownCast(t);
06696fd8 350 if (!ent.IsNull())
351 {
352 ent->InitColor ( colent, rank );
353 Handle(IGESSolid_Face) ent_f = Handle(IGESSolid_Face)::DownCast(ent);
354 if (!ent_f.IsNull())
355 {
356 if (!ent_f->Surface().IsNull())
357 ent_f->Surface()->InitColor ( colent, rank );
358 }
359 }
7fd59977 360 }
361 }
362 /* // alternative: consider recursive mapping S -> compound -> entities
363 else {
364 TopoDS_Shape comp = TransferBRep::ShapeResult(bnd);
365 if ( ! comp.IsNull() && comp.ShapeType() < S.ShapeType() )
366 for ( TopoDS_Iterator it(comp); it.More(); it.Next() ) {
367 MakeColors ( it.Value(), settings, colors, Map, style );
368 }
369 }
370 */
371 }
372 }
373 }
374
375 // iterate on subshapes (except vertices :)
376 if ( S.ShapeType() == TopAbs_EDGE ) return;
377 for ( TopoDS_Iterator it(S); it.More(); it.Next() ) {
378 MakeColors ( it.Value(), settings, colors, Map, style );
379 }
380}
381
382
383static void AttachLayer (const Handle(Transfer_FinderProcess) &FP,
384 const Handle(XCAFDoc_LayerTool)& LTool,
385 const TopoDS_Shape& aSh,
386 const Standard_Integer localIntName)
387{
388
389 TopTools_SequenceOfShape shseq;
390 if ( aSh.ShapeType() == TopAbs_COMPOUND ) {
391 TopoDS_Iterator aShIt(aSh);
392 for ( ; aShIt.More(); aShIt.Next() ) {
393 TopoDS_Shape newSh = aShIt.Value();
394 Handle(TColStd_HSequenceOfExtendedString) shLayers = new TColStd_HSequenceOfExtendedString;
395 if (! LTool->GetLayers( newSh, shLayers) || newSh.ShapeType() == TopAbs_COMPOUND )
396 AttachLayer(FP, LTool, newSh, localIntName);
397 }
398 return;
399 } else if ( aSh.ShapeType() == TopAbs_SOLID || aSh.ShapeType() == TopAbs_SHELL ) {
400 for (TopExp_Explorer exp(aSh,TopAbs_FACE) ; exp.More(); exp.Next()) {
401 TopoDS_Face entSh = TopoDS::Face (exp.Current());
402 shseq.Append(entSh);
403 }
404 } else {
405 shseq.Append(aSh);
406 }
407
408 for (Standard_Integer i = 1; i <= shseq.Length(); i++ ) {
409 TopoDS_Shape localShape = shseq.Value(i);
410 Handle(IGESData_IGESEntity) Igesent;
411 Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, localShape );
412 if ( FP->FindTypedTransient ( mapper, STANDARD_TYPE(IGESData_IGESEntity), Igesent ) ) {
413 Igesent->InitLevel( 0, localIntName );
7fd59977 414 }
0797d9d3 415#ifdef OCCT_DEBUG
04232180 416 else std::cout << "Warning: Can't find entity for shape in mapper" << std::endl;
7fd59977 417#endif
418 }
419}
420
421
422static void MakeLayers (const Handle(Transfer_FinderProcess) &FP,
423 const Handle(XCAFDoc_ShapeTool)& STool,
424 const Handle(XCAFDoc_LayerTool)& LTool,
425 const TDF_LabelSequence& aShapeLabels,
426 const Standard_Integer localIntName)
427{
428 for ( Standard_Integer j = 1; j <= aShapeLabels.Length(); j++ ) {
429 TDF_Label aShapeLabel = aShapeLabels.Value(j);
430 TopoDS_Shape aSh;
431 if ( ! STool->GetShape ( aShapeLabel, aSh ) ) continue;
432 AttachLayer (FP, LTool, aSh, localIntName);
433 }
434}
435
436
437
438//=======================================================================
439//function : WriteLayers
440//purpose :
441//=======================================================================
442
1db4f07b 443Standard_Boolean IGESCAFControl_Writer::WriteLayers (const TDF_LabelSequence& labels)
7fd59977 444{
1db4f07b
RL
445 if ( labels.Length() <=0 ) return Standard_False;
446 Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( labels(1) );
7fd59977 447 if ( STool.IsNull() ) return Standard_False;
1db4f07b 448 Handle(XCAFDoc_LayerTool) LTool = XCAFDoc_DocumentTool::LayerTool( labels(1) );
7fd59977 449 if ( LTool.IsNull() ) return Standard_False;
450
451 Standard_Integer globalIntName = 0;
452 TDF_LabelSequence aLayerLabels;
453 LTool->GetLayerLabels( aLayerLabels );
454
455 Handle(Transfer_FinderProcess) FP = TransferProcess();
456 for ( Standard_Integer i = 1; i <= aLayerLabels.Length(); i++ ){
457 TDF_Label aOneLayerL = aLayerLabels.Value(i);
458 if ( aOneLayerL.IsNull() ) continue;
459 TCollection_ExtendedString localName;
460 LTool->GetLayer(aOneLayerL, localName);
461 Standard_Integer localIntName = 0;
462 TCollection_AsciiString asciiName(localName,'?');
463 if (asciiName.IsIntegerValue() ) {
464 localIntName = asciiName.IntegerValue();
465 if (globalIntName < localIntName) globalIntName = localIntName;
466
467 TDF_LabelSequence aShapeLabels;
468 LTool->GetShapesOfLayer( aOneLayerL, aShapeLabels );
469 if ( aShapeLabels.Length() <= 0 ) continue;
470 MakeLayers(FP, STool, LTool, aShapeLabels, localIntName);
471 }
472 }
473
474 for ( Standard_Integer i1 = 1; i1 <= aLayerLabels.Length(); i1++ ) {
475 TDF_Label aOneLayerL = aLayerLabels.Value(i1);
476 if ( aOneLayerL.IsNull() ) continue;
477 TCollection_ExtendedString localName;
478 LTool->GetLayer(aOneLayerL, localName);
479 Standard_Integer localIntName = 0;
480 TCollection_AsciiString asciiName(localName,'?');
481 if (asciiName.IsIntegerValue() ) continue;
482 TDF_LabelSequence aShapeLabels;
483 LTool->GetShapesOfLayer( aOneLayerL, aShapeLabels );
484 if ( aShapeLabels.Length() <= 0 ) continue;
485 localIntName = ++globalIntName;
486 MakeLayers (FP, STool, LTool, aShapeLabels, localIntName);
487 }
488
489 return Standard_True;
490}
491
492
493//=======================================================================
494//function : WriteNames
495//purpose :
496//=======================================================================
497
5203f741 498Standard_Boolean IGESCAFControl_Writer::WriteNames (const TDF_LabelSequence& theLabels)
7fd59977 499{
5203f741 500 if (theLabels.Length() <= 0) return Standard_False;
501
502 DataMapOfShapeNames aMapOfShapeNames;
503
504 for (Standard_Integer anIter = 1; anIter <= theLabels.Length(); anIter++ )
505 {
506 TDF_Label aLabel = theLabels.Value (anIter);
507
508 TopoDS_Shape aShape;
7fd59977 509 Handle(TDataStd_Name) aName;
5203f741 510 if (!XCAFDoc_ShapeTool::GetShape (aLabel, aShape)) continue;
511 if (!aLabel.FindAttribute (TDataStd_Name::GetID(), aName)) continue;
512
513 aMapOfShapeNames.Bind (aShape, aName->Get());
514
515 // Collect names for subshapes
516 TopLoc_Location aLocation;
517 CollectShapeNames (aLabel, aLocation, aName, aMapOfShapeNames);
518 }
519
520 for (DataMapOfShapeNames::Iterator anIter (aMapOfShapeNames);
521 anIter.More(); anIter.Next())
522 {
523 const TopoDS_Shape& aShape = anIter.Key();
524 const TCollection_ExtendedString& aName = anIter.Value();
525
526 Handle(Transfer_FinderProcess) aFinderProcess = TransferProcess();
527 Handle(IGESData_IGESEntity) anIGESEntity;
528 Handle(TransferBRep_ShapeMapper) aShapeMapper = TransferBRep::ShapeMapper (aFinderProcess, aShape);
529
530 if (aFinderProcess->FindTypedTransient (aShapeMapper, STANDARD_TYPE(IGESData_IGESEntity), anIGESEntity))
531 {
532 Handle(TCollection_HAsciiString) anAsciiName = new TCollection_HAsciiString (" ");
533 Standard_Integer aNameLength = 8 - aName.Length();
534 if (aNameLength < 0) aNameLength = 0;
535 for (Standard_Integer aCharPos = 1; aNameLength < 8; aCharPos++, aNameLength++)
536 {
537 anAsciiName->SetValue (aNameLength+1, IsAnAscii (aName.Value (aCharPos)) ? (Standard_Character )aName.Value (aCharPos) : '?');
7fd59977 538 }
5203f741 539 anIGESEntity->SetLabel (anAsciiName);
6f21399c
MS
540
541 // Set long IGES name using 406 form 15 entity
542 Handle(IGESBasic_Name) aLongNameEntity = new IGESBasic_Name;
543 Handle(TCollection_HExtendedString) aTmpStr = new TCollection_HExtendedString(aName);
544 aLongNameEntity->Init(1, new TCollection_HAsciiString(aTmpStr, '_'));
545
546 anIGESEntity->AddProperty(aLongNameEntity);
547 AddEntity(aLongNameEntity);
5203f741 548 }
7fd59977 549 }
5203f741 550
7fd59977 551 return Standard_True;
552}
553
7fd59977 554//=======================================================================
555//function : SetColorMode
556//purpose :
557//=======================================================================
558
559void IGESCAFControl_Writer::SetColorMode (const Standard_Boolean colormode)
560{
561 myColorMode = colormode;
562}
563
564//=======================================================================
565//function : GetColorMode
566//purpose :
567//=======================================================================
568
569Standard_Boolean IGESCAFControl_Writer::GetColorMode () const
570{
571 return myColorMode;
572}
573
574//=======================================================================
575//function : SetNameMode
576//purpose :
577//=======================================================================
578
579void IGESCAFControl_Writer::SetNameMode (const Standard_Boolean namemode)
580{
581 myNameMode = namemode;
582}
583
584//=======================================================================
585//function : GetNameMode
586//purpose :
587//=======================================================================
588
589Standard_Boolean IGESCAFControl_Writer::GetNameMode () const
590{
591 return myNameMode;
592}
593
594//=======================================================================
595//function : SetLayerMode
596//purpose :
597//=======================================================================
598
599void IGESCAFControl_Writer::SetLayerMode (const Standard_Boolean layermode)
600{
601 myLayerMode = layermode;
602}
603
604//=======================================================================
605//function : GetLayerMode
606//purpose :
607//=======================================================================
608
609Standard_Boolean IGESCAFControl_Writer::GetLayerMode () const
610{
611 return myLayerMode;
612}