xc
SlidingVector3d.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 //SlidingVector3d.h
22 
23 #ifndef VDESLIZ3D_H
24 #define VDESLIZ3D_H
25 
26 
27 #include "Pos3d.h"
28 #include "Vector3d.h"
29 #include "utility/utils/misc_utils/mchne_eps.h"
30 
31 class Line3d;
32 
34 //
36 class SlidingVector3d : public Vector3d
37  {
38  protected:
40  public:
41  SlidingVector3d(const Pos3d &o= Pos3d(),const Vector3d &v= Vector3d());
42  SlidingVector3d(const Pos3d &o,const Pos3d &p);
43 
44  bool operator==(const SlidingVector3d &) const;
45 
46  virtual SlidingVector3d getMoment(const Pos3d &o) const;
47  virtual GEOM_FT getMoment(const Line3d &e) const;
48  const Pos3d &getOrg(void) const;
49  const Pos3d getDest(void) const;
50  const Vector3d &getVector(void) const;
51  Vector3d getVector3d(void) const;
52  SlidingVector3d &operator*=(const GEOM_FT &);
53  friend SlidingVector3d operator*(const SlidingVector3d &m,const GEOM_FT &p);
54  friend SlidingVector3d operator*(const GEOM_FT &p,const SlidingVector3d &m);
55  friend SlidingVector3d operator/(const SlidingVector3d &m,const GEOM_FT &p);
56  friend std::ostream &operator<<(std::ostream &os,const SlidingVector3d &v);
57  };
58 
59 SlidingVector3d operator*(const SlidingVector3d &m,const GEOM_FT &p);
60 SlidingVector3d operator*(const GEOM_FT &p,const SlidingVector3d &m);
61 SlidingVector3d operator/(const SlidingVector3d &m,const GEOM_FT &p);
62 std::ostream &operator<<(std::ostream &os,const SlidingVector3d &v);
64 
65 inline GEOM_FT Abs(const SlidingVector3d &v)
66  { return v.GetModulus(); }
67 
68 #endif
Pos3d org
Point that fix the line of action.
Definition: SlidingVector3d.h:39
Vector3d operator-(const Vector3d &) const
Return la resta de los vectores.
Definition: Vector3d.cc:198
bool operator==(const SlidingVector3d &) const
Comparison operator.
Definition: SlidingVector3d.cc:39
virtual SlidingVector3d getMoment(const Pos3d &o) const
Moment of a sliding vector with respect to a point.
Definition: SlidingVector3d.cc:60
virtual GEOM_FT GetModulus(void) const
Return el módulo del vector.
Definition: Vector3d.cc:158
SlidingVector3d(const Pos3d &o=Pos3d(), const Vector3d &v=Vector3d())
Constructor.
Definition: SlidingVector3d.cc:31
sliding vector en tres dimensiones.
Definition: SlidingVector3d.h:36
Vector3d getVector3d(void) const
Return the vector part of the object.
Definition: SlidingVector3d.cc:87
Posición en tres dimensiones.
Definition: Pos3d.h:44
Line in a three-dimensional space.
Definition: Line3d.h:62
const Vector3d & getVector(void) const
Return the vector part of the object.
Definition: SlidingVector3d.cc:80
Vector en tres dimensiones.
Definition: Vector3d.h:39