summaryrefslogtreecommitdiff
path: root/inc/Xw_GraphicDevice.hxx
blob: c7063e55016282ef36cdd557f70895690aa55bd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _Xw_GraphicDevice_HeaderFile
#define _Xw_GraphicDevice_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_Xw_GraphicDevice_HeaderFile
#include <Handle_Xw_GraphicDevice.hxx>
#endif

#ifndef _TCollection_AsciiString_HeaderFile
#include <TCollection_AsciiString.hxx>
#endif
#ifndef _Handle_Xw_ColorMap_HeaderFile
#include <Handle_Xw_ColorMap.hxx>
#endif
#ifndef _Handle_Xw_TypeMap_HeaderFile
#include <Handle_Xw_TypeMap.hxx>
#endif
#ifndef _Handle_Xw_WidthMap_HeaderFile
#include <Handle_Xw_WidthMap.hxx>
#endif
#ifndef _Handle_Xw_FontMap_HeaderFile
#include <Handle_Xw_FontMap.hxx>
#endif
#ifndef _Handle_Xw_MarkMap_HeaderFile
#include <Handle_Xw_MarkMap.hxx>
#endif
#ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx>
#endif
#ifndef _Aspect_GraphicDevice_HeaderFile
#include <Aspect_GraphicDevice.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Xw_TypeOfMapping_HeaderFile
#include <Xw_TypeOfMapping.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Xw_TypeOfVisual_HeaderFile
#include <Xw_TypeOfVisual.hxx>
#endif
#ifndef _Quantity_Length_HeaderFile
#include <Quantity_Length.hxx>
#endif
#ifndef _Handle_Aspect_GraphicDriver_HeaderFile
#include <Handle_Aspect_GraphicDriver.hxx>
#endif
class Xw_ColorMap;
class Xw_TypeMap;
class Xw_WidthMap;
class Xw_FontMap;
class Xw_MarkMap;
class Aspect_GraphicDeviceDefinitionError;
class Aspect_BadAccess;
class Xw_Window;
class Aspect_GraphicDriver;


//! This class defines an X11 Graphic Device <br>
//!  Warning: An Graphic Device is defined by : <br>
//!		- a connection "host:server.screen" <br>
//!		- a colormap mapping of type Xw_TOM_xxxxx <br>
//!		- a "UseDefault" flag which permits the use of the <br>
//!			DefaultColormap if possible. <br>
//!	    The connection can be specified directly <br>
//!	    or extracted from an existing Window. <br>
//!	    All Xw_Windows may share the same Graphic Device if <br>
//!	    you don't want to have any side effects on the stations <br>
//!	    which have only one hardware pseudo-colormap . <br>
//!	    Four kind of mapping are possible : <br>
//!	    1) Xw_TOM_SIMPLERAMP <br>
//!	       Allocates the number of required colors in the <br>
//!	       colormap. <br>
//!	       The number of user colors depends directly on <br>
//!	       the hardware colormap size if UseDefault is False, <br>
//!	       or on the remainding free colors in the hardware colormap <br>
//!	       if UseDefault is True. <br>
//!	    2) Xw_TOM_BESTRAMP <br>
//!	       Allocates the number of required colors in the <br>
//!	       colormap but leaves the Odd color indexes free <br>
//!	       if possible for highlight color management. <br>
//!	       (plane 0 is reserved for this usage) <br>
//!	       The number of user colors depends directly on <br>
//!	       the hardware colormap size if UseDefault is False, <br>
//!	       or on the remainding free colors in the hardware colormap <br>
//!	       if UseDefault is True. <br>
//!	    3) Xw_TOM_COLORCUBE (the default) <br>
//!	       Allocates the maximum available colors in the colormap <br>
//!	       and builds a colorcube at this place. <br>
//!	       Any user color will be approximate and will be chosen as <br>
//!	       the nearest of the set of available colorcube colors. <br>
//!	       In this case the number of user colors can be unlimited. <br>
//!	    4) Xw_TOM_HARDWARE <br>
//!	       May do serious damage to the color system. <br>
//!	       Must be used for maintenance only. <br>
//!	    5) Xw_TOM_READONLY <br>
//!	       Allocates the number of required read only colors in the <br>
//!	       default colormap. <br>
//!	       The number of user colors depends directly on <br>
//!	       the hardware colormap size. <br>
class Xw_GraphicDevice : public Aspect_GraphicDevice {

public:

