CFx SDK Documentation  2020SP3
DbLSStroke.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef ODDGNLS_DBLSSTROKE_H
25 #define ODDGNLS_DBLSSTROKE_H
26 
27 #include "OdaCommon.h"
28 #include "DbFiler.h"
29 
30 #include "TD_PackPush.h"
31 
39 {
40  enum WidthMode
41  {
42  kLSNoWidth = 0, // Stroke haven't width.
43  kLSWidthLeft = 1, // Stroke have width only for left side.
44  kLSWidthRight = 2, // Stroke have width only for right side.
45  kLSWidthFull = 3 // Stroke have width only for left and right sides.
46  };
47  enum CapMode
48  {
49  kLSCapsClosed = 0, // Closed stroke caps.
50  kLSCapsOpen = 1, // Open stroke caps.
51  kLSCapsExtended = 2, // Extended stroke caps.
52  kLSCapsHexagon = 3, // Hexagonal stroke caps.
53  kLSCapsOctagon = 4, // Octagonal stroke caps.
54  kLSCapsDecagon = 5, // Decagonal stroke caps.
55  kLSCapsArc = 30 // Round stroke caps.
56  };
57 
58 protected:
59  bool m_bIsDash; // true - dash; false - gap
61  bool m_bCanBeScaled; // Variable length
62  /* InvertAt boolean flags:
63  - Invert at: None: true, true.
64  - Invert at: Origin: false, true.
65  - Invert at: End: true, false.
66  - Invert at: Both: false, false.
67  - for non-RSC LineStyles (( Border ), ( Center ) and etc.) them always false.
68  - them always false for internal components.
69  */
72  double m_fLength;
73  double m_fStartWidth;
74  double m_fEndWidth;
77 
78 public:
80  : m_bIsDash(false)
85  , m_fLength(1.0)
86  , m_fStartWidth(0.0)
87  , m_fEndWidth(0.0)
90  {
91  }
92 
96  bool isDash() const { return m_bIsDash; }
100  bool isGap() const { return !m_bIsDash; }
104  void setDash() { m_bIsDash = true; }
108  void setGap() { m_bIsDash = false; }
114  void setIsDash(bool bSet) { m_bIsDash = bSet; }
115 
119  bool bypassCorner() const { return m_bBypassCorner; }
125  void setBypassCorner(bool bSet) { m_bBypassCorner = bSet; }
126 
130  bool canBeScaled() const { return m_bCanBeScaled; }
136  void setCanBeScaled(bool bSet) { m_bCanBeScaled = bSet; }
137 
141  bool invertAtOrigin() const { return !m_bDontInvertAtOrigin; }
147  void setInvertAtOrigin(bool bSet) { m_bDontInvertAtOrigin = !bSet; }
148 
152  bool invertAtEnd() const { return !m_bDontInvertAtEnd; }
158  void setInvertAtEnd(bool bSet) { m_bDontInvertAtEnd = !bSet; }
159 
163  double length() const { return m_fLength; }
169  void setLength(double fLen) { m_fLength = fLen; }
170 
174  double startWidth() const { return m_fStartWidth; }
180  void setStartWidth(double fWidth) { m_fStartWidth = fWidth; }
181 
185  double endWidth() const { return m_fEndWidth; }
191  void setEndWidth(double fWidth) { m_fEndWidth = fWidth; }
192 
196  WidthMode widthMode() const { return m_WidthMode; }
202  void setWidthMode(WidthMode mode) { m_WidthMode = mode; }
203 
207  CapMode capMode() const { return m_CapMode; }
213  void setCapMode(CapMode mode) { m_CapMode = mode; }
214 
215 private:
217 
218  OdResult dwgInFields(OdDbDwgFiler *pFiler);
219  void dwgOutFields(OdDbDwgFiler *pFiler) const;
220  OdResult dxfInFields(OdDbDxfFiler *pFiler);
221  void dxfOutFields(OdDbDxfFiler *pFiler) const;
222 
223 #ifdef ODA_DIAGNOSTICS
224  void trace(OdUInt32 nStroke) const;
225 #endif
226 };
227 
228 #include "TD_PackPop.h"
229 
230 #endif // ODDGNLS_DBLSSTROKE_H
OdResult
OdResult
Definition: OdResult.h:29
OdDbLSStroke::setInvertAtEnd
void setInvertAtEnd(bool bSet)
Definition: DbLSStroke.h:158
OdDbLSStroke::CapMode
CapMode
Definition: DbLSStroke.h:48
OdDbLSStroke::setInvertAtOrigin
void setInvertAtOrigin(bool bSet)
Definition: DbLSStroke.h:147
OdDbLSStroke::setLength
void setLength(double fLen)
Definition: DbLSStroke.h:169
OdDbLSStroke::kLSCapsOpen
@ kLSCapsOpen
Definition: DbLSStroke.h:50
OdDbLSStroke::kLSCapsHexagon
@ kLSCapsHexagon
Definition: DbLSStroke.h:52
OdDbLSStroke::m_bDontInvertAtOrigin
bool m_bDontInvertAtOrigin
Definition: DbLSStroke.h:70
OdDbLSStroke::widthMode
WidthMode widthMode() const
Definition: DbLSStroke.h:196
OdDbLSStroke::setIsDash
void setIsDash(bool bSet)
Definition: DbLSStroke.h:114
OdDbLSStroke::kLSCapsClosed
@ kLSCapsClosed
Definition: DbLSStroke.h:49
false
false
Definition: DimVarDefs.h:165
OdDbLSStroke::kLSWidthFull
@ kLSWidthFull
Definition: DbLSStroke.h:45
OdDbLSStroke::kLSCapsExtended
@ kLSCapsExtended
Definition: DbLSStroke.h:51
OdDbLSStroke::setDash
void setDash()
Definition: DbLSStroke.h:104
TD_PackPop.h
OdDbLSStroke::isDash
bool isDash() const
Definition: DbLSStroke.h:96
OdDbLSStroke::isGap
bool isGap() const
Definition: DbLSStroke.h:100
OdDbLSStroke::capMode
CapMode capMode() const
Definition: DbLSStroke.h:207
OdDbLSStroke::setGap
void setGap()
Definition: DbLSStroke.h:108
OdDbLSStroke::kLSCapsArc
@ kLSCapsArc
Definition: DbLSStroke.h:55
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdDbLSStroke::OdDbLSStrokePatternComponentImpl
friend class OdDbLSStrokePatternComponentImpl
Definition: DbLSStroke.h:216
OdDbLSStroke::m_fLength
double m_fLength
Definition: DbLSStroke.h:72
OdDbLSStroke::m_bBypassCorner
bool m_bBypassCorner
Definition: DbLSStroke.h:60
OdDbLSStroke::kLSCapsDecagon
@ kLSCapsDecagon
Definition: DbLSStroke.h:54
OdDbLSStroke::kLSNoWidth
@ kLSNoWidth
Definition: DbLSStroke.h:42
OdDbLSStroke::m_bDontInvertAtEnd
bool m_bDontInvertAtEnd
Definition: DbLSStroke.h:71
OdDbLSStroke::kLSWidthLeft
@ kLSWidthLeft
Definition: DbLSStroke.h:43
OdDbLSStroke::invertAtOrigin
bool invertAtOrigin() const
Definition: DbLSStroke.h:141
OdDbLSStroke::setCapMode
void setCapMode(CapMode mode)
Definition: DbLSStroke.h:213
OdDbLSStroke::setCanBeScaled
void setCanBeScaled(bool bSet)
Definition: DbLSStroke.h:136
OdDbLSStroke::kLSWidthRight
@ kLSWidthRight
Definition: DbLSStroke.h:44
OdDbLSStroke::setBypassCorner
void setBypassCorner(bool bSet)
Definition: DbLSStroke.h:125
OdDbLSStroke::m_fEndWidth
double m_fEndWidth
Definition: DbLSStroke.h:74
OdDbDxfFiler
Definition: DbFiler.h:194
OdaCommon.h
OdDbLSStroke::setWidthMode
void setWidthMode(WidthMode mode)
Definition: DbLSStroke.h:202
OdDbLSStroke::setStartWidth
void setStartWidth(double fWidth)
Definition: DbLSStroke.h:180
OdDbLSStroke::setEndWidth
void setEndWidth(double fWidth)
Definition: DbLSStroke.h:191
TD_PackPush.h
OdDbLSStroke::bypassCorner
bool bypassCorner() const
Definition: DbLSStroke.h:119
OdDbLSStroke::kLSCapsOctagon
@ kLSCapsOctagon
Definition: DbLSStroke.h:53
OdDbLSStroke::m_bCanBeScaled
bool m_bCanBeScaled
Definition: DbLSStroke.h:61
OdDbLSStroke::m_fStartWidth
double m_fStartWidth
Definition: DbLSStroke.h:73
OdDbLSStroke::m_bIsDash
bool m_bIsDash
Definition: DbLSStroke.h:59
OdDbLSStroke::length
double length() const
Definition: DbLSStroke.h:163
OdDbLSStroke::endWidth
double endWidth() const
Definition: DbLSStroke.h:185
OdDbLSStroke
Definition: DbLSStroke.h:39
OdDbLSStroke::m_WidthMode
WidthMode m_WidthMode
Definition: DbLSStroke.h:75
DbFiler.h
OdDbLSStroke::m_CapMode
CapMode m_CapMode
Definition: DbLSStroke.h:76
OdDbLSStroke::OdDbLSStroke
OdDbLSStroke()
Definition: DbLSStroke.h:79
OdDbLSStroke::canBeScaled
bool canBeScaled() const
Definition: DbLSStroke.h:130
OdDbLSStroke::WidthMode
WidthMode
Definition: DbLSStroke.h:41
OdDbLSStroke::startWidth
double startWidth() const
Definition: DbLSStroke.h:174
OdDbDwgFiler
Definition: DbFiler.h:1031
OdDbLSStroke::invertAtEnd
bool invertAtEnd() const
Definition: DbLSStroke.h:152