xc
Spot.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 //Spot.h
29 
30 #ifndef SPOT_H
31 #define SPOT_H
32 
33 #include "SectionGeometryWrapper.h"
34 #include "utility/geom/pos_vec/Pos2d.h"
35 
36 class BND2d;
37 
38 namespace XC {
39 class Axis;
40 
42 //
45  {
46  private:
47  Pos2d p;
48  std::set<const Axis *> pt_axes;
49  friend class Axis;
50  void insert_linea(Axis *l);
51  void borra_linea(Axis *l);
52  protected:
53 
54  virtual void update_topology(void);
55 
56  friend class SectionGeometry;
58  Spot(const Pos2d &pto= Pos2d());
61  : SectionGeometryWrapper("",m) {}
63  Spot(const std::string &name= "",SectionGeometry *m= nullptr)
64  : SectionGeometryWrapper(name,m) {}
65 
66  public:
68  inline virtual unsigned short int GetDimension(void) const
69  { return 0; }
70  BND2d Bnd(void) const;
71 
73  const Pos2d &getPos(void) const
74  { return p; }
76  Pos2d &getPos(void)
77  { return p; }
78  inline void setPos(const Pos2d &pos)
79  { p= pos; }
80  Vector2d VectorPos(void) const;
81 
83  const std::set<const Axis *> &getConnectedAxes(void) const
84  { return pt_axes; }
85  bool isConnectedTo(const Axis &l) const;
86  inline size_t nLines(void) const
87  { return pt_axes.size(); }
88 
89  double getDistanceTo(const Pos2d &pt) const;
90 
91 
92  };
93 
94 } //end of XC namespace
95 
96 #endif
double getDistanceTo(const Pos2d &pt) const
Return the distance to the position being passed as parameter.
Definition: Spot.cc:76
"boundary" en dos dimensiones.
Definition: BND2d.h:38
bool isConnectedTo(const Axis &l) const
Returns true if the point is an end of the line.
Definition: Spot.cc:66
const Pos2d & getPos(void) const
Return the object position.
Definition: Spot.h:73
Posición en dos dimensiones.
Definition: Pos2d.h:41
Vector en dos dimensiones.
Definition: Vector2d.h:40
Base class of section geometry representation classes.
Definition: SectionGeometryWrapper.h:48
Base class for 1D entities in section definition.
Definition: Axis.h:44
Pos2d & getPos(void)
Return the object position.
Definition: Spot.h:76
Spot(SectionGeometry *m)
Constructor.
Definition: Spot.h:60
const std::set< const Axis * > & getConnectedAxes(void) const
Return the list of lines that begin or end in this point.
Definition: Spot.h:83
Point object for section geometry definition.
Definition: Spot.h:44
BND2d Bnd(void) const
Returns the object BND.
Definition: Spot.cc:62
Vector2d VectorPos(void) const
Returns position vector of the point.
Definition: Spot.cc:54
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
virtual unsigned short int GetDimension(void) const
Return the object dimension (0, 1, 2 or 3).
Definition: Spot.h:68
virtual void update_topology(void)
Update topology.
Definition: Spot.cc:58
Spot(const Pos2d &pto=Pos2d())
Constructor.
Definition: Spot.cc:37
Spot(const std::string &name="", SectionGeometry *m=nullptr)
Constructor.
Definition: Spot.h:63
Cross section geometry.
Definition: SectionGeometry.h:65