Skip to content
Snippets Groups Projects
Commit aaa26d4d authored by Julien Malik's avatar Julien Malik
Browse files

MRG

parents 98cd5225 52af77b5
Branches
Tags
No related merge requests found
......@@ -51,7 +51,7 @@ ENDIF(OTB_FOUND)
OPTION(OTB_USE_QT "Generate Qt wrappers for Applications" OFF)
OPTION(OTB_USE_QT "Generate Qt wrappers for Applications" ON)
IF(OTB_USE_QT)
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTXML 1)
......
FILE(GLOB srcs "*.cxx")
ADD_LIBRARY(otbWrapperCore ${srcs})
TARGET_LINK_LIBRARIES(otbWrapperCore OTBCommon OTBIO)
ADD_LIBRARY(OTBWrapperCore ${srcs})
TARGET_LINK_LIBRARIES(OTBWrapperCore OTBCommon OTBIO)
......@@ -23,15 +23,11 @@ namespace otb
namespace Wrapper
{
Application::Application()
{
//m_ParameterList = ParameterList::New();
}
Application::Application(): m_Name(""), m_Description("")
{}
Application::~Application()
{
}
{}
}
}
......
......@@ -19,8 +19,10 @@
#define __otbWrapperApplication_h
#include <string>
#include "otbMacro.h"
#include "itkObject.h"
#include "otbWrapperParameterList.h"
#include "itkObjectFactory.h"
namespace otb
{
......@@ -35,57 +37,53 @@ namespace Wrapper
class ITK_EXPORT Application : public itk::Object
{
public:
/** Standard class typedefs. */
typedef Application Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Standard class typedefs. */
typedef Application Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Defining ::New() static method */
itkNewMacro(Self);
/** Defining ::New() static method */
itkNewMacro(Self);
/** RTTI support */
itkTypeMacro(Application,itk::Object);
/** RTTI support */
itkTypeMacro(Application,itk::Object);
std::string GetName()
{
return m_Name;
}
/** Set the parameter name */
itkSetStringMacro(Name);
std::string GetDescription()
{
return m_Description;
}
/** Get the parameter name */
itkGetStringMacro(Name);
ParameterList* GetParameterList();
/** Set the parameter description */
itkSetStringMacro(Description);
virtual int Execute() { return 0;}
/** Get the parameter description */
itkGetStringMacro(Description);
protected:
Application();
virtual ~Application();
ParameterList* GetParameterList()
{
return m_ParameterList;
}
private:
Application(const Application &); //purposely not implemented
void operator =(const Application&); //purposely not implemented
virtual int Execute() {return 0;}
void SetName(std::string s)
{
m_Name = s;
}
protected:
/** Constructor */
Application();
virtual ~Application();
void SetDescription(std::string s)
{
m_Description = s;
}
private:
Application(const Application &); //purposely not implemented
void operator =(const Application&); //purposely not implemented
std::string m_Name;
std::string m_Description;
ParameterList::Pointer m_ParameterList;
};
std::string m_Name;
std::string m_Description;
ParameterList::Pointer m_ParameterList;
}; //end class
}
}
} // end namespace Wrapper
} //end namespace otb
#endif // __otbWrapperApplicationOptions_h_
#endif // __otbWrapperApplication_h_
......@@ -2,4 +2,4 @@
FILE(GLOB srcs "*.cxx")
ADD_LIBRARY(OTBWrapperQtWidget ${srcs})
TARGET_LINK_LIBRARIES(OTBWrapperQtWidget OTBCommon OTBIO otbWrapperCore)
TARGET_LINK_LIBRARIES(OTBWrapperQtWidget OTBCommon OTBIO OTBWrapperCore)
......@@ -37,6 +37,12 @@ ADD_TEST(owTvNumericalParameter ${OTB_WRAPPER_TESTS}
"mykey"
"my description"
)
# Application class test
ADD_TEST(owTuApplication ${OTB_WRAPPER_TESTS}
otbWrapperApplicationNew
)
# ----------------Source files CXX -----------------------------------
SET(Wrapper_SRCS
......@@ -44,10 +50,10 @@ otbWrapperTests.cxx
otbWrapperParameterTest.cxx
otbWrapperNumericalParameterTest.cxx
otbWrapperEmptyParameterTest.cxx
#otbWrapperApplicationTest.cxx
otbWrapperApplicationTest.cxx
otbWrapperParameterListTest.cxx
)
ADD_EXECUTABLE(otbWrapperTests ${Wrapper_SRCS})
TARGET_LINK_LIBRARIES(otbWrapperTests OTBIO OTBCommon ITKIO ITKCommon OTBTesting)
TARGET_LINK_LIBRARIES(otbWrapperTests OTBIO OTBCommon ITKIO ITKCommon OTBTesting OTBWrapperCore)
/*=========================================================================
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.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "otbWrapperApplication.h"
int otbWrapperApplicationNew(int argc, char* argv[])
{
typedef otb::Wrapper::Application ApplicationType;
ApplicationType::Pointer application = ApplicationType::New();
return EXIT_SUCCESS;
}
......@@ -31,6 +31,6 @@ void RegisterTests()
REGISTER_TEST(otbWrapperNumericalParameterNew);
REGISTER_TEST(otbWrapperNumericalParameterTest1);
REGISTER_TEST(otbWrapperEmptyParameterNew);
//REGISTER_TEST(otbWrapperApplicationNew);
REGISTER_TEST(otbWrapperApplicationNew);
REGISTER_TEST(otbWrapperParameterListNew);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment