Commit d45cab79 authored by Emmanuel Christophe's avatar Emmanuel Christophe

Compilation ok

parent 0af647de
......@@ -14,7 +14,7 @@ ENDIF(OTB_FOUND)
INCLUDE_DIRECTORIES("/home/christop/slash/include" )
INCLUDE_DIRECTORIES("/usr/include/freetype2" )
LINK_DIRECTORIES("/home/christop/slash/lib64")
LINK_DIRECTORIES("/home/christop/slash/lib")
......
......@@ -35,7 +35,7 @@ int main(int argc, char * argv[])
//Save the image in a file
typedef otb::ImageFileWriter<ImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetInput(vectorDataRendering);
writer->SetInput(vectorDataRendering->GetOutput());
writer->SetFileName(argv[2]);
writer->Update();
......
......@@ -30,11 +30,44 @@ namespace otb
template <class TVectorData, class TImage>
class VectorDataToImageFilter
: public itk::ImageSource
class ITK_EXPORT VectorDataToImageFilter : public itk::ImageSource<TImage>
{
public:
/** Standard class typedefs. */
typedef VectorDataToImageFilter Self;
typedef itk::ImageSource<TImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(VectorDataToImageFilter, ImageSource);
/** Some typedefs. */
typedef TVectorData VectorDataType;
typedef TImage ImageType;
virtual void SetInput( const VectorDataType *input);
const VectorDataType * GetInput(void);
protected:
/** Constructor */
VectorDataToImageFilter();
/** Destructor */
virtual ~VectorDataToImageFilter() {};
/**PrintSelf method */
virtual void PrintSelf(std::ostream& os, itk::Indent indent) const;
virtual void GenerateData(void);
private:
VectorDataToImageFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
}; // end class
......
......@@ -19,12 +19,72 @@
#ifndef __otbVectorDataToImageFilter_txx
#define __otbVectorDataToImageFilter_txx
#include "otbVectorDataToImageFilter.h"
namespace otb
{
/**
* Constructor
*/
template <class TVectorData, class TImage>
VectorDataToImageFilter<TVectorData, TImage>
::VectorDataToImageFilter()
{
this->SetNumberOfRequiredInputs( 1 );
}
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
::SetInput(const VectorDataType *input)
{
// Process object is not const-correct so the const_cast is required here
this->itk::ProcessObject::SetNthInput(0,
const_cast< VectorDataType * >( input ) );
}
template <class TVectorData, class TImage>
const typename VectorDataToImageFilter<TVectorData, TImage>::VectorDataType *
VectorDataToImageFilter<TVectorData, TImage>
::GetInput(void)
{
if (this->GetNumberOfInputs() < 1)
{
return 0;
}
return static_cast<const TVectorData * >
(this->itk::ProcessObject::GetInput(0) );
}
/**
* Generate Data
*/
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
::GenerateData(void)
{
}
/**
* PrintSelf Method
*/
template <class TVectorData, class TImage>
void
VectorDataToImageFilter<TVectorData, TImage>
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os, indent);
}
}
#endif
\ No newline at end of file
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