xc
PntMap.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 //PntMap.h
29 
30 #ifndef PNTMAP_H
31 #define PNTMAP_H
32 
33 #include "EntityMap.h"
34 #include <map>
35 
36 class Pos3d;
37 class Pos2d;
38 class Line3d;
39 class Plane;
40 class Vector3d;
41 
42 namespace XC {
43 
44 class Preprocessor;
45 class MultiBlockTopology;
46 class Pnt;
47 class SetEstruct;
48 class TrfGeom;
49 
51 //
53 class PntMap: public EntityMap<Pnt>
54  {
55  const double tol= 0.01;
56  private:
57  void updateSets(Pnt *) const;
58  protected:
59  Pnt *Crea(void);
60  public:
61  PntMap(MultiBlockTopology *mbt= nullptr);
62 
63  Pos3d getCentroid(void) const;
64  Vector3d getVector(const Indice &i,const Indice &j) const;
65  Line3d getRecta(const Indice &i,const Indice &j) const;
66  Plane getPlane(const Indice &i,const Indice &j,const Indice &k) const;
67 
68  bool checkPosition(const Pos3d &);
69  Pnt *New(void);
70  Pnt *New(const size_t &);
71  Pnt *New(const Pos3d &);
72  Pnt *New(const size_t &,const Pos3d &);
73  Pnt *New(const Pos2d &);
74  Pnt *New(const size_t &,const Pos2d &);
75 
76  Pnt *Copy(const Pnt *,const Vector3d &v);
77  void Copy(const std::vector<PntMap::Indice> &);
78  void Transform(const TrfGeom &trf,const std::vector<PntMap::Indice> &);
79  double Dist(const Indice &i,const Indice &j) const;
80 
81  boost::python::dict getPyDict(void) const;
82  void setPyDict(const boost::python::dict &);
83  };
84 
85 } //end of XC namespace
86 #endif
Geometric entities container (points, lines, surfaces,...).
Definition: EntityMap.h:43
Posición en dos dimensiones.
Definition: Pos2d.h:41
Model geometry manager.
Definition: MultiBlockTopology.h:68
double Dist(const Indice &i, const Indice &j) const
Return the distance between the points which identifiers are being passed as parameters.
Definition: PntMap.cc:340
Plane in a three-dimensional space.
Definition: Plane.h:49
void Transform(const TrfGeom &trf, const std::vector< PntMap::Indice > &)
Applies the transformation to the points identified by the indices being passed as parameter...
Definition: PntMap.cc:322
PntMap(MultiBlockTopology *mbt=nullptr)
Constructor.
Definition: PntMap.cc:42
Vector3d getVector(const Indice &i, const Indice &j) const
Return the vector defined by the points which indices are being passed as parameters.
Definition: PntMap.cc:97
Point container.
Definition: PntMap.h:53
Point (KPoint).
Definition: Pnt.h:50
Pnt * Copy(const Pnt *, const Vector3d &v)
Creates a new point, copy from the point argument with the corresponding name according to the value ...
Definition: PntMap.cc:272
Pnt * New(void)
Creates a new point.
Definition: PntMap.cc:190
Pos3d getCentroid(void) const
Return the centroid of the points.
Definition: PntMap.cc:63
Geometric transformation that can be applied to the components of a set.
Definition: TrfGeom.h:48
bool checkPosition(const Pos3d &)
Check if there is a point too close to the new one.
Definition: PntMap.cc:165
Line3d getRecta(const Indice &i, const Indice &j) const
Return the line defined by the points which indices are being passed as parameters.
Definition: PntMap.cc:114
Posición en tres dimensiones.
Definition: Pos3d.h:44
Line in a three-dimensional space.
Definition: Line3d.h:62
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: PntMap.cc:375
Vector en tres dimensiones.
Definition: Vector3d.h:39
Pnt * Crea(void)
Creates a new point.
Definition: PntMap.cc:153
Plane getPlane(const Indice &i, const Indice &j, const Indice &k) const
Return the plane defined by the points which indices are being passed as parameters.
Definition: PntMap.cc:131
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: PntMap.cc:359