-
-
Notifications
You must be signed in to change notification settings - Fork 102
/
ellipse.h
91 lines (75 loc) · 3.25 KB
/
ellipse.h
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
#pragma once
#include "cad/const.h"
#include "cad/interface/entitydispatch.h"
#include "cad/geometry/geocoordinate.h"
#include "cad/geometry/geoellipse.h"
#include "cad/base/cadentity.h"
#include "cad/vo/entitycoordinate.h"
#include <cad/meta/layer.h>
namespace lc {
namespace entity {
/*!
* \brief A ellipse that can be put in a drawing
*
* A Ellipse is a graphics elipse item that can be put on a drawing using a CreateEntity operation.
*
* \sa CreateEntities::append
*
* \author R. van Twisk
*
* \date 2012-04-16
*/
class Ellipse : public std::enable_shared_from_this<Ellipse>, public CADEntity, public geo::Ellipse {
public:
Ellipse(const geo::Coordinate ¢er, const geo::Coordinate &majorP, double minorRadius, double startAngle,
double endAngle, const Layer_CSPtr layer);
Ellipse(const geo::Coordinate ¢er, const geo::Coordinate &majorP, double minorRadius, double startAngle,
double endAngle, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo);
Ellipse(const Ellipse_CSPtr other, bool sameID = false);
public:
/**
* @brief move, moves by an offset
* @param geo::Coordinate offset
* @return CADEntity_CSPtr moved entity
*/
virtual CADEntity_CSPtr move(const geo::Coordinate &offset) const override;
/**
* @brief copy, copies by an offset
* @param geo::Coordinate offset
* @return CADEntity_CSPtr copied entity
*/
virtual CADEntity_CSPtr copy(const geo::Coordinate &offset) const override;
/**
* @brief rotate, rotate operation
* @param geo::Coordinate rotation_center
* @param double rotation_angle
* @return CADEntity_CSPtr rotated entity
*/
virtual CADEntity_CSPtr rotate(const geo::Coordinate &rotation_center, const double rotation_angle) const override;
/**
* @brief scale, scales the entity
* @param geo::Coordinate scale_center
* @param double scale_factor
* @return
*/
virtual CADEntity_CSPtr scale(const geo::Coordinate &scale_center,
const geo::Coordinate &scale_factor) const override;
virtual CADEntity_CSPtr mirror(const geo::Coordinate& axis1,
const geo::Coordinate& axis2) const override {}
/**
* @brief boundingBox of the entity
* @return geo::Area area
*/
virtual const geo::Area boundingBox() const override;
virtual CADEntity_CSPtr modify(Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo) const override;
public:
virtual void accept(GeoEntityVisitor &v) const override { v.visit(*this); }
virtual void dispatch(EntityDispatch &ed) const override {
ed.visit(shared_from_this());
}
};
using Ellipse_SPtr = std::shared_ptr<Ellipse>;
using Ellipse_CSPtr = std::shared_ptr<const Ellipse>;
}
}
// ELLIPSE_H