  //! Create an Graphic Device on the specified Connection <br>
//!	    by using ALL screen defaults if possible <br>
//!	    (i.e:Default Colormap) <br>
//!  Warning: Raises if the Device is Badly defined <br>
  Standard_EXPORT   Xw_GraphicDevice(const Standard_CString Connection,const Xw_TypeOfMapping Mapping = Xw_TOM_COLORCUBE,const Standard_Integer Ncolors = 0,const Standard_Boolean UseDefault = Standard_True);
  //! Destroies all ressources attached to the GraphicDevice <br>
//!	    (Windows, Colormaps, ....) <br>
//!  Warning: Raises if the Device is Badly defined <br>
  Standard_EXPORT   virtual  void Destroy() ;
~Xw_GraphicDevice()
{
  Destroy();
}
  //! Returns the 2D oriented Device color map. <br>
  Standard_EXPORT     Handle_Xw_ColorMap ColorMap2D() const;
  //! Returns the 2D oriented Visual Class. <br>
  Standard_EXPORT     Xw_TypeOfVisual VisualClass2D() const;
  //! Returns the 2D oriented overlay Visual Class. <br>
  Standard_EXPORT     Xw_TypeOfVisual OverlayVisualClass2D() const;
  //! Returns the 3D oriented Device color map. <br>
  Standard_EXPORT     Handle_Xw_ColorMap ColorMap3D() const;
  //! Returns the 3D oriented Visual Class. <br>
  Standard_EXPORT     Xw_TypeOfVisual VisualClass3D() const;
  //! Returns the 3D oriented overlay Visual Class. <br>
  Standard_EXPORT     Xw_TypeOfVisual OverlayVisualClass3D() const;
  //! Returns the Device Type map. <br>
  Standard_EXPORT     Handle_Xw_TypeMap TypeMap() const;
  //! Returns the Device Width map. <br>
  Standard_EXPORT     Handle_Xw_WidthMap WidthMap() const;
  //! Returns the Device Font map. <br>
  Standard_EXPORT     Handle_Xw_FontMap FontMap() const;
  //! Returns the Device Mark map. <br>
  Standard_EXPORT     Handle_Xw_MarkMap MarkMap() const;
  //! Returns the Device connection string. <br>
  Standard_EXPORT     Standard_CString Display() const;
  //! Returns the Device Display Address. <br>
  Standard_EXPORT     Standard_Address XDisplay() const;
  //! Returns the Display size in PIXEL <br>
//!  Warning: Raises if the connection is not defined properly <br>
  Standard_EXPORT     void DisplaySize(Standard_Integer& Width,Standard_Integer& Height) const;
  //! Returns the Display size in METER <br>
//!  Warning: Raises if the connection is not defined properly <br>
  Standard_EXPORT     void DisplaySize(Quantity_Length& Width,Quantity_Length& Height) const;
  //! Returns the plane layer ID from a visual ID <br>
//!  Warning: Raises if the connection is not defined properly <br>
  Standard_EXPORT     Standard_Integer PlaneLayer(const Standard_Integer aVisualID) const;
  
  Standard_EXPORT   virtual  Handle_Aspect_GraphicDriver GraphicDriver() const;

friend class Xw_Window;


  DEFINE_STANDARD_RTTI(Xw_GraphicDevice)

protected:

  
  Standard_EXPORT   Xw_GraphicDevice();
  //! Initializes all ressources attached to the GraphicDevice <br>
//!  Category: methods to modify the class definition <br>
//!  Warning: Raises if the Device is Badly defined <br>
  Standard_EXPORT     void InitMaps(const Standard_CString Connection,const Xw_TypeOfMapping Mapping,const Standard_Integer Ncolors,const Standard_Boolean UseDefault) ;
  //! Returns extended data colormap 2D structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedColorMap2D() const;
  //! Returns extended data overlay colormap 2D structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedOverlayColorMap2D() const;
  //! Returns extended data colormap 3D structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedColorMap3D() const;
  //! Returns extended data overlay colormap 3D structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedOverlayColorMap3D() const;
  //! Returns extended data typemap structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedTypeMap() const;
  //! Returns extended data widthmap structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedWidthMap() const;
  //! Returns extended data fontmap structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedFontMap() const;
  //! Returns extended data markmap structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedMarkMap() const;
  //! Returns extended data display structure pointer. <br>
  Standard_EXPORT     Standard_Address ExtendedDisplay() const;

Standard_Address MyExtendedDisplay;


private: 


TCollection_AsciiString MyDisplay;
Handle_Xw_ColorMap MyColorMap2D;
Handle_Xw_ColorMap MyColorMap3D;
Handle_Xw_TypeMap MyTypeMap;
Handle_Xw_WidthMap MyWidthMap;
Handle_Xw_FontMap MyFontMap;
Handle_Xw_MarkMap MyMarkMap;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif