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 
56  Vector3d getTangent(const double &) const;
57  Vector3d getNormal(const double &) const;
58  Vector3d getBinormal(const double &) const;
59  Rect3d3dCooSys getCooSys(const double &) const;
60  Ref3d3d getRefSys(const double &) const;
61 
62  boost::python::dict getPyDict(void) const;
63  void setPyDict(const boost::python::dict &);
64 
65  virtual void Print(std::ostream &os) const;
66  friend std::ostream &operator<<(std::ostream &os,const FrenetTrihedron &sc);
67  };
68 
69 #endif
Rect3d3dCooSys getCooSys(const double &) const
Return the coordinate system corresponding to the given arc length.
Definition: FrenetTrihedron.cc:229
FrenetTrihedron(void)
Default constructor.
Definition: FrenetTrihedron.cc:27
Vector3d getNormal(const double &) const
Return the normal vector corresponding to the given arc length.
Definition: FrenetTrihedron.cc:181
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:247
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:251
const Polyline3d & getPath(void) const
Return the underlying path.
Definition: FrenetTrihedron.cc:40
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:157
Ref3d3d getRefSys(const double &) const
Return the coordinate reference system corresponding to the given arc length.
Definition: FrenetTrihedron.cc:240
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: FrenetTrihedron.cc:259
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:205