xc
FrenetTrihedron.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 //FrenetTrihedron.h
22 //Coordinate systems base class.
23 
24 #ifndef FRENET_TRIHEDRON_H
25 #define FRENET_TRIHEDRON_H
26 
27 #include "../ProtoGeom.h"
28 #include "utility/geom/d1/Polyline3d.h"
29 #include "utility/geom/pos_vec/Vector3d.h"
30 #include "Rect3d3dCooSys.h"
31 #include "utility/geom/coo_sys/ref_sys/Ref3d3d.h"
32 #include <map>
33 
37  {
38  Polyline3d path;
39  typedef std::map<double, Polyline3d::const_iterator> IntervalMap;
40 
41  IntervalMap interval_map;
42  std::vector<Vector3d> tangent_vectors;
43  std::vector<Vector3d> normal_vectors;
44  std::vector<Vector3d> binormal_vectors;
45 
46  IntervalMap compute_interval_map(void);
47  IntervalMap::const_iterator get_interval_end(const double &) const;
48  void compute_tangent_vectors(void);
49  void compute_vectors(void);
50  public:
51  FrenetTrihedron(void);
52  FrenetTrihedron(const Polyline3d &);
53 
54  const Polyline3d &getPath(void) const;
55  const std::vector<Vector3d> &getTangentVectorAtVertices(void) const;
56  boost::python::list getTangentVectorAtVerticesPy(void) const;
57  const std::vector<Vector3d> &getNormalVectorAtVertices(void) const;
58  boost::python::list getNormalVectorAtVerticesPy(void) const;
59  const std::vector<Vector3d> &getBinormalVectorAtVertices(void) const;
60  boost::python::list getBinormalVectorAtVerticesPy(void) const;
61 
62  Vector3d getTangent(const double &) const;
63  Vector3d getNormal(const double &) const;
64  Vector3d getBinormal(const double &) const;
65  Rect3d3dCooSys getCooSys(const double &) const;
66  Rect3d3dCooSys getHorizontalCooSys(const double &, const Vector3d &) const;
67  Ref3d3d getRefSys(const double &) const;
68  Ref3d3d getHorizontalRefSys(const double &, const Vector3d &) const;
69 
70  boost::python::dict getPyDict(void) const;
71  void setPyDict(const boost::python::dict &);
72 
73  virtual void Print(std::ostream &os) const;
74  friend std::ostream &operator<<(std::ostream &os,const FrenetTrihedron &sc);
75  };
76 
77 #endif
Rect3d3dCooSys getCooSys(const double &) const
Return the coordinate system corresponding to the given arc length.
Definition: FrenetTrihedron.cc:274
boost::python::list getBinormalVectorAtVerticesPy(void) const
Return a Python list containing the normal vectors at each of the vertices.
Definition: FrenetTrihedron.cc:180
FrenetTrihedron(void)
Default constructor.
Definition: FrenetTrihedron.cc:28
Vector3d getNormal(const double &) const
Return the normal vector corresponding to the given arc length.
Definition: FrenetTrihedron.cc:222
boost::python::list getNormalVectorAtVerticesPy(void) const
Return a Python list containing the normal vectors at each of the vertices.
Definition: FrenetTrihedron.cc:165
Three-dimensional coordinate system defined in a three-dimensional space.
Definition: Rect3d3dCooSys.h:33
Polyline in a three-dimensional space.
Definition: Polyline3d.h:37
virtual void Print(std::ostream &os) const
Prints the matrix.
Definition: FrenetTrihedron.cc:315
Base class for geometry objects.
Definition: ProtoGeom.h:33
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: FrenetTrihedron.cc:319
const Polyline3d & getPath(void) const
Return the underlying path.
Definition: FrenetTrihedron.cc:41
const std::vector< Vector3d > & getTangentVectorAtVertices(void) const
Return a reference to the tangent vectors.
Definition: FrenetTrihedron.cc:145
Coordinate systems base class.
Definition: FrenetTrihedron.h:36
Vector3d getTangent(const double &) const
Return the tangent vector corresponding to the given arc length.
Definition: FrenetTrihedron.cc:191
Ref3d3d getRefSys(const double &) const
Return the coordinate reference system corresponding to the given arc length.
Definition: FrenetTrihedron.cc:298
boost::python::list getTangentVectorAtVerticesPy(void) const
Return a Python list containing the tangent vectors at each of the vertices.
Definition: FrenetTrihedron.cc:150
const std::vector< Vector3d > & getBinormalVectorAtVertices(void) const
Return a oeference to the binormal vectors.
Definition: FrenetTrihedron.cc:175
const std::vector< Vector3d > & getNormalVectorAtVertices(void) const
Return a reference to the normal vectors.
Definition: FrenetTrihedron.cc:160
Rect3d3dCooSys getHorizontalCooSys(const double &, const Vector3d &) const
Return a reference system corresponding to the given arc length and whose XY plane is parpendigular t...
Definition: FrenetTrihedron.cc:287
Ref3d3d getHorizontalRefSys(const double &, const Vector3d &) const
Return a reference system corresponding to the given arc length and whose XY plane is parpendigular t...
Definition: FrenetTrihedron.cc:308
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: FrenetTrihedron.cc:327
Vector en tres dimensiones.
Definition: Vector3d.h:39
Three-dimensional reference system defined in a three-dimensional space.
Definition: Ref3d3d.h:39
Vector3d getBinormal(const double &) const
Return the binormal vector corresponding to the given arc length.
Definition: FrenetTrihedron.cc:248