~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/include/ipemark.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2004-06-08 00:44:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040608004402-72yu51xlh7vt6p9m
Tags: upstream-6.0pre16
ImportĀ upstreamĀ versionĀ 6.0pre16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
// --------------------------------------------------------------------
 
3
// The mark object
 
4
// --------------------------------------------------------------------
 
5
/*
 
6
 
 
7
    This file is part of the extensible drawing editor Ipe.
 
8
    Copyright (C) 1993-2004  Otfried Cheong
 
9
 
 
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.
 
14
 
 
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.
 
19
 
 
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.
 
24
 
 
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.
 
29
 
 
30
*/
 
31
 
 
32
#ifndef IPEMARK_H
 
33
#define IPEMARK_H
 
34
 
 
35
#include "ipeobj.h"
 
36
 
 
37
// --------------------------------------------------------------------
 
38
 
 
39
class IPE_EXPORT IpeMark : public IpeObject {
 
40
public:
 
41
  enum { ECircle = 1, EDisc, EBox, ESquare, ECross };
 
42
 
 
43
  explicit IpeMark(const IpeAllAttributes &attr, const IpeVector &pos);
 
44
  explicit IpeMark(IpeRepository *rep, const IpeXmlAttributes &attr,
 
45
                   IpeString data);
 
46
  IpeMark(const IpeMark &rhs);
 
47
  virtual IpeObject *Clone() const;
 
48
 
 
49
  virtual IpeMark *AsMark();
 
50
 
 
51
  virtual void Accept(IpeVisitor &visitor) const;
 
52
 
 
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,
 
58
                          double bound) const;
 
59
  virtual void SnapVtx(const IpeVector &mouse, const IpeMatrix &m,
 
60
                       IpeVector &pos, double &bound) const;
 
61
 
 
62
  virtual void CheckStyle(const IpeStyleSheet *sheet,
 
63
                           IpeAttributeSeq &seq) const;
 
64
 
 
65
  inline IpeVector Position() const;
 
66
  inline int Shape() const;
 
67
  inline IpeAttribute Size() const;
 
68
 
 
69
  void SetShape(int shape);
 
70
  void SetSize(IpeAttribute size);
 
71
 
 
72
 private:
 
73
  IpeVector iPos;
 
74
  int iShape;
 
75
  IpeAttribute iSize;
 
76
};
 
77
 
 
78
// --------------------------------------------------------------------
 
79
 
 
80
//! Return mark position.
 
81
inline IpeVector IpeMark::Position() const
 
82
{
 
83
  return iPos;
 
84
}
 
85
 
 
86
//! Return mark type.
 
87
inline int IpeMark::Shape() const
 
88
{
 
89
  return iShape;
 
90
}
 
91
 
 
92
//! Return mark size.
 
93
inline IpeAttribute IpeMark::Size() const
 
94
{
 
95
  return iSize;
 
96
}
 
97
 
 
98
// --------------------------------------------------------------------
 
99
#endif