xc
Xd3dCooSys.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 //Xd3dCooSys.h
22 //Coordinate system of dimension X defined in a three-dimensional space.
23 
24 #ifndef XD3D_COO_SYS_H
25 #define XD3D_COO_SYS_H
26 
27 #include "CooSys.h"
28 
29 class Vector3d;
30 class Dir3d;
31 class Pos3d;
32 
37 class Xd3dCooSys: public CooSys
38  {
39  public:
40  typedef Vector3d VGlobal;
41  typedef Pos3d PGlobal;
42  typedef Dir3d DGlobal;
43  protected:
44  void vectores_unitarios(const VGlobal &i_,const VGlobal &j_,const VGlobal &k_);
45  Xd3dCooSys(const size_t &i)
46  : CooSys(i,3) {}
47  Xd3dCooSys(const size_t &i,const VGlobal &v1);
48  Xd3dCooSys(const size_t &i,const VGlobal &v1,const VGlobal &v2);
49  Xd3dCooSys(const size_t &i,const PGlobal &o,const PGlobal &p);
50  Xd3dCooSys(const size_t &i,const PGlobal &p1,const PGlobal &p2, const PGlobal &p3);
51  Xd3dCooSys(const size_t &i,const VGlobal &v1,const VGlobal &v2,const VGlobal &v3);
52 
53 
54  void putRow(const size_t &axis,const VGlobal &v);
55  void XAxisVector(const VGlobal &v);
56  void TwoPoints(const PGlobal &o,const PGlobal &p);
57  void ThreePoints(const PGlobal &o,const PGlobal &p1,const PGlobal &p2);
58 
59  public:
60  //@ brief Constructor virtual.
61  virtual Xd3dCooSys *CopiaXd3d(void) const= 0;
62  virtual VGlobal getAxisVDir(const size_t &axis) const;
63  //Return the direction vector of the axis.
64  virtual DGlobal getAxisDir(const size_t &axis) const;
65 
66  VGlobal getGlobalCoordinates(const FT_matrix &v) const;
67  FT_matrix getLocalCoordinates(const VGlobal &v) const;
68  };
69 
70 #endif
void TwoPoints(const PGlobal &o, const PGlobal &p)
Build the coordinate system formed by the vectors: i_ the op vector (see XAxisVector).
Definition: Xd3dCooSys.cc:178
virtual VGlobal getAxisVDir(const size_t &axis) const
Return the direction vector of the axis being passed as parameter.
Definition: Xd3dCooSys.cc:74
Pos3d PGlobal
Point in the 3D space.
Definition: Xd3dCooSys.h:41
Base class for coordinate systems defined in a three-dimensional space.
Definition: Xd3dCooSys.h:37
void XAxisVector(const VGlobal &v)
Builds the coordinate system formed by the vectors: i_ the vector being passed as parameter...
Definition: Xd3dCooSys.cc:150
FT_matrix getLocalCoordinates(const VGlobal &v) const
Return the local coordinates of the vector.
Definition: Xd3dCooSys.cc:91
VGlobal getGlobalCoordinates(const FT_matrix &v) const
Return the global coordinates of the vector.
Definition: Xd3dCooSys.cc:82
void ThreePoints(const PGlobal &o, const PGlobal &p1, const PGlobal &p2)
Create the coordinate system with axis oriented as follows: x axis: from o to p1; y axis: normal to x...
Definition: Xd3dCooSys.cc:185
void vectores_unitarios(const VGlobal &i_, const VGlobal &j_, const VGlobal &k_)
Makes the system of coordinates have the following unit vectors:
Definition: Xd3dCooSys.cc:100
Dirección en el espacio de tres dimensiones.
Definition: Dir3d.h:35
Posición en tres dimensiones.
Definition: Pos3d.h:44
Dir3d DGlobal
Direction in the 3D space.
Definition: Xd3dCooSys.h:42
virtual DGlobal getAxisDir(const size_t &axis) const
Return the dirección of the axis being passed as parameter.
Definition: Xd3dCooSys.cc:70
Matrix which components are GEOM_FT numbers.
Definition: FT_matrix.h:40
Vector3d VGlobal
Vector in the 3D space.
Definition: Xd3dCooSys.h:40
Coordinate systems base class.
Definition: CooSys.h:38
Vector en tres dimensiones.
Definition: Vector3d.h:39