XC Open source finite element analysis program
Spot.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 //Spot.h
28 
29 #ifndef SPOT_H
30 #define SPOT_H
31 
32 #include "EntGeomSection.h"
33 #include "xc_utils/src/geom/pos_vec/Pos2d.h"
34 
35 class BND2d;
36 
37 namespace XC {
38 class Eje;
39 
41 //
43 class Spot: public EntGeomSection
44  {
45  private:
46  Pos2d p;
47  std::set<const Eje *> ejes_pt;
48  friend class Eje;
49  void inserta_linea(Eje *l);
50  void borra_linea(Eje *l);
51  protected:
52 
53  virtual void actualiza_topologia(void);
54 
55  friend class GeomSection;
57  Spot(const Pos2d &pto= Pos2d());
60  : EntGeomSection("",m) {}
62  Spot(const std::string &nombre= "",GeomSection *m= nullptr)
63  : EntGeomSection(nombre,m) {}
64 
65  public:
67  inline virtual unsigned short int GetDimension(void) const
68  { return 0; }
69  BND2d Bnd(void) const;
70 
72  const Pos2d &GetPos(void) const
73  { return p; }
75  Pos2d &GetPos(void)
76  { return p; }
77  inline void setPos(const Pos2d &pos)
78  { p= pos; }
79  Vector2d VectorPos(void) const;
80 
82  const std::set<const Eje *> &EjesTocan(void) const
83  { return ejes_pt; }
84  bool Toca(const Eje &l) const;
85  inline size_t nLines(void) const
86  { return ejes_pt.size(); }
87 
88  double DistanciaA(const Pos2d &pt) const;
89 
90 
91  };
92 
93 } //end of XC namespace
94 
95 #endif
Vector2d VectorPos(void) const
Returns position vector of the point.
Definition: Spot.cc:54
Spot(const std::string &nombre="", GeomSection *m=nullptr)
Constructor.
Definition: Spot.h:62
Point object for section geometry definition.
Definition: Spot.h:43
Spot(GeomSection *m)
Constructor.
Definition: Spot.h:59
BND2d Bnd(void) const
Returns the object BND.
Definition: Spot.cc:62
const std::set< const Eje * > & EjesTocan(void) const
Return the list of lines that begin or end in this point.
Definition: Spot.h:82
const Pos2d & GetPos(void) const
Return the object position.
Definition: Spot.h:72
bool Toca(const Eje &l) const
Returns true if the point is an end of the line.
Definition: Spot.cc:66
Base class of section geometry representation classes.
Definition: EntGeomSection.h:47
Base class for 1D entities in section definition.
Definition: Eje.h:43
virtual unsigned short int GetDimension(void) const
Return the object dimension (0, 1, 2 or 3).
Definition: Spot.h:67
double DistanciaA(const Pos2d &pt) const
Return the distance to the position being passed as parameter.
Definition: Spot.cc:76
Spot(const Pos2d &pto=Pos2d())
Constructor.
Definition: Spot.cc:37
================================================================================
Definition: ContinuaReprComponent.h:34
Pos2d & GetPos(void)
Return the object position.
Definition: Spot.h:75
virtual void actualiza_topologia(void)
Updates topology.
Definition: Spot.cc:58
Cross section geometry.
Definition: GeomSection.h:62