Skip to content
Snippets Groups Projects
Commit 671d566e authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: Modified WrapperInputVectorDataParam loading, added to Qt widget factory

parent ff137cea
No related branches found
No related tags found
No related merge requests found
......@@ -66,8 +66,38 @@ InputVectorDataParameter::SetFromFileName(const std::string& filename)
VectorDataType*
InputVectorDataParameter::GetVectorData() const
InputVectorDataParameter::GetVectorData()
{
// 2 cases : the user sets a filename vs. the user sets a vector data
//////////////////////// Filename case:
if (!m_FileName.empty())
{
//typedef otb::ImageFileReader<TOutputImage> ReaderType;
//typename ReaderType::Pointer reader = ReaderType::New();
m_Reader = VectorDataFileReaderType::New();
m_Reader->SetFileName(m_FileName);
try
{
// Update the viewer here to load the file => no streaming for VectorData
m_Reader->Update();
}
catch (itk::ExceptionObject & err)
{
this->ClearValue();
}
m_VectorData = m_Reader->GetOutput();
}
//////////////////////// VectorData case:
else
{
if (m_VectorData.IsNull())
{
// Else : error
itkExceptionMacro("No input vector data or filename detected...");
}
}
return m_VectorData;
}
......
......@@ -52,7 +52,7 @@ public:
bool SetFromFileName(const std::string& filename);
itkGetConstMacro(FileName, std::string);
VectorDataType* GetVectorData() const;
VectorDataType* GetVectorData();
void SetVectorData(VectorDataType* vectorData);
......
......@@ -38,6 +38,7 @@
#include "otbWrapperQtWidgetDirectoryParameter.h"
#include "otbWrapperQtWidgetParameterGroup.h"
#include "otbWrapperQtWidgetInputVectorDataListParameter.h"
#include "otbWrapperQtWidgetInputVectorDataParameter.h"
#include "otbWrapperQtWidgetRAMParameter.h"
namespace otb
......@@ -101,6 +102,7 @@ QtWidgetParameterFactory::CreateQtWidget( Parameter* param, QtWidgetModel* model
CREATEWIDGET(ComplexOutputImageParameter, QtWidgetComplexOutputImageParameter)
CREATEWIDGET(InputImageListParameter, QtWidgetInputImageListParameter)
CREATEWIDGET(InputVectorDataListParameter, QtWidgetInputVectorDataListParameter)
CREATEWIDGET(InputVectorDataParameter, QtWidgetInputVectorDataParameter)
CREATEWIDGET(OutputImageParameter, QtWidgetOutputImageParameter)
CREATEWIDGET(OutputVectorDataParameter, QtWidgetOutputVectorDataParameter)
CREATEWIDGET(EmptyParameter, QtWidgetEmptyParameter)
......
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