0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / Aspect / Aspect_Window.cxx
CommitLineData
b311480e 1// Created by: NW,JPB,CAL,GG
2// Copyright (c) 1991-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-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// Modified: GG 28/11/00 G002
17// Add BackgroundImage() and BackgroundFillMethod() methods
7fd59977 18//-Version
7fd59977 19//-Design Creation d'une fenetre
7fd59977 20//-Warning
7fd59977 21//-References
7fd59977 22//-Language C++ 2.0
7fd59977 23//-Declarations
7fd59977 24// for the class
7fd59977 25
42cf5bc1 26#include <Aspect_Background.hxx>
27#include <Aspect_GradientBackground.hxx>
28#include <Aspect_Window.hxx>
29#include <Aspect_WindowDefinitionError.hxx>
30#include <Aspect_WindowError.hxx>
31#include <Quantity_Color.hxx>
32#include <Standard_Type.hxx>
7fd59977 33
25e59720 34IMPLEMENT_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
92efcf78 35
42cf5bc1 36//-Aliases
7fd59977 37//-Global data definitions
7fd59977 38//-Destructors
7fd59977 39//-Constructors
dc3fe572 40Aspect_Window::Aspect_Window()
41: MyBackground(),
7fd59977 42 MyGradientBackground(),
dc3fe572 43 MyBackgroundFillMethod(Aspect_FM_NONE)
7fd59977 44{
45}
46
7fd59977 47Aspect_Background Aspect_Window::Background() const
48{
49 return MyBackground;
50}
51
7fd59977 52Aspect_FillMethod Aspect_Window::BackgroundFillMethod() const
53{
54 return MyBackgroundFillMethod;
55}
56
57Aspect_GradientBackground Aspect_Window::GradientBackground() const
58{
59 return MyGradientBackground;
60}
61
62Standard_Boolean Aspect_Window::IsVirtual() const
63{
64 return MyIsVirtual;
65}
66
67void Aspect_Window::SetVirtual (const Standard_Boolean theVirtual)
68{
69 MyIsVirtual = theVirtual;
70}
dc3fe572 71
72void Aspect_Window::SetBackground (const Aspect_Background& theBackground)
73{
74 SetBackground (theBackground.Color());
75}
76
dc3fe572 77void Aspect_Window::SetBackground (const Quantity_Color& theColor)
78{
79 MyBackground.SetColor (theColor);
80}
81
82void Aspect_Window::SetBackground (const Aspect_GradientBackground& theBackground)
83{
84 Quantity_Color aFirstColor, aSecondColor;
85 theBackground.Colors (aFirstColor, aSecondColor);
86 SetBackground (aFirstColor, aSecondColor, theBackground.BgGradientFillMethod());
87}
88
89void Aspect_Window::SetBackground (const Quantity_Color& theFirstColor,
90 const Quantity_Color& theSecondColor,
91 const Aspect_GradientFillMethod theFillMethod)
92{
93 MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
94}