XC Open source finite element analysis program
MapLineas.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 //MapLineas.h
28 
29 #ifndef MAPLineas_H
30 #define MAPLineas_H
31 
32 #include "MapEnt.h"
33 #include "Edge.h"
34 
35 class Recta3d;
36 class Plano3d;
37 
38 namespace XC {
39 
40 class Edge;
41 class Linea;
42 class DividedLine;
43 class CmbEdge;
44 class ArcoCircunf;
45 
47 //
49 class MapLineas: public MapEnt<Edge>
50  {
51  private:
52  void UpdateSets(Edge *) const;
53  protected:
54  template <class E>
55  Edge *Crea(void);
56 
57 
58  public:
59  MapLineas(Cad *cad= nullptr);
60 
61  Vector3d getVector(const Indice &i,const Indice &j) const;
62  Recta3d getRecta(const Indice &i,const Indice &j) const;
63  Plano3d getPlano(const Indice &i,const Indice &j,const Indice &k) const;
64 
65  template <class E>
66  Edge *Nueva(void);
67  Edge *createLine(Pnt *,Pnt *);
69  Edge *createArc(Pnt *,Pnt *,Pnt *);
70  Edge *createLineSequence(void);
71  Edge *createCopy(const Edge *l);
72 
73  Linea *newLine(const size_t &, const size_t &);
74  DividedLine *newDividedLine(const size_t &, const size_t &);
75  ArcoCircunf *newCircleArc(const size_t &, const size_t &, const size_t &);
76  CmbEdge *newLineSequence(void);
77  };
78 
80 template <class E>
82  {
83  Preprocessor *preprocessor= getPreprocessor();
84  assert(preprocessor);
85  Edge *retval= new E(preprocessor);
86  retval->Nombre()= "l"+boost::lexical_cast<std::string>(getTag());
87  (*this)[getTag()]= retval;
88  UpdateSets(retval);
89  tag++;
90  return retval;
91  }
92 
94 template <class E>
96  {
97  Edge *retval= busca(getTag());
98  if(!retval) //El edge is new.
99  retval= Crea<E>();
100  return retval;
101  }
102 
103 } //end of XC namespace
104 #endif
Contenedor de puntos del modelo.
Definition: MapLineas.h:49
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
const Preprocessor * getPreprocessor(void) const
Return a pointer to preprocessor.
Definition: MapCadMemberBase.cc:54
Linea * newLine(const size_t &, const size_t &)
Line segment.
Definition: MapLineas.cc:49
Edge * busca(const Indice &)
Edge * createLine(Pnt *, Pnt *)
Creates a new line entre los puntos being passed as parameters and inserts it on the container...
Definition: MapLineas.cc:117
Edge * createDividedLine(Pnt *, Pnt *)
Creates a new line between the points being passed as parameters and inserts it on the container...
Definition: MapLineas.cc:154
Line segment between two points.
Definition: DividedLine.h:39
Circumference arc.
Definition: ArcoCircunf.h:43
Segmento de recta entre dos puntos.
Definition: Linea.h:41
Edge * createLineSequence(void)
Creates a line sequence (polyline) with those being passed as parameters and inserts it in the edge s...
Definition: MapLineas.cc:219
Edge * Crea(void)
Creates a new line.
Definition: MapLineas.h:81
ArcoCircunf * newCircleArc(const size_t &, const size_t &, const size_t &)
Circle arc.
Definition: MapLineas.cc:75
Finite element model generation tools.
Definition: Preprocessor.h:58
CmbEdge * newLineSequence(void)
Circle arc.
Definition: MapLineas.cc:90
Edge * Nueva(void)
Creates a new Edge.
Definition: MapLineas.h:95
Punto (KPoint).
Definition: Pnt.h:49
Model geometry manager. Management of geometry entities: points, lines, surfaces, bodies...
Definition: Cad.h:69
MapLineas(Cad *cad=nullptr)
Constructor.
Definition: MapLineas.cc:45
Edge * createCopy(const Edge *l)
Creates a new line, copia de la being passed as parameter con el nombre being passed as parameter...
Definition: MapLineas.cc:228
Edge * createArc(Pnt *, Pnt *, Pnt *)
Creates a new arc of circle between the points being passed as parameters and inserts it in the edge ...
Definition: MapLineas.cc:189
Compound line.
Definition: CmbEdge.h:42
================================================================================
Definition: ContinuaReprComponent.h:34
DividedLine * newDividedLine(const size_t &, const size_t &)
Divided line.
Definition: MapLineas.cc:62
Geometric entities container (points, lines, surfaces,...).
Definition: MapEnt.h:42