Added CV_DEPRECATED macro

pull/8062/head
mshabunin 8 years ago
parent 205ccddff8
commit c6c519166e
  1. 2
      doc/Doxyfile.in
  2. 10
      modules/core/include/opencv2/core/cvdef.h
  3. 28
      modules/flann/include/opencv2/flann.hpp
  4. 13
      modules/flann/include/opencv2/flann/defines.h
  5. 4
      modules/flann/include/opencv2/flann/flann_base.hpp
  6. 2
      modules/flann/include/opencv2/flann/matrix.h

@ -251,7 +251,7 @@ PREDEFINED = __cplusplus=1 \
CV_DEFAULT(x)=" = x" \
CV_NEON=1 \
CV_SSE2=1 \
FLANN_DEPRECATED=
CV_DEPRECATED=
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
TAGFILES =

@ -369,6 +369,16 @@ Cv64suf;
# define CV_EXPORTS
#endif
#ifndef CV_DEPRECATED
# if defined(__GNUC__)
# define CV_DEPRECATED __attribute__ ((deprecated))
# elif defined(_MSC_VER)
# define CV_DEPRECATED __declspec(deprecated)
# else
# define CV_DEPRECATED
# endif
#endif
#ifndef CV_EXTERN_C
# ifdef __cplusplus
# define CV_EXTERN_C extern "C"

@ -59,7 +59,7 @@ can be found in @cite Muja2009 .
namespace cvflann
{
CV_EXPORTS flann_distance_t flann_distance_type();
FLANN_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order);
CV_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order);
}
@ -230,7 +230,7 @@ public:
::cvflann::IndexParams getParameters() { return nnIndex->getParameters(); }
FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); }
CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); }
private:
::cvflann::Index<Distance>* nnIndex;
@ -344,7 +344,7 @@ public:
typedef typename L2<T>::ElementType ElementType;
typedef typename L2<T>::ResultType DistanceType;
FLANN_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params)
CV_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params)
{
printf("[WARNING] The cv::flann::Index_<T> class is deperecated, use cv::flann::GenericIndex<Distance> instead\n");
@ -368,13 +368,13 @@ public:
if (nnIndex_L1) nnIndex_L1->buildIndex();
if (nnIndex_L2) nnIndex_L2->buildIndex();
}
FLANN_DEPRECATED ~Index_()
CV_DEPRECATED ~Index_()
{
if (nnIndex_L1) delete nnIndex_L1;
if (nnIndex_L2) delete nnIndex_L2;
}
FLANN_DEPRECATED void knnSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& searchParams)
CV_DEPRECATED void knnSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& searchParams)
{
::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());
::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());
@ -383,7 +383,7 @@ public:
if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams);
if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams);
}
FLANN_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams)
CV_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams)
{
CV_Assert(queries.type() == CvType<ElementType>::type());
CV_Assert(queries.isContinuous());
@ -401,7 +401,7 @@ public:
if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams);
}
FLANN_DEPRECATED int radiusSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)
CV_DEPRECATED int radiusSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)
{
::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());
::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());
@ -411,7 +411,7 @@ public:
if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);
}
FLANN_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)
CV_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)
{
CV_Assert(query.type() == CvType<ElementType>::type());
CV_Assert(query.isContinuous());
@ -429,32 +429,32 @@ public:
if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);
}
FLANN_DEPRECATED void save(String filename)
CV_DEPRECATED void save(String filename)
{
if (nnIndex_L1) nnIndex_L1->save(filename);
if (nnIndex_L2) nnIndex_L2->save(filename);
}
FLANN_DEPRECATED int veclen() const
CV_DEPRECATED int veclen() const
{
if (nnIndex_L1) return nnIndex_L1->veclen();
if (nnIndex_L2) return nnIndex_L2->veclen();
}
FLANN_DEPRECATED int size() const
CV_DEPRECATED int size() const
{
if (nnIndex_L1) return nnIndex_L1->size();
if (nnIndex_L2) return nnIndex_L2->size();
}
FLANN_DEPRECATED ::cvflann::IndexParams getParameters()
CV_DEPRECATED ::cvflann::IndexParams getParameters()
{
if (nnIndex_L1) return nnIndex_L1->getParameters();
if (nnIndex_L2) return nnIndex_L2->getParameters();
}
FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters()
CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters()
{
if (nnIndex_L1) return nnIndex_L1->getIndexParameters();
if (nnIndex_L2) return nnIndex_L2->getIndexParameters();
@ -505,7 +505,7 @@ int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::K
/** @deprecated
*/
template <typename ELEM_TYPE, typename DIST_TYPE>
FLANN_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params)
CV_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params)
{
printf("[WARNING] cv::flann::hierarchicalClustering<ELEM_TYPE,DIST_TYPE> is deprecated, use "
"cv::flann::hierarchicalClustering<Distance> instead\n");

@ -50,19 +50,6 @@
#endif
#ifdef FLANN_DEPRECATED
#undef FLANN_DEPRECATED
#endif
#ifdef __GNUC__
#define FLANN_DEPRECATED __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define FLANN_DEPRECATED __declspec(deprecated)
#else
#pragma message("WARNING: You need to implement FLANN_DEPRECATED for this compiler")
#define FLANN_DEPRECATED
#endif
#undef FLANN_PLATFORM_32_BIT
#undef FLANN_PLATFORM_64_BIT
#if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64

@ -241,7 +241,7 @@ public:
/**
* \brief Returns actual index
*/
FLANN_DEPRECATED NNIndex<Distance>* getIndex()
CV_DEPRECATED NNIndex<Distance>* getIndex()
{
return nnIndex_;
}
@ -250,7 +250,7 @@ public:
* \brief Returns index parameters.
* \deprecated use getParameters() instead.
*/
FLANN_DEPRECATED const IndexParams* getIndexParameters()
CV_DEPRECATED const IndexParams* getIndexParameters()
{
return &index_params_;
}

@ -66,7 +66,7 @@ public:
/**
* Convenience function for deallocating the storage data.
*/
FLANN_DEPRECATED void free()
CV_DEPRECATED void free()
{
fprintf(stderr, "The cvflann::Matrix<T>::free() method is deprecated "
"and it does not do any memory deallocation any more. You are"

Loading…
Cancel
Save