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
itk::EncapsulateMetaData<ValueType>(dict,m_Key,value);
}
ValueType GetValue(void)
ValueType GetValue(void) const
{
ValueType resp = itk::NumericTraits<ValueType>::Zero;
itk::MetaDataDictionary & dict = this->GetMetaDataDictionary();
const itk::MetaDataDictionary & dict = this->GetMetaDataDictionary();
if(dict.HasKey(m_Key))
{
itk::ExposeMetaData<ValueType>(dict,m_Key,resp);
......@@ -84,7 +84,7 @@ class ITK_EXPORT PolyLineParametricPathWithValue
* Return the path length (perimeter).
* \return The length.
*/
virtual double GetLength();
virtual double GetLength() const;
protected:
/** Constructor */
......
......@@ -36,7 +36,7 @@ namespace otb
template < class TValue,unsigned int VDimension>
double PolyLineParametricPathWithValue<TValue,VDimension>
::GetLength()
::GetLength() const
{
double length = 0.0;
VertexListConstIteratorType it = this->GetVertexList()->Begin();
......
......@@ -71,14 +71,14 @@ class ITK_EXPORT Polygon
* \param point The point to check.
* \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.
* \param point The point to check.
* \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.
......@@ -86,7 +86,7 @@ class ITK_EXPORT Polygon
* \param b Second point of the segment,
* \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.
......@@ -94,7 +94,7 @@ class ITK_EXPORT Polygon
* \param b Second point of the segment,
* \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.
......@@ -104,7 +104,7 @@ class ITK_EXPORT Polygon
* \param a1 Second point of the second segment.
* \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.
......@@ -114,7 +114,7 @@ class ITK_EXPORT Polygon
* \param a1 Second point of the second segment.
* \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.
......@@ -126,13 +126,13 @@ class ITK_EXPORT Polygon
* Return the polygon surface.
* \return The surface.
*/
double GetSurface();
double GetSurface() const;
/**
* Return the polygon length (perimeter).
* \return The length.
*/
virtual double GetLength();
virtual double GetLength() const;
protected:
/** Constructor */
......@@ -153,7 +153,7 @@ private:
void operator=(const Self&); //purposely not implemented
double m_Epsilon;
double m_Surface;
};
}// End namespace otb
......
......@@ -31,7 +31,7 @@ namespace otb
template<class TValue>
bool
Polygon<TValue>
::IsInside(VertexType point)
::IsInside(VertexType point) const
{
double x = point[0];
double y = point[1];
......@@ -110,7 +110,7 @@ Polygon<TValue>
template<class TValue>
bool
Polygon<TValue>
::IsOnEdge(VertexType point)
::IsOnEdge(VertexType point) const
{
//std::cout<<"Checking point "<<point<<std::endl;
bool resp = false;
......@@ -198,7 +198,7 @@ Polygon<TValue>
template<class TValue>
unsigned int
Polygon<TValue>
::NbCrossing(VertexType a, VertexType b)
::NbCrossing(VertexType a, VertexType b) const
{
unsigned int resp = 0;
VertexListConstIteratorType it = this->GetVertexList()->Begin();
......@@ -232,7 +232,7 @@ Polygon<TValue>
template<class TValue>
unsigned int
Polygon<TValue>
::NbTouching(VertexType a, VertexType b)
::NbTouching(VertexType a, VertexType b) const
{
unsigned int resp = 0;
VertexListConstIteratorType it = this->GetVertexList()->Begin();
......@@ -268,7 +268,7 @@ Polygon<TValue>
template<class TValue>
bool
Polygon<TValue>
::IsCrossing(VertexType a1, VertexType a2, VertexType b1, VertexType b2)
::IsCrossing(VertexType a1, VertexType a2, VertexType b1, VertexType b2) const
{
bool resp = false;
double xbmin = std::min(b1[0],b2[0]);
......@@ -325,7 +325,7 @@ Polygon<TValue>
template<class TValue>
bool
Polygon<TValue>
::IsTouching(VertexType a1, VertexType a2, VertexType b1, VertexType b2)
::IsTouching(VertexType a1, VertexType a2, VertexType b1, VertexType b2) const
{
bool resp = false;
double xbmin = std::min(b1[0],b2[0]);
......@@ -480,8 +480,9 @@ Polygon<TValue>
template<class TValue>
double
Polygon<TValue>
::GetSurface()
::GetSurface() const
{
double m_Surface;
m_Surface = 0.0;
VertexListConstIteratorType it = this->GetVertexList()->Begin();
......@@ -522,7 +523,7 @@ template<class TValue>
*/
template < class TValue>
double Polygon<TValue>
::GetLength()
::GetLength() const
{
double length = 0.0;
VertexListConstIteratorType it = this->GetVertexList()->Begin();
......
......@@ -15,6 +15,9 @@ SET(PROJECTIONS_EXAMPLES ${CXX_TEST_PATH}/otbProjectionsExamplesTests)
ADD_EXECUTABLE(SensorModelExample SensorModelExample.cxx )
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 )
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