xc
VectorPos.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. PĂ©rez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //VectorPos.h
22 //Positions vector.
23 
24 #ifndef VECTORPOS_H
25 #define VECTORPOS_H
26 
27 #include "PosArray.h"
28 
29 
31 //
33 template <class POS>
34 class VectorPos: public PosArray<POS>
35  {
36  public:
37  typedef PosArray<POS> m_pos;
38  public:
39  VectorPos(const size_t &f=1): m_pos(f,1) {}
40  VectorPos(const POS &p1,const POS &p2,const size_t &num,const GEOM_FT &ratio);
41  VectorPos(const POS &p1,const POS &p2,const size_t &ndiv);
42  inline VectorPos<POS> getBox(size_t f1, size_t f2) const
43  { return VectorPos(*this,f1,1,f2,1); }
44  inline const POS &getRow(size_t iRow) const
45  { return m_pos::operator()(iRow,1); }
46  inline VectorPos<POS> getColumn(size_t col) const
47  { return m_pos::getColumn(1); }
48  };
49 
50 template <class POS>
51 VectorPos<POS>::VectorPos(const POS &p1,const POS &p2,const size_t &num,const GEOM_FT &ratio)
52  : m_pos(p1,p2,num,ratio) {}
53 
54 template <class POS>
55 VectorPos<POS>::VectorPos(const POS &p1,const POS &p2,const size_t &ndiv)
56  : m_pos(p1,p2,ndiv) {}
57 
58 #endif
Clase base para los vectores de posiciones.
Definition: VectorPos.h:34
Base class for position matrices used to represent grids of points.
Definition: PosArray.h:37