-
Notifications
You must be signed in to change notification settings - Fork 0
/
curve_line.cpp
116 lines (90 loc) · 2.59 KB
/
curve_line.cpp
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/extended_type_info.hpp>
#include <boost/serialization/nvp.hpp>
#include "curve_line.h"
#include <boost/serialization/export.hpp>
// TODO: export here LineBase since BOOST_CLASS_EXPORT
// does not work on linux for this class
BOOST_CLASS_EXPORT(cppgef::LineBase)
BOOST_CLASS_EXPORT(cppgef::CurveLine)
template
void cppgef::CurveLine::serialize(
boost::archive::text_oarchive &ar,
const unsigned int /* file_version */
);
template
void cppgef::CurveLine::serialize(
boost::archive::text_iarchive &ar,
const unsigned int /* file_version */
);
template
void cppgef::CurveLine::serialize(
boost::archive::xml_oarchive &ar,
const unsigned int /* file_version */
);
template
void cppgef::CurveLine::serialize(
boost::archive::xml_iarchive &ar,
const unsigned int /* file_version */
);
namespace cppgef
{
CurveLine::CurveLine() :
LineBase()
{
start_control_point_.signalXChanged().connect (
sigc::mem_fun( this, &CurveLine::onStartControlPointChanged ));
start_control_point_.signalYChanged().connect (
sigc::mem_fun( this, &CurveLine::onStartControlPointChanged ));
end_control_point_.signalXChanged().connect (
sigc::mem_fun( this, &CurveLine::onEndControlPointChanged ));
end_control_point_.signalYChanged().connect (
sigc::mem_fun( this, &CurveLine::onEndControlPointChanged ));
}
CurveLine::~CurveLine()
{
}
Point& CurveLine::getStartControlPoint()
{
return start_control_point_;
}
void CurveLine::setStartControlPoint(const Point& value)
{
start_control_point_ = value;
}
Point& CurveLine::getEndControlPoint()
{
return end_control_point_;
}
void CurveLine::setEndControlPoint(const Point& value)
{
end_control_point_ = value;
}
CurveLine::signal_property_changed_t CurveLine::signalStartControlPointChanged()
{
return signal_start_control_point_changed_;
}
CurveLine::signal_property_changed_t CurveLine::signalEndControlPointChanged()
{
return signal_end_control_point_changed_;
}
void CurveLine::onStartControlPointChanged()
{
signal_start_control_point_changed_.emit();
}
void CurveLine::onEndControlPointChanged()
{
signal_end_control_point_changed_.emit();
}
template< class Archive >
void CurveLine::serialize(Archive & ar, const unsigned int version)
{
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(LineBase);
ar & BOOST_SERIALIZATION_NVP(start_control_point_);
ar & BOOST_SERIALIZATION_NVP(end_control_point_);
}
}