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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
/////////////////////////////////////////////////////////////////////////////// 
// 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_SECTIONVIEWSTYLE_H
#define OD_SECTIONVIEWSTYLE_H
 
#include "DbModelDocViewStyle.h"
#include "Ge/GeDoubleArray.h"
 
#include "TD_PackPush.h"
 
/** \details
    This class represents detail view style objects.
    
    Library:  TD_Db
    <group OdDb_Classes> 
*/
class TOOLKIT_EXPORT OdDbSectionViewStyle : public OdDbModelDocViewStyle
{
public:
  ODDB_DECLARE_MEMBERS(OdDbSectionViewStyle);
 
  /** \details
    Defines identifier position types.
  */
  enum IdentifierPosition {
    kEndCuttingPlane             = 0, // The identifier is placed at the end of the cutting plane.
    kAboveDirectionArrowLine     = 1, // The identifier is placed above the direction arrow line.
    kAboveDirectionArrowSymbol   = 2, // The identifier is placed above the direction arrow symbol.
    kStartDirectionArrow         = 3, // The identifier is placed at the start of the direction arrow.
    kEndDirectionArrow           = 4, // The identifier is placed at the end of the direction arrow.
  };
 
  /** \details
    Defines section view symbol arrowhead direction.
  */
  enum ArrowDirection {
    kTowardsCuttingPlane    = 0, // The arrowheads are oriented towards the cutting plane.
    kAwayFromCuttingPlane   = 1, // The arrowheads are oriented away from the cutting plane.
  };
 
  /** \details
    Default constructor. Creates an OdDbSectionViewStyle instance.
  */
  OdDbSectionViewStyle();
  ~OdDbSectionViewStyle();
   
  /** \details
    Returns the object ID of the style assigned to the identifier.
  */
  OdDbObjectId identifierStyleId() const;
 
  /** \details
    Sets the identifier's text style.
 
 
    ObjectId The ID of the text style for the identifier.
 
    \returns
    OdDb::eOk if successful.
  */
  OdResult setIdentifierStyleId(const OdDbObjectId &objId);
 
  /** \details
    Returns the identifier's color.
  */
  OdCmColor identifierColor() const;
 
  /** \details
    Sets the identifier's color.
  */
  OdResult setIdentifierColor(const OdCmColor& color);
 
  /** \details
    Returns the identifier's height.
  */
  double identifierHeight() const;
 
  /** \details
    Sets the identifier's height.
  */
  OdResult setIdentifierHeight(double height);
 
  /** \details
    Returns the excluded characters that are specified for the identifier.
  */
  OdString identifierExcludeCharacters() const;
 
  /** \details
    Sets the characters to exclude for the identifier.
 
 
    str   Characters to exclude, each separated by a comma. 
 
    \returns
    eOk if successful 
    or 
    eInvalidInput if incorrect format or invalid characters.
  */
  OdResult setIdentifierExcludeCharacters(const OdString& str);
 
  /** \details
    Returns the object ID of the arrow start symbol.
  */
  OdDbObjectId arrowStartSymbolId() const;
 
  /** \details
    Sets the arrow start symbol to use a specified block.
  */
  OdResult setArrowStartSymbolId(const OdDbObjectId &arrowSymbolId);
 
  /** \details
    Returns the object ID of the arrow end symbol.
  */
  OdDbObjectId arrowEndSymbolId() const;
 
  /** \details
    Sets the arrow end symbol to use a specified block.
  */
  OdResult setArrowEndSymbolId(const OdDbObjectId &arrowSymbolId);
 
  /** \details
    Returns the arrow symbol's color.
  */
  OdCmColor arrowSymbolColor() const;
 
  /** \details
    Sets the arrow symbol's color.
  */
  OdResult setArrowSymbolColor(const OdCmColor& color);
 
  /** \details
    Returns the arrow symbol's size.
  */
  double arrowSymbolSize() const;
 
  /** \details
    Sets the arrow symbol's size.
  */
  OdResult setArrowSymbolSize(double size);
 
  /** \details
    Returns the arrow symbol's extension length.
  */
  double arrowSymbolExtensionLength() const;
 
  /** \details
    Sets the arrow symbol's extension length.
  */
  OdResult setArrowSymbolExtensionLength(double length);
 
  /** \details
    Returns the plane line's lineweight.
  */
  OdDb::LineWeight planeLineWeight() const;
 
  /** \details
    Sets the plane line's lineweight.
  */
  OdResult setPlaneLineWeight(OdDb::LineWeight lineweight);
 
  /** \details
    Returns the plane line's color.
  */
  OdCmColor planeLineColor() const;
 
  /** \details
    Sets the plane line's color.
  */
  OdResult setPlaneLineColor(const OdCmColor& color);
 
  /** \details
    Returns the object ID of the plane line's linetype.
  */
  OdDbObjectId planeLineTypeId() const;
 
  /** \details
    Sets the plane line's linetype according to the linetype's object ID.
  */
  OdResult setPlaneLineTypeId(const OdDbObjectId &objId);
 
  /** \details
    Returns the bend line's color.
  */
  OdCmColor bendLineColor() const;
 
  /** \details
    Sets the bend line's color.
  */
  OdResult setBendLineColor(const OdCmColor& color);
 
  /** \details
    Returns the bend line's lineweight.
  */
  OdDb::LineWeight  bendLineWeight() const;
 
  /** \details
    Sets the bend line's lineweight.
  */
  OdResult setBendLineWeight(OdDb::LineWeight lineweight);
 
  /** \details
    Returns the object ID of the bend line's linetype.
  */
  OdDbObjectId bendLineTypeId() const;
 
  /** \details
    Sets the bend line's linetype.
  */
  OdResult setBendLineTypeId(const OdDbObjectId &objId);
 
  /** \details
    Returns the bend line's length.
  */
  double bendLineLength() const;
 
  /** \details
    Sets the bend line's length.
  */
  OdResult setBendLineLength(double length);
 
  /** \details
    Returns the end line's length.
  */
  double endLineLength() const;
 
  /** \details
    Sets the end line's length.
  */
  OdResult setEndLineLength(double length);
 
  /** \details
    Returns the object ID of the view label's text style.
  */
  OdDbObjectId viewLabelTextStyleId() const;
 
  /** \details
    Sets the view label's text style.
  */
  OdResult setViewLabelTextStyleId(const OdDbObjectId &objId);
 
  /** \details
    Returns the view label's color.
  */
  OdCmColor viewLabelTextColor() const;
 
  /** \details
    Sets the view label's color.
  */
  OdResult setViewLabelTextColor(const OdCmColor& color);
 
  /** \details
    Returns the view label's text height.
  */
  double viewLabelTextHeight() const;
 
  /** \details
    Sets the view label's text height.
  */
  OdResult setViewLabelTextHeight(double height);
 
  /** \details
    Returns the view label's offset.
  */
  double viewLabelOffset() const;
 
  /** \details
    Sets the view label's offset.
  */
  OdResult setViewLabelOffset(double offset);
 
  /** \details
    Returns the view label's attachment point.
  */
  OdDbModelDocViewStyle::AttachmentPoint viewLabelAttachment() const;
 
  /** \details
    Sets the view label's attachment point.
  */
  OdResult setViewLabelAttachment(OdDbModelDocViewStyle::AttachmentPoint attachment);
 
  /** \details
    Returns the view label's text alignment.
  */
  OdDbModelDocViewStyle::TextAlignment viewLabelAlignment() const;
 
  /** \details
    Sets the view label's text alignment.
  */
  OdResult setViewLabelAlignment(OdDbModelDocViewStyle::TextAlignment alignment);
 
  /** \details
    Returns the view label's pattern.
  */
  OdString viewLabelPattern() const;
 
  /** \details
    Returns the view label's pattern.
 
 
    pField  (Optional) If the pattern uses fields,
            they are copied 'pField'.
    \returns
    Pattern of the view label.
  */
  OdString getViewLabelPattern(OdDbField* pField = NULL) const;
 
  /** \details
    Sets the view label's pattern.
    
 
    pattern     Pattern to assign to the view label.
    pField      (Optional) Specify a field to assign the pattern from the field
                (instead of the pattern itself).
 
    \returns
    OdDb::eOk if successful.
  */
  OdResult setViewLabelPattern(const OdString& pattern,
                               const OdDbField* pField = NULL);
 
  /** \details
    Returns the hatch pattern.
  */
  OdString hatchPattern() const;
 
  /** \details
    Sets the hatch pattern.
  */
  OdResult setHatchPattern(const OdString& pattern);
 
  /** \details
    Returns the hatch's color.
  */
  OdCmColor hatchColor() const;
 
  /** \details
    Sets the hatch's color.
  */
  OdResult setHatchColor(const OdCmColor& color);
 
  /** \details
    Returns the hatch's background color.
  */
  OdCmColor hatchBackgroundColor() const;
 
  /** \details
    Sets the hatch's background color.
  */
  OdResult setHatchBackgroundColor(const OdCmColor& color);
 
  /** \details
    Returns the hatch's scale.
  */
  double hatchScale() const;
 
  /** \details
    Sets the hatch's scale.
  */
  OdResult setHatchScale(double scale);
 
  /** \details
    Returns the hatch's angle array as a pointer to an OdGeDoubleArray object.
  */
  const OdGeDoubleArray& hatchAngles() const;
 
  /** \details
    Sets the hatch's angle array.
    
    \param angleArray [in]  Array of doubles to set hatch's angles used by section views.
 
    \note
    eOk if successful.
 
    \remarks
    Angles are set in radians. At least one angle value must be present in the array. The first element is used by the first section view component, the second element is used by the second component and so on. 
    If the component number is more than the array size then the sequence is cycled. 
  */
  OdResult setHatchAngles(const OdGeDoubleArray& angleArray);
 
  /** \details
    Sets the hatch's transparency.
    
    \param transparency [in]  Transparency object to set hatch's transparency.
 
    \note
    eOk if successful.
  */
  OdResult setHatchTransparency(const OdCmTransparency& transparency);
 
  /** \details
    Returns the hatch's transparency as an OdCmTransparency object.
  */
  OdCmTransparency hatchTransparency() const;
 
  /** \details
    Returns whether continuous labeling is enabled.
  */
  bool isContinuousLabeling() const;
 
  /** \details
    Sets whether continuous labeling is enabled or disabled.
 
    \param bValue [in]  True if continuous labeling is to be enabled, false otherwise.
 
    \note
    eOk if successful.
  */
  OdResult setContinuousLabeling(bool bValue);
 
  /** \details
    Returns whether arrowheads display.
  */
  bool showArrowheads() const;
 
  /** \details
    Sets whether arrowheads are shown or not.
 
    \param bValue [in]  True if arrowheads are to be shown, false otherwise.
 
    \note
    eOk if successful.
  */
  OdResult setShowArrowheads(bool bValue);
 
  /** \details
    Returns whether view labels display.
  */
  bool showViewLabel() const;
 
  /** \details
    Sets whether view labels are shown or not.
 
    \param bValue [in]  True if view labels are to be shown, false otherwise.
 
    \note
    eOk if successful.
  */
  OdResult setShowViewLabel(bool bValue);
 
  /** \details
    Returns whether plane lines display.
  */
  bool showAllPlaneLines() const;
 
  /** \details
    Sets whether plane lines are shown or not.
 
    \param bValue [in]  True if plane lines are to be shown, false otherwise.
 
    \note
    eOk if successful.
  */
  OdResult setShowAllPlaneLines(bool bValue);
 
  /** \details
    Returns whether identifiers at all bends of the cutting plane lines display.
  */
  bool showAllBendIndentifiers() const;
 
  /** \details
    Sets whether identifiers at all bends are shown or not.
 
    \param bValue [in]  True if identifiers at all bends are to be shown, false otherwise.
 
    \note
    eOk if successful.
  */
  OdResult setShowAllBendIndentifiers(bool bValue);
 
  /** \details
    Returns whether end lines and bend lines display.
  */
  bool showEndAndBendLines() const;
 
  /** \details
    Sets whether end lines and bend lines are shown or not.
 
    \param bValue [in]  True if end lines and bend lines are to be shown, false otherwise.
 
    \note
    eOk if successful.
  */
  OdResult setShowEndAndBendLines(bool bValue);
 
  /** \details
    Returns whether hatches display.
  */
  bool showHatching() const;
 
  /** \details
    Sets whether hatches are shown or not.
 
    \param bValue [in]  True if hatches are to be shown, false otherwise.
 
    \note
    eOk if successful.
  */
  OdResult setShowHatching(bool bValue);
 
  ///** \details
  //  Inspects the string that defines the excluded characters of an identifier and checks it
  //  for valid characters and the correct format.
  //
  //  \param [in] str  String of characters that is set as the excluded characters for the identifier.
  //
  //  \returns
  //  True if the string is formatted correctly; false otherwise.
  //*/
  //static bool validateIdentifierExcludeCharacters(const OdString& str);
 
  /** \details
    Returns view identifier position as an OdDbSectionViewStyle::IdentifierPosition value.
  */
  OdDbSectionViewStyle::IdentifierPosition viewIdentifierPosition() const;
 
  /** \details
    Sets view identifier position type.
 
    \param type [in]  Identifier position type.
 
    \note
    eOk if successful.
  */
  OdResult setViewIdentifierPosition(OdDbSectionViewStyle::IdentifierPosition type);
 
  /** \details
    Returns view identifier offset as a double value.
  */
  double viewIdentifierOffset() const;
 
  /** \details
    Sets view identifier offset.
 
    \param offset [in]  View identifier offset.
 
    \note
    eOk if successful.
  */
  OdResult setViewIdentifierOffset(double offset);
 
  /** \details
    Returns arrow position type for this OdDbSectionViewStyle object as an OdDbSectionViewStyle::ArrowDirection value.
  */
  OdDbSectionViewStyle::ArrowDirection arrowPosition() const;
 
  /** \details
    Sets section view symbol arrowhead direction for this OdDbSectionViewStyle object.
 
    \param type [in]  Arrowhead direction.
 
    \note
    eOk if successful.
  */
  OdResult setArrowPosition(OdDbSectionViewStyle::ArrowDirection type);
 
  /** \details
    Returns the end line's overshoot value.
  */
  double endLineOvershoot() const;
 
  /** \details
    Sets the end line's overshoot value.
 
    \param length [in]  Line's overshoot length.
 
    \note
    eOk if successful.
  */
  OdResult setEndLineOvershoot(double length);
 
  // OdDbModelDocViewStyle overridden functions
  virtual OdDbObjectId postViewStyleToDb(OdDbDatabase* pDb, const OdString& styleName);
 
protected:
  // OdDbObject overridden functions
  virtual OdResult dwgInFields(OdDbDwgFiler* pFiler);
  virtual void dwgOutFields(OdDbDwgFiler* pFiler) const;
  virtual OdResult dxfInFields(OdDbDxfFiler* pFiler);
  virtual void dxfOutFields(OdDbDxfFiler* pFiler) const;
 
//protected:
//  // For internal use only
//  virtual OdDbObjectPtr subDeepClone(OdDbObject* pOwner,
//                                     OdDbIdMapping& idMap, bool isPrimary = true) const;
//  virtual OdDbObjectPtr subWblockClone(OdDbObject* pOwner,
//                                       OdDbIdMapping& idMap, bool isPrimary = true) const;
};
 
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbSectionViewStyle object pointers.
*/
typedef OdSmartPtr<OdDbSectionViewStyle> OdDbSectionViewStylePtr;
 
#include "TD_PackPop.h"
 
#endif // OD_SECTIONVIEWSTYLE_H