Commit 6289b3ef authored by Rashad Kanavath's avatar Rashad Kanavath

COMP: add export macro for shared library build

parent bb50cf4f
......@@ -33,7 +33,7 @@ namespace otb
*
* \ingroup OTBCurlAdapters
*/
class ITK_EXPORT CurlHelper : public CurlHelperInterface
class OTBCurlAdapters_EXPORT CurlHelper : public CurlHelperInterface
{
public:
/** Standard class typedefs. */
......@@ -46,11 +46,11 @@ public:
itkNewMacro(Self);
bool TestUrlAvailability(const std::string& url) const ITK_OVERRIDE;
bool IsCurlReturnHttpError(const std::string& url) const;
int RetrieveFile(const std::ostringstream& urlStream, std::string filename) const ITK_OVERRIDE;
int RetrieveFile(const std::string& urlString, std::string filename) const ITK_OVERRIDE;
int RetrieveUrlInMemory(const std::string& urlString, std::string& output) const ITK_OVERRIDE;
......@@ -60,7 +60,7 @@ public:
int maxConnect) const ITK_OVERRIDE;
itkGetMacro(Timeout,long int);
itkSetMacro(Timeout,long int);
protected:
......
......@@ -21,6 +21,7 @@
#include <iosfwd>
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "OTBCurlAdaptersExport.h"
namespace otb
{
......@@ -34,7 +35,7 @@ namespace otb
*
* \ingroup OTBCurlAdapters
*/
class ITK_EXPORT CurlHelperInterface : public itk::Object
class OTBCurlAdapters_EXPORT CurlHelperInterface : public itk::Object
{
public:
/** Standard class typedefs. */
......
......@@ -22,11 +22,14 @@
#include <boost/shared_ptr.hpp>
class OGRFieldDefn;
class OGRFeature;
#if defined(_MSC_VER)
#pragma warning ( push )
#pragma warning ( disable: 4251 )
#include "ogr_core.h" // OGR enums
#pragma warning ( pop )
#else
#include "ogr_core.h" // OGR enums
#endif
#include "itkIndent.h"
#include "OTBGdalAdaptersExport.h"
......@@ -173,7 +176,7 @@ public:
/** \copydoc Field::ogr() const */
OGRField & ogr();
private:
/**\name Unchecked definitions
* All the definitions that follow do the real work. However, they are not the
......@@ -208,11 +211,11 @@ private:
* All the fields decoding is at the wrong place (\c OGRFeature instead of
* \c OGRField) => need for an index.
*/
int m_index;
};
}
}
} // end namespace otb::ogr
#ifndef OTB_MANUAL_INSTANTIATION
......
......@@ -20,6 +20,7 @@
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "OTBOSSIMAdaptersExport.h"
class ossimLocalTm;
//class ossimDate;
......@@ -36,7 +37,7 @@ namespace otb
*
* \ingroup OTBOSSIMAdapters
**/
class DateTimeAdapter : public itk::Object
class OTBOSSIMAdapters_EXPORT DateTimeAdapter : public itk::Object
{
public:
/** Standard class typedefs. */
......@@ -50,35 +51,35 @@ public:
/** Run-time type information (and related methods). */
itkTypeMacro(DateTimeAdapter, itk::Object);
/** Year Accessor*/
int GetYear();
/** Month Accessor*/
int GetMonth();
/** Day Accessor*/
int GetDay();
/** Hour Accessor*/
int GetHour();
/** Minute Accessor*/
int GetMinute();
/** Seconds Accessor*/
double GetSeconds() const;
/** Set the date and time from an Iso8601 string
* Return true if the date is valid
*/
bool SetFromIso8601(const std::string &date);
/** Return the delta with an other date, expressed in seconds */
double GetDeltaInSeconds(const DateTimeAdapter *pastDate);
// TODO : add print self function
protected:
DateTimeAdapter();
~DateTimeAdapter() ITK_OVERRIDE;
......
......@@ -104,7 +104,7 @@ namespace MetaDataKey
};
KeyType GetKeyType(const std::string& name);
KeyType OTBOSSIMAdapters_EXPORT GetKeyType(const std::string& name);
typedef std::vector<double> VectorType;
typedef std::vector<bool> BoolVectorType;
......@@ -119,7 +119,7 @@ namespace MetaDataKey
*
* \ingroup OTBOSSIMAdapters
*/
class ITK_EXPORT OTB_GCP
class OTBOSSIMAdapters_EXPORT OTB_GCP
{
public:
......
set(DOCUMENTATION "TODO")
otb_module(OTBCommandLineParser
ENABLE_SHARED
DEPENDS
OTBCommon
OTBITK
......
......@@ -29,6 +29,8 @@
#include <string>
#include <boost/cstdint.hpp>
#include "OTBCommonExport.h"
namespace otb
{
/**
......@@ -41,7 +43,7 @@ namespace otb
* Please refer to each static method documentation for available
* configuration values and related environment variables.
*/
class ConfigurationManager
class OTBCommon_EXPORT ConfigurationManager
{
public:
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
......@@ -51,7 +53,7 @@ public:
#endif
/**
* DEMDirectory is a directory were DEM tiles are stored.
* DEMDirectory is a directory were DEM tiles are stored.
*
* If environment variable OTB_DEM_DIRECTORY is defined,
* returns it contents as a string
......@@ -74,7 +76,7 @@ public:
*
* If environment variable OTB_MAX_RAM_HINT is defined and could be
* converted to int, return its content as a 64 bits unsigned int.
* Else, returns default value, which is 128 Mb
* Else, returns default value, which is 128 Mb
*
*/
static RAMValueType GetMaxRAMHint();
......
......@@ -25,9 +25,11 @@
#include "itkProcessObject.h"
#include "itkTimeProbe.h"
#include "OTBCommonExport.h"
namespace otb
{
{
/** \class FilterWatcherBase
* \brief This class is an abstract class
* Provides an interface to progress task mechanic
......@@ -40,7 +42,7 @@ namespace otb
*
* \ingroup OTBCommon
*/
class /*ITK_EXPORT*/ FilterWatcherBase
class OTBCommon_EXPORT FilterWatcherBase
{
public:
......
......@@ -48,7 +48,7 @@ namespace otb
*
* \ingroup OTBCommon
*/
class /*ITK_EXPORT*/ StandardFilterWatcher : public FilterWatcherBase
class OTBCommon_EXPORT StandardFilterWatcher : public FilterWatcherBase
{
public:
......
......@@ -48,7 +48,7 @@ namespace otb
*
* \ingroup OTBCommon
*/
class /*ITK_EXPORT*/ StandardOneLineFilterWatcher : public FilterWatcherBase
class OTBCommon_EXPORT StandardOneLineFilterWatcher : public FilterWatcherBase
{
public:
......
......@@ -48,7 +48,7 @@ namespace otb
*
* \ingroup OTBCommon
*/
class /*ITK_EXPORT*/ StandardWriterWatcher : public WriterWatcherBase
class OTBCommon_EXPORT StandardWriterWatcher : public WriterWatcherBase
{
public:
......
......@@ -24,6 +24,8 @@
#include "itksys/SystemTools.hxx"
#include "itkMacro.h"
#include "OTBCommonExport.h"
namespace otb
{
......@@ -35,7 +37,7 @@ namespace otb
*
* \ingroup OTBCommon
*/
class ITK_EXPORT System
class OTBCommon_EXPORT System
{
public:
......
......@@ -19,6 +19,7 @@
#define otbUtils_h
#include "itkMacro.h"
#include "OTBCommonExport.h"
namespace otb
{
......@@ -34,10 +35,11 @@ namespace otb
namespace Utils
{
/** Check that the values for lon, lat are reasonable */
bool IsLonLatValid(double lon, double lat);
bool OTBCommon_EXPORT IsLonLatValid(double lon, double lat);
template <class T>
inline std::string ConvertToString (const T& v)
inline std::string
OTBCommon_EXPORT ConvertToString (const T& v)
{
std::stringstream s;
s << v;
......
......@@ -25,6 +25,8 @@
#include "itkProcessObject.h"
#include "itkTimeProbe.h"
#include "OTBCommonExport.h"
namespace otb
{
......@@ -43,7 +45,7 @@ namespace otb
*
* \ingroup OTBCommon
*/
class /*ITK_EXPORT*/ WriterWatcherBase
class OTBCommon_EXPORT WriterWatcherBase
{
public:
......
......@@ -21,6 +21,7 @@
#include <cassert>
#include "vnl/vnl_math.h"
#include <itkVariableLengthVector.h>
#include "OTBMetadataExport.h"
namespace itk
{
......@@ -30,17 +31,17 @@ class MetaDataDictionary;
namespace otb
{
/**
/**
* Reads no data flag from the MetaDataDictionnary dict to flags and values
* vectors. Returns true upon success.
* vectors. Returns true upon success.
*/
bool ReadNoDataFlags(const itk::MetaDataDictionary& dict, std::vector<bool> & flags, std::vector<double> & values);
bool OTBMetadata_EXPORT ReadNoDataFlags(const itk::MetaDataDictionary& dict, std::vector<bool> & flags, std::vector<double> & values);
/**
/**
* Write no data flags to the MetaDataDictionnary dict from flags and values
* vectors. Returns true upon success.
* vectors. Returns true upon success.
*/
void WriteNoDataFlags(const std::vector<bool> & flags, const std::vector<double> & values, itk::MetaDataDictionary& dict);
void OTBMetadata_EXPORT WriteNoDataFlags(const std::vector<bool> & flags, const std::vector<double> & values, itk::MetaDataDictionary& dict);
/**
* Test if the pixel corresponds to a no data pixel according to a
......@@ -52,7 +53,8 @@ void WriteNoDataFlags(const std::vector<bool> & flags, const std::vector<double>
* value for each band. If flag is 0, the value will be ignored.
* \param nanIsNoData If true, NaN values will be reported as no-data.
*/
template<typename T> bool IsNoData(const T & pixel, const
template<typename T> bool
OTBMetadata_EXPORT IsNoData(const T & pixel, const
std::vector<bool> & flags, const std::vector<double> & values, bool nanIsNoData = false) {
assert(flags.size()>0);
assert(values.size()>0);
......@@ -75,19 +77,20 @@ template<typename T> bool IsNoData(const T & pixel, const
* Reads a pixel and change the no data value if it is found. No data
* value is changed either if the pixel value is NaN or if the pixel
* value equals the no data value and flag is true.
*
*
* \param pixel The pixel to process \param flags A vector of size > 1
* containing a flag per band to indicate if a no data value is
* available for this band
* \param values A vector of size > 1 corresponding to the current no data
* value for each band. If flag is 0, the value will be ignored.
* \param newValues A vector of size > 1 corresponding to the new no data
* value for each band. If flag is 0, the value will be ignored
* value for each band. If flag is 0, the value will be ignored
* \param nanIsNoData If true, NaN values will be considered as no-data
* and changed as well.
*
*/
template<typename T> T ChangeNoData(const T & pixel, const
template<typename T> T
OTBMetadata_EXPORT ChangeNoData(const T & pixel, const
std::vector<bool> & flags,
const std::vector<double> & values,
const std::vector<double> & newValues,
......@@ -95,7 +98,7 @@ template<typename T> T ChangeNoData(const T & pixel, const
assert(flags.size()>0);
assert(values.size()>0);
assert(newValues.size()>0);
if(nanIsNoData && vnl_math_isnan(pixel))
{
return static_cast<T>(newValues[0]);
......@@ -112,7 +115,7 @@ template<typename T> T ChangeNoData(const T & pixel, const
/**
* Specialization of IsNoData function to handle itk::VariableLengthVector
*/
template <typename T> bool IsNoData(const itk::VariableLengthVector<T> & pixel, const std::vector<bool> & flags, const std::vector<double> & values, bool nanIsNoData = false)
template <typename T> bool OTBMetadata_EXPORT IsNoData(const itk::VariableLengthVector<T> & pixel, const std::vector<bool> & flags, const std::vector<double> & values, bool nanIsNoData = false)
{
assert(flags.size()>=pixel.Size());
assert(values.size()>=pixel.Size());
......@@ -131,7 +134,8 @@ template <typename T> bool IsNoData(const itk::VariableLengthVector<T> & pixel,
/**
* Specialization of ChangeNoData function to handle itk::VariableLengthVector
*/
template <typename T> itk::VariableLengthVector<T> ChangeNoData(const itk::VariableLengthVector<T> & pixel,
template <typename T> itk::VariableLengthVector<T>
OTBMetadata_EXPORT ChangeNoData(const itk::VariableLengthVector<T> & pixel,
const std::vector<bool> & flags,
const std::vector<double> & values,
const std::vector<double> & newValues,
......@@ -142,7 +146,7 @@ template <typename T> itk::VariableLengthVector<T> ChangeNoData(const itk::Varia
assert(newValues.size()>=pixel.Size());
itk::VariableLengthVector<T> outPixel(pixel.Size());
for(unsigned int i = 0; i < pixel.Size();++i)
{
if((nanIsNoData && vnl_math_isnan(pixel[i])) || (flags[i] && (pixel[i] == values[i])))
......
......@@ -21,6 +21,7 @@
#include "itkPoint.h"
#include "itkMultiThreader.h"
#include "otbCurlHelperInterface.h"
#include "OTBCartoExport.h"
namespace otb
{
......@@ -36,7 +37,7 @@ namespace otb
* \ingroup OTBCarto
*/
class ITK_EXPORT CoordinateToName : public itk::Object
class OTBCarto_EXPORT CoordinateToName : public itk::Object
{
public:
/** Standard class typedefs. */
......
......@@ -19,6 +19,7 @@
#define otbPlaceNameToLonLat_h
#include "otbCurlHelperInterface.h"
#include "OTBCartoExport.h"
namespace otb
{
......@@ -31,7 +32,7 @@ namespace otb
* \ingroup OTBCarto
*/
class ITK_EXPORT PlaceNameToLonLat : public itk::Object
class OTBCarto_EXPORT PlaceNameToLonLat : public itk::Object
{
public:
/** Standard class typedefs. */
......
......@@ -29,7 +29,7 @@ namespace otb
*
* \ingroup OTBSupervised
*/
class CV_EXPORTS_W CvRTreesWrapper : public CvRTrees
class OTBSupervised_EXPORT CvRTreesWrapper : public CvRTrees
{
public:
typedef std::vector<unsigned int> VotesVectorType;
......@@ -37,25 +37,25 @@ public:
~CvRTreesWrapper() ITK_OVERRIDE;
/** Compute the number of votes for each class. */
void get_votes(const cv::Mat& sample,
void get_votes(const cv::Mat& sample,
const cv::Mat& missing,
VotesVectorType& vote_count) const;
/** Predict the confidence of the classifcation by computing the proportion
of trees which voted for the majority class.
*/
float predict_confidence(const cv::Mat& sample,
const cv::Mat& missing =
float predict_confidence(const cv::Mat& sample,
const cv::Mat& missing =
cv::Mat()) const;
/** Predict the confidence margin of the classifcation by computing the
/** Predict the confidence margin of the classifcation by computing the
difference in votes between the first and second most voted classes.
This measure is preferred to the proportion of votes of the majority
class, since it provides information about the conflict between the
most likely classes.
*/
float predict_margin(const cv::Mat& sample,
const cv::Mat& missing =
float predict_margin(const cv::Mat& sample,
const cv::Mat& missing =
cv::Mat()) const;
};
......
......@@ -38,7 +38,7 @@
#include <opencv2/ml/ml.hpp>
#endif
#include "OTBSupervisedExport.h"
#include "itkListSample.h"
......
......@@ -22,7 +22,7 @@
#include "itkDataObject.h"
#include "itkMacro.h"
#include "itkObjectFactory.h"
#include "OTBSimulationExport.h"
namespace otb
{
......@@ -34,7 +34,7 @@ namespace otb
* \ingroup OTBSimulation
*/
class ITK_EXPORT LeafParameters : public itk::DataObject
class OTBSimulation_EXPORT LeafParameters : public itk::DataObject
{
public:
/** Standard class typedefs */
......
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