zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
#ifndef _OD_GIVIEWPORT_GEOMETRY_H_
#define _OD_GIVIEWPORT_GEOMETRY_H_
 
#include "Gi/Gi.h"
#include "Gi/GiGeometry.h"
 
class OdGePoint3d;
class OdGeVector3d;
class OdGeMatrix2d;
class OdGiRasterImage;
class OdGiMetafile;
class OdGiCommonDraw;
class OdGsDCRect;
 
#include "TD_PackPush.h"
 
/** \details
  This class defines the interface for objects that draw themselves.
  <group OdGi_Classes> 
*/
class FIRSTDLL_EXPORT OdGiSelfGdiDrawable : public OdRxObject
{
public:
  ODRX_DECLARE_MEMBERS(OdGiSelfGdiDrawable);
 
  /** \details
    This function is called to have a GDI self-drawable to draw itself.
    \param drawObj [in]  Object to be drawn.
    \param hdc [in]  Handle to the device context.
    \param screenRect [in]  Screen rectangle in device coordinates (pixels).
  */
  virtual void draw(const OdGiCommonDraw& drawObj,
                    void* hdc,
                    const OdGsDCRect& screenRect) const = 0;
};
 
/** \details
  This abstract class represents a protocol extension for the OdGiSelfGdiDrawable interface.
  <group OdGi_Classes> 
*/
class FIRSTDLL_EXPORT OdGiSelfGiDrawablePE : public OdRxObject
{
public:
  ODRX_DECLARE_MEMBERS(OdGiSelfGiDrawablePE);
 
  // return false to create HDC and draw via OdGiSelfGdiDrawable interface
  /** \details
    Returns false to create HDC and draw object via OdGiSelfGdiDrawable interface.
    
    \param pRxObject [in] Pointer to a drawn object.
    \param pDestGeom [in] Pointer to the Conveyor object. 
    \param origin [in] Drawn object's origin.
    \param u [in] Drawn object's width vector.
    \param v [in] Drawn object's height vector.
    \param screenRect [in] Screen rectangle in device coordinates (pixels).
    \param isExport [in] Boolean flag, which indicates that image transparency is on.
  */
  virtual bool draw(OdRxObject* pRxObject, 
                    class OdGiConveyorGeometry* pDestGeom,
                    const OdGePoint3d& origin,
                    const OdGeVector3d& u, const OdGeVector3d& v,
                    const OdGsDCRect& screenRect,
                    bool isExport = false) const = 0;
};
 
/** \details
    This class defines functions that allow entities to vectorize themselves.
    
    \remarks
    Vectorization with the methods of this class are viewport dependent. 
    For viewport specific vectorization, use subViewportDraw() instead of subWorldDraw().
 
    An OdGiViewportGeometry object passed to the subViewportDraw()
    method of an entity.
 
    Model coordinates are applied to all geometry in this class except for setExtents(). 
   
    You can obtain objects of the following classes fromOdGiViewportDraw:
 
    <table>
    Class                 Description
    OdGiSubEntityTraits   Control of drawing attributes and selection markers. 
    OdGiViewportGeometry  Drawing model coordinate geometry and transforms. 
    </table>
 
    \sa
    TD_Gi
    
    <group OdGi_Classes> 
*/
class FIRSTDLL_EXPORT OdGiViewportGeometry : public OdGiGeometry
{
public:
  ODRX_DECLARE_MEMBERS(OdGiViewportGeometry);
 
  /** \details
    Draws a polyline, with coordinates specified in Eye Coordinates.
 
    \param numVertices [in]  Number of vertices.
    \param vertexList [in]  Array of vertices.
 
    \remarks
    This polyline is drawn with a continuous linetype.
 
    \sa
    Coordinate Systems
  */
  virtual void polylineEye(
    OdUInt32 numVertices, 
    const OdGePoint3d* vertexList) = 0;
 
  /** \details
    Draws a filled polygon, with coordinates specified in Eye Coordinates.
 
    \param numVertices [in]  Number of vertices in the polygon.
    \param vertexList [in]  Vertices of the polygon.
 
    \sa
    Coordinate Systems
  */
  virtual void polygonEye(
    OdUInt32 numVertices, 
    const OdGePoint3d* vertexList) = 0;
 
  /** \details
    Draws a polyline, with coordinates specified in normalized device Coordinates.
 
    \param numVertices [in]  Number of vertices in the polyline.
    \param vertexList [in]  Vertices of the polyline.
 
    \remarks
    This polyline is drawn with a continuous linetype.
 
    \sa
    Coordinate Systems
  */
  virtual void polylineDc(
    OdUInt32 numVertices, 
    const OdGePoint3d* vertexList) = 0;
 
  /** \details
    Draws a filled polygon, with coordinates specified in normalized device Coordinates.
 
    \param numVertices [in]  Number of vertices in the polygon.
    \param vertexList [in]  Vertices of the polygon.
 
    \sa
    Coordinate Systems
  */
  virtual void polygonDc(
    OdUInt32 numVertices, 
    const OdGePoint3d* vertexList) = 0;
 
  /** \details
    Draws the specified raster image.
 
    \param origin [in]  Image origin.
    \param u [in]  Image width vector.
    \param v [in]  Image height vector.
    \param pImage [in]  Pointer to the image object.
    \param uvBoundary [in]  Array of image boundary points (may not be null).
    \param numBoundPts [in]  Number of boundary points.
    \param transparency [in]  True if and only if image transparency is on.
    \param brightness [in]  Image brightness [0 .. 100].
    \param contrast [in]  Image contrast [0 .. 100].
    \param fade [in]  Image fade value [0 .. 100].
 
    \note
    All coordinates are in Model coordinates.
  */
  virtual void rasterImageDc(
    const OdGePoint3d& origin,
    const OdGeVector3d& u,
    const OdGeVector3d& v,
    const OdGiRasterImage* pImage, 
    const OdGePoint2d* uvBoundary, 
    OdUInt32 numBoundPts,
    bool transparency = false,
    double brightness = 50.0,
    double contrast = 50.0,
    double fade = 0.0) = 0;
 
  /** \details
    Draws the specified Windows Metafile.
 
    \param origin [in]  Metafile origin.
    \param u [in]  Metafile width vector.
    \param v [in]  Metafile height vector.
    \param pMetafile [in]  Pointer to the Metafile object.
    \param dcAligned [in]  reserved.
    \param baAllowClipping [in]  reserved.
 
    \note
    All coordinates are in Model coordinates.
  */
  virtual void  metafileDc(
    const OdGePoint3d& origin,
    const OdGeVector3d& u,
    const OdGeVector3d& v,
    const OdGiMetafile* pMetafile,
    bool dcAligned = true,
    bool allowClipping = false) = 0;
 
  /** \details
    Passes to the rendering framework an object that can render itself.
 
    \param origin [in]  Object origin.
    \param u [in]  Object width vector.
    \param v [in]  Object height vector.
    \param dcAligned [in]  reserved.
    \param allowClipping [in]  reserved.
    \param pDrawable [in]  Pointer to the drawable.
    \remarks
    Teigha uses this function to render Ole2Frame entities. 
    
    \note
    ownerDrawDc is not conveyor primitive, so Teigha's rendering framework performs no processing 
    (transformation, linetyping, or clipping) for this object. 
 
    All coordinates are in Model coordinates.
 
    \sa
    OdGiSelfGdiDrawable.
  */
  virtual void ownerDrawDc(
    const OdGePoint3d& origin,
    const OdGeVector3d& u,
    const OdGeVector3d& v,
    const OdGiSelfGdiDrawable* pDrawable,
    bool dcAligned = true,
    bool allowClipping = false);
};
 
#include "TD_PackPop.h"
 
#endif