~lib2geom-hackers/lib2geom/trunk

« back to all changes in this revision

Viewing changes to translate.h

  • Committer: njh
  • Date: 2006-05-22 11:50:24 UTC
  • Revision ID: svn-v4:4601daaa-0314-0410-9a8b-c964a3c23b6b:trunk/lib2geom:1
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SEEN_Geom_TRANSLATE_H
 
2
#define SEEN_Geom_TRANSLATE_H
 
3
 
 
4
#include "point.h"
 
5
 
 
6
namespace Geom {
 
7
 
 
8
class translate {
 
9
public:
 
10
    Point offset;
 
11
private:
 
12
    translate();
 
13
public:
 
14
    explicit translate(Point const &p) : offset(p) {}
 
15
    explicit translate(Coord const x, Coord const y) : offset(x, y) {}
 
16
    Coord operator[](Dim2 const dim) const { return offset[dim]; }
 
17
    Coord operator[](unsigned const dim) const { return offset[dim]; }
 
18
};
 
19
 
 
20
} /* namespace Geom */
 
21
 
 
22
 
 
23
#endif /* !SEEN_Geom_TRANSLATE_H */
 
24
 
 
25
/*
 
26
  Local Variables:
 
27
  mode:c++
 
28
  c-file-style:"stroustrup"
 
29
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
30
  indent-tabs-mode:nil
 
31
  fill-column:99
 
32
  End:
 
33
*/
 
34
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :