File: Coordinate.h

package info (click to toggle)
urg 0.8.11-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,212 kB
  • ctags: 1,605
  • sloc: sh: 10,014; cpp: 6,459; ansic: 2,419; makefile: 203
file content (102 lines) | stat: -rw-r--r-- 1,881 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef QRC_COORDINATE_H
#define QRC_COORDINATE_H

/*!
  \file
  \brief Wn

  \author Satofumi KAMIMURA

  $Id: Coordinate.h 1601 2010-01-04 15:09:50Z satofumi $
*/

#include "Position.h"
#include <set>
#include <memory>


namespace qrk
{
  /*!
    \brief Wn
  */
  class Coordinate
  {
  public:
    Coordinate(void);
    virtual ~Coordinate(void);


    /*!
      \brief O[oWn̎擾
    */
    static Coordinate* root(void);


    /*!
      \brief Wň_ݒ

      w肵WnɌ_ʒutB

      \param[in,out] parent eƂĐݒ肷Wn
      \param[in] position _̐eWnł̈ʒu
    */
    void setOriginTo(Coordinate* parent, const Position<long>& position);


    /*!
      \brief eWn̎擾

      \retval eWn
    */
    Coordinate* parent(void) const;


    /*!
      \brief qWn̎擾

      \retval qWñ|C^ꗗ
    */
    std::set<Coordinate*> children(void) const;


    /*!
      \brief qWň_ʒu擾

      \param[in] child qWn
      \retval qWň_ʒu

      \todo ]͂΁ACӂ̍Wn^ďł悤ɕύX
    */
    Position<long> offset(const Coordinate* child) const;


    /*!
      \brief w肵ʒuWn̂ǂɑ邩擾

      \param[in] position ʒu
      \param[in] coordinate ʒu݂Wn
      \retval g̍Wnł̈ʒu
    */
    Position<long> pointPosition(const Coordinate* coordinate,
                                 const Position<long>& position) const;

  protected:
    /*!
      \brief Wn̕]OɌĂ΂郁\bh
    */
    virtual void beforeEvaluate(void)
    {
    }

  private:
    Coordinate(Coordinate* parent);
    Coordinate(const Coordinate& rhs);
    Coordinate& operator = (const Coordinate& rhs);

    struct pImpl;
    std::auto_ptr<pImpl> pimpl;
  };
}

#endif /*! QRC_COORDINATE_H */