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
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
/////////////////////////////////////////////////////////////////////////////// 
// 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 _ODDBDIMSTYLETABLERECORD_INCLUDED
#define _ODDBDIMSTYLETABLERECORD_INCLUDED
 
#include "TD_PackPush.h"
 
#include "DbSymbolTableRecord.h"
 
/** \details
    This namespace contains utility functions for Dimension Style processing.
 
    <group TD_Namespaces>
*/
namespace OdDmUtil
{
  /** \details
    Returns the R14 DIMFIT value corresponding to the specified DIMATFIT and DIMTMOVE values.
 
    \param dimatfit [in]  DIMATFIT value.
    \param dimtmove [in]  DIMTMOVE value.
    
    \remarks
    The complete mapping is as follows:
    
    <table>
    DIMTMOVE    DIMAFIT   DIMFIT
    0           0         0
    0           1         1
    0           2         2
    0           3         3
    1           0         4
    1           1         4
    1           2         4
    1           3         4
    2           0         5
    2           1         5
    2           2         5
    2           3         5
    </table>
    
    All other input combinations return 3.
  */
  int TOOLKIT_EXPORT dimfit(
    int dimatfit, 
    int dimtmove);
  
  /** \details
    Returns the R14 DIMUNIT value corresponding to the specified DIMLUNIT and DIMFRAC values.
 
    \param dimlunit [in]  DIMLUNIT value.
    \param dimfrac [in]  DIMFRAC value.    
 
    \remarks
    The complete mapping is as follows:
    
    <table>
    DIMFRAC   DIMLUNIT  DIMUNIT
    0         1         1 
    0         2         2
    0         3         3
    0         4         4
    0         5         5
    0         6         8
    1         1         1 
    1         2         2
    1         3         3
    1         4         4
    1         5         5
    1         6         8
    2         1         1 
    2         2         2
    2         3         3
    2         4         6
    2         5         7
    2         6         8
    </table>
    
    All other input combinations return 2.
  */
  int TOOLKIT_EXPORT dimunit(
    int dimlunit, 
    int dimfrac);
  
  /** \details
    Returns the R15 DIMATFIT value corresponding to the specified R14 DIMFIT value.
 
    \param dimfit [in]  DIMFIT value.
    
    \remarks
    The complete mapping is as follows:
    
    <table>
    dimfit  dimatfit
    0       0
    1       1
    2       2
    3       3
    4       3
    5       3
    other   3
    </table>
    
  */
  int TOOLKIT_EXPORT dimatfit(
    int dimfit);
  
  /** \details
    Returns the R15 DIMTMOVE value corresponding to the specified R14 DIMFIT value.
    
    \param dimfit [in]  DIMFIT value.
    
    \remarks
    The complete mapping is as follows:
    
    <table>
    dimfit  dimtmove
    0       0
    1       0
    2       0
    3       0
    4       1
    5       2
    other   0
    </table>
  */
  int TOOLKIT_EXPORT dimtmove(
    int dimfit);
  
  /** \details
    Returns the R15 DIMLUNIT value corresponding to the specified R14 DUMUNIT value.
    
    \param dimunit [in]  DIMUNIT value.
    
    \remarks
    The complete mapping is as follows:
    
    <table>
    dimunit    dimlunit
    1          1
    2          2
    3          3
    4          4
    5          5
    6          4
    7          5
    8          6
    other      2
    </table>
  */
  int TOOLKIT_EXPORT dimlunit(
    int dimunit);
  
  /** \details
    Returns the R15 DIMFRAC value corresponding to the specified R14 DUMUNIT value.
    
    \param dimunit [in]  DIMUNIT value.
    
    \remarks
    The complete mapping is as follows:
    
    <table>
    dimunit    dimfrac
    1          0
    2          0
    3          0
    4          0
    5          0
    6          2
    7          2
    8          0
    other      0
    </table>
  */
  int TOOLKIT_EXPORT dimfrac(
    int dimunit);
    
  /** \details
    Returns the local name of the specified dimension arrowhead.
    \param blockId [in]  Object ID of the dimension arrowhead.
  */
  OdString TOOLKIT_EXPORT arrowName(
    OdDbObjectId blockId);
  
