Commit e070b9e0 authored by Julien Malik's avatar Julien Malik
Browse files

ENH: rename VectorDataToImageFilter to VectorDataToMapFilter

parent 66e65a44
......@@ -16,8 +16,8 @@
=========================================================================*/
#ifndef __otbVectorDataToImageFilter_h
#define __otbVectorDataToImageFilter_h
#ifndef __otbVectorDataToMapFilter_h
#define __otbVectorDataToMapFilter_h
#include "itkImageSource.h"
#include "otbRGBAPixelConverter.h"
......@@ -29,7 +29,7 @@
namespace otb
{
/** \class VectorDataToImageFilter
/** \class VectorDataToMapFilter
* \brief <b>EXPERIMENTAL FEATURE</b> Render a vector data into an image
*
* To use this class, you need to compile the library with the option OTB_USE_MAPNIK
......@@ -58,11 +58,11 @@ namespace otb
*/
template <class TVectorData, class TImage>
class ITK_EXPORT VectorDataToImageFilter : public itk::ImageSource<TImage>
class ITK_EXPORT VectorDataToMapFilter : public itk::ImageSource<TImage>
{
public:
/** Standard class typedefs. */
typedef VectorDataToImageFilter Self;
typedef VectorDataToMapFilter Self;
typedef itk::ImageSource<TImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
......@@ -71,7 +71,7 @@ public:
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(VectorDataToImageFilter, ImageSource);
itkTypeMacro(VectorDataToMapFilter, ImageSource);
/** Some typedefs. */
typedef TVectorData VectorDataType;
......@@ -181,9 +181,9 @@ public:
protected:
/** Constructor */
VectorDataToImageFilter();
VectorDataToMapFilter();
/** Destructor */
virtual ~VectorDataToImageFilter() {}
virtual ~VectorDataToMapFilter() {}
/**PrintSelf method */
virtual void PrintSelf(std::ostream& os, itk::Indent indent) const;
......@@ -194,7 +194,7 @@ protected:
virtual void BeforeThreadedGenerateData();
private:
VectorDataToImageFilter(const Self &); //purposely not implemented
VectorDataToMapFilter(const Self &); //purposely not implemented
void operator =(const Self&); //purposely not implemented
void ProcessNode(InternalTreeNodeType * source, datasource_ptr mDatasource);
......@@ -245,7 +245,7 @@ private:
} // end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbVectorDataToImageFilter.txx"
#include "otbVectorDataToMapFilter.txx"
#endif
#endif
......@@ -16,11 +16,11 @@
=========================================================================*/
#ifndef __otbVectorDataToImageFilter_txx
#define __otbVectorDataToImageFilter_txx
#ifndef __otbVectorDataToMapFilter_txx
#define __otbVectorDataToMapFilter_txx
#include <sstream>
#include "otbVectorDataToImageFilter.h"
#include "otbVectorDataToMapFilter.h"
#include "itkImageRegionIterator.h"
#include "itkImageIteratorWithIndex.h"
#include "otbVectorDataStyle.h"
......@@ -99,8 +99,8 @@ static geom* create_geom(mapnik::eGeomType geom_type) { return new geom(geom_typ
* Constructor
*/
template <class TVectorData, class TImage>
VectorDataToImageFilter<TVectorData, TImage>
::VectorDataToImageFilter() :
VectorDataToMapFilter<TVectorData, TImage>
::VectorDataToMapFilter() :
m_StyleList(),
m_UseAsOverlay(true),
m_RenderingStyleType(OSM)
......@@ -119,7 +119,7 @@ VectorDataToImageFilter<TVectorData, TImage>
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::SetInput(const VectorDataType *input)
{
// Process object is not const-correct so the const_cast is required here
......@@ -129,7 +129,7 @@ VectorDataToImageFilter<TVectorData, TImage>
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::SetInput(unsigned int idx, const VectorDataType *input)
{
// Process object is not const-correct so the const_cast is required here
......@@ -138,8 +138,8 @@ VectorDataToImageFilter<TVectorData, TImage>
}
template <class TVectorData, class TImage>
const typename VectorDataToImageFilter<TVectorData, TImage>::VectorDataType *
VectorDataToImageFilter<TVectorData, TImage>
const typename VectorDataToMapFilter<TVectorData, TImage>::VectorDataType *
VectorDataToMapFilter<TVectorData, TImage>
::GetInput(void)
{
if (this->GetNumberOfInputs() < 1)
......@@ -152,8 +152,8 @@ VectorDataToImageFilter<TVectorData, TImage>
}
template <class TVectorData, class TImage>
const typename VectorDataToImageFilter<TVectorData, TImage>::VectorDataType *
VectorDataToImageFilter<TVectorData, TImage>
const typename VectorDataToMapFilter<TVectorData, TImage>::VectorDataType *
VectorDataToMapFilter<TVectorData, TImage>
::GetInput(unsigned int idx)
{
return static_cast<const TVectorData *>
......@@ -163,7 +163,7 @@ VectorDataToImageFilter<TVectorData, TImage>
//----------------------------------------------------------------------------
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::SetSpacing(const SpacingType& spacing)
{
if (this->m_Spacing != spacing)
......@@ -176,7 +176,7 @@ VectorDataToImageFilter<TVectorData, TImage>
//----------------------------------------------------------------------------
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::SetSpacing(const double spacing[2])
{
SpacingType s(spacing);
......@@ -186,7 +186,7 @@ VectorDataToImageFilter<TVectorData, TImage>
//----------------------------------------------------------------------------
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::SetSpacing(const float spacing[2])
{
itk::Vector<float, 2> sf(spacing);
......@@ -198,7 +198,7 @@ VectorDataToImageFilter<TVectorData, TImage>
//----------------------------------------------------------------------------
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::SetOrigin(const double origin[2])
{
OriginType p(origin);
......@@ -208,7 +208,7 @@ VectorDataToImageFilter<TVectorData, TImage>
//----------------------------------------------------------------------------
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::SetOrigin(const float origin[2])
{
itk::Point<float, 2> of(origin);
......@@ -222,7 +222,7 @@ VectorDataToImageFilter<TVectorData, TImage>
*/
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::GenerateOutputInformation()
{
// we can't call the superclass method here.
......@@ -259,7 +259,7 @@ VectorDataToImageFilter<TVectorData, TImage>
*/
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::BeforeThreadedGenerateData(void)
{
......@@ -427,7 +427,7 @@ VectorDataToImageFilter<TVectorData, TImage>
*/
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::GenerateData(void)
{
......@@ -538,7 +538,7 @@ VectorDataToImageFilter<TVectorData, TImage>
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::ProcessNode(InternalTreeNodeType * source, datasource_ptr mDatasource)
{
typedef typename VectorDataType::DataNodeType DataNodeType;
......@@ -680,25 +680,25 @@ VectorDataToImageFilter<TVectorData, TImage>
case FEATURE_MULTIPOINT:
{
itkExceptionMacro(
<< "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToImageFilter(), please request for it");
<< "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToMapFilter(), please request for it");
break;
}
case FEATURE_MULTILINE:
{
itkExceptionMacro(
<< "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToImageFilter(), please request for it");
<< "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToMapFilter(), please request for it");
break;
}
case FEATURE_MULTIPOLYGON:
{
itkExceptionMacro(
<< "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToImageFilter(), please request for it");
<< "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToMapFilter(), please request for it");
break;
}
case FEATURE_COLLECTION:
{
itkExceptionMacro(
<< "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToImageFilter(), please request for it");
<< "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToMapFilter(), please request for it");
break;
}
}
......@@ -710,7 +710,7 @@ VectorDataToImageFilter<TVectorData, TImage>
*/
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
VectorDataToMapFilter<TVectorData, TImage>
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os, indent);
......
......@@ -24,10 +24,10 @@
void RegisterTests()
{
REGISTER_TEST(otbVectorDataToImageFilterNew);
REGISTER_TEST(otbVectorDataToImageFilter);
REGISTER_TEST(otbVectorDataToImageFilterBinary);
REGISTER_TEST(otbVectorDataToImageFilterSensorModel);
REGISTER_TEST(otbVectorDataToImageFilterWorld);
REGISTER_TEST(otbVectorDataToImageFilterNoFonts);
REGISTER_TEST(otbVectorDataToMapFilterNew);
REGISTER_TEST(otbVectorDataToMapFilter);
REGISTER_TEST(otbVectorDataToMapFilterBinary);
REGISTER_TEST(otbVectorDataToMapFilterSensorModel);
REGISTER_TEST(otbVectorDataToMapFilterWorld);
REGISTER_TEST(otbVectorDataToMapFilterNoFonts);
}
......@@ -26,9 +26,9 @@
#include "itkRGBAPixel.h"
#include "otbImage.h"
#include "otbVectorDataToImageFilter.h"
#include "otbVectorDataToMapFilter.h"
int otbVectorDataToImageFilter(int argc, char * argv[])
int otbVectorDataToMapFilter(int argc, char * argv[])
{
if (argc < 4)
......@@ -85,8 +85,8 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
extractROI->SetRegion(region);
extractROI->SetInput(projection->GetOutput());
typedef otb::VectorDataToImageFilter<VectorDataType, ImageType> VectorDataToImageFilterType;
VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New();
typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType;
VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New();
vectorDataRendering->SetInput(extractROI->GetOutput());
vectorDataRendering->SetSize(size);
......@@ -106,7 +106,7 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
return EXIT_SUCCESS;
}
int otbVectorDataToImageFilterBinary(int argc, char * argv[])
int otbVectorDataToMapFilterBinary(int argc, char * argv[])
{
if (argc < 3)
......@@ -163,14 +163,14 @@ int otbVectorDataToImageFilterBinary(int argc, char * argv[])
extractROI->SetRegion(region);
extractROI->SetInput(projection->GetOutput());
typedef otb::VectorDataToImageFilter<VectorDataType, ImageType> VectorDataToImageFilterType;
VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New();
typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType;
VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New();
vectorDataRendering->SetInput(extractROI->GetOutput());
vectorDataRendering->SetSize(size);
vectorDataRendering->SetOrigin(origin);
vectorDataRendering->SetSpacing(spacing);
vectorDataRendering->SetRenderingStyleType(VectorDataToImageFilterType::Binary);
vectorDataRendering->SetRenderingStyleType(VectorDataToMapFilterType::Binary);
//Save the image in a file
typedef otb::ImageFileWriter<ImageType> WriterType;
......
......@@ -19,17 +19,17 @@
#include "itkRGBAPixel.h"
#include "otbImage.h"
#include "otbVectorData.h"
#include "otbVectorDataToImageFilter.h"
#include "otbVectorDataToMapFilter.h"
int otbVectorDataToImageFilterNew(int argc, char * argv[])
int otbVectorDataToMapFilterNew(int argc, char * argv[])
{
typedef otb::VectorData<> VectorDataType;
typedef itk::RGBAPixel<unsigned char> PixelType;
typedef otb::Image<PixelType, 2> ImageType;
typedef otb::VectorDataToImageFilter<VectorDataType, ImageType> VectorDataToImageFilterType;
VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New();
typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType;
VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New();
std::cout << vectorDataRendering << std::endl;
......
......@@ -26,9 +26,9 @@
#include "itkRGBAPixel.h"
#include "otbImage.h"
#include "otbVectorDataToImageFilter.h"
#include "otbVectorDataToMapFilter.h"
int otbVectorDataToImageFilterNoFonts(int argc, char * argv[])
int otbVectorDataToMapFilterNoFonts(int argc, char * argv[])
{
if (argc < 3)
......@@ -85,8 +85,8 @@ int otbVectorDataToImageFilterNoFonts(int argc, char * argv[])
extractROI->SetRegion(region);
extractROI->SetInput(projection->GetOutput());
typedef otb::VectorDataToImageFilter<VectorDataType, ImageType> VectorDataToImageFilterType;
VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New();
typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType;
VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New();
vectorDataRendering->SetInput(extractROI->GetOutput());
vectorDataRendering->SetSize(size);
......
......@@ -27,9 +27,9 @@
#include "itkRGBAPixel.h"
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbVectorDataToImageFilter.h"
#include "otbVectorDataToMapFilter.h"
int otbVectorDataToImageFilterSensorModel(int argc, char * argv[])
int otbVectorDataToMapFilterSensorModel(int argc, char * argv[])
{
if (argc < 5)
......@@ -88,8 +88,8 @@ int otbVectorDataToImageFilterSensorModel(int argc, char * argv[])
std::cout << "Origin: " << origin << std::endl;
std::cout << "Spacing: " << spacing << std::endl;
typedef otb::VectorDataToImageFilter<VectorDataType, ImageType> VectorDataToImageFilterType;
VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New();
typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType;
VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New();
vectorDataRendering->SetInput(projection->GetOutput());
vectorDataRendering->SetSize(size);
......
......@@ -26,9 +26,9 @@
#include "itkRGBAPixel.h"
#include "otbImage.h"
#include "otbVectorDataToImageFilter.h"
#include "otbVectorDataToMapFilter.h"
int otbVectorDataToImageFilterWorld(int argc, char * argv[])
int otbVectorDataToMapFilterWorld(int argc, char * argv[])
{
if (argc < 11)
......@@ -76,8 +76,8 @@ int otbVectorDataToImageFilterWorld(int argc, char * argv[])
spacing[0] = atof(argv[8]);
spacing[1] = atof(argv[9]);
typedef otb::VectorDataToImageFilter<VectorDataType, ImageType> VectorDataToImageFilterType;
VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New();
typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType;
VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New();
vectorDataRendering->SetInput(0, projection0->GetOutput());
vectorDataRendering->SetInput(1, projection1->GetOutput());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment