Skip to content
Snippets Groups Projects
Commit 0075ab88 authored by Jordi Inglada's avatar Jordi Inglada
Browse files

ENH: base class for GISTable functions

parent 54762465
No related branches found
No related tags found
No related merge requests found
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __itkGISTableFunction_h
#define __itkGISTableFunction_h
#include "itkFunctionBase.h"
#include "otbGISTable.h"
namespace otb
{
/** \class GISTableFunction
* \brief Evaluates a const transaction on a GISTable
*
* GISTableFunction is a baseclass for all objects that evaluate
* a const transaction on a GISTable.
*
* The input image is set via method SetInputTable().
*
*
* \sa GISTable
* \sa GISConnection
*
* \ingroup GISTableFunctions
*/
template <
class TInputTable,
class TOutput
>
class ITK_EXPORT GISTableFunction :
public FunctionBase< TInputTable,
TOutput >
{
public:
/** Dimension underlying input image. */
itkStaticConstMacro(TableDimension, unsigned int,
TInputTable::SpatialDimension);
/** Standard class typedefs. */
typedef GISTableFunction Self;
typedef FunctionBase<
TInputTable,
TOutput > Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Run-time type information (and related methods). */
itkTypeMacro(GISTableFunction, FunctionBase);
/** InputTableType typedef support. */
typedef TInputTable InputTableType;
/** Connection typedef support */
typedef typename InputTableType::ConnectionType ConnectionType;
/** InputImagePointer typedef support */
typedef typename InputTableType::ConstPointer InputTableConstPointer;
/** OutputType typedef support. */
typedef TOutput OutputType;
/** Set the input table. */
virtual void SetInputTable( const InputTableType* ptr );
/** Get the input image. */
const InputTableType * GetInputTable() const
{ return m_Table.GetPointer(); }
/** Evaluate the function.
* Subclasses must provide this method. */
virtual TOutput Evaluate( ) const = 0;
protected:
GISTableFunction();
~GISTableFunction() {}
void PrintSelf(std::ostream& os, Indent indent) const;
/** Const pointer to the input image. */
InputTableConstPointer m_Image;
private:
GISTableFunction(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
};
} // end namespace otb
#if OTB_MANUAL_INSTANTIATION
# include "itkGISTableFunction.txx"
#endif
#endif
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbGISTableFunction_txx
#define __otbGISTableFunction_txx
#include "otbGISTableFunction.h"
namespace otb
{
/**
* Constructor
*/
template <class TInputTable, class TOutput>
GISTableFunction<TInputTable, TOutput>
::GISTableFunction()
{
m_Table = NULL;
}
/**
* Standard "PrintSelf" method
*/
template <class TInputTable, class TOutput>
void
GISTableFunction<TInputTable, TOutput>
::PrintSelf(
std::ostream& os,
Indent indent) const
{
Superclass::PrintSelf( os, indent );
os << indent << "InputTable: " << m_Table.GetPointer() << std::endl;
}
/**
* Initialize by setting the input table
*/
template <class TInputTable, class TOutput>
void
GISTableFunction<TInputTable, TOutput>
::SetInputTable(
const InputTableType* ptr )
{
// set the input table
m_Table = ptr;
}
} // end namespace itk
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment