0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / TDataXtd / TDataXtd_Presentation.cxx
1 // Created on: 2015-04-20
2 // Created by: Alexander Zaikin
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2015 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <TDataXtd_Presentation.hxx>
18
19 #include <TDF_DefaultDeltaOnRemoval.hxx>
20 #include <TDF_Tool.hxx>
21 #include <TCollection_ExtendedString.hxx>
22
23 IMPLEMENT_STANDARD_RTTIEXT(TDataXtd_Presentation,TDF_Attribute)
24
25 //=======================================================================
26 //function : getColorNameFromOldEnum
27 //purpose  :
28 //=======================================================================
29 Quantity_NameOfColor TDataXtd_Presentation::getColorNameFromOldEnum (Standard_Integer theOld)
30 {
31   Standard_Integer aNew = theOld;
32   if (theOld >= 43)  { --aNew; }  // Quantity_NOC_CHARTREUSE1 merged to Quantity_NOC_CHARTREUSE1
33   if (theOld >= 124) { --aNew; }  // Quantity_NOC_GOLD1 merged to Quantity_NOC_GOLD
34   if (theOld >= 136 && theOld < 223)
35   {
36     if (theOld == 146) { return Quantity_NOC_GRAY2; }
37     if (theOld == 157) { return Quantity_NOC_GRAY3; }
38     if (theOld == 168) { return Quantity_NOC_GRAY4; }
39     if (theOld == 179) { return Quantity_NOC_GRAY5; }
40     if (theOld == 190) { return Quantity_NOC_GRAY6; }
41     if (theOld == 201) { return Quantity_NOC_GRAY7; }
42     if (theOld == 212) { return Quantity_NOC_GRAY8; }
43     if (theOld == 222) { return Quantity_NOC_GRAY9; }
44
45     if      (theOld >  212) { aNew += 1; } // old Quantity_NOC_GRAY8
46     else if (theOld >  201) { aNew += 2; } // old Quantity_NOC_GRAY7
47     else if (theOld >  190) { aNew += 3; } // old Quantity_NOC_GRAY6
48     else if (theOld >  179) { aNew += 4; } // old Quantity_NOC_GRAY5
49     else if (theOld >  168) { aNew += 5; } // old Quantity_NOC_GRAY4
50     else if (theOld >  157) { aNew += 6; } // old Quantity_NOC_GRAY3
51     else if (theOld >  146) { aNew += 7; } // old Quantity_NOC_GRAY2
52     else                    { aNew += 8; }
53   }
54
55   if (theOld >  228) { aNew+=3; } // moved Quantity_NOC_GRAY96, 97, 98
56   if (theOld >= 230) { --aNew; }  // Quantity_NOC_GREEN1 merged to Quantity_NOC_GREEN
57   if (theOld == 235) { return Quantity_NOC_GRAY97; }
58   if (theOld == 236) { return Quantity_NOC_GRAY98; }
59   if (theOld == 237) { return Quantity_NOC_GRAY99; }
60   if (theOld >= 238) { aNew-=3; } // moved Quantity_NOC_GRAY96, 97, 98
61   if (theOld >= 360) { --aNew; }  // Quantity_NOC_ORANGE1 merged to Quantity_NOC_ORANGE
62   if (theOld >= 365) { --aNew; }  // Quantity_NOC_ORANGERED1 merged to Quantity_NOC_ORANGERED
63   if (theOld >= 413) { --aNew; }  // Quantity_NOC_RED1 merged to Quantity_NOC_RED
64   if (theOld >= 489) { --aNew; }  // Quantity_NOC_TOMATO1 merged to Quantity_NOC_TOMATO
65   if (theOld >= 511) { --aNew; }  // Quantity_NOC_YELLOW1 merged to Quantity_NOC_YELLOW
66   if (aNew > Quantity_NOC_WHITE) { return Quantity_NOC_WHITE; }
67   return (Quantity_NameOfColor )aNew;
68 }
69
70 //=======================================================================
71 //function : getOldColorNameFromNewEnum
72 //purpose  :
73 //=======================================================================
74 Standard_Integer TDataXtd_Presentation::getOldColorNameFromNewEnum (Quantity_NameOfColor theNew)
75 {
76   Standard_Integer anOld = theNew;
77   if (theNew >= Quantity_NOC_CHARTREUSE2)  { ++anOld; }  // Quantity_NOC_CHARTREUSE1 merged to Quantity_NOC_CHARTREUSE1
78   if (theNew >= Quantity_NOC_GOLD2)        { ++anOld; }  // Quantity_NOC_GOLD1 merged to Quantity_NOC_GOLD
79   if (theNew >= Quantity_NOC_GRAY2 && theNew <= Quantity_NOC_GRAY89)
80   {
81     if (theNew == Quantity_NOC_GRAY2) { return 146; }
82     if (theNew == Quantity_NOC_GRAY3) { return 157; }
83     if (theNew == Quantity_NOC_GRAY4) { return 168; }
84     if (theNew == Quantity_NOC_GRAY5) { return 179; }
85     if (theNew == Quantity_NOC_GRAY6) { return 190; }
86     if (theNew == Quantity_NOC_GRAY7) { return 201; }
87     if (theNew == Quantity_NOC_GRAY8) { return 212; }
88     if (theNew == Quantity_NOC_GRAY9) { return 222; }
89
90     if      (theNew >= Quantity_NOC_GRAY80) { anOld -= 1; }
91     else if (theNew >= Quantity_NOC_GRAY70) { anOld -= 2; }
92     else if (theNew >= Quantity_NOC_GRAY60) { anOld -= 3; }
93     else if (theNew >= Quantity_NOC_GRAY50) { anOld -= 4; }
94     else if (theNew >= Quantity_NOC_GRAY40) { anOld -= 5; }
95     else if (theNew >= Quantity_NOC_GRAY30) { anOld -= 6; }
96     else if (theNew >= Quantity_NOC_GRAY20) { anOld -= 7; }
97     else                                    { anOld -= 8; }
98   }
99   if (theNew == Quantity_NOC_GRAY97) { return 235; }
100   if (theNew == Quantity_NOC_GRAY98) { return 236; }
101   if (theNew == Quantity_NOC_GRAY99) { return 237; }
102
103   if (theNew >= Quantity_NOC_GREEN)      { anOld -= 3; } // moved Quantity_NOC_GRAY96, 97, 98
104   if (theNew >= Quantity_NOC_GREEN2)     { ++anOld; }    // Quantity_NOC_GREEN1 merged to Quantity_NOC_GREEN
105   if (theNew >= Quantity_NOC_HONEYDEW)   { anOld += 3; } // moved Quantity_NOC_GRAY96, 97, 98
106   if (theNew >= Quantity_NOC_ORANGE2)    { ++anOld; }    // Quantity_NOC_ORANGE1 merged to Quantity_NOC_ORANGE
107   if (theNew >= Quantity_NOC_ORANGERED2) { ++anOld; }    // Quantity_NOC_ORANGERED1 merged to Quantity_NOC_ORANGERED
108   if (theNew >= Quantity_NOC_RED2)       { ++anOld; }    // Quantity_NOC_RED1 merged to Quantity_NOC_RED
109   if (theNew >= Quantity_NOC_TOMATO2)    { ++anOld; }    // Quantity_NOC_TOMATO1 merged to Quantity_NOC_TOMATO
110   if (theNew >= Quantity_NOC_YELLOW2)    { ++anOld; }    // Quantity_NOC_YELLOW1 merged to Quantity_NOC_YELLOW
111   return anOld;
112 }
113
114 //=======================================================================
115 //function : TDataXtd_Presentation
116 //purpose  : Default constructor.
117 //=======================================================================
118 TDataXtd_Presentation::TDataXtd_Presentation()
119 : myDriverGUID           ("00000000-0000-0000-0000-000000000000"),
120   myColor                (Quantity_NOC_WHITE),
121   myMaterialIndex        (0),
122   myMode                 (0),
123   myTransparency         (0.0),
124   myWidth                (0.0),
125   myIsDisplayed          (Standard_False),
126   myHasOwnColor          (Standard_False),
127   myHasOwnMaterial       (Standard_False),
128   myHasOwnTransparency   (Standard_False),
129   myHasOwnWidth          (Standard_False),
130   myHasOwnMode           (Standard_False),
131   myHasOwnSelectionMode  (Standard_False)
132 {}
133
134
135 //=======================================================================
136 //function : Set
137 //purpose  : 
138 //=======================================================================
139 Handle(TDataXtd_Presentation) TDataXtd_Presentation::Set (const TDF_Label& theLabel,
140                                                                   const Standard_GUID& theDriverId)
141 {
142   Handle(TDataXtd_Presentation) aPresentation;
143
144   if ( !theLabel.FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
145   {
146     aPresentation = new TDataXtd_Presentation();
147     theLabel.AddAttribute(aPresentation);
148   }
149
150   aPresentation->SetDriverGUID(theDriverId);
151   return aPresentation;
152 }
153
154 //=======================================================================
155 //function : Unset
156 //purpose  : 
157 //=======================================================================
158 void TDataXtd_Presentation::Unset(const TDF_Label& theLabel)
159 {
160   Handle(TDataXtd_Presentation) aPresentation;
161   if (theLabel.FindAttribute(TDataXtd_Presentation::GetID(), aPresentation))
162     theLabel.ForgetAttribute(aPresentation);
163 }
164
165
166 //=======================================================================
167 //function : GetID
168 //purpose  : 
169 //=======================================================================
170 const Standard_GUID& TDataXtd_Presentation::GetID()
171 {
172   static Standard_GUID TDataXtd_PresentationID("04fb4d00-5690-11d1-8940-080009dc3333");
173   return TDataXtd_PresentationID;
174 }
175
176
177 //=======================================================================
178 //function : ID
179 //purpose  : 
180 //=======================================================================
181 const Standard_GUID& TDataXtd_Presentation::ID() const
182 {
183   return GetID();
184 }
185
186
187 //=======================================================================
188 //function :GetDriverGUID
189 //purpose  : 
190 //=======================================================================
191 Standard_GUID TDataXtd_Presentation::GetDriverGUID() const
192 {
193   return myDriverGUID;
194 }
195
196
197 //=======================================================================
198 //function :SetDriverGUID
199 //purpose  : 
200 //=======================================================================
201 void TDataXtd_Presentation::SetDriverGUID(const Standard_GUID& theGUID)
202 {
203   if ( myDriverGUID != theGUID )
204   {
205     Backup();
206     myDriverGUID = theGUID;
207   }
208 }
209
210
211 //=======================================================================
212 //function : IsDisplayed
213 //purpose  : 
214 //=======================================================================
215 Standard_Boolean TDataXtd_Presentation::IsDisplayed() const
216 {
217   return myIsDisplayed;
218 }
219
220
221 //=======================================================================
222 //function : HasOwnMaterial
223 //purpose  : 
224 //=======================================================================
225 Standard_Boolean TDataXtd_Presentation::HasOwnMaterial() const
226 {
227   return myHasOwnMaterial;
228 }
229
230
231 //=======================================================================
232 //function : HasOwnTransparency
233 //purpose  : 
234 //=======================================================================
235 Standard_Boolean TDataXtd_Presentation::HasOwnTransparency() const
236 {
237   return myHasOwnTransparency;
238 }
239
240
241 //=======================================================================
242 //function : HasOwnColor
243 //purpose  : 
244 //=======================================================================
245 Standard_Boolean TDataXtd_Presentation::HasOwnColor() const
246 {
247   return myHasOwnColor;
248 }
249
250
251 //=======================================================================
252 //function : HasOwnWidth
253 //purpose  : 
254 //=======================================================================
255 Standard_Boolean TDataXtd_Presentation::HasOwnWidth() const
256 {
257   return myHasOwnWidth;
258 }
259
260
261 //=======================================================================
262 //function : HasOwnMode
263 //purpose  : 
264 //=======================================================================
265 Standard_Boolean TDataXtd_Presentation::HasOwnMode() const
266 {
267   return myHasOwnMode;
268 }
269
270
271 //=======================================================================
272 //function : HasOwnSelectionMode
273 //purpose  : 
274 //=======================================================================
275 Standard_Boolean TDataXtd_Presentation::HasOwnSelectionMode() const
276 {
277   return myHasOwnSelectionMode;
278 }
279
280
281 //=======================================================================
282 //function : SetDisplayed
283 //purpose  : 
284 //=======================================================================
285 void TDataXtd_Presentation::SetDisplayed(const Standard_Boolean theIsDisplayed)
286 {
287   if (myIsDisplayed != theIsDisplayed)
288   {
289     Backup();
290     myIsDisplayed = theIsDisplayed;
291   }
292 }
293
294
295 //=======================================================================
296 //function : SetMaterialIndex
297 //purpose  : 
298 //=======================================================================
299 void TDataXtd_Presentation::SetMaterialIndex(const Standard_Integer theMaterialIndex)
300 {
301   if (! myHasOwnMaterial || myMaterialIndex != theMaterialIndex)
302   {
303     Backup();
304     myMaterialIndex = theMaterialIndex;
305     myHasOwnMaterial = Standard_True;
306   }
307 }
308
309
310 //=======================================================================
311 //function : SetTransparency
312 //purpose  : 
313 //=======================================================================
314 void TDataXtd_Presentation::SetTransparency(const Standard_Real theValue)
315 {
316   if (! myHasOwnTransparency || myTransparency != theValue)
317   {
318     Backup();
319     myTransparency = theValue;
320     myHasOwnTransparency = Standard_True;
321   }
322 }
323
324
325 //=======================================================================
326 //function : SetColor
327 //purpose  : 
328 //=======================================================================
329 void TDataXtd_Presentation::SetColor(const Quantity_NameOfColor theColor)
330 {
331   if (! myHasOwnColor || myColor != theColor)
332   {
333     Backup();
334     myColor = theColor;
335     myHasOwnColor = Standard_True;
336   }
337 }
338
339
340 //=======================================================================
341 //function : SetWidth
342 //purpose  : 
343 //=======================================================================
344 void TDataXtd_Presentation::SetWidth(const Standard_Real theWidth)
345 {
346   if (! myHasOwnWidth || myWidth != theWidth)
347   {
348     Backup();
349     myWidth = theWidth;
350     myHasOwnWidth = Standard_True;
351   }
352 }
353
354
355 //=======================================================================
356 //function : SetMode
357 //purpose  : 
358 //=======================================================================
359 void TDataXtd_Presentation::SetMode(const Standard_Integer theMode)
360 {
361   if (! myHasOwnMode || myMode != theMode)
362   {
363     Backup();
364     myMode = theMode;
365     myHasOwnMode = Standard_True;
366   }
367 }
368
369 //=======================================================================
370 //function : GetNbSelectionModes
371 //purpose  : Returns the number of selection modes of the attribute.
372 //         : It starts with 1 .. GetNbSelectionModes().
373 //=======================================================================
374 Standard_EXPORT Standard_Integer TDataXtd_Presentation::GetNbSelectionModes() const
375 {
376   return mySelectionModes.Extent();
377 }
378
379 //=======================================================================
380 //function : SetSelectionMode
381 //purpose  : 
382 //=======================================================================
383 void TDataXtd_Presentation::SetSelectionMode(const Standard_Integer theSelectionMode, const Standard_Boolean theTransaction)
384 {
385   if (!myHasOwnSelectionMode || GetNbSelectionModes() > 1 ||
386       (GetNbSelectionModes() > 0 && mySelectionModes.First() != theSelectionMode))
387   {
388     if (theTransaction)
389       Backup();
390     mySelectionModes.Clear();
391     mySelectionModes.Append(theSelectionMode);
392     myHasOwnSelectionMode = Standard_True;
393   }
394 }
395
396 //=======================================================================
397 //function : AddSelectionMode
398 //purpose  : 
399 //=======================================================================
400 void TDataXtd_Presentation::AddSelectionMode(const Standard_Integer theSelectionMode, const Standard_Boolean theTransaction)
401 {
402   if (!myHasOwnSelectionMode || !HasSelectionMode(theSelectionMode))
403   {
404     if (theTransaction)
405       Backup();
406     mySelectionModes.Append(theSelectionMode);
407     myHasOwnSelectionMode = Standard_True;
408   }
409 }
410
411 //=======================================================================
412 //function : MaterialIndex
413 //purpose  : 
414 //=======================================================================
415 Standard_Integer TDataXtd_Presentation::MaterialIndex() const
416 {
417   return myMaterialIndex;
418 }
419
420
421 //=======================================================================
422 //function : Transparency
423 //purpose  : 
424 //=======================================================================
425 Standard_Real TDataXtd_Presentation::Transparency() const
426 {
427   return myTransparency;
428 }
429
430
431 //=======================================================================
432 //function : Color
433 //purpose  : 
434 //=======================================================================
435 Quantity_NameOfColor TDataXtd_Presentation::Color() const
436 {
437   return myColor;
438 }
439
440
441 //=======================================================================
442 //function : Width
443 //purpose  : 
444 //=======================================================================
445 Standard_Real TDataXtd_Presentation::Width() const
446 {
447    return myWidth;
448 }
449
450
451 //=======================================================================
452 //function : Mode
453 //purpose  : 
454 //=======================================================================
455 Standard_Integer TDataXtd_Presentation::Mode() const
456 {
457   return myMode;
458 }
459
460
461 //=======================================================================
462 //function : SelectionMode
463 //purpose  : 
464 //=======================================================================
465 Standard_Integer TDataXtd_Presentation::SelectionMode(const Standard_Integer index) const
466 {
467   Standard_Integer aSelectionMode(0);
468   TColStd_ListOfInteger::Iterator itr(mySelectionModes);
469   for (Standard_Integer i = 1; itr.More() && i <= index; itr.Next(), i++)
470   {
471     if (i == index)
472       aSelectionMode = itr.Value();
473   }
474   return aSelectionMode;
475 }
476
477
478 //=======================================================================
479 //function : UnsetMaterial
480 //purpose  : 
481 //=======================================================================
482 void TDataXtd_Presentation::UnsetMaterial()
483 {
484   if (myHasOwnMaterial)
485   {
486     Backup();
487     myHasOwnMaterial = Standard_False;
488   }
489 }
490
491
492 //=======================================================================
493 //function : UnsetTransparency
494 //purpose  : 
495 //=======================================================================
496 void TDataXtd_Presentation::UnsetTransparency()
497 {
498   if (myHasOwnTransparency)
499   {
500     Backup();
501     myHasOwnTransparency = Standard_False;
502   }
503 }
504
505
506 //=======================================================================
507 //function : UnsetColor
508 //purpose  : 
509 //=======================================================================
510 void TDataXtd_Presentation::UnsetColor()
511 {
512   if (myHasOwnColor)
513   {
514     Backup();
515     myHasOwnColor = Standard_False;
516   }
517 }
518
519
520 //=======================================================================
521 //function : UnsetWidth
522 //purpose  : 
523 //=======================================================================
524 void TDataXtd_Presentation::UnsetWidth()
525 {
526   if (myHasOwnWidth)
527   {
528     Backup();
529     myHasOwnWidth = Standard_False;
530   }
531 }
532
533
534 //=======================================================================
535 //function : UnsetMode
536 //purpose  : 
537 //=======================================================================
538 void TDataXtd_Presentation::UnsetMode()
539 {
540   if (myHasOwnMode)
541   {
542     Backup();
543     myHasOwnMode = Standard_False;
544   }
545 }
546
547
548 //=======================================================================
549 //function : UnsetSelectionMode
550 //purpose  : 
551 //=======================================================================
552 void TDataXtd_Presentation::UnsetSelectionMode()
553 {
554   if (myHasOwnSelectionMode)
555   {
556     Backup();
557     myHasOwnSelectionMode = Standard_False;
558     mySelectionModes.Clear();
559   }
560 }
561
562
563 //=======================================================================
564 //function : BackupCopy
565 //purpose  : 
566 //=======================================================================
567 Handle(TDF_Attribute) TDataXtd_Presentation::BackupCopy() const
568 {
569   Handle(TDataXtd_Presentation) aCopy = new TDataXtd_Presentation;
570
571   aCopy->myIsDisplayed   = myIsDisplayed;
572   aCopy->myDriverGUID    = myDriverGUID;
573   aCopy->mySelectionModes= mySelectionModes;
574   aCopy->myTransparency  = myTransparency;
575   aCopy->myColor         = myColor;
576   aCopy->myMode          = myMode;
577   aCopy->myWidth         = myWidth;
578   aCopy->myMaterialIndex = myMaterialIndex;
579
580   aCopy->myHasOwnColor         = myHasOwnColor;
581   aCopy->myHasOwnMaterial      = myHasOwnMaterial;
582   aCopy->myHasOwnWidth         = myHasOwnWidth;
583   aCopy->myHasOwnMode          = myHasOwnMode;
584   aCopy->myHasOwnTransparency  = myHasOwnTransparency;
585   aCopy->myHasOwnSelectionMode = myHasOwnSelectionMode;
586
587   return aCopy;
588 }
589
590
591 //=======================================================================
592 //function : NewEmpty
593 //purpose  : 
594 //=======================================================================
595 Handle(TDF_Attribute) TDataXtd_Presentation::NewEmpty() const
596 {
597   return new TDataXtd_Presentation();
598 }
599
600
601 //=======================================================================
602 //function : Restore
603 //purpose  : 
604 //=======================================================================
605 void TDataXtd_Presentation::Restore(const Handle(TDF_Attribute)& theAttribute)
606 {
607   Handle(TDataXtd_Presentation) aPresentation =
608     Handle(TDataXtd_Presentation)::DownCast(theAttribute);
609
610   myHasOwnMaterial = aPresentation->HasOwnMaterial();
611   myMaterialIndex = aPresentation->MaterialIndex();
612
613   myHasOwnColor = aPresentation->HasOwnColor();
614   myColor = aPresentation->Color();
615
616   myHasOwnWidth = aPresentation->HasOwnWidth();
617   myWidth = aPresentation->Width();
618
619   myHasOwnMode = aPresentation->HasOwnMode();
620   myMode = aPresentation->Mode();
621
622   myHasOwnSelectionMode = aPresentation->HasOwnSelectionMode();
623   mySelectionModes = aPresentation->mySelectionModes;
624
625   myHasOwnTransparency = aPresentation->HasOwnTransparency();
626   myTransparency = aPresentation->Transparency();
627
628   myIsDisplayed = aPresentation->IsDisplayed();
629   myDriverGUID  = aPresentation->GetDriverGUID();
630 }
631
632
633 //=======================================================================
634 //function : Paste
635 //purpose  : 
636 //=======================================================================
637 void TDataXtd_Presentation::Paste(const Handle(TDF_Attribute)& theInto,
638                                   const Handle(TDF_RelocationTable)&) const
639 {
640   Handle(TDataXtd_Presentation) anInto =
641     Handle(TDataXtd_Presentation)::DownCast(theInto);
642
643   anInto->Backup();
644
645   if (myHasOwnMaterial)
646   {
647     anInto->myMaterialIndex = myMaterialIndex;
648     anInto->myHasOwnMaterial = Standard_True;
649   }
650   else
651   {
652     anInto->myHasOwnMaterial = Standard_False;
653   }
654
655   if (myHasOwnColor)
656   {
657     anInto->myColor = myColor;
658     anInto->myHasOwnColor = Standard_True;
659   }
660   else
661   {
662     anInto->myHasOwnColor = Standard_False;
663   }
664
665   if(myHasOwnWidth)
666   {
667     anInto->myWidth = myWidth;
668     anInto->myHasOwnWidth = Standard_True;
669   }
670   else
671   {
672     anInto->myHasOwnWidth = Standard_False;
673   }
674
675   if (myHasOwnMode)
676   {
677     anInto->myMode = myMode;
678     anInto->myHasOwnMode = Standard_True;
679   }
680   else
681   {
682     anInto->myHasOwnMode = Standard_False;
683   }
684
685   if (myHasOwnSelectionMode)
686   {
687     anInto->mySelectionModes = mySelectionModes;
688     anInto->myHasOwnSelectionMode = Standard_True;
689   }
690   else
691   {
692     anInto->myHasOwnSelectionMode = Standard_False;
693   }
694
695   if (myHasOwnTransparency)
696   {
697     anInto->myTransparency = myTransparency;
698     anInto->myHasOwnTransparency = Standard_True;
699   }
700   else
701   {
702     anInto->myHasOwnTransparency = Standard_False;
703   }
704
705   anInto->myIsDisplayed = myIsDisplayed;
706   anInto->myDriverGUID  = myDriverGUID;
707 }
708
709 //=======================================================================
710 //function : HasSelectionMode
711 //purpose  : Checks a list of selection modes.
712 //=======================================================================
713 Standard_Boolean TDataXtd_Presentation::HasSelectionMode(const Standard_Integer theSelectionMode) const
714 {
715   Standard_Boolean ret(Standard_False);
716   TColStd_ListOfInteger::Iterator itr(mySelectionModes);
717   for (; itr.More(); itr.Next())
718   {
719     if (theSelectionMode == itr.Value())
720       ret = Standard_True;
721   }
722   return ret;
723 }