2
// --------------------------------------------------------------------
3
// The reference object
4
// --------------------------------------------------------------------
7
This file is part of the extensible drawing editor Ipe.
8
Copyright (C) 1993-2004 Otfried Cheong
10
Ipe is free software; you can redistribute it and/or modify it
11
under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 2 of the License, or
13
(at your option) any later version.
15
As a special exception, you have permission to link Ipe with the
16
CGAL library and distribute executables, as long as you follow the
17
requirements of the Gnu General Public License in regard to all of
18
the software in the executable aside from CGAL.
20
Ipe is distributed in the hope that it will be useful, but WITHOUT
21
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23
License for more details.
25
You should have received a copy of the GNU General Public License
26
along with Ipe; if not, you can find it at
27
"http://www.gnu.org/copyleft/gpl.html", or write to the Free
28
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37
// --------------------------------------------------------------------
41
class IPE_EXPORT IpeReference : public IpeObject {
43
explicit IpeReference(IpeRepository *rep, const IpeXmlAttributes &attr,
45
explicit IpeReference(const IpeStyleSheet *sheet, IpeAttribute name);
47
IpeReference(const IpeReference &rhs);
48
virtual IpeObject *Clone() const;
50
virtual IpeReference *AsReference();
52
virtual void Accept(IpeVisitor &visitor) const;
53
virtual void SaveAsXml(IpePainter &painter, IpeStream &stream,
54
IpeString layer) const;
55
virtual void Draw(IpePainter &painter) const;
56
virtual void AddToBBox(IpeRect &box, const IpeMatrix &m) const;
57
virtual double Distance(const IpeVector &v, const IpeMatrix &m,
59
virtual void SnapVtx(const IpeVector &mouse, const IpeMatrix &m,
60
IpeVector &pos, double &bound) const;
61
virtual void SnapBnd(const IpeVector &mouse, const IpeMatrix &m,
62
IpeVector &pos, double &bound) const;
64
virtual void CheckStyle(const IpeStyleSheet *sheet,
65
IpeAttributeSeq &seq) const;
67
//! Return symbolic name.
68
inline IpeAttribute Name() const { return iName; }
70
//! Return pointer to cached object.
71
inline const IpeObject *Object() const { return iObject; }
75
mutable const IpeObject *iObject; // iObject is owned by the style sheet
78
// --------------------------------------------------------------------