This file is indexed.

/usr/include/OTB-5.8/otbVectorDataExtractROI.h is in libotb-dev 5.8.0+dfsg-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*=========================================================================

  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 "otbDEMHandler.h"
#include "itkMacro.h"
#include "itkPreOrderTreeIterator.h"

namespace otb
{

/** \class VectorDataExtractROI
 * \brief Extract a subset of a Vector Data based on location
 *
 * The region to extract is specified by a otb::RemoteSensingRegion
 * object. This region contains its own projection reference that may be
 * different from the projection of the vector data.
 *
 * The projection of the vector data will not be modified by this filter
 * if you need to change the projection, refer to otb::VectorDataProjectionFilter
 *
 * \note Parameter to this class for input and outputs are vectorData
 *
 * \sa RemoteSensingRegion
 * \sa VectorDataProjectionFilter
 *
 * \ingroup VectorDataFilter
 *
 * \example Projections/VectorDataExtractROIExample.cxx
 *
 * \ingroup OTBVectorDataManipulation
 */
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::LineType           LineType;
  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 : automate 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; }

protected:
  VectorDataExtractROI();
  ~VectorDataExtractROI() ITK_OVERRIDE {}
  void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE;

  /** Method to compare the projection embedded in the cartoRegion And the the InputVectorData*/
  virtual void CompareInputAndRegionProjection();

  /** Method to project from carto reference to Geo axis*/
  virtual void ProjectRegionToInputVectorProjection();

  /** Improve the Projected roi*/
  virtual RegionType ComputeVertexListBoundingRegion(typename VertexListType::ConstPointer vertexlist);

  /** Method to transform itk::Point to itk::ContinuousIndex*/
  virtual VertexType  PointToContinuousIndex(ProjPointType point);

  /** Prototype of the generate data method*/
  void GenerateData(void) ITK_OVERRIDE;

  /** Method to check if the polygon Bounding Box ha ve a non-null intersection with the ROI*/
  virtual bool IsPolygonIntersectionNotNull(PolygonPointerType polygon);

  /** Method to check if the line Bounding Box ha ve a non-null intersection with the ROI*/
  virtual bool IsLineIntersectionNotNull(LinePointerType line);

  virtual void ProcessNode(InternalTreeNodeType * source, InternalTreeNodeType * destination);
  using Superclass::ProcessNode;

private:
  VectorDataExtractROI(const Self &); //purposely not implemented
  void operator =(const Self&); //purposely not implemented

  int CounterClockWise(PointType firstPoint, PointType secondPoint, PointType thirdPoint);
  bool IsSegmentIntersectSegment(LinePointerType segmentLineAB, LinePointerType segmentLineCD);

  bool        m_ProjectionNeeded;
  RegionType  m_ROI;
  RegionType  m_GeoROI;

  unsigned int m_Kept;
};

} // end namespace otb

#ifndef OTB_MANUAL_INSTANTIATION
#include "otbVectorDataExtractROI.txx"
#endif

#endif