Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Point_2.h
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Copyright (c) 1999 The CGAL Consortium
4 
5 // This software and related documentation is part of the Computational
6 // Geometry Algorithms Library (CGAL).
7 // This software and documentation is provided "as-is" and without warranty
8 // of any kind. In no event shall the CGAL Consortium be liable for any
9 // damage of any kind.
10 //
11 // Every use of CGAL requires a license.
12 //
13 // Academic research and teaching license
14 // - For academic research and teaching purposes, permission to use and copy
15 // the software and its documentation is hereby granted free of charge,
16 // provided that it is not a component of a commercial product, and this
17 // notice appears in all copies of the software and related documentation.
18 //
19 // Commercial licenses
20 // - A commercial license is available through Algorithmic Solutions, who also
21 // markets LEDA (http://www.algorithmic-solutions.de).
22 // - Commercial users may apply for an evaluation license by writing to
23 // Algorithmic Solutions (contact@algorithmic-solutions.com).
24 //
25 // The CGAL Consortium consists of Utrecht University (The Netherlands),
26 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
27 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
28 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
29 // and Tel-Aviv University (Israel).
30 //
31 // ----------------------------------------------------------------------
32 //
33 // release : CGAL-2.2
34 // release_date : 2000, September 30
35 //
36 // source : Point_2.fw
37 // file : include/CGAL/Point_2.h
38 // package : _2 (3.6)
39 // revision : 3.6
40 // revision_date : 30 Jul 2000
41 // author(s) : Andreas Fabri
42 // Stefan Schirra
43 //
44 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
45 // email : contact@cgal.org
46 // www : http://www.cgal.org
47 //
48 // ======================================================================
49 
50 
51 #ifndef CGAL_POINT_2_H
52 #define CGAL_POINT_2_H
53 
54 #ifndef CGAL_REP_CLASS_DEFINED
55 #error no representation class defined
56 #endif // CGAL_REP_CLASS_DEFINED
57 
58 #ifdef CGAL_HOMOGENEOUS_H
59 #include <CGAL/PointH2.h>
60 #endif // CGAL_HOMOGENEOUS_H
61 
62 #ifdef CGAL_CARTESIAN_H
63 #include <CGAL/Cartesian/Point_2.h>
64 #endif // CGAL_CARTESIAN_H
65 
66 #ifdef CGAL_SIMPLE_CARTESIAN_H
67 #include <CGAL/SimpleCartesian/PointS2.h>
68 #endif // CGAL_SIMPLE_CARTESIAN_H
69 
70 
72 
74 
75 template <class R_>
76 class Point_2 : public R_::Point_2_base
77 {
78 public:
79  typedef R_ R;
80  typedef typename R::RT RT;
81  typedef typename R::FT FT;
82  typedef typename R::Point_2_base RPoint_2;
83  typedef typename R::Vector_2_base RVector_2;
84 
85 
86 friend CGAL_FRIEND_INLINE
87  CGAL::Point_2<R>
89  (const CGAL::Vector_2<R>& v);
90 
92  {}
93 
94  Point_2(const Origin& o)
95  : RPoint_2(o)
96  {}
97 
98  Point_2(const CGAL::Point_2<R>& p)
99  : RPoint_2((RPoint_2&)p)
100  {}
101 
102  Point_2(const RPoint_2& p)
103  : RPoint_2(p)
104  {}
105 
106  Point_2(const RT& hx, const RT& hy)
107  : RPoint_2(hx, hy)
108  {}
109 
110  Point_2(const RT& hx, const RT& hy, const RT& hw)
111  : RPoint_2(hx, hy, hw)
112  {}
113 
114 
115  bool operator==(const CGAL::Point_2<R>& p) const
116  {
117  return RPoint_2::operator==(p);
118  }
119 
120  bool operator!=(const CGAL::Point_2<R>& p) const
121  {
122  return !(*this == p);
123  }
124 
125  RT hx() const
126  {
127  return RPoint_2::hx();
128  }
129 
130  RT hy() const
131  {
132  return RPoint_2::hy();
133  }
134 
135  RT hw() const
136  {
137  return RPoint_2::hw();
138  }
139  FT x() const
140  {
141  return RPoint_2::x();
142  }
143 
144  FT y() const
145  {
146  return RPoint_2::y();
147  }
148 
149  RT homogeneous(int i) const
150  {
151  return RPoint_2::homogeneous(i);
152  }
153 
154  FT cartesian(int i) const
155  {
156  return RPoint_2::cartesian(i);
157  }
158 
159  FT operator[](int i) const
160  {
161  return cartesian(i);
162  }
163 
164  int dimension() const
165  {
166  return 2;
167  }
168 
169  Bbox_2 bbox() const
170  {
171  return RPoint_2::bbox();
172  }
173 
174  CGAL::Point_2<R> transform(const CGAL::Aff_transformation_2<R>& t) const
175  {
176  return RPoint_2::transform(t);
177  }
178 
179 private:
180 
182  : RPoint_2(v)
183  {}
184 };
185 
186 #ifndef NO_OSTREAM_INSERT_POINT_2
187 template < class R >
188 std::ostream&
189 operator<<(std::ostream& os, const Point_2<R>& p)
190 {
191  typedef typename R::Point_2_base RPoint_2;
192  return os << (const RPoint_2&)p;
193 }
194 #endif // NO_OSTREAM_INSERT_POINT_2
195 
196 #ifndef NO_ISTREAM_EXTRACT_POINT_2
197 template < class R >
198 std::istream&
199 operator>>(std::istream& is, Point_2<R>& p)
200 {
201  typedef typename R::Point_2_base RPoint_2;
202  return is >> (RPoint_2&)p;
203 }
204 #endif // NO_ISTREAM_EXTRACT_POINT_2
205 
206 template <class R>
207 inline
209 operator+(const Origin& o, const Vector_2<R>& v);
210 
211 template <class R>
212 inline
214 operator-(const Origin& o, const Vector_2<R>& v);
215 
216 template <class R>
217 inline
219 operator-(const Point_2<R>& p, const Origin& );
220 
222 
223 
224 #ifndef CGAL_VECTOR_2_H
225 #include <CGAL/Vector_2.h>
226 #endif // CGAL_VECTOR_2_H
227 
229 
230 #ifndef CGAL_AFF_TRANSFORMATION_2_H
232 #endif // CGAL_AFF_TRANSFORMATION_2_H
233 
235 
236 template <class R>
237 inline
238 bool
239 operator==(const Origin& o, const Point_2<R>& p)
240 { return p == o; }
241 
242 template <class R>
243 inline
244 bool
245 operator!=(const Origin& o, const Point_2<R>& p)
246 { return p != o; }
247 
249 
250 
251 #endif // CGAL_POINT_2_H
int dimension() const
Definition: Point_2.h:164
FT cartesian(int i) const
Definition: Point_2.h:154
RT hy() const
Definition: Point_2.h:130
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool operator==(const Origin &o, const Point_2< R > &p)
Definition: Point_2.h:239
Point_2(const RT &hx, const RT &hy, const RT &hw)
Definition: Point_2.h:110
FT y() const
Definition: Point_2.h:144
void int int REAL REAL * y
Definition: read.cpp:74
FT operator[](int i) const
Definition: Point_2.h:159
R::RT RT
Definition: Vector_2.h:83
R_ R
Definition: Point_2.h:79
Iterator_from_circulator< C, Ref, Ptr > operator+(Dist n, const Iterator_from_circulator< C, Ref, Ptr > &circ)
Definition: circulator.h:689
FT x() const
Definition: Point_2.h:139
R::Vector_2_base RVector_2
Definition: Point_2.h:83
Point_2< R > vector_to_point_conversion(const Vector_2< R > &v)
Point_2(const RVector_2 &v)
Definition: Point_2.h:181
friend CGAL_FRIEND_INLINE CGAL::Point_2< R > CGAL_SCOPE vector_to_point_conversion CGAL_NULL_TMPL_ARGS(const CGAL::Vector_2< R > &v)
R::FT FT
Definition: Point_2.h:81
#define CGAL_SCOPE
Definition: config.h:70
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
R::FT FT
Definition: Vector_2.h:84
bool operator!=(const CGAL::Point_2< R > &p) const
Definition: Point_2.h:120
Point_2(const RT &hx, const RT &hy)
Definition: Point_2.h:106
RT hw() const
Definition: Point_2.h:135
RT homogeneous(int i) const
Definition: Point_2.h:149
Point_2()
Definition: Point_2.h:91
Point_2(const CGAL::Point_2< R > &p)
Definition: Point_2.h:98
R::Point_2_base RPoint_2
Definition: Point_2.h:82
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
CGAL::Point_2< R > transform(const CGAL::Aff_transformation_2< R > &t) const
Definition: Point_2.h:174
bool operator!=(const Origin &o, const Point_2< R > &p)
Definition: Point_2.h:245
RT hx() const
Definition: Point_2.h:125
R::RT RT
Definition: Point_2.h:80
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
std::istream & operator>>(std::istream &is, CGAL::Aff_transformation_2< R > &t)
Point_2(const RPoint_2 &p)
Definition: Point_2.h:102
bool operator==(const CGAL::Point_2< R > &p) const
Definition: Point_2.h:115
Point_2(const Origin &o)
Definition: Point_2.h:94
Bbox_2 bbox() const
Definition: Point_2.h:169
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
Point_2< R > operator-(const Origin &o, const Vector_2< R > &v)
#define CGAL_FRIEND_INLINE
Definition: kernel_basic.h:61