1
/****************************************************************************
3
** This file is part of the LibreCAD project, a 2D CAD program
5
** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)
6
** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
9
** This file may be distributed and/or modified under the terms of the
10
** GNU General Public License version 2 as published by the Free Software
11
** Foundation and appearing in the file gpl-2.0.txt included in the
12
** packaging of this file.
14
** This program is distributed in the hope that it will be useful,
15
** but WITHOUT ANY WARRANTY; without even the implied warranty of
16
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
** GNU General Public License for more details.
19
** You should have received a copy of the GNU General Public License
20
** along with this program; if not, write to the Free Software
21
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
** This copyright notice MUST APPEAR in all copies of the script!
25
**********************************************************************/
28
#ifndef RS_DIMDIAMETER_H
29
#define RS_DIMDIAMETER_H
31
#include "rs_dimension.h"
34
* Holds the data that defines a diametric dimension entity.
36
class RS_DimDiametricData {
41
RS_DimDiametricData():
42
definitionPoint(false),
47
* Constructor with initialisation.
49
* @param definitionPoint Definition point of the diametric dimension.
50
* @param leader Leader length.
52
RS_DimDiametricData(const RS_Vector& definitionPoint,
54
this->definitionPoint = definitionPoint;
55
this->leader = leader;
58
friend class RS_DimDiametric;
59
//friend class RS_ActionDimDiametric;
61
friend std::ostream& operator << (std::ostream& os,
62
const RS_DimDiametricData& dd) {
63
os << "(" << dd.definitionPoint << "/" << dd.leader << ")";
68
/** Definition point. */
69
RS_Vector definitionPoint;
77
* Class for diametric dimension entities.
79
* @author Andrew Mustun
81
class RS_DimDiametric : public RS_Dimension {
83
RS_DimDiametric(RS_EntityContainer* parent,
84
const RS_DimensionData& d,
85
const RS_DimDiametricData& ed);
86
virtual ~RS_DimDiametric() {}
88
virtual RS_Entity* clone() {
89
RS_DimDiametric* d = new RS_DimDiametric(*this);
90
d->setOwner(isOwner());
96
/** @return RS2::EntityDimDiametric */
97
virtual RS2::EntityType rtti() const {
98
return RS2::EntityDimDiametric;
102
* @return Copy of data that defines the diametric dimension.
105
RS_DimDiametricData getEData() const {
109
virtual RS_VectorSolutions getRefPoints();
111
virtual QString getMeasuredLabel();
113
virtual void updateDim(bool autoText=false);
115
RS_Vector getDefinitionPoint() {
116
return edata.definitionPoint;
121
virtual void move(const RS_Vector& offset);
122
virtual void rotate(const RS_Vector& center, const double& angle);
123
virtual void rotate(const RS_Vector& center, const RS_Vector& angleVector);
124
virtual void scale(const RS_Vector& center, const RS_Vector& factor);
125
virtual void mirror(const RS_Vector& axisPoint1, const RS_Vector& axisPoint2);
127
virtual void moveRef(const RS_Vector& ref, const RS_Vector& offset);
129
friend std::ostream& operator << (std::ostream& os,
130
const RS_DimDiametric& d);
133
/** Extended data. */
134
RS_DimDiametricData edata;