LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lc::entity::Dimension Class Reference

#include <dimension.h>

Inheritance diagram for lc::entity::Dimension:
Collaboration diagram for lc::entity::Dimension:

Public Member Functions

 Dimension (geo::Coordinate const &definitionPoint, geo::Coordinate const &middleOfText, TextConst::AttachmentPoint const &attachmentPoint, double const textAngle, double lineSpacingFactor, TextConst::LineSpacingStyle const &lineSpacingStyle, std::string const &explicitValue)
 Dimension. More...
 
 Dimension (geo::Coordinate const &_definitionPoint, geo::Coordinate const &_middleOfText, TextConst::AttachmentPoint _attachPt, double _angle)
 Dimension. More...
 
 Dimension (Dimension const &other)
 
const geo::CoordinatedefinitionPoint () const noexcept
 move, moves by an offset More...
 
const geo::CoordinatemiddleOfText () const noexcept
 
TextConst::AttachmentPoint const & attachmentPoint () const
 
double textAngle () const
 
double lineSpacingFactor () const
 
TextConst::LineSpacingStyle lineSpacingStyle () const
 
std::string explicitValue () const
 

Private Attributes

const geo::Coordinate _definitionPoint
 
const geo::Coordinate _middleOfText
 
const TextConst::AttachmentPoint _attachmentPoint
 
const double _textAngle
 
const double _lineSpacingFactor
 
const TextConst::LineSpacingStyle _lineSpacingStyle
 
const std::string _explicitValue
 

Detailed Description

Base class for all dimensions It takes in the values pretty much as given by the DXF reference TODO: Should we move some variables to the implementation of an actual Dimension like DimRadial and have all optional variables as part of the meta map?

Definition at line 16 of file dimension.h.

Constructor & Destructor Documentation

Dimension::Dimension ( geo::Coordinate const &  definitionPoint,
geo::Coordinate const &  middleOfText,
TextConst::AttachmentPoint const &  attachmentPoint,
double const  textAngle,
double  lineSpacingFactor,
TextConst::LineSpacingStyle const &  lineSpacingStyle,
std::string const &  explicitValue 
)

Dimension.

Parameters
definitionPointdefinition_point of the dimension
middleOfTextMiddle of text
attachmentPointWhere the text is located in reference to the text location
angleAngle of obliqueness
lineSpacingFactorSpacing factor
lineSpacingStylename
explicitValuegiven value

Definition at line 7 of file dimension.cpp.

16 }
const TextConst::LineSpacingStyle _lineSpacingStyle
Definition: dimension.h:123
TextConst::LineSpacingStyle lineSpacingStyle() const
Definition: dimension.cpp:91
const geo::Coordinate & definitionPoint() const noexcept
move, moves by an offset
Definition: dimension.cpp:71
const std::string _explicitValue
Definition: dimension.h:124
const geo::Coordinate _middleOfText
Definition: dimension.h:119
std::string explicitValue() const
Definition: dimension.cpp:95
const double _lineSpacingFactor
Definition: dimension.h:122
const geo::Coordinate & middleOfText() const noexcept
Definition: dimension.cpp:75
TextConst::AttachmentPoint const & attachmentPoint() const
Definition: dimension.cpp:83
const geo::Coordinate _definitionPoint
Definition: dimension.h:118
double lineSpacingFactor() const
Definition: dimension.cpp:87
const TextConst::AttachmentPoint _attachmentPoint
Definition: dimension.h:120
double textAngle() const
Definition: dimension.cpp:79
const double _textAngle
Definition: dimension.h:121
Dimension::Dimension ( geo::Coordinate const &  _definitionPoint,
geo::Coordinate const &  _middleOfText,
TextConst::AttachmentPoint  _attachPt,
double  _angle 
)

Dimension.

Parameters
definitionPointdefinition_point of the dimension
middleOfTextMiddle of text
attachmentPointWhere the text is located in reference to the text location
angleAngle of obliqueness

Definition at line 18 of file dimension.cpp.

26  _lineSpacingStyle(TextConst::LineSpacingStyle::AtLeast),
27  _explicitValue("<>") {
28 }
const TextConst::LineSpacingStyle _lineSpacingStyle
Definition: dimension.h:123
const geo::Coordinate & definitionPoint() const noexcept
move, moves by an offset
Definition: dimension.cpp:71
const std::string _explicitValue
Definition: dimension.h:124
const geo::Coordinate _middleOfText
Definition: dimension.h:119
const double _lineSpacingFactor
Definition: dimension.h:122
const geo::Coordinate & middleOfText() const noexcept
Definition: dimension.cpp:75
TextConst::AttachmentPoint const & attachmentPoint() const
Definition: dimension.cpp:83
const geo::Coordinate _definitionPoint
Definition: dimension.h:118
const TextConst::AttachmentPoint _attachmentPoint
Definition: dimension.h:120
double textAngle() const
Definition: dimension.cpp:79
const double _textAngle
Definition: dimension.h:121
Dimension::Dimension ( Dimension const &  other)

