From d5966d0fa777456402665345e29cb01d023da52b Mon Sep 17 00:00:00 2001 From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org> Date: Tue, 24 Mar 2009 10:51:51 +0800 Subject: [PATCH] BUG: fix bug in polygon bounding region computation test --- Code/Common/otbPolyLineParametricPathWithValue.h | 4 ++-- Code/Common/otbRemoteSensingRegion.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Code/Common/otbPolyLineParametricPathWithValue.h b/Code/Common/otbPolyLineParametricPathWithValue.h index ad7b0d89ce..fa4784abf2 100644 --- a/Code/Common/otbPolyLineParametricPathWithValue.h +++ b/Code/Common/otbPolyLineParametricPathWithValue.h @@ -93,13 +93,13 @@ template < class TValue,unsigned int VDimension=2> */ virtual double GetLength() const; - void AddVertex (const ContinuousIndexType &vertex); + virtual void AddVertex (const ContinuousIndexType &vertex); /** * Compute the path bounding region. * \return The region. */ - RegionType GetBoundingRegion(void) const; + virtual RegionType GetBoundingRegion(void) const; protected: /** Constructor */ diff --git a/Code/Common/otbRemoteSensingRegion.h b/Code/Common/otbRemoteSensingRegion.h index ac691e26df..80a9b0ee95 100644 --- a/Code/Common/otbRemoteSensingRegion.h +++ b/Code/Common/otbRemoteSensingRegion.h @@ -35,7 +35,8 @@ namespace otb * piece of an Image. The RemoteSensingRegion is represented with an index and * a size in each of the n-dimensions of the image. (The index is the * corner of the image, the size is the lengths of the image in each of - * the topological directions.) + * the topological directions. <b>For this class, the notion of index and origin + * are the same.</b>) * * As the size and origin can be given in various system coordinates, they contain * double values (through the use of an itk::ContinuousIndex). @@ -132,6 +133,18 @@ public: return m_Index; } + /** Set the index defining the corner of the region. */ + void SetIndex(const IndexType &index) + { + m_Index = index; + } + + /** Get index defining the corner of the region. */ + const IndexType& GetIndex() const + { + return m_Index; + } + /** Set the size of the region. This plus the index determines the * rectangular shape, or extent, of the region. */ void SetSize(const SizeType &size) -- GitLab