xc
SlidingVectorsSystem3d.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 //SlidingVectorsSystem3d.h
22 //Sliding vectors system.
23 
24 #ifndef SLIDINGVECTORSSYSTEM3D_H
25 #define SLIDINGVECTORSSYSTEM3D_H
26 
27 #include "../ProtoGeom.h"
28 #include "SlidingVector3d.h"
29 #include "Pos3d.h"
30 
31 class Line3d;
32 class Plane;
33 class Ref3d3d;
34 
35 
37 //
40  {
41  Vector3d mom;
42  public:
43  SlidingVectorsSystem3d(const Pos3d &O= Pos3d(),const Vector3d &R= Vector3d(),const Vector3d &Mo= Vector3d());
44  explicit SlidingVectorsSystem3d(const SlidingVector3d &v);
45 
46  bool operator==(const SlidingVectorsSystem3d &) const;
47 
48  Vector3d getResultant(void) const
49  { return getVector(); }
50  Vector3d getResultant(const Ref3d3d &ref) const;
51  const Vector3d &getMoment(void) const
52  { return mom; }
53  SlidingVector3d getMoment(const Pos3d &P) const;
54  GEOM_FT getMoment(const Line3d &e) const;
55  Vector3d getMoment(const Ref3d3d &ref) const;
56  bool Nulo(void) const;
57  void Neg(void);
58  Line3d centralAxis(void) const;
59  bool existsZeroMomentLine(const double &tol= sqrt_mchne_eps_dbl) const;
60  Line3d getZeroMomentLine(const double &tol= sqrt_mchne_eps_dbl) const;
61  Pos3d PointOfApplication(const Plane &p) const;
62 
63  SlidingVectorsSystem3d reduceTo(const Pos3d &Q) const;
64  std::vector<SlidingVector3d> distribute(const std::vector<Pos3d> &) const;
65  boost::python::list distributePyNoWeights(const boost::python::list &) const;
66  std::vector<SlidingVector3d> distribute(const std::vector<Pos3d> &, const std::vector<double> &) const;
67  boost::python::list distributePy(const boost::python::list &, const boost::python::list &) const;
68 
69 
70  SlidingVectorsSystem3d &operator+=(const SlidingVector3d &v);
71  SlidingVectorsSystem3d &operator-=(const SlidingVector3d &v);
72  SlidingVectorsSystem3d &operator+=(const SlidingVectorsSystem3d &s);
73  SlidingVectorsSystem3d &operator-=(const SlidingVectorsSystem3d &s);
74  SlidingVectorsSystem3d &operator*=(const GEOM_FT &d);
77  friend SlidingVectorsSystem3d operator*(const GEOM_FT &d, const SlidingVectorsSystem3d &s);
78  friend SlidingVectorsSystem3d operator*(const SlidingVectorsSystem3d &s,const GEOM_FT &d);
79  void Print(std::ostream &os) const;
80  void PrintLtx(std::ostream &os,const std::string &ud_long= " m",const GEOM_FT &f_long=1.0, const std::string &ud_f= " N",const GEOM_FT &f_f=1.0) const;
81  friend std::ostream &operator<<(std::ostream &os, const SlidingVectorsSystem3d &svd3d);
82  };
83 
86 SlidingVectorsSystem3d operator*(const GEOM_FT &d, const SlidingVectorsSystem3d &s);
92 std::ostream &operator<<(std::ostream &os, const SlidingVectorsSystem3d &svd3d);
93 
94 #endif
friend SlidingVectorsSystem3d operator-(const SlidingVectorsSystem3d &s1, const SlidingVectorsSystem3d &s2)
Return the difference of sliding vectors systems.
Definition: SlidingVectorsSystem3d.cc:350
friend SlidingVectorsSystem3d operator+(const SlidingVectorsSystem3d &s1, const SlidingVectorsSystem3d &s2)
Return the sum of the sliding vectors systems.
Definition: SlidingVectorsSystem3d.cc:342
Line3d centralAxis(void) const
Return the central axis of the system (moment paraller to resultant).
Definition: SlidingVectorsSystem3d.cc:146
boost::python::list distributePyNoWeights(const boost::python::list &) const
Assigns a vector to each point to obtain an equivalent sliding vector system.
Definition: SlidingVectorsSystem3d.cc:215
Line3d getZeroMomentLine(const double &tol=sqrt_mchne_eps_dbl) const
Return the line of the points with zero moment.
Definition: SlidingVectorsSystem3d.cc:150
Plane in a three-dimensional space.
Definition: Plane.h:49
bool operator==(const SlidingVectorsSystem3d &) const
Comparison operator.
Definition: SlidingVectorsSystem3d.cc:60
std::vector< SlidingVector3d > distribute(const std::vector< Pos3d > &) const
Assigns a vector to each point to obtain an equivalent sliding vector system.
Definition: SlidingVectorsSystem3d.cc:172
bool existsZeroMomentLine(const double &tol=sqrt_mchne_eps_dbl) const
Return true if the line of the points with zero moment exists.
Definition: SlidingVectorsSystem3d.cc:159
friend SlidingVectorsSystem3d operator*(const GEOM_FT &d, const SlidingVectorsSystem3d &s)
Return the product of the sliding vectors system by a scalar.
Definition: SlidingVectorsSystem3d.cc:358
boost::python::list distributePy(const boost::python::list &, const boost::python::list &) const
Assigns a vector to each point to obtain an equivalent sliding vector system.
Definition: SlidingVectorsSystem3d.cc:284
Pos3d PointOfApplication(const Plane &p) const
Return the intersection of the zero moment line (if exists) with the plane.
Definition: SlidingVectorsSystem3d.cc:86
sliding vector en tres dimensiones.
Definition: SlidingVector3d.h:36
friend std::ostream & operator<<(std::ostream &os, const SlidingVectorsSystem3d &svd3d)
Prints.
Definition: SlidingVectorsSystem3d.cc:405
Posición en tres dimensiones.
Definition: Pos3d.h:44
Sliding vectors system en un espacio tridimensional.
Definition: SlidingVectorsSystem3d.h:39
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
void Print(std::ostream &os) const
Imprime el sliding vectors system.
Definition: SlidingVectorsSystem3d.cc:368
Vector en tres dimensiones.
Definition: Vector3d.h:39
Three-dimensional reference system defined in a three-dimensional space.
Definition: Ref3d3d.h:39