Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Segment_3.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 : Segment_3.fw
37 // file : include/CGAL/Segment_3.h
38 // package : _3 (3.7)
39 // revision : 3.7
40 // revision_date : 16 Aug 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_SEGMENT_3_H
52 #define CGAL_SEGMENT_3_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 #ifndef CGAL_SEGMENTH3_H
60 #include <CGAL/SegmentH3.h>
61 #endif // CGAL_SEGMENTH3_H
62 #endif // CGAL_HOMOGENEOUS_H
63 
64 #ifdef CGAL_CARTESIAN_H
65 #ifndef CGAL_SEGMENTC3_H
66 #include <CGAL/Cartesian/Segment_3.h>
67 #endif // CGAL_SEGMENTC3_H
68 #endif // CGAL_CARTESIAN_H
69 
70 #ifdef CGAL_SIMPLE_CARTESIAN_H
72 #endif // CGAL_SIMPLE_CARTESIAN_H
73 
74 
75 #ifndef CGAL_LINE_3_H
76 #include <CGAL/Line_3.h>
77 #endif // CGAL_LINE_3_H
78 
80 
81 template <class R_>
82 class Segment_3 : public R_::Segment_3_base
83 {
84 public:
85  typedef R_ R;
86  typedef typename R::RT RT;
87  typedef typename R::FT FT;
88  typedef typename R::Segment_3_base RSegment_3;
89 
91  {}
92  Segment_3(const CGAL::Segment_3<R>& s) : RSegment_3(s)
93  {}
94  Segment_3(const CGAL::Point_3<R>& sp, const CGAL::Point_3<R>& ep)
95  : RSegment_3(sp,ep)
96  {}
98  {}
99 
100  bool has_on(const CGAL::Point_3<R>& p) const
101  { return RSegment_3::has_on(p); }
102  bool operator==(const CGAL::Segment_3<R>& s) const
103  { return RSegment_3::operator==(s); }
104  bool operator!=(const CGAL::Segment_3<R>& s) const
105  { return !(*this == s); }
106  CGAL::Point_3<R> start() const
107  { return RSegment_3::start(); }
108  CGAL::Point_3<R> end() const
109  { return RSegment_3::end(); }
110  CGAL::Point_3<R> source() const
111  { return RSegment_3::source(); }
112  CGAL::Point_3<R> target() const
113  { return RSegment_3::target(); }
114  CGAL::Point_3<R> min() const
115  { return RSegment_3::min(); }
116  CGAL::Point_3<R> max() const
117  { return RSegment_3::max(); }
118  CGAL::Point_3<R> vertex(int i) const
119  { return RSegment_3::vertex(i); }
120  CGAL::Point_3<R> operator[](int i) const
121  { return vertex(i); }
123  { return RSegment_3::squared_length(); }
124  CGAL::Direction_3<R> direction() const
125  { return RSegment_3::direction(); }
126  CGAL::Segment_3<R> opposite() const
127  { return CGAL::Segment_3<R>(target(),source()); }
128  CGAL::Segment_3<R> transform(const CGAL::Aff_transformation_3<R>& t) const
129  { return RSegment_3::transform(t); }
130  CGAL::Line_3<R> supporting_line() const
131  { return RSegment_3::supporting_line(); }
132  bool is_degenerate() const
133  { return RSegment_3::is_degenerate(); }
134  Bbox_3 bbox() const
135  { return source().bbox() + target().bbox(); }
136 };
137 
138 
139 #ifndef NO_OSTREAM_INSERT_SEGMENT_3
140 template < class R>
141 std::ostream&
142 operator<<(std::ostream& os, const Segment_3<R>& s)
143 {
144  typedef typename R::Segment_3_base RSegment_3;
145  return os << (const RSegment_3& )s;
146 }
147 #endif // NO_OSTREAM_INSERT_SEGMENT_3
148 
149 #ifndef NO_ISTREAM_EXTRACT_SEGMENT_3
150 template < class R>
151 std::istream&
152 operator>>(std::istream& is, Segment_3<R>& s)
153 {
154  typedef typename R::Segment_3_base RSegment_3;
155  return is >> (RSegment_3& )s;
156 }
157 #endif // NO_ISTREAM_EXTRACT_SEGMENT_3
158 
159 
161 
162 
163 #endif // CGAL_SEGMENT_3_H
CGAL::Direction_3< R > direction() const
Definition: Segment_3.h:124
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool operator==(const Origin &o, const Point_2< R > &p)
Definition: Point_2.h:239
CGAL::Segment_3< R > transform(const CGAL::Aff_transformation_3< R > &t) const
Definition: Segment_3.h:128
CGAL::Point_3< R > end() const
Definition: Segment_3.h:108
bool operator==(const CGAL::Segment_3< R > &s) const
Definition: Segment_3.h:102
double s
Definition: blastest.C:80
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
CGAL::Point_3< R > operator[](int i) const
Definition: Segment_3.h:120
CGAL::Point_3< R > min() const
Definition: Segment_3.h:114
bool operator!=(const CGAL::Segment_3< R > &s) const
Definition: Segment_3.h:104
Segment_3()
Definition: Segment_3.h:90
CGAL::Point_3< R > vertex(int i) const
Definition: Segment_3.h:118
CGAL::Point_3< R > max() const
Definition: Segment_3.h:116
R::RT RT
Definition: Segment_3.h:86
CGAL::Point_3< R > start() const
Definition: Segment_3.h:106
R::FT FT
Definition: Segment_3.h:87
CGAL::Point_3< R > target() const
Definition: Segment_3.h:112
Segment_3(const RSegment_3 &s)
Definition: Segment_3.h:97
blockLoc i
Definition: read.cpp:79
bool has_on(const CGAL::Point_3< R > &p) const
Definition: Segment_3.h:100
CGAL::Segment_3< R > opposite() const
Definition: Segment_3.h:126
Segment_3(const CGAL::Segment_3< R > &s)
Definition: Segment_3.h:92
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
CGAL::Line_3< R > supporting_line() const
Definition: Segment_3.h:130
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
std::istream & operator>>(std::istream &is, CGAL::Aff_transformation_2< R > &t)
bool is_degenerate() const
Definition: Segment_3.h:132
R::Segment_3_base RSegment_3
Definition: Segment_3.h:88
FT squared_length() const
Definition: Segment_3.h:122
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
CGAL::Point_3< R > source() const
Definition: Segment_3.h:110
Bbox_3 bbox() const
Definition: Segment_3.h:134
Segment_3(const CGAL::Point_3< R > &sp, const CGAL::Point_3< R > &ep)
Definition: Segment_3.h:94