Definition at line 30 of file dimension.cpp.

30  : _definitionPoint(other.definitionPoint()),
31  _middleOfText(other._middleOfText),
32  _attachmentPoint(other._attachmentPoint),
33  _textAngle(other._textAngle),
34  _lineSpacingFactor(other._lineSpacingFactor),
35  _lineSpacingStyle(other._lineSpacingStyle),
36  _explicitValue(other._explicitValue) {
37 
38 }
const TextConst::LineSpacingStyle _lineSpacingStyle
Definition: dimension.h:123
const std::string _explicitValue
Definition: dimension.h:124
const geo::Coordinate _middleOfText
Definition: dimension.h:119
const double _lineSpacingFactor
Definition: dimension.h:122
const geo::Coordinate _definitionPoint
Definition: dimension.h:118
const TextConst::AttachmentPoint _attachmentPoint
Definition: dimension.h:120
const double _textAngle
Definition: dimension.h:121

Member Function Documentation

TextConst::AttachmentPoint const & Dimension::attachmentPoint ( ) const

Definition at line 83 of file dimension.cpp.

83  {
84  return _attachmentPoint;
85 }
const TextConst::AttachmentPoint _attachmentPoint
Definition: dimension.h:120
const geo::Coordinate & Dimension::definitionPoint ( ) const
noexcept

move, moves by an offset

Parameters
geo::Coordinateoffset
Returns
CADEntity_CSPtr moved entity copy, copies by an offset
Parameters
geo::Coordinateoffset
Returns
CADEntity_CSPtr copied entity rotate, rotate operation
Parameters
geo::Coordinaterotation_center
doublerotation_angle
Returns
CADEntity_CSPtr rotated entity scale, scales the entity
Parameters
geo::Coordinatescale_center
doublescale_factor
Returns
Definition point of this dimension

Definition at line 71 of file dimension.cpp.

71  {
72  return _definitionPoint;
73 }
const geo::Coordinate _definitionPoint
Definition: dimension.h:118
std::string Dimension::explicitValue ( ) const

Returns the explicit value of this dimension The explicit value is the value given by the user instead of the measured one default is the measurement. If "" or "<>" if a blank space it's suppressed

Definition at line 95 of file dimension.cpp.

95  {
96  return _explicitValue;
97 }
const std::string _explicitValue
Definition: dimension.h:124
double Dimension::lineSpacingFactor ( ) const

Line spacing factor

Definition at line 87 of file dimension.cpp.

87  {
88  return _lineSpacingFactor;
89 }
const double _lineSpacingFactor
Definition: dimension.h:122
TextConst::LineSpacingStyle Dimension::lineSpacingStyle ( ) const

Line spacing style

Definition at line 91 of file dimension.cpp.

91  {
92  return _lineSpacingStyle;
93 }
const TextConst::LineSpacingStyle _lineSpacingStyle
Definition: dimension.h:123
const geo::Coordinate & Dimension::middleOfText ( ) const
noexcept

Middle location of the text

Definition at line 75 of file dimension.cpp.

75  {
76  return _middleOfText;
77 }
const geo::Coordinate _middleOfText
Definition: dimension.h:119
double Dimension::textAngle ( ) const

Angle of witch to draw the text on

Definition at line 79 of file dimension.cpp.

79  {
80  return _textAngle;
81 }
const double _textAngle
Definition: dimension.h:121

Member Data Documentation

const TextConst::AttachmentPoint lc::entity::Dimension::_attachmentPoint
private

Definition at line 120 of file dimension.h.

const geo::Coordinate lc::entity::Dimension::_definitionPoint
private

Definition at line 118 of file dimension.h.

const std::string lc::entity::Dimension::_explicitValue
private

Definition at line 124 of file dimension.h.

const double lc::entity::Dimension::_lineSpacingFactor
private

Definition at line 122 of file dimension.h.

const TextConst::LineSpacingStyle lc::entity::Dimension::_lineSpacingStyle
private

Definition at line 123 of file dimension.h.

const geo::Coordinate lc::entity::Dimension::_middleOfText
private

Definition at line 119 of file dimension.h.

const double lc::entity::Dimension::_textAngle
private

Definition at line 121 of file dimension.h.


The documentation for this class was generated from the following files: