CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbLSStroke.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
37{
39 {
40 kLSNoWidth = 0, // Stroke haven't width.
41 kLSWidthLeft = 1, // Stroke have width only for left side.
42 kLSWidthRight = 2, // Stroke have width only for right side.
43 kLSWidthFull = 3 // Stroke have width only for left and right sides.
44 };
46 {
47 kLSCapsClosed = 0, // Closed stroke caps.
48 kLSCapsOpen = 1, // Open stroke caps.
49 kLSCapsExtended = 2, // Extended stroke caps.
50 kLSCapsHexagon = 3, // Hexagonal stroke caps.
51 kLSCapsOctagon = 4, // Octagonal stroke caps.
52 kLSCapsDecagon = 5, // Decagonal stroke caps.
53 kLSCapsArc = 30 // Round stroke caps.
54 };
55
56protected:
57 bool m_bIsDash; // true - dash; false - gap
59 bool m_bCanBeScaled; // Variable length
60 /* InvertAt boolean flags:
61 - Invert at: None: true, true.
62 - Invert at: Origin: false, true.
63 - Invert at: End: true, false.
64 - Invert at: Both: false, false.
65 - for non-RSC LineStyles (( Border ), ( Center ) and etc.) them always false.
66 - them always false for internal components.
67 */
70 double m_fLength;
75
76public:
83 , m_fLength(1.0)
84 , m_fStartWidth(0.0)
85 , m_fEndWidth(0.0)
88 {
89 }
90
94 bool isDash() const { return m_bIsDash; }
98 bool isGap() const { return !m_bIsDash; }
102 void setDash() { m_bIsDash = true; }
106 void setGap() { m_bIsDash = false; }
112 void setIsDash(bool bSet) { m_bIsDash = bSet; }
113
117 bool bypassCorner() const { return m_bBypassCorner; }
123 void setBypassCorner(bool bSet) { m_bBypassCorner = bSet; }
124
128 bool canBeScaled() const { return m_bCanBeScaled; }
134 void setCanBeScaled(bool bSet) { m_bCanBeScaled = bSet; }
135
139 bool invertAtOrigin() const { return !m_bDontInvertAtOrigin; }
145 void setInvertAtOrigin(bool bSet) { m_bDontInvertAtOrigin = !bSet; }
146
150 bool invertAtEnd() const { return !m_bDontInvertAtEnd; }
156 void setInvertAtEnd(bool bSet) { m_bDontInvertAtEnd = !bSet; }
157
161 double length() const { return m_fLength; }
167 void setLength(double fLen) { m_fLength = fLen; }
168
172 double startWidth() const { return m_fStartWidth; }
178 void setStartWidth(double fWidth) { m_fStartWidth = fWidth; }
179
183 double endWidth() const { return m_fEndWidth; }
189 void setEndWidth(double fWidth) { m_fEndWidth = fWidth; }
190
194 WidthMode widthMode() const { return m_WidthMode; }
200 void setWidthMode(WidthMode mode) { m_WidthMode = mode; }
201
205 CapMode capMode() const { return m_CapMode; }
211 void setCapMode(CapMode mode) { m_CapMode = mode; }
212
213private:
215
216 OdResult dwgInFields(OdDbDwgFiler *pFiler);
217 void dwgOutFields(OdDbDwgFiler *pFiler) const;
218 OdResult dxfInFields(OdDbDxfFiler *pFiler);
219 void dxfOutFields(OdDbDxfFiler *pFiler) const;
220
221#ifdef ODA_DIAGNOSTICS
222 void trace(OdUInt32 nStroke) const;
223#endif
224};
225
226#include "TD_PackPop.h"
227
228#endif // ODDGNLS_DBLSSTROKE_H
false
Definition: DimVarDefs.h:165
unsigned int OdUInt32
OdResult
Definition: OdResult.h:29
bool m_bIsDash
Definition: DbLSStroke.h:57
bool invertAtOrigin() const
Definition: DbLSStroke.h:139
double endWidth() const
Definition: DbLSStroke.h:183
bool m_bCanBeScaled
Definition: DbLSStroke.h:59
bool m_bDontInvertAtEnd
Definition: DbLSStroke.h:69
bool canBeScaled() const
Definition: DbLSStroke.h:128
double m_fEndWidth
Definition: DbLSStroke.h:72
void setDash()
Definition: DbLSStroke.h:102
double m_fLength
Definition: DbLSStroke.h:70
void setCanBeScaled(bool bSet)
Definition: DbLSStroke.h:134
void setBypassCorner(bool bSet)
Definition: DbLSStroke.h:123
void setWidthMode(WidthMode mode)
Definition: DbLSStroke.h:200
void setGap()
Definition: DbLSStroke.h:106
double m_fStartWidth
Definition: DbLSStroke.h:71
double length() const
Definition: DbLSStroke.h:161
bool isDash() const
Definition: DbLSStroke.h:94
CapMode capMode() const
Definition: DbLSStroke.h:205
friend class OdDbLSStrokePatternComponentImpl
Definition: DbLSStroke.h:214
WidthMode widthMode() const
Definition: DbLSStroke.h:194
WidthMode m_WidthMode
Definition: DbLSStroke.h:73
CapMode m_CapMode
Definition: DbLSStroke.h:74
void setIsDash(bool bSet)
Definition: DbLSStroke.h:112
void setStartWidth(double fWidth)
Definition: DbLSStroke.h:178
bool invertAtEnd() const
Definition: DbLSStroke.h:150
void setCapMode(CapMode mode)
Definition: DbLSStroke.h:211
void setInvertAtOrigin(bool bSet)
Definition: DbLSStroke.h:145
double startWidth() const
Definition: DbLSStroke.h:172
bool m_bBypassCorner
Definition: DbLSStroke.h:58
void setInvertAtEnd(bool bSet)
Definition: DbLSStroke.h:156
void setEndWidth(double fWidth)
Definition: DbLSStroke.h:189
bool bypassCorner() const
Definition: DbLSStroke.h:117
bool isGap() const
Definition: DbLSStroke.h:98
void setLength(double fLen)
Definition: DbLSStroke.h:167
bool m_bDontInvertAtOrigin
Definition: DbLSStroke.h:68