  /** \details
    Returns true if and only if the specified arrowhead name is that of a built-in arrowhead.
 
    \param arrowheadName [in]  Arrowhead name.
 
    \remarks
    The built-in arrowheads are as follows:
    
    <table>
    BLOCK NAME    UI STRING
    ArchTick      "Architectural tick"
    BoxBlank      "Box"
    BoxFilled     "Box filled"
    Closed        "Closed"
    ClosedBlank   "Closed blank"
    DatumBlank    "Datum triangle"
    DatumFilled   "Datum triangle filled"
    Dot           "Dot"
    DotBlank      "Dot blank"
    DotSmall      "Dot small"
    Integral      "Integral"
    None          "None"
    Oblique       "Oblique"
    Open          "Open"
    Open30        "Open 30"
    Open90        "Right angle"
    Origin        "Origin indicator"
    Origin2       "Origin indicator 2"
    Small         "Dot small blank"
    </table>
  */
  bool TOOLKIT_EXPORT isBuiltInArrow(
    const OdString& arrowheadName);
  
  /** \details
    Returns true if and only if the specified arrowhead name is that of a built-in arrowhead 
    that is treated as having zero length.  
      
    \param arrowheadName [in]  Arrowhead name.
 
    \remarks
    The built-in zero-length arrowheads are as follows:
 
    <table>
    BLOCK NAME
    ArchTick
    DotSmall
    Integral
    None
    Oblique
    Small
    </table>
  */
  bool TOOLKIT_EXPORT isZeroLengthArrow(
    const OdString& arrowheadName);
  
  /** \details
    Returns the Object ID of the arrowhead block with the specified arrowhead name.
 
    \param arrowheadName [in]  Arrowhead name.
    \param pDb [in]  Database containing the arrowhead.
  */
  OdDbObjectId TOOLKIT_EXPORT findArrowId(
    const OdString& arrowheadName, 
    const OdDbDatabase* pDb);
  
  /** \details
    Returns the Object ID of the arrowhead block with the specified arrowhead name, creating
    this block if necessary.
 
    \param arrowheadName [in]  Arrowhead name.
    \param pDb [in]  Database containing the arrowhead.
  */
  OdDbObjectId TOOLKIT_EXPORT getArrowId(
    const OdString& arrowheadName, 
    OdDbDatabase* pDb);
 
  /*
       OdString globalArrowName(const OdChar* pName);  
       OdString globalArrowName(OdDbObjectId blockId);
       OdString arrowName(const OdChar* pName);
  */
 
}
 
/** \details
 
    <group TD_Namespaces>
*/
namespace OdDb
{
  enum DimArrowFlags
  {
    kFirstArrow  = 0, // First arrowhead
    kSecondArrow = 1  // Second arrowhead
  };
}
 
/** \details
    This class represents Dimension Style records in the OdDbDimStyleTable in an OdDbDatabase instance.
 
    \sa
    TD_Db
 
    <group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdDbDimStyleTableRecord: public OdDbSymbolTableRecord
{
public:
  ODDB_DECLARE_MEMBERS(OdDbDimStyleTableRecord);
  
  OdDbDimStyleTableRecord();
 
/*DOM-IGNORE-BEGIN*/  
#define VAR_DEF(type, name, dxf, def_value, metric_def_value, reserve1, reserve2)\
  /** Description: Returns the DIM##NAME value of this Dimension Style. \
    Remarks: ##remarks \
    Notes: ##notes \
  */ \
  type dim##name() const; \
  \
  /** Description: Sets the DIM##NAME value for this Dimension Style.  \
    Arguments: val (I) New value for DIM##NAME.  ##RANGE \
    Remarks: ##remarks \
    Notes: ##notes \
    See Also: ##see_also \
  */ \
  void setDim##name(type val);
 
#include "DimVarDefs.h"
#undef VAR_DEF
/*DOM-IGNORE-END*/
  
  void setDimblk(
    const OdString& val);
 
  void setDimblk1(
    const OdString& val);
  void setDimblk2(
  const OdString& val);
  void setDimldrblk(
    const OdString& val);
 
  // 2005-2006 support
  
  /** \details
    Returns the background text color and flags for this Dimension Style.
    \param bgrndTxtColor [out]  Receives the background text color.
  */
  OdUInt16 getBgrndTxtColor(OdCmColor& bgrndTxtColor) const;
  
  /** \details
    Sets the background text color and flags for this Dimension Style.
    \param bgrndTxtColor [in]  Background text color.
    \param bgrndTxtFlags [in]  Background text flags.
  */
  void setBgrndTxtColor(const OdCmColor& bgrndTxtColor, OdUInt16 bgrndTxtFlags);
 
  /** \details
    Returns the extension line fixed length enable flag for this Dimension Style.
  */
  bool getExtLineFixLenEnable() const;
 
  /** \details
    Controls the extension line fixed length enable flag for this Dimension Style.
    \param extLineFixLenEnable [in]  Extension line fixed length flag.
  */
  void setExtLineFixLenEnable(bool extLineFixLenEnable);
 
  /** \details
    Returns the extension line fixed length for this Dimension Style.
  */
  double getExtLineFixLen() const;
 
  /** \details
    Sets the extension line fixed length for this Dimension Style.
    \param extLineFixLen [in]  Extension line fixed length.
  */
  void setExtLineFixLen(double extLineFixLen);
 
  /** \details
    Returns the arc symbol type for this Dimension Style.
    \remarks
    getArcSymbolType() returns one of the following:
    
    <table>
    Value   Description
    0       Arc symbol precedes text.
    1       Arc symbol is above text.
    2       No arc symbol.
    </table>
  */
  OdUInt16 getArcSymbolType() const;
  /** \details
    Sets the arc symbol type for this Dimension Style.
    \param arcSymbolType [in]  Arc symbol type.
 
    \remarks
    getArcSymbolType() must be one of the following:
    
    <table>
    Value   Description
    0       Arc symbol precedes text.
    1       Arc symbol is above text.
    2       No arc symbol.
    </table>
  */
  void setArcSymbolType(OdUInt16 arcSymbolType);
 
  /** \details
    Returns the jog angle for this Dimension Style.
    \note
    All angles are expressed in radians. 
  */
  double getJogAngle() const;
  /** \details
    Sets the jog angle for this Dimension Style.
    \param jogAngle [in]  Jog angle. 
    \note
    All angles are expressed in radians. 
  */
  void setJogAngle(double jogAngle);
 
  /** \details
    Returns the Object ID of the dimension line linetype for this Dimension Style.
  */
  OdDbObjectId getDimLinetype() const;
 
  /** \details
    Sets the Object ID of the dimension line linetype for this Dimension Style.
 
    \param linetypeId [in]  Dimension line linetype Object ID.
  */
  void setDimLinetype(const OdDbObjectId& linetypeId);
 
  /** \details
    Returns the Object ID of the first extension line linetype for this Dimension Style.
  */
  OdDbObjectId getDimExt1Linetype() const;
 
  /** \details
    Sets the Object ID of the first extension line linetype for this Dimension Style.
    
    \param linetypeId [in]  First extension line linetype Object ID.
  */
  void setDimExt1Linetype(const OdDbObjectId& linetypeId);
 
  /** \details
    Returns the Object ID of the second extension line linetype for this Dimension Style.
  */
  OdDbObjectId getDimExt2Linetype() const;
  /** \details
    Sets the Object ID of the second extension line linetype for this Dimension entity.
    
    \param linetypeId [in]  Second extension line linetype Object ID.
  */
  void setDimExt2Linetype(const OdDbObjectId& linetypeId);
 
  double jogSymbolHeight();
 
  void setJogSymbolHeight(double value);
  void setDIMTALN(bool value);
  bool getDIMTALN() const;
 
  void setDIMBREAK(double value);
  double getDIMBREAK() const;
 
  virtual OdResult dwgInFields(
    OdDbDwgFiler* pFiler);
  
  virtual void dwgOutFields(
    OdDbDwgFiler* pFiler) const;
  
  virtual OdResult dxfInFields(
    OdDbDxfFiler* pFiler);
  
  virtual void dxfOutFields(
    OdDbDxfFiler* pFiler) const;
  
  virtual OdResult dxfInFields_R12(
    OdDbDxfFiler* pFiler);
 
  virtual void dxfOutFields_R12(
    OdDbDxfFiler* pFiler) const;
  
  virtual OdResult subGetClassID(
    void* pClsid) const;
 
  /** \details
    Returns the Object ID of the arrowhead block for the specified arrowhead type.
 
    \param arrowType [in]  Arrow type.
    
    \remarks
    arrowType must be one of the following:
    
    <table>
    Name           Value    Description    
    kFirstArrow    0        First arrowhead
    kSecondArrow   1        Second arrowhead
    </table>
  */
  OdDbObjectId arrowId(
    OdDb::DimArrowFlags arrowType) const;
 
  /** \details
    Returns true if and only if this Dimension Style has been modified for recompute.
  */
  bool isModifiedForRecompute() const;
 
  /*
  OdString dimpost() const;
  OdString dimapost() const;
  OdString dimblk() const;
  OdString dimblk1() const;
  OdString dimblk2() const;
  
  int dimfit() const;
  int dimunit() const;
    
  void setDimfit(int fit);
  void setDimunit(int unit);
  */
  OdResult subErase( bool erasing );
};
 
/** \details
    This template class is a specialization of the OdSmartPtr class for OdDbDimStyleTableRecord object pointers.
*/
typedef OdSmartPtr<OdDbDimStyleTableRecord> OdDbDimStyleTableRecordPtr;
 
#include "TD_PackPop.h"
 
#endif // _ODDBDIMSTYLETABLERECORD_INCLUDED