| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/image_processing/TePDIMtxDoubleAdpt.hpp
Go to the documentation of this file.

    00001 /*
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular
    00017 purpose. The library provided hereunder is on an "as is" basis, and the
    00018 authors have no obligation to provide maintenance, support, updates,
    00019 enhancements, or modifications.
    00020 In no event shall INPE be held liable to any party
    00021 for direct, indirect, special, incidental, or consequential damages arising
    00022 out of the use of this library and its documentation.
    00023 */
    00024
    00025 #ifndef TEPDIMTXDOUBLEADPT_HPP
    00026   #define TEPDIMTXDOUBLEADPT_HPP
    00027
    00028   #include "TePDIMatrix.hpp"
    00029
    00036   class TePDIMtxDoubleAdptInt
    00037   {
    00038     public :
    00039
    00040       virtual ~TePDIMtxDoubleAdptInt() {};
    00041
    00048       virtual void getValue( const unsigned int& lin,
    00049         const unsigned int col, double& value ) const = 0;
    00050
    00057       virtual void setValue( const unsigned int& lin,
    00058         const unsigned int col, const double& value ) = 0;
    00059
    00066       virtual bool reset( unsigned int lines,
    00067          unsigned int columns ) = 0;
    00068
    00072       virtual unsigned int getNLines() const = 0;
    00073
    00077       virtual unsigned int getNCols() const = 0;
    00078
    00079     protected :
    00080
    00081       TePDIMtxDoubleAdptInt() {};
    00082       TePDIMtxDoubleAdptInt( const TePDIMtxDoubleAdptInt& ) {};
    00083   };
    00084
    00091   template< class T >
    00092   class TePDIMtxDoubleAdpt : public TePDIMatrix< T >,
    00093     public TePDIMtxDoubleAdptInt
    00094   {
    00095     public :
    00096
    00098       typedef typename TePDIMatrix< T >::MemoryPolicy MemoryPolicy;
    00099
    00100       TePDIMtxDoubleAdpt() {};
    00101
    00102       ~TePDIMtxDoubleAdpt() {};
    00103
    00104       // Overloaded.
    00105       inline void getValue( const unsigned int& lin,
    00106         const unsigned int col, double& value ) const
    00107       {
    00108         TEAGN_DEBUG_CONDITION( col < TePDIMatrix< T >::GetColumns(),
    00109           "Invalid column" );
    00110
    00111         value = (double)TePDIMatrix< T >::getScanLine( lin )[ col ];
    00112       };
    00113
    00114       // Overloaded.
    00115       inline void setValue( const unsigned int& lin,
    00116         const unsigned int col, const double& value )
    00117       {
    00118         TEAGN_DEBUG_CONDITION( col < TePDIMatrix< T >::GetColumns(),
    00119           "Invalid column" );
    00120
    00121         TePDIMatrix< T >::getScanLine( lin )[ col ] = (T)value;
    00122       };
    00123
    00124       // Overloaded.
    00125       inline bool reset( unsigned int lines, unsigned int columns )
    00126       {
    00127         return TePDIMatrix< T >::Reset( lines, columns );
    00128       };
    00129
    00130       // Overloaded
    00131       inline unsigned int getNLines() const
    00132       {
    00133         return TePDIMatrix< T >::GetLines();
    00134       };
    00135
    00136       // Overloaded
    00137       inline unsigned int getNCols() const
    00138       {
    00139         return TePDIMatrix< T >::GetColumns();
    00140       };
    00141   };
    00142
    00143 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines