Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

GridCell.h (Maintainer: Eva Lange)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 // --------------------------------------------------------------------------
00004 //                   OpenMS Mass Spectrometry Framework
00005 // --------------------------------------------------------------------------
00006 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00007 //
00008 //  This library is free software; you can redistribute it and/or
00009 //  modify it under the terms of the GNU Lesser General Public
00010 //  License as published by the Free Software Foundation; either
00011 //  version 2.1 of the License, or (at your option) any later version.
00012 //
00013 //  This library is distributed in the hope that it will be useful,
00014 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 //  Lesser General Public License for more details.
00017 //
00018 //  You should have received a copy of the GNU Lesser General Public
00019 //  License along with this library; if not, write to the Free Software
00020 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 //
00022 // --------------------------------------------------------------------------
00023 // $Maintainer: Eva Lange $
00024 // --------------------------------------------------------------------------
00025 
00026 #ifndef OPENMS_ANALYSIS_MAPMATCHING_GRIDCELL_H
00027 #define OPENMS_ANALYSIS_MAPMATCHING_GRIDCELL_H
00028 
00029 #include <OpenMS/DATASTRUCTURES/DPosition.h>
00030 #include <OpenMS/DATASTRUCTURES/DRange.h>
00031 #include <OpenMS/ANALYSIS/MAPMATCHING/LinearMapping.h>
00032 
00033 #include <vector>
00034 
00035 namespace OpenMS
00036 {
00037 
00040   class GridCell
00041     : public DRange<2>
00042   {
00043   public:
00044     enum { DIMENSION = 2 };
00045     typedef DoubleReal  CoordinateType;
00046     typedef DPosition<2> PositionType;
00047     typedef std::vector<LinearMapping> MappingVector;
00048 
00052 
00053     GridCell() :
00054         DRange<2>(),
00055         mappings_()
00056     { }
00057 
00059     GridCell(CoordinateType i, CoordinateType j,
00060              CoordinateType k, CoordinateType l) :
00061         DRange<2>(i, j, k, l),
00062         mappings_()
00063     { }
00064 
00066     GridCell(const GridCell& gc)
00067         : DRange<2>(gc)
00068     {
00069       setMappings(gc.mappings_);
00070     }
00071 
00073     virtual ~GridCell()
00074     {}
00076 
00078     GridCell& operator = (const GridCell& rhs);
00079 
00083 
00084     inline void setMappings(const MappingVector& m)
00085     { 
00086       mappings_ = m;
00087     }
00089     inline MappingVector& getMappings() { return mappings_; }
00091     inline const MappingVector& getMappings() const { return mappings_; }
00093 
00094   protected:
00097     MappingVector mappings_;
00098 
00099   }; // end of class GridCell
00100   
00102   std::ostream& operator << (std::ostream& os, const GridCell& grid);
00103 
00104 
00105 } // end of namespace OpenMS
00106 
00107 #endif  // OPENMS_ANALYSIS_MAPMATCHING_GRIDCELL_H

Generated Tue Apr 1 15:36:34 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1