Skip to content
Snippets Groups Projects
Commit 28c5b95c authored by Julien Michel's avatar Julien Michel
Browse files

MRG

parents 7ab5029e 92306219
Branches
Tags
No related merge requests found
...@@ -65,10 +65,10 @@ class ITK_EXPORT PolyLineParametricPathWithValue ...@@ -65,10 +65,10 @@ class ITK_EXPORT PolyLineParametricPathWithValue
itk::EncapsulateMetaData<ValueType>(dict,m_Key,value); itk::EncapsulateMetaData<ValueType>(dict,m_Key,value);
} }
ValueType GetValue(void) ValueType GetValue(void) const
{ {
ValueType resp = itk::NumericTraits<ValueType>::Zero; ValueType resp = itk::NumericTraits<ValueType>::Zero;
itk::MetaDataDictionary & dict = this->GetMetaDataDictionary(); const itk::MetaDataDictionary & dict = this->GetMetaDataDictionary();
if(dict.HasKey(m_Key)) if(dict.HasKey(m_Key))
{ {
itk::ExposeMetaData<ValueType>(dict,m_Key,resp); itk::ExposeMetaData<ValueType>(dict,m_Key,resp);
...@@ -84,7 +84,7 @@ class ITK_EXPORT PolyLineParametricPathWithValue ...@@ -84,7 +84,7 @@ class ITK_EXPORT PolyLineParametricPathWithValue
* Return the path length (perimeter). * Return the path length (perimeter).
* \return The length. * \return The length.
*/ */
virtual double GetLength(); virtual double GetLength() const;
protected: protected:
/** Constructor */ /** Constructor */
......
...@@ -36,7 +36,7 @@ namespace otb ...@@ -36,7 +36,7 @@ namespace otb
template < class TValue,unsigned int VDimension> template < class TValue,unsigned int VDimension>
double PolyLineParametricPathWithValue<TValue,VDimension> double PolyLineParametricPathWithValue<TValue,VDimension>
::GetLength() ::GetLength() const
{ {
double length = 0.0; double length = 0.0;
VertexListConstIteratorType it = this->GetVertexList()->Begin(); VertexListConstIteratorType it = this->GetVertexList()->Begin();
......
...@@ -71,14 +71,14 @@ class ITK_EXPORT Polygon ...@@ -71,14 +71,14 @@ class ITK_EXPORT Polygon
* \param point The point to check. * \param point The point to check.
* \return True if the point is inside the polygon. * \return True if the point is inside the polygon.
*/ */
bool IsInside(VertexType point); bool IsInside(VertexType point) const;
/** /**
* Check wether point is strictly on the edge of the polygon. * Check wether point is strictly on the edge of the polygon.
* \param point The point to check. * \param point The point to check.
* \return True if the point is on the edge of the polygon. * \return True if the point is on the edge of the polygon.
*/ */
bool IsOnEdge(VertexType point); bool IsOnEdge(VertexType point) const;
/** /**
* Returns the number of crossings of the polygon with a given segment. * Returns the number of crossings of the polygon with a given segment.
...@@ -86,7 +86,7 @@ class ITK_EXPORT Polygon ...@@ -86,7 +86,7 @@ class ITK_EXPORT Polygon
* \param b Second point of the segment, * \param b Second point of the segment,
* \return the number of strict crossings of segment [ab] with the polygon. * \return the number of strict crossings of segment [ab] with the polygon.
*/ */
unsigned int NbCrossing(VertexType a, VertexType b); unsigned int NbCrossing(VertexType a, VertexType b) const;
/** /**
* Returns the number of touchings without crossing of the polygon with a given segment. * Returns the number of touchings without crossing of the polygon with a given segment.
...@@ -94,7 +94,7 @@ class ITK_EXPORT Polygon ...@@ -94,7 +94,7 @@ class ITK_EXPORT Polygon
* \param b Second point of the segment, * \param b Second point of the segment,
* \return the number of touchings without crossing of segment [ab] with the polygon. * \return the number of touchings without crossing of segment [ab] with the polygon.
*/ */
unsigned int NbTouching(VertexType a, VertexType b); unsigned int NbTouching(VertexType a, VertexType b) const;
/** /**
* Check wether two segments [a1a2] and [b1b2] are strictly crossing. * Check wether two segments [a1a2] and [b1b2] are strictly crossing.
...@@ -104,7 +104,7 @@ class ITK_EXPORT Polygon ...@@ -104,7 +104,7 @@ class ITK_EXPORT Polygon
* \param a1 Second point of the second segment. * \param a1 Second point of the second segment.
* \return True if the two segments are strictly crossing. * \return True if the two segments are strictly crossing.
*/ */
bool IsCrossing(VertexType a1, VertexType a2, VertexType b1, VertexType b2); bool IsCrossing(VertexType a1, VertexType a2, VertexType b1, VertexType b2) const;
/** /**
* Check wether two segments[a1a2] and [b1b2] are touching without crossing. * Check wether two segments[a1a2] and [b1b2] are touching without crossing.
...@@ -114,7 +114,7 @@ class ITK_EXPORT Polygon ...@@ -114,7 +114,7 @@ class ITK_EXPORT Polygon
* \param a1 Second point of the second segment. * \param a1 Second point of the second segment.
* \return True if the two segments are touching without crossing. * \return True if the two segments are touching without crossing.
*/ */
bool IsTouching(VertexType a1, VertexType a2, VertexType b1, VertexType b2); bool IsTouching(VertexType a1, VertexType a2, VertexType b1, VertexType b2) const;
/** /**
* Compute the polygon bounding region. * Compute the polygon bounding region.
...@@ -126,13 +126,13 @@ class ITK_EXPORT Polygon ...@@ -126,13 +126,13 @@ class ITK_EXPORT Polygon
* Return the polygon surface. * Return the polygon surface.
* \return The surface. * \return The surface.
*/ */
double GetSurface(); double GetSurface() const;
/** /**
* Return the polygon length (perimeter). * Return the polygon length (perimeter).
* \return The length. * \return The length.
*/ */
virtual double GetLength(); virtual double GetLength() const;
protected: protected:
/** Constructor */ /** Constructor */
...@@ -153,7 +153,7 @@ private: ...@@ -153,7 +153,7 @@ private:
void operator=(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented
double m_Epsilon; double m_Epsilon;
double m_Surface;
}; };
}// End namespace otb }// End namespace otb
......
...@@ -31,7 +31,7 @@ namespace otb ...@@ -31,7 +31,7 @@ namespace otb
template<class TValue> template<class TValue>
bool bool
Polygon<TValue> Polygon<TValue>
::IsInside(VertexType point) ::IsInside(VertexType point) const
{ {
double x = point[0]; double x = point[0];
double y = point[1]; double y = point[1];
...@@ -110,7 +110,7 @@ Polygon<TValue> ...@@ -110,7 +110,7 @@ Polygon<TValue>
template<class TValue> template<class TValue>
bool bool
Polygon<TValue> Polygon<TValue>
::IsOnEdge(VertexType point) ::IsOnEdge(VertexType point) const
{ {
//std::cout<<"Checking point "<<point<<std::endl; //std::cout<<"Checking point "<<point<<std::endl;
bool resp = false; bool resp = false;
...@@ -198,7 +198,7 @@ Polygon<TValue> ...@@ -198,7 +198,7 @@ Polygon<TValue>
template<class TValue> template<class TValue>
unsigned int unsigned int
Polygon<TValue> Polygon<TValue>
::NbCrossing(VertexType a, VertexType b) ::NbCrossing(VertexType a, VertexType b) const
{ {
unsigned int resp = 0; unsigned int resp = 0;
VertexListConstIteratorType it = this->GetVertexList()->Begin(); VertexListConstIteratorType it = this->GetVertexList()->Begin();
...@@ -232,7 +232,7 @@ Polygon<TValue> ...@@ -232,7 +232,7 @@ Polygon<TValue>
template<class TValue> template<class TValue>
unsigned int unsigned int
Polygon<TValue> Polygon<TValue>
::NbTouching(VertexType a, VertexType b) ::NbTouching(VertexType a, VertexType b) const
{ {
unsigned int resp = 0; unsigned int resp = 0;
VertexListConstIteratorType it = this->GetVertexList()->Begin(); VertexListConstIteratorType it = this->GetVertexList()->Begin();
...@@ -268,7 +268,7 @@ Polygon<TValue> ...@@ -268,7 +268,7 @@ Polygon<TValue>
template<class TValue> template<class TValue>
bool bool
Polygon<TValue> Polygon<TValue>
::IsCrossing(VertexType a1, VertexType a2, VertexType b1, VertexType b2) ::IsCrossing(VertexType a1, VertexType a2, VertexType b1, VertexType b2) const
{ {
bool resp = false; bool resp = false;
double xbmin = std::min(b1[0],b2[0]); double xbmin = std::min(b1[0],b2[0]);
...@@ -325,7 +325,7 @@ Polygon<TValue> ...@@ -325,7 +325,7 @@ Polygon<TValue>
template<class TValue> template<class TValue>
bool bool
Polygon<TValue> Polygon<TValue>
::IsTouching(VertexType a1, VertexType a2, VertexType b1, VertexType b2) ::IsTouching(VertexType a1, VertexType a2, VertexType b1, VertexType b2) const
{ {
bool resp = false; bool resp = false;
double xbmin = std::min(b1[0],b2[0]); double xbmin = std::min(b1[0],b2[0]);
...@@ -480,8 +480,9 @@ Polygon<TValue> ...@@ -480,8 +480,9 @@ Polygon<TValue>
template<class TValue> template<class TValue>
double double
Polygon<TValue> Polygon<TValue>
::GetSurface() ::GetSurface() const
{ {
double m_Surface;
m_Surface = 0.0; m_Surface = 0.0;
VertexListConstIteratorType it = this->GetVertexList()->Begin(); VertexListConstIteratorType it = this->GetVertexList()->Begin();
...@@ -522,7 +523,7 @@ template<class TValue> ...@@ -522,7 +523,7 @@ template<class TValue>
*/ */
template < class TValue> template < class TValue>
double Polygon<TValue> double Polygon<TValue>
::GetLength() ::GetLength() const
{ {
double length = 0.0; double length = 0.0;
VertexListConstIteratorType it = this->GetVertexList()->Begin(); VertexListConstIteratorType it = this->GetVertexList()->Begin();
......
...@@ -15,6 +15,9 @@ SET(PROJECTIONS_EXAMPLES ${CXX_TEST_PATH}/otbProjectionsExamplesTests) ...@@ -15,6 +15,9 @@ SET(PROJECTIONS_EXAMPLES ${CXX_TEST_PATH}/otbProjectionsExamplesTests)
ADD_EXECUTABLE(SensorModelExample SensorModelExample.cxx ) ADD_EXECUTABLE(SensorModelExample SensorModelExample.cxx )
TARGET_LINK_LIBRARIES(SensorModelExample OTBProjections OTBCommon OTBIO ITKCommon ITKIO) TARGET_LINK_LIBRARIES(SensorModelExample OTBProjections OTBCommon OTBIO ITKCommon ITKIO)
ADD_EXECUTABLE(MapProjectionExample MapProjectionExample.cxx )
TARGET_LINK_LIBRARIES(MapProjectionExample OTBProjections OTBCommon OTBIO)
ADD_EXECUTABLE(OrthoRectificationExample OrthoRectificationExample.cxx ) ADD_EXECUTABLE(OrthoRectificationExample OrthoRectificationExample.cxx )
TARGET_LINK_LIBRARIES(OrthoRectificationExample OTBProjections OTBCommon OTBIO ITKCommon ITKIO) TARGET_LINK_LIBRARIES(OrthoRectificationExample OTBProjections OTBCommon OTBIO ITKCommon ITKIO)
......
/*=========================================================================
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 "otbMapProjections.h"
int main( int argc, char* argv[] )
{
if(argc < 3 )
{
std::cout << argv[0] <<" <lon> <lat> <outputfile>" << std::endl;
return EXIT_FAILURE;
}
double lon = atof(argv[1]);
double lat = atof(argv[2]);
const char * outFileName = argv[3];
std::ofstream file;
file.open(outFileName);
file << std::setprecision(15);
otb::UtmForwardProjection::Pointer lUtmProjection = otb::UtmForwardProjection::New();
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment