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

« back to all changes in this revision

Viewing changes to src/include/ipesnap.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2009-12-11 21:22:35 UTC
  • mfrom: (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091211212235-5iio4nzpra64snab
Tags: 7.0.10-1
* New upstream.  Closes: #551192.
  - New build-depends: libcairo2-dev, liblua5.1-0-dev, gsfonts
  - patches/config.diff: Remove.  Upstream build system replaced.
  - Runtime lib package changed to libipe7.0.10 from libipe1c2a
  - Devel package renamed to libipe-dev (from libipe1-dev)
  - Package ipe depends on lua5.1 due to ipe-update-master.

* rules: Re-write to use dh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
/*
6
6
 
7
7
    This file is part of the extensible drawing editor Ipe.
8
 
    Copyright (C) 1993-2007  Otfried Cheong
 
8
    Copyright (C) 1993-2009  Otfried Cheong
9
9
 
10
10
    Ipe is free software; you can redistribute it and/or modify it
11
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
 
12
    the Free Software Foundation; either version 3 of the License, or
13
13
    (at your option) any later version.
14
14
 
15
15
    As a special exception, you have permission to link Ipe with the
36
36
 
37
37
// --------------------------------------------------------------------
38
38
 
39
 
class IpePage;
40
 
 
41
 
class IPE_EXPORT IpeSnapData {
42
 
public:
43
 
  //! The different snap modes as bitmasks.
44
 
  enum TSnapModes { ESnapNone = 0,
45
 
                    ESnapVtx = 1, ESnapBd = 2, ESnapInt = 4,
46
 
                    ESnapGrid = 8, ESnapAngle = 0x10,
47
 
                    ESnapAuto = 0x20 };
48
 
 
49
 
  int iSnap;              //!< Activated snapping modes (TSnapModes)
50
 
  bool iGridVisible;      //!< Is the grid visible?
51
 
  int iGridSize;          //!< Snap grid spacing.
52
 
  double iAngleSize;      //!< Angle for angular snapping.
53
 
  int iSnapDistance;      //!< Snap distance (in pixels).
54
 
  int iSelectDistance;    //!< Select distance (in pixels).
55
 
  bool iWithAxes;         //!< Show coordinate system?
56
 
  IpeVector iOrigin;      //!< Origin of coordinate system
57
 
  IpeAngle iDir;          //!< Direction of x-axis
58
 
 
59
 
  bool IntersectionSnap(IpeVector &pos, const IpePage *page,
60
 
                        double snapDist) const;
61
 
  bool SnapAngularIntersection(IpeVector &pos, const IpeLine &l,
62
 
                               const IpePage *page,
63
 
                               double snapDist) const;
64
 
  bool SimpleSnap(IpeVector &pos, const IpePage *page, double snapDist) const;
65
 
  bool Snap(IpeVector &pos, const IpePage *page, double snapDist,
66
 
            IpeVector *autoOrg = 0) const;
67
 
  IpeLine GetLine(const IpeVector &mouse, const IpeVector &base) const;
68
 
  bool SetEdge(const IpeVector &pos, const IpePage *page);
69
 
};
 
39
namespace ipe {
 
40
 
 
41
  class Page;
 
42
 
 
43
  class Snap {
 
44
  public:
 
45
    //! The different snap modes as bitmasks.
 
46
    enum TSnapModes { ESnapNone = 0,
 
47
                      ESnapVtx = 1, ESnapBd = 2, ESnapInt = 4,
 
48
                      ESnapGrid = 8, ESnapAngle = 0x10,
 
49
                      ESnapAuto = 0x20 };
 
50
 
 
51
    int iSnap;           //!< Activated snapping modes (TSnapModes)
 
52
    bool iGridVisible;   //!< Is the grid visible?
 
53
    int iGridSize;       //!< Snap grid spacing.
 
54
    double iAngleSize;   //!< Angle for angular snapping.
 
55
    int iSnapDistance;   //!< Snap distance (in pixels).
 
56
    bool iWithAxes;      //!< Show coordinate system?
 
57
    Vector iOrigin;      //!< Origin of coordinate system
 
58
    Angle iDir;          //!< Direction of x-axis
 
59
 
 
60
    bool intersectionSnap(Vector &pos, const Page *page,
 
61
                          double snapDist) const;
 
62
    bool snapAngularIntersection(Vector &pos, const Line &l,
 
63
                                 const Page *page,
 
64
                                 double snapDist) const;
 
65
    bool simpleSnap(Vector &pos, const Page *page,
 
66
                    double snapDist) const;
 
67
    bool snap(Vector &pos, const Page *page, double snapDist,
 
68
              Vector *autoOrg = 0) const;
 
69
    Line getLine(const Vector &mouse, const Vector &base) const;
 
70
    bool setEdge(const Vector &pos, const Page *page);
 
71
  };
 
72
 
 
73
} // namespace
70
74
 
71
75
// --------------------------------------------------------------------
72
76
#endif