<commit_before>/*=========================================================================

  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.

=========================================================================*/
#ifndef __otbVectorDataExtractROI_h
#define __otbVectorDataExtractROI_h

#include "otbVectorDataToVectorDataFilter.h"
#include "otbRemoteSensingRegion.h"
#include "itkMacro.h"

namespace otb
{

/** \class VectorDataExtractROI
 * \brief Extract a subset of a Vector Data.
 *
 * \note Parameter to this class for input and outputs are vectorData
 *
 */
template <class TVectorData>
class ITK_EXPORT VectorDataExtractROI:
      public VectorDataToVectorDataFilter<TVectorData ,TVectorData >
{
public:
  /** Standard class typedefs. */
  typedef VectorDataExtractROI                                     Self;
  typedef VectorDataToVectorDataFilter<TVectorData ,TVectorData >  Superclass;
  typedef itk::SmartPointer<Self>                                  Pointer;
  typedef itk::SmartPointer<const Self>                            ConstPointer;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(VectorDataExtractROI,VectorDataToVectorDataFilter);

  /** Image type information*/
  typedef TVectorData                                                       VectorDataType;
  typedef typename VectorDataType::DataNodeType                             DataNodeType;
  typedef typename DataNodeType::Pointer                                    DataNodePointerType;
  typedef typename VectorDataType::DataTreeType                             DataTreeType;
  typedef typename DataNodeType::PolygonPointerType                         PolygonPointerType;
  typedef typename DataNodeType::PolygonType                                PolygonType;
  typedef typename DataNodeType::LinePointerType                            LinePointerType;
  typedef typename DataNodeType::PointType                                  PointType;

  /** Need Vertex and Vertex List Type*/
  typedef typename PolygonType::VertexType                                  VertexType;
  typedef typename PolygonType::VertexListType                              VertexListType;
  typedef typename PolygonType::VertexListPointer                           VertexListPointer;


  /** TODO : automatize the dimension of the region*/
  typedef otb::RemoteSensingRegion<typename VertexType::CoordRepType>                RegionType;
  typedef typename  RegionType::IndexType                                    IndexType;
  typedef typename  RegionType::SizeType                                     SizeType;

  typedef itk::Point<typename VertexType::CoordRepType ,IndexType::IndexDimension>                       ProjPointType;

  typedef itk::PreOrderTreeIterator<typename VectorDataType::DataTreeType> InputTreeIteratorType;
  typedef typename VectorDataType::DataTreeType::TreeNodeType InternalTreeNodeType;
  typedef typename InternalTreeNodeType::ChildrenListType     ChildrenListType;


  /** Method to Set/Get the Region of intereset*/
   void SetRegion(const RegionType&  region)
     {
       m_ROI = region;
     }

   const RegionType & GetRegion()
     {return m_ROI;}

  itkSetStringMacro(DEMDirectory);
  itkGetStringMacro(DEMDirectory);
 
protected:<commit_msg>DOC: add example in doxygen<commit_after>/*=========================================================================

  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.

=========================================================================*/
#ifndef __otbVectorDataExtractROI_h
#define __otbVectorDataExtractROI_h

#include "otbVectorDataToVectorDataFilter.h"
#include "otbRemoteSensingRegion.h"
#include "itkMacro.h"

namespace otb
{

/** \class VectorDataExtractROI
 * \brief Extract a subset of a Vector Data based on location
 *
 * \note Parameter to this class for input and outputs are vectorData
 *
 * \example Projections/VectorDataExtractROIExample.cxx
 */
template <class TVectorData>
class ITK_EXPORT VectorDataExtractROI:
      public VectorDataToVectorDataFilter<TVectorData ,TVectorData >
{
public:
  /** Standard class typedefs. */
  typedef VectorDataExtractROI                                     Self;
  typedef VectorDataToVectorDataFilter<TVectorData ,TVectorData >  Superclass;
  typedef itk::SmartPointer<Self>                                  Pointer;
  typedef itk::SmartPointer<const Self>                            ConstPointer;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(VectorDataExtractROI,VectorDataToVectorDataFilter);

  /** Image type information*/
  typedef TVectorData                                                       VectorDataType;
  typedef typename VectorDataType::DataNodeType                             DataNodeType;
  typedef typename DataNodeType::Pointer                                    DataNodePointerType;
  typedef typename VectorDataType::DataTreeType                             DataTreeType;
  typedef typename DataNodeType::PolygonPointerType                         PolygonPointerType;
  typedef typename DataNodeType::PolygonType                                PolygonType;
  typedef typename DataNodeType::LinePointerType                            LinePointerType;
  typedef typename DataNodeType::PointType                                  PointType;

  /** Need Vertex and Vertex List Type*/
  typedef typename PolygonType::VertexType                                  VertexType;
  typedef typename PolygonType::VertexListType                              VertexListType;
  typedef typename PolygonType::VertexListPointer                           VertexListPointer;


  /** TODO : automatize the dimension of the region*/
  typedef otb::RemoteSensingRegion<typename VertexType::CoordRepType>                RegionType;
  typedef typename  RegionType::IndexType                                    IndexType;
  typedef typename  RegionType::SizeType                                     SizeType;

  typedef itk::Point<typename VertexType::CoordRepType ,IndexType::IndexDimension>                       ProjPointType;

  typedef itk::PreOrderTreeIterator<typename VectorDataType::DataTreeType> InputTreeIteratorType;
  typedef typename VectorDataType::DataTreeType::TreeNodeType InternalTreeNodeType;
  typedef typename InternalTreeNodeType::ChildrenListType     ChildrenListType;


  /** Method to Set/Get the Region of intereset*/
   void SetRegion(const RegionType&  region)
     {
       m_ROI = region;
     }

   const RegionType & GetRegion()
     {return m_ROI;}

  itkSetStringMacro(DEMDirectory);
  itkGetStringMacro(DEMDirectory);

protected:
{'fraction_non_alphanumeric': 0.09733333333333333, 'fraction_numerical': 0.0, 'mean_word_length': 2.64657267865824, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5091615', 'n_tokens_mistral': 1849, 'n_tokens_neox': 1749, 'n_words': 478}