0024002: Overall code and build procedure refactoring -- automatic
[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
42cf5bc1 34//-Aliases
7fd59977 35//-Global data definitions
7fd59977 36//-Destructors
7fd59977 37//-Constructors
dc3fe572 38Aspect_Window::Aspect_Window()
39: MyBackground(),
7fd59977 40 MyGradientBackground(),
dc3fe572 41 MyBackgroundFillMethod(Aspect_FM_NONE)
7fd59977 42{
43}
44
7fd59977 45Aspect_Background Aspect_Window::Background() const
46{
47 return MyBackground;
48}
49
7fd59977 50Aspect_FillMethod Aspect_Window::BackgroundFillMethod() const
51{
52 return MyBackgroundFillMethod;
53}
54
55Aspect_GradientBackground Aspect_Window::GradientBackground() const
56{
57 return MyGradientBackground;
58}
59
60Standard_Boolean Aspect_Window::IsVirtual() const
61{
62 return MyIsVirtual;
63}
64
65void Aspect_Window::SetVirtual (const Standard_Boolean theVirtual)
66{
67 MyIsVirtual = theVirtual;
68}
dc3fe572 69
70void Aspect_Window::SetBackground (const Aspect_Background& theBackground)
71{
72 SetBackground (theBackground.Color());
73}
74
75void Aspect_Window::SetBackground (const Quantity_NameOfColor theNameOfColor)
76{
77 MyBackground.SetColor (theNameOfColor);
78}
79
80void Aspect_Window::SetBackground (const Quantity_Color& theColor)
81{
82 MyBackground.SetColor (theColor);
83}
84
85void Aspect_Window::SetBackground (const Aspect_GradientBackground& theBackground)
86{
87 Quantity_Color aFirstColor, aSecondColor;
88 theBackground.Colors (aFirstColor, aSecondColor);
89 SetBackground (aFirstColor, aSecondColor, theBackground.BgGradientFillMethod());
90}
91
92void Aspect_Window::SetBackground (const Quantity_Color& theFirstColor,
93 const Quantity_Color& theSecondColor,
94 const Aspect_GradientFillMethod theFillMethod)
95{
96 MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
97}