xc
D2to3d.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //d2to3D.h
22 
23 #ifndef D2TO3D_H
24 #define D2TO3D_H
25 
26 #include "utility/geom/d2/Surface3d.h"
27 #include "utility/geom/coo_sys/ref_sys/Ref2d3d.h"
28 #include "../cgal_types.h"
29 
30 class Plane;
31 class Line2d;
32 class Ray2d;
33 class Segment2d;
34 class Line3d;
35 class Ray3d;
36 class Segment3d;
37 class Pos3dArray;
38 class Pos2dArray;
39 
41 //
44 class D2to3d: public Surface3d
45  {
46  Ref2d3d ref;
47 
48  protected:
49  explicit D2to3d(const Ref2d3d &);
50  explicit D2to3d(const Ref3d3d &);
51  explicit D2to3d(const Pos3d &o);
52  D2to3d(const Pos3d &o,const Pos3d &p,const Pos3d &q);
53  D2to3d(const Pos3d &o,const Vector3d &n,const Vector3d &i);
54 
55  public:
56  D2to3d(void);
57 
58  virtual bool operator==(const D2to3d &) const;
59  void ThreePoints(const Pos3d &p1,const Pos3d &p2,const Pos3d &p3);
60 
62  inline virtual unsigned short int Dimension(void) const
63  { return 2; }
64 
65 
66  Vector3d getIVector(void) const; //I unary vector.
67  Vector3d getJVector(void) const; //J unary vector.
68  Vector3d getKVector(void) const; //K unary vector.
69 
70  Pos3d to_3d(const Pos2d &) const;
71  Vector3d to_3d(const Vector2d &) const;
72  Line3d to_3d(const Line2d &) const;
73  Ray3d to_3d(const Ray2d &) const;
74  Segment3d to_3d(const Segment2d &) const;
75  Pos3dArray to_3d(const Pos2dArray &) const;
76  Pos2d to_2d(const Pos3d &) const;
77  Vector2d to_2d(const Vector3d &) const;
78  Line2d to_2d(const Line3d &) const;
79  Ray2d to_2d(const Ray3d &) const;
80  Segment2d to_2d(const Segment3d &) const;
81  const Ref2d3d &getRef(void) const
82  { return ref; }
83  Plane getPlane(void) const;
84 
85  void Print(std::ostream &os) const;
86  };
87 
88 #endif
Pos2d to_2d(const Pos3d &) const
Return the 2D point corresponding to the 3D point argument.
Definition: D2to3d.cc:132
Base class for surfaces in a three-dimensional space.
Definition: Surface3d.h:35
Segment en tres dimensiones.
Definition: Segment3d.h:41
Posición en dos dimensiones.
Definition: Pos2d.h:41
Array of positions in a three-dimensional space.
Definition: Pos3dArray.h:38
Line in a two-dimensional space.
Definition: Line2d.h:61
Vector3d getJVector(void) const
Return the unary vector J expressed in global coordinates.
Definition: D2to3d.cc:92
Plane in a three-dimensional space.
Definition: Plane.h:49
Vector3d getIVector(void) const
Return the unary vector I expressed in global coordinates.
Definition: D2to3d.cc:88
Vector en dos dimensiones.
Definition: Vector2d.h:40
Array of positions in a two-dimensional space.
Definition: Pos2dArray.h:38
Ray in a three-dimensional space.
Definition: Ray3d.h:36
virtual bool operator==(const D2to3d &) const
Comparison operator.
Definition: D2to3d.cc:73
Segment in a two-dimensional space.
Definition: Segment2d.h:38
virtual unsigned short int Dimension(void) const
Return the dimension of the object: 0, 1, 2 or 3.
Definition: D2to3d.h:62
Class that places 2D objects (circle, ellipse, polygons, ...) in a 3D space.
Definition: D2to3d.h:44
D2to3d(void)
Constructor.
Definition: D2to3d.cc:40
Posición en tres dimensiones.
Definition: Pos3d.h:44
Line in a three-dimensional space.
Definition: Line3d.h:62
Vector3d getKVector(void) const
Return the unary vector K expressed in global coordinates.
Definition: D2to3d.cc:96
Ray in a two-dimensional space.
Definition: Ray2d.h:35
Vector en tres dimensiones.
Definition: Vector3d.h:39
Two-dimensional reference system defined in a three-dimensional space.
Definition: Ref2d3d.h:41
Three-dimensional reference system defined in a three-dimensional space.
Definition: Ref3d3d.h:39
Pos3d to_3d(const Pos2d &) const
Return the 3D point corresponding to the 2D point argument.
Definition: D2to3d.cc:100