Chemical Data Processing Library C++ API - Version 1.1.1
SpatialGrid.hpp
Go to the documentation of this file.
1 /*
2  * SpatialGrid.hpp
3  *
4  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
27 #ifndef CDPL_GRID_SPATIALGRID_HPP
28 #define CDPL_GRID_SPATIALGRID_HPP
29 
30 #include <memory>
31 
33 #include "CDPL/Math/Vector.hpp"
34 
35 
36 namespace CDPL
37 {
38 
39  namespace Grid
40  {
41 
45  template <typename T, typename CVT = T>
46  class SpatialGrid : public AttributedGrid
47  {
48 
49  public:
50  typedef std::shared_ptr<SpatialGrid> SharedPointer;
51  typedef T ValueType;
52  typedef CVT CoordinatesValueType;
54 
55  virtual ValueType& operator()(std::size_t i) = 0;
56 
57  virtual const ValueType& operator()(std::size_t i) const = 0;
58 
59  virtual void getCoordinates(std::size_t i, CoordinatesType& coords) const = 0;
60 
61  protected:
63  {
65  return *this;
66  }
67  };
68 
71  } // namespace Grid
72 } // namespace CDPL
73 
74 #endif // CDPL_GRID_SPATIALGRID_HPP
CDPL::Grid::SpatialGrid::operator=
SpatialGrid & operator=(const SpatialGrid &grid)
Definition: SpatialGrid.hpp:62
CDPL::Grid::SpatialGrid::operator()
virtual const ValueType & operator()(std::size_t i) const =0
CDPL::Grid::AttributedGrid::operator=
AttributedGrid & operator=(const AttributedGrid &grid)
Definition: AttributedGrid.hpp:58
CDPL::Grid::DSpatialGrid
SpatialGrid< double > DSpatialGrid
Definition: SpatialGrid.hpp:70
CDPL::Grid::SpatialGrid::operator()
virtual ValueType & operator()(std::size_t i)=0
AttributedGrid.hpp
Definition of a grid data type.
CDPL::Grid::SpatialGrid::ValueType
T ValueType
Definition: SpatialGrid.hpp:51
CDPL::Math::CVector
Definition: Vector.hpp:1053
CDPL::Grid::SpatialGrid
SpatialGrid.
Definition: SpatialGrid.hpp:47
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::Grid::SpatialGrid::getCoordinates
virtual void getCoordinates(std::size_t i, CoordinatesType &coords) const =0
CDPL::Grid::SpatialGrid::CoordinatesType
Math::CVector< CVT, 3 > CoordinatesType
Definition: SpatialGrid.hpp:53
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Grid::AttributedGrid
AttributedGrid.
Definition: AttributedGrid.hpp:46
CDPL::Grid::SpatialGrid::CoordinatesValueType
CVT CoordinatesValueType
Definition: SpatialGrid.hpp:52
CDPL::Grid::SpatialGrid::SharedPointer
std::shared_ptr< SpatialGrid > SharedPointer
Definition: SpatialGrid.hpp:50
Vector.hpp
Definition of vector data types.
CDPL::Grid::FSpatialGrid
SpatialGrid< float > FSpatialGrid
Definition: SpatialGrid.hpp:69