xc
Segment.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 //Segment.h
28 
29 #ifndef SEGMENT_H
30 #define SEGMENT_H
31 
32 #include "Axis.h"
33 
34 
35 namespace XC {
36 
38 //
40 class Segment: public Axis
41  {
42  Spot *p1;
43  Spot *p2;
44  protected:
45 
46  public:
47  Segment(GeomSection *m,const size_t &ndiv= 4);
48  Segment(const std::string &nombre= "",GeomSection *m= nullptr,const size_t &ndiv= 4);
49  Spot *P1(void);
50  const Spot *P1(void) const;
51  Spot *P2(void);
52  const Spot *P2(void) const;
53  void setEndPoints(size_t, size_t);
54  int getVtkCellType(void) const;
56  inline virtual size_t getNumberOfVertices(void) const
57  { return 2; }
58  virtual const Spot *getVertex(const size_t &i) const;
59  virtual Spot *getVertex(const size_t &i);
60  virtual void SetVertice(const size_t &,Spot *);
61  virtual BND2d Bnd(void) const;
62  double getLong(void) const;
63 
64  };
65 
66 } //end of XC namespace
67 #endif
Cross section geometry.
Definition: GeomSection.h:63
Segment(GeomSection *m, const size_t &ndiv=4)
Constructor.
Definition: Segment.cc:37
virtual size_t getNumberOfVertices(void) const
Return the number of vertices.
Definition: Segment.h:56
Line segment.
Definition: Segment.h:40
Spot * P1(void)
Returns a pointer to start point.
Definition: Segment.cc:45
Spot * P2(void)
Returns a pointer to end point.
Definition: Segment.cc:51
Base class for 1D entities in section definition.
Definition: Axis.h:43
Point object for section geometry definition.
Definition: Spot.h:43
virtual BND2d Bnd(void) const
Returns the 2D interval occupied by the segment.
Definition: Segment.cc:101
virtual const Spot * getVertex(const size_t &i) const
Returns the i-th vertex.
Definition: Segment.cc:74
virtual void SetVertice(const size_t &, Spot *)
Sets the i-th vertex.
Definition: Segment.cc:92
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
int getVtkCellType(void) const
VTK interface.
Definition: Segment.cc:118
double getLong(void) const
Return segment length.
Definition: Segment.cc:122
void setEndPoints(size_t, size_t)
Assigns end points.
Definition: Segment.cc:59
size_t ndiv
Number of divisions.
Definition: Axis.h:47