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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
/////////////////////////////////////////////////////////////////////////////// 
// 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_DB_OLE2FRAME_
#define _OD_DB_OLE2FRAME_
 
#include "TD_PackPush.h"
 
#include "DbOleFrame.h"
#include "Ge/GePoint3d.h"
 
class OdOleItemHandler;
class COleClientItem;
 
/** <group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdRectangle3d
{
public:
  OdGePoint3d upLeft;
  OdGePoint3d upRight;
  OdGePoint3d lowLeft;
  OdGePoint3d lowRight;
};
 
/** \details
    This class represents OLE2 entities in an OdDbDatabase instance.
 
    \sa
    TD_Db
    
    <group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdDbOle2Frame : public OdDbOleFrame
{
public:
  ODDB_DECLARE_MEMBERS(OdDbOle2Frame);
 
  OdDbOle2Frame();
  
  OdResult dwgInFields(
    OdDbDwgFiler* pFiler);
 
  void dwgOutFields(
    OdDbDwgFiler* pFiler) const;
 
  OdResult dxfInFields(
    OdDbDxfFiler* pFiler);
 
  void dxfOutFields(
    OdDbDxfFiler* pFiler) const;
  
  ODRX_SEALED_VIRTUAL bool subWorldDraw(
    OdGiWorldDraw* pWd) const ODRX_OVERRIDE;
 
  ODRX_SEALED_VIRTUAL void subViewportDraw(
    OdGiViewportDraw* pVd) const ODRX_OVERRIDE;
 
  ODRX_SEALED_VIRTUAL OdResult subTransformBy(
    const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
  
  /** \details
    Returns the upper-left corner of the OLE object (DXF 10).
    
    \param point3d [out]  Receives the upper-left corner.
  */
  void getLocation(OdGePoint3d& 
    point3d) const;
 
  /** \details
    Returns the corner points of the OLE object (DXF 10 & 11).
    
    \param rect3d [out]  Receives the corner points.
  */
  void position(
    OdRectangle3d& rect3d) const;
  
  /** \details
      Sets the corner points of the OLE object (DXF 10 & 11).
    
    \param rect3d [in]  Corner points.
  */
  void setPosition(
    const OdRectangle3d& rect3d);
 
  /** \details
    Returns the user type-string for the OLE object (DXF 3).
    
    Examples:  
    "Word Document"  
    "Excel Chart"  
  */
  OdString getUserType() const;
  
  enum Type
  {
      kUnknown  = 0,
      kLink     = 1,
      kEmbedded = 2,
      kStatic   = 3
  };
  /** \details
    Returns the type of this OLE object (DXF 71).  
    
    \remarks
    getType() returns one of the following:
    
    <table>
    Name         Value
    kUnknown     0
    kLink        1
    kEmbedded    2
    kStatic      3
    </table>
  */
  Type getType() const;
 
  /** \details
    Returns the filename and item to which this OLE object is linked.
    
    Example:
    D:/My Documents/My Workbook.xls!Sheet2!R1C1:R10C10
 
    \sa
    getLinkPath()
  */
  OdString getLinkName() const;
  
  /** \details
    Returns the filename to which this OLE object is linked.
 
    Example:
    D:/My Documents/My Workbook.xls
             
    \sa
    getLinkName()
  */
  OdString getLinkPath() const;
  
  enum PlotQuality
  {
      kMonochrome   = 0,  // e.g., spreadsheet
      kLowGraphics  = 1,  // e.g., color text & pie charts
      kHighGraphics = 2,  // e.g., photograph 
      kAutomatic    = 3   // e.g., Automatic
  };
 
  /** \details
    Returns the output quality for this OLE object (DXF 73).
    
    \remarks
    Controls the color depth and resolution when plotted.
    
    outputQuality() returns one of the following:
 
    <table>
    Name               Value    Example
    kMonochrome        0        Spreadsheet
    kLowGraphics       1        Color text & pie charts
    kHighGraphics      2        Photograph 
    kAutomatic         3        Automatic
    </table>
  */
  PlotQuality outputQuality() const;
 
  /** \details
    Sets the output quality for this OLE object (DXF 73).
    
    \param quality [in]  Output quality.
      
    \remarks
    Controls the color depth and resolution when plotted.
 
    quality must be one of the following:
    
    <table>
    Name               Value    Example
    kMonochrome        0        Spreadsheet
    kLowGraphics       1        Color text & pie charts
    kHighGraphics      2        Photograph 
    kAutomatic         3        Automatic
    </table>
  */
  void setOutputQuality(
    PlotQuality  quality);
 
  /** \details
    Returns the compound document data size for this OLE object.
  */
  OdUInt32 getCompoundDocumentDataSize() const;
 
  /** \details
    Writes the compound document data to the specified stream.
    
    \param streamBuf [out]  StreamBuf object to which the data are to be written.
  */
  void getCompoundDocument(
    OdStreamBuf& streamBuf) const;
 
  /** \details
    Reads the compound document data from the specified stream.
    
    \param nSize [in]  Size of compound data.
    \param streamBuf [in]  StreamBuf object from which the data are to be read.
  */
  void setCompoundDocument(
    OdUInt32 nSize, 
    OdStreamBuf& streamBuf);
 
  OdResult subGetClassID(void* pClsid) const;
  
  /** \details
    Returns the Item Handler for this OLE object.
  */
  const OdOleItemHandler* itemHandler() const;
 
  
  /** \details
    Creates an Item Handler for this OLE object.
    
    \remarks
    Returns the Item Handler.
  */
  OdOleItemHandler* getItemHandler();
 
  void subClose();
 
  /** \details
    Returns unknown field.
 
    \remarks
    Was not accessible in DD1.12 (OdDbOle2FrameImpl::m_UnknownFromDWG)
 
    \note
    Currently Teigha does not handle this field.
    This method will be removed or renamed in future releases.
  */
  OdInt32 unhandled_unknown0() const;
 
  /** \details
    Returns unknown field.
 
    \remarks
    Still unknown. OdDbOle2Frame::getUnknown1() in DD1.12
 
    \note
    Currently Teigha does not handle this field.
    This method will be removed or renamed in future releases.
  */
  OdUInt8 unhandled_unknown1() const;
 
  /** \details
    Returns unknown field.
 
    \remarks
    Still unknown. OdDbOle2Frame::getUnknown2() in DD1.12
 
    \note
    Currently Teigha does not handle this field.
    This method will be removed or renamed in future releases.
  */
  OdUInt8 unhandled_unknown2() const;
 
  /** \details
    Sets unknown fields.
 
    \note
    Currently Teigha does not handle these fields.
    This method will be removed or renamed in future releases.
  */
  void unhandled_setUnknown(OdInt32 unk0 = 0, OdUInt8 unk1 = 0x80, OdUInt8 unk2 = 0x55);
 
  /** \details
 
    \remarks
    OdDbOle2Frame::getPixelWidth() in DD1.12
 
    \note
    Currently Teigha does not handle this field.
    This method will be removed or renamed in future releases.
  */
  OdUInt16 unhandled_himetricWidth() const;
 
  /** \details
 
    \remarks
    OdDbOle2Frame::getPixelHeight() in DD1.12
 
    \note
    Currently Teigha does not handle this field.
    This method will be removed or renamed in future releases.
  */
  OdUInt16 unhandled_himetricHeight() const;
 
  /** \details
    Sets unhandled fields.
 
    \note
    Currently Teigha does not handle these fields.
    This method will be removed or renamed in future releases.
  */
  void unhandled_setHimetricSize(OdUInt16 w, OdUInt16 h);
 
  // New properties
 
  /** \details
    Resets current OLE XData.
 
    \param bInitSize [in]  Init actual OLE object size using current WCS size.
  */
  void reset(bool bInitSize = false);
 
  /** \details
    Returns automatically selectable by application plot quality.
  */
  bool autoOutputQuality() const;
 
  /** \details
    Sets plot quality to automatically selectable by application.
 
    \param bFlag [in]  New value.
  */
  void setAutoOutputQuality(bool bFlag);
 
  /** \details
    Returns rotation angle for this OLE object.
  */
  double rotation() const;
 
  /** \details
    Sets rotation angle for this OLE object.
 
    \param fAngle [in]  New value.
  */
  void setRotation(double fAngle);
 
  /** \details
    Returns actual width of this OLE object in WCS.
  */
  double wcsWidth() const;
 
  /** \details
    Sets actual width of this OLE object in WCS.
 
    \param fWidth [in]  New OLE object WCS width.
  */
  void setWcsWidth(double fWidth);
 
  /** \details
    Returns actual height of this OLE object in WCS.
  */
  double wcsHeight() const;
 
  /** \details
    Sets actual height of this OLE object in WCS.
 
    \param fHeight [in]  New OLE object WCS height.
  */
  void setWcsHeight(double fHeight);
 
  /** \details
    Returns percentage of the current OLE object width scale to original object width scale.
  */
  double scaleWidth() const;
 
  /** \details
    Sets new OLE object width scale relative to original object width.
 
    \param fScale [in]  New width scale in percents.
  */
  void setScaleWidth(double fScale);
 
  /** \details
    Returns percentage of the current OLE object height scale to original object height scale.
  */
  double scaleHeight() const;
 
  /** \details
    Sets new OLE object height scale relative to original object height.
 
    \param fScale [in]  New height scale in percents.
  */
  void setScaleHeight(double fScale);
 
  /** \details
    Returns lock aspect property.
  */
  bool lockAspect() const;
 
  /** \details
    Sets lock aspect property.
 
    \param bFlag [in]  New value.
  */
  void setLockAspect(bool bLockAspect);
 
  /** \details
    Returns pointer to MFC COleClientItem object.
 
    \note
    Returns non-Null pointer only if OleItemHandler implementation is MFC-based and supports this method
  */
  COleClientItem * getOleClientItem() const;
 
  virtual OdResult subGetTransformedCopy(const OdGeMatrix3d& mat, OdDbEntityPtr& pCopy) const;
  void subSetDatabaseDefaults(OdDbDatabase *pDb, bool);
};
 
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbOld2Frame object pointers.
*/
typedef OdSmartPtr<OdDbOle2Frame> OdDbOle2FramePtr;
 
#include "TD_PackPop.h"
 
#endif