f47afe53 |
1 | // Created on: 2009-04-06 |
2 | // Created by: Sergey ZARITCHNY |
3 | // Copyright (c) 2009-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 _TDataXtd_Presentation_HeaderFile |
17 | #define _TDataXtd_Presentation_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_Type.hxx> |
21 | #include <Standard_GUID.hxx> |
22 | |
23 | #include <gp_Pnt.hxx> |
24 | #include <TDF_Attribute.hxx> |
25 | #include <Quantity_NameOfColor.hxx> |
26 | |
27 | class TDF_Label; |
28 | class gp_Pnt; |
29 | class Standard_GUID; |
30 | class TDF_Attribute; |
31 | class TDF_RelocationTable; |
32 | |
33 | |
34 | class TDataXtd_Presentation; |
35 | DEFINE_STANDARD_HANDLE(TDataXtd_Presentation, TDF_Attribute) |
36 | |
37 | //! Attribute containing parameters of presentation of the shape, |
38 | //! e.g. the shape attached to the same label and displayed using |
39 | //! TPrsStd tools (see TPrsStd_AISPresentation). |
40 | class TDataXtd_Presentation : public TDF_Attribute |
41 | { |
42 | public: |
43 | //!@name Attribute mechanics |
44 | |
45 | //! Empty constructor |
46 | Standard_EXPORT TDataXtd_Presentation(); |
47 | |
48 | //! Create if not found the TDataXtd_Presentation attribute and set its driver GUID |
49 | Standard_EXPORT static Handle(TDataXtd_Presentation) Set(const TDF_Label& theLabel, const Standard_GUID& theDriverId); |
50 | |
51 | //! Remove attribute of this type from the label |
52 | Standard_EXPORT static void Unset(const TDF_Label& theLabel); |
53 | |
54 | //! Returns the ID of the attribute. |
55 | Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; |
56 | |
57 | //! Returns the ID of the attribute. |
58 | Standard_EXPORT static const Standard_GUID& GetID(); |
59 | |
60 | //! Restores the contents from <anAttribute> into this |
61 | //! one. It is used when aborting a transaction. |
62 | Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE; |
63 | |
64 | //! Returns an new empty attribute from the good end |
65 | //! type. It is used by the copy algorithm. |
66 | Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; |
67 | |
68 | //! This method is different from the "Copy" one, |
69 | //! because it is used when copying an attribute from |
70 | //! a source structure into a target structure. This |
71 | //! method pastes the current attribute to the label |
72 | //! corresponding to the insertor. The pasted |
73 | //! attribute may be a brand new one or a new version |
74 | //! of the previous one. |
75 | Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& intoAttribute, |
76 | const Handle(TDF_RelocationTable)& aRelocTationable) const Standard_OVERRIDE; |
77 | |
78 | Standard_EXPORT Handle(TDF_Attribute) BackupCopy() const Standard_OVERRIDE; |
79 | |
80 | DEFINE_STANDARD_RTTIEXT(TDataXtd_Presentation,TDF_Attribute) |
81 | |
82 | public: |
83 | //!@name Access to data |
84 | |
85 | //! Returns the GUID of the driver managing display of associated AIS object |
86 | Standard_EXPORT Standard_GUID GetDriverGUID() const; |
87 | |
88 | //! Sets the GUID of the driver managing display of associated AIS object |
89 | Standard_EXPORT void SetDriverGUID(const Standard_GUID& theGUID); |
90 | |
91 | Standard_EXPORT Standard_Boolean IsDisplayed() const; |
92 | |
93 | Standard_EXPORT Standard_Boolean HasOwnMaterial() const; |
94 | |
95 | Standard_EXPORT Standard_Boolean HasOwnTransparency() const; |
96 | |
97 | Standard_EXPORT Standard_Boolean HasOwnColor() const; |
98 | |
99 | Standard_EXPORT Standard_Boolean HasOwnWidth() const; |
100 | |
101 | Standard_EXPORT Standard_Boolean HasOwnMode() const; |
102 | |
103 | Standard_EXPORT Standard_Boolean HasOwnSelectionMode() const; |
104 | |
105 | Standard_EXPORT void SetDisplayed(const Standard_Boolean theIsDisplayed); |
106 | |
107 | Standard_EXPORT void SetMaterialIndex(const Standard_Integer theMaterialIndex); |
108 | |
109 | Standard_EXPORT void SetTransparency(const Standard_Real theValue); |
110 | |
111 | Standard_EXPORT void SetColor(const Quantity_NameOfColor theColor); |
112 | |
113 | Standard_EXPORT void SetWidth(const Standard_Real theWidth); |
114 | |
115 | Standard_EXPORT void SetMode(const Standard_Integer theMode); |
116 | |
117 | Standard_EXPORT void SetSelectionMode(const Standard_Integer theSelectionMode); |
118 | |
119 | Standard_EXPORT Standard_Integer MaterialIndex() const; |
120 | |
121 | Standard_EXPORT Standard_Real Transparency() const; |
122 | |
123 | Standard_EXPORT Quantity_NameOfColor Color() const; |
124 | |
125 | Standard_EXPORT Standard_Real Width() const; |
126 | |
127 | Standard_EXPORT Standard_Integer Mode() const; |
128 | |
129 | Standard_EXPORT Standard_Integer SelectionMode() const; |
130 | |
131 | Standard_EXPORT void UnsetMaterial(); |
132 | |
133 | Standard_EXPORT void UnsetTransparency(); |
134 | |
135 | Standard_EXPORT void UnsetColor(); |
136 | |
137 | Standard_EXPORT void UnsetWidth(); |
138 | |
139 | Standard_EXPORT void UnsetMode(); |
140 | |
141 | Standard_EXPORT void UnsetSelectionMode(); |
142 | |
143 | private: |
144 | Standard_GUID myDriverGUID; |
145 | Quantity_NameOfColor myColor; |
146 | Standard_Integer myMaterialIndex; |
147 | Standard_Integer myMode; |
148 | Standard_Integer mySelectionMode; |
149 | Standard_Real myTransparency; |
150 | Standard_Real myWidth; |
151 | Standard_Boolean myIsDisplayed; |
152 | Standard_Boolean myHasOwnColor; |
153 | Standard_Boolean myHasOwnMaterial; |
154 | Standard_Boolean myHasOwnTransparency; |
155 | Standard_Boolean myHasOwnWidth; |
156 | Standard_Boolean myHasOwnMode; |
157 | Standard_Boolean myHasOwnSelectionMode; |
158 | }; |
159 | |
160 | #endif // _TDataXtd_Presentation_HeaderFile |