123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- #include "objmap_object_impl.hpp"
- ObjMapObject::ObjMapObject()
- {
- }
- ObjMapObject::ObjMapObject(const std::shared_ptr<ObjMapObjectImpl>& impl_)
- : impl(impl_)
- {
- }
- CL_Pointf
- ObjMapObject::get_pos() const
- {
- if (impl.get())
- return impl->pos;
- else
- return CL_Pointf();
- }
- void
- ObjMapObject::set_pos(const CL_Pointf& p)
- {
- if (impl.get())
- {
- impl->pos = p;
- }
- }
- MetaData
- ObjMapObject::get_metadata() const
- {
- if (impl.get())
- return impl->data;
- else
- return MetaData();
- }
- void
- ObjMapObject::set_metadata(const MetaData& data_)
- {
- if (impl.get())
- impl->data = data_;
- }
- void
- ObjMapObject::draw(CL_GraphicContext* gc)
- {
- if (impl.get())
- impl->draw(gc);
- }
- CL_Rectf
- ObjMapObject::get_bound_rect() const
- {
- if (impl.get())
- return impl->get_bound_rect();
- else
- return CL_Rect();
- }
- bool
- ObjMapObject::is_null() const
- {
- return !impl.get();
- }
- bool
- ObjMapObject::operator==(const ObjMapObject& obj) const
- {
- return impl.get() == obj.impl.get();
- }
- bool
- ObjMapObject::operator<(const ObjMapObject& obj) const
- {
- return impl.get() < obj.impl.get();
- }
- CL_Signal_v1<ObjMapObject>&
- ObjMapObject::sig_select()
- {
- return impl->on_select;
- }
- CL_Signal_v1<ObjMapObject>&
- ObjMapObject::sig_deselect()
- {
- return impl->on_deselect;
- }
- CL_Signal_v1<ObjMapObject>&
- ObjMapObject::sig_move()
- {
- return impl->on_move;
- }
- void
- ObjMapObject::add_control_points()
- {
- impl->add_control_points();
- }
- void
- ObjMapObject::update_control_points()
- {
- impl->update_control_points();
- }
|