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
440
441
442
443
444
445
446
447
448
/////////////////////////////////////////////////////////////////////////////// 
// 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_DBPLOTSETVAL_H
#define OD_DBPLOTSETVAL_H
 
#include "RxObject.h"
#include "DbPlotSettings.h"
#include "OdArray.h"
 
class OdDbPlotSettings;
 
typedef OdDbPlotSettings::PlotPaperUnits PlotPaperUnits;
typedef OdDbPlotSettings::PlotRotation   PlotRotation;
typedef OdDbPlotSettings::PlotType       PlotType;
typedef OdDbPlotSettings::StdScaleType   StdScaleType;
 
/** \details
    This class defines access methods that validate data for
    OdDbPlotSettings objects prior to setting the data on the
    objects.
    
    \sa
    TD_Db
    
    \remarks
    Plot device and style lists should be refreshed with refreshLists() prior to
    using the other methods in this class, in case any plot devices, PC3 files, or plot style tables were changed
    after starting your application.
    
    <group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdDbPlotSettingsValidator : public OdRxObject
{
public:
  ODRX_DECLARE_MEMBERS(OdDbPlotSettingsValidator);
 
  /** \details
    Sets the plot device and media names for the specified PlotSettings object.
 
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param plotDeviceName [in]  Name of the system printer or PC3 file.
    \param mediaName [in]  Media name.
    
    \note
    (plotDeviceName == none_device) requires (mediaName == none_user_media)
  */
  virtual OdResult setPlotCfgName(
    OdDbPlotSettings* pPlotSettings,
    const OdString& plotDeviceName,
    const OdString& mediaName = OdString::kEmpty) = 0;
 
  /** \details
    Sets the canonical (locale-independent) media name for the specified PlotSettings object.
 
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param mediaName [in]  Canonical media name.
    
    \remarks
    The canonical media name is locale-independent.
    
    \sa
    getLocaleMediaName()
 
    \note
    Canonical media names are case-sensitive.
  */
  virtual OdResult setCanonicalMediaName(
    OdDbPlotSettings* pPlotSettings,
    const OdString& mediaName) = 0;
 
  /** \details
    Sets the plot origin offset for the specified PlotSettings object.
 
    \param xCoordinate [out]  X-coordinate of the origin offset.
    \param yCoordinate [out]  Y-coordinate of the origin offset.
    
    \remarks
    The plot origin offset is measured with respect to the plot margin.
     
    \note
    All distances are returned in millimeters, regardless of the drawing units. 
  */
  virtual OdResult setPlotOrigin(
    OdDbPlotSettings *pPlotSettings,
    double xCoordinate,
    double yCoordinate) = 0;
 
 
  /** \details
    Sets the plot paper units for the specified PlotSettings object.
 
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param plotPaperUnits [in]  Plot paper units.
        
    \remarks
    The plot paper units determine the units of the margins, offsets, paper size, and drawing units.
    
    plotPaperUnits must be one of the following:
    
    <table>
    Name            Value   Description
    kInches         0       Inches
    kMillimeters    1       Millimeters
    kPixels         2       Pixels
    </table>
  */
  virtual OdResult setPlotPaperUnits(
    OdDbPlotSettings* pPlotSettings,
    const PlotPaperUnits plotPaperUnits) = 0;
 
 
  /** \details
    Sets the plot rotation for specified PlotSettings object.
 
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param plotRotation [in]  Plot rotation.
    
    \remarks
    plotRotation must be one of the following:
    
    <table>
    Name         Value    Description
    k0degrees    0        No rotation
    k90degrees   1        90° CCW
    k180degrees  2        Inverted°
    k270degrees  3        90° CW
    </table>
  */
  virtual OdResult setPlotRotation(
    OdDbPlotSettings* pPlotSettings,
    const PlotRotation plotRotation) = 0;
 
  /** \details
    Controls the centering of the plot for the specified PlotSettings object.
 
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param plotCentered [in]  Plot centered.
  */
  virtual OdResult setPlotCentered(
    OdDbPlotSettings* pPlotSettings,
    bool plotCentered) = 0;
 
  /** \details
    Sets the plot type for the specified PlotSettings object.
 
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param plotType [in]  Plot type.
 
    \remarks
    plotType must be one of the following:
    
    <table>
    Name        Value   Description
    kDisplay    0       Display
    kExtents    1       Extents
    kLimits     2       Limits
    kView       3       View
    kWindow     4       Window
    kLayout     5       Layout
    </table>
  */
  virtual OdResult setPlotType(
    OdDbPlotSettings* pPlotSettings,
    const PlotType plotType) = 0;
 
  /** \details
    Sets the corners of the plot window area for the specified PlotSettings object.
 
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param xMin [in]  X-coordinate of the lower-left corner.      
    \param yMin [in]  Y-coordinate of the lower-left corner.      
    \param xMax [in]  X-coordinate of the upper-right corner.      
    \param yMax [in]  Y-coordinate of the upper-right corner.      
    
    \remarks
    The corners define the area to be plotted if and only if plotType == kWindow.
  */
  virtual OdResult setPlotWindowArea(
    OdDbPlotSettings* pPlotSettings,
    double xMin,
    double yMin,
    double xMax,
    double yMax) = 0;
 
  /** \details
    Sets the plot view name for the specified PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param plotViewName [in]  Plot view name.
  
    \remarks
    This string specifies the named view to be plotted if and only if plotType == kView. 
  */
  virtual OdResult setPlotViewName(
    OdDbPlotSettings* pPlotSettings,
    const OdString& plotViewName) = 0;
 
  /** \details
    Controls the use of a standard scale for the specified PlotSettings object.
 
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param useStandardScale [in]  Use standard scale.
  */
  virtual OdResult setUseStandardScale(
    OdDbPlotSettings* pPlotSettings,
    bool useStandardScale) = 0;
 
  /** \details
    Sets the custom print scale for the specified PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param numerator [in]  Receives the PaperSpace units.
    \param denominator [in]  Receives the media units.
    
    \remarks
    The custom print scale always reflects the scale that this PlotSettings object will use to plot.
  */
  virtual OdResult setCustomPrintScale(
    OdDbPlotSettings* pPlotSettings,
    double numerator,
    double denominator) = 0;
 
  /** \details
    Sets the current style sheet for the specified PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param currentStyleSheet [in]  Name of current style sheet.
  */
  virtual OdResult setCurrentStyleSheet(
    OdDbPlotSettings* pPlotSettings,
    const OdString& currentStyleSheet) = 0;
 
  /** \details
    Sets the standard scale type for the specified PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param stdScaleType [in]  Name of current style sheet.
 
    \remarks
    stdScaleType must be one of the of the following
    
    <table>
    Name            Value   Scale
    kScaleToFit     0       Scaled to Fit
    k1_128in_1ft    1       1/128=1'
    k1_64in_1ft     2       1/64=1'
    k1_32in_1ft     3       1/32=1'
    k1_16in_1ft     4       1/16=1'
    k3_32in_1ft     5       3/32=1'
    k1_8in_1ft      6       1/8=1'
    k3_16in_1ft     7       3/16=1'
    k1_4in_1ft      8       1/4=1'
    k3_8in_1ft      9       3/8=1'
    k1_2in_1ft      10      1/2=1'
    k3_4in_1ft      11      3/4=1'
    k1in_1ft        12      1=1'
    k3in_1ft        13      3=1'
    k6in_1ft        14      6=1'
    k1ft_1ft        15      1'=1'
    k1_1            16      1:1
    k1_2            17      1:2
    k1_4            18      1:4
    k1_5            19      1:5
    k1_8            20      1:8
    k1_10           21      1:10
    k1_16           22      1:16
    k1_20           23      1:20
    k1_30           24      1:30
    k1_40           25      1:40
    k1_50           26      1:50
    k1_100          27      1:100
    k2_1            28      2:1
    k4_1            29      4:1
    k8_1            30      8:1
    k10_1           31      10:1
    k100_1          32      100:1
    k1000_1         33      1000:1
    k1and1_2in_1ft  34      1.5"=1'
    </table>
  */
  virtual OdResult setStdScaleType(
    OdDbPlotSettings* pPlotSettings,
    const StdScaleType stdScaleType) = 0;
 
  /** \details
    Sets the standard scale, as a floating point value, for the specified PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param standardScale [in]  Standard scale.
  */
  virtual OdResult setStdScale(
    OdDbPlotSettings* pPlotSettings,
    double standardScale) = 0;
  
  /** \details
    Returns an array of all available system printers and PC3 files.
    
    \remarks
    Plot device and style lists should be refreshed with refreshLists() prior to
    using the other methods in this class, in case any plot devices, PC3 files, or plot style tables were changed
    after starting your application.
    
    \param deviceList [out]  Receives the plot device list.
  */
  virtual void plotDeviceList(
    OdArray<const OdChar*> & deviceList) = 0;
 
  /** \details
    Returns an array canonical (locale-independent) media names for the specified
    PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param mediaList [out]  Receives the media name list.
 
    \remarks
    Plot device and style lists should be refreshed with refreshLists() prior to
    using the other methods in this class, in case any plot devices, PC3 files, or plot style tables were changed
    after starting your application.
  */
  virtual OdResult canonicalMediaNameList(
    OdDbPlotSettings* pPlotSettings,
    OdArray<const OdChar*> & mediaList) = 0;
 
  /** \details
    Returns the locale-dependent media name for the specified PlotSettings object and canonical media name or index.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param canonicalName [out]  Locale-independent media name.
    
    \remarks
    Plot device and style lists should be refreshed with refreshLists() prior to
    using the other methods in this class, in case any plot devices were added or removed
    after starting your application.
  */
  virtual OdString getLocaleMediaName(
    OdDbPlotSettings *pPlotSettings,
    const OdString&  canonicalName) = 0;
 
  /** \param mediaIndex [in]  Media index.
  */
  virtual OdString getLocaleMediaName(
    OdDbPlotSettings *pPlotSettings,
    int mediaIndex) = 0;
 
  /** \details
    Sets the media name closest to the specified parameters for the specified PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param paperWidth [in]  Paper width.
    \param paperHeight [in]  Paper height.
    \param plotPaperUnits [in]  Plot paper units.
    \param matchPrintableArea [in]  True to match against printable area or physical media size.
 
    \remarks
    The plot paper units determine the units of the margins, offsets, paper size, and drawing units.
 
    plotPaperUnits must be one of the following:
    
    <table>
    Name            Value   Description
    kInches         0       Inches
    kMillimeters    1       Millimeters
    kPixels         2       Pixels
    </table>
  */
   virtual OdResult setClosestMediaName(
    OdDbPlotSettings* pPlotSettings,
    double paperWidth,
    double paperHeight,
    const PlotPaperUnits plotPaperUnits,
    bool matchPrintableArea) = 0;
 
  /** \details
    Returns an array of all available plot style tables.
    
    \remarks
    Plot device and style lists should be refreshed with refreshLists() prior to
    using the other methods in this class, in case any plot devices, PC3 files, or plot style tables were changed
    after starting your application.
    
    \param styleList [out]  Receives the plot style list.
  */
  virtual OdResult plotStyleSheetList(
    OdArray<const OdChar*> & styleList) = 0;
 
  /** \details
    Refreshes the plot device and style lists for the specified PlotSettings object.
    
    \remarks
    Plot device and style lists should be refreshed with refreshLists() prior to
    using the other methods in this class, in case any plot devices, PC3 files, or plot style tables were changed
    after starting your application.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
  */
  virtual void refreshLists(
    OdDbPlotSettings* pPlotSettings) = 0;
 
 
  /** \details
    Controls the Zoom to Paper on Update setting for the specified PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
    \param zoomToPaperOnUpdate [in]  Zoom to Paper on Update.
  */
  virtual OdResult setZoomToPaperOnUpdate(
    OdDbPlotSettings* pPlotSettings,
    bool zoomToPaperOnUpdate) = 0;
 
  /** \details
    Applies the default plot configuration settings to the specified PlotSettings object.
    
    \param pPlotSettings [in]  Pointer to the PlotSettings object.
  */
  virtual OdResult setDefaultPlotConfig(
    OdDbPlotSettings* pPlotSettings) = 0;
};
 
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbPlotSettingsValidator object pointers.
*/
typedef OdSmartPtr<OdDbPlotSettingsValidator> OdDbPlotSettingsValidatorPtr;
 
#endif // OD_DBPLOTSETVAL_H