42cf5bc1 |
1 | // Created on: 2000-08-16 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 2000-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 | #ifndef _XCAFDoc_Color_HeaderFile |
17 | #define _XCAFDoc_Color_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_Type.hxx> |
21 | |
22 | #include <Quantity_Color.hxx> |
973d410e |
23 | #include <Quantity_ColorRGBA.hxx> |
42cf5bc1 |
24 | #include <TDF_Attribute.hxx> |
25 | #include <Quantity_NameOfColor.hxx> |
26 | #include <Standard_Real.hxx> |
27 | class Standard_GUID; |
28 | class TDF_Label; |
29 | class Quantity_Color; |
973d410e |
30 | class Quantity_ColorRGBA; |
42cf5bc1 |
31 | class TDF_Attribute; |
32 | class TDF_RelocationTable; |
33 | |
34 | |
35 | class XCAFDoc_Color; |
36 | DEFINE_STANDARD_HANDLE(XCAFDoc_Color, TDF_Attribute) |
37 | |
38 | //! attribute to store color |
39 | class XCAFDoc_Color : public TDF_Attribute |
40 | { |
41 | |
42 | public: |
43 | |
44 | |
45 | Standard_EXPORT XCAFDoc_Color(); |
46 | |
47 | Standard_EXPORT static const Standard_GUID& GetID(); |
48 | |
49 | Standard_EXPORT static Handle(XCAFDoc_Color) Set (const TDF_Label& label, const Quantity_Color& C); |
973d410e |
50 | |
51 | Standard_EXPORT static Handle(XCAFDoc_Color) Set (const TDF_Label& label, const Quantity_ColorRGBA& C); |
42cf5bc1 |
52 | |
53 | Standard_EXPORT static Handle(XCAFDoc_Color) Set (const TDF_Label& label, const Quantity_NameOfColor C); |
54 | |
55 | //! Find, or create, a Color attribute and set it's value |
56 | //! the Color attribute is returned. |
973d410e |
57 | Standard_EXPORT static Handle(XCAFDoc_Color) Set (const TDF_Label& label, const Standard_Real R, const Standard_Real G, const Standard_Real B, const Standard_Real alpha = 1.0); |
42cf5bc1 |
58 | |
59 | Standard_EXPORT void Set (const Quantity_Color& C); |
973d410e |
60 | |
61 | Standard_EXPORT void Set (const Quantity_ColorRGBA& C); |
42cf5bc1 |
62 | |
63 | Standard_EXPORT void Set (const Quantity_NameOfColor C); |
64 | |
973d410e |
65 | Standard_EXPORT void Set (const Standard_Real R, const Standard_Real G, const Standard_Real B, const Standard_Real alpha = 1.0); |
42cf5bc1 |
66 | |
67 | Standard_EXPORT const Quantity_Color& GetColor() const; |
973d410e |
68 | |
69 | Standard_EXPORT const Quantity_ColorRGBA& GetColorRGBA() const; |
42cf5bc1 |
70 | |
71 | Standard_EXPORT Quantity_NameOfColor GetNOC() const; |
72 | |
42cf5bc1 |
73 | Standard_EXPORT void GetRGB (Standard_Real& R, Standard_Real& G, Standard_Real& B) const; |
973d410e |
74 | |
75 | Standard_EXPORT Standard_ShortReal GetAlpha() const; |
42cf5bc1 |
76 | |
79104795 |
77 | Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; |
42cf5bc1 |
78 | |
79104795 |
79 | Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With) Standard_OVERRIDE; |
42cf5bc1 |
80 | |
79104795 |
81 | Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; |
42cf5bc1 |
82 | |
79104795 |
83 | Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE; |
bc73b006 |
84 | |
85 | //! Dumps the content of me into the stream |
86 | Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; |
42cf5bc1 |
87 | |
88 | |
89 | |
90 | |
92efcf78 |
91 | DEFINE_STANDARD_RTTIEXT(XCAFDoc_Color,TDF_Attribute) |
42cf5bc1 |
92 | |
93 | protected: |
94 | |
95 | |
96 | |
97 | |
98 | private: |
99 | |
100 | |
973d410e |
101 | Quantity_ColorRGBA myColor; |
42cf5bc1 |
102 | |
103 | |
104 | }; |
105 | |
106 | |
107 | |
108 | |
109 | |
110 | |
111 | |
112 | #endif // _XCAFDoc_Color_HeaderFile |