0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / Aspect / Aspect_Window.cxx
1 // Created by: NW,JPB,CAL,GG
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-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 // Modified:    GG 28/11/00 G002
17 //              Add BackgroundImage() and BackgroundFillMethod() methods
18 //-Version
19 //-Design       Creation d'une fenetre
20 //-Warning
21 //-References
22 //-Language     C++ 2.0
23 //-Declarations
24 // for the class
25
26 #include <Aspect_Background.hxx>
27 #include <Aspect_Window.hxx>
28 #include <Aspect_WindowDefinitionError.hxx>
29 #include <Quantity_Color.hxx>
30 #include <Standard_Type.hxx>
31
32 IMPLEMENT_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
33
34 //-Aliases
35 //-Global data definitions
36 //-Destructors
37 //-Constructors
38 Aspect_Window::Aspect_Window()
39 : MyBackground(),
40   MyGradientBackground(),
41   MyBackgroundFillMethod(Aspect_FM_NONE)
42 {
43 }
44
45 Aspect_Background Aspect_Window::Background() const
46 {
47   return MyBackground;
48 }
49
50 Aspect_FillMethod Aspect_Window::BackgroundFillMethod() const
51 {
52   return MyBackgroundFillMethod;
53 }
54
55 Aspect_GradientBackground Aspect_Window::GradientBackground() const
56 {
57   return MyGradientBackground;
58 }
59
60 Standard_Boolean Aspect_Window::IsVirtual() const
61 {
62   return MyIsVirtual;
63 }
64
65 void Aspect_Window::SetVirtual (const Standard_Boolean theVirtual)
66 {
67   MyIsVirtual = theVirtual;
68 }
69
70 void Aspect_Window::SetBackground (const Aspect_Background& theBackground)
71 {
72   SetBackground (theBackground.Color());
73 }
74
75 void Aspect_Window::SetBackground (const Quantity_Color& theColor)
76 {
77   MyBackground.SetColor (theColor);
78 }
79
80 void Aspect_Window::SetBackground (const Aspect_GradientBackground& theBackground)
81 {
82   Quantity_Color aFirstColor, aSecondColor;
83   theBackground.Colors (aFirstColor, aSecondColor);
84   SetBackground (aFirstColor, aSecondColor, theBackground.BgGradientFillMethod());
85 }
86
87 void Aspect_Window::SetBackground (const Quantity_Color& theFirstColor,
88                                    const Quantity_Color& theSecondColor,
89                                    const Aspect_GradientFillMethod theFillMethod)
90 {
91   MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
92 }
93
94 //=======================================================================
95 //function : DumpJson
96 //purpose  : 
97 //=======================================================================
98 void Aspect_Window::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
99 {
100   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
101   
102   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyBackground)
103   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyGradientBackground)
104
105   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyBackgroundFillMethod)
106   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyIsVirtual)
107 }