/usr/include/OTB-5.8/otbRCC8GraphFileReader.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 | /*=========================================================================
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 otbRCC8GraphFileReader_h
#define otbRCC8GraphFileReader_h
#include "otbRCC8GraphSource.h"
#include "itkMacro.h"
namespace otb
{
/** \class RCC8GraphFileReaderException
* \brief Base exception class for IO problems during reading.
*
* \ingroup OTBRCC8
*/
class ITK_EXPORT RCC8GraphFileReaderException
: public itk::ExceptionObject
{
public:
/** Run-time information. */
itkTypeMacro(RCC8GraphFileReaderException, ExceptionObject);
/** Constructor. */
RCC8GraphFileReaderException(const char *file, unsigned int line,
const char* message = "Error in IO",
const char* loc = "Unknown") :
ExceptionObject(file, line, message, loc) {}
/** Constructor. */
RCC8GraphFileReaderException(const std::string & file, unsigned int line,
const char* message = "Error in IO",
const char* loc = "Unknown") :
ExceptionObject(file, line, message, loc) {}
};
/**
* \class RCC8GraphFileReader
* \brief This class reads a RCC8 graph from a .dot file (graphviz format).
*
* The parsing algorithm reads the lines from the file, deciding if the line is
* a vertex or edge line. It then call the correct parse method between ParseEdge
* and ParseVertex. The ParseVertex use builds an AttributesMap and pass it to a new
* vertex.
*
* \sa RCC8GraphFileWriter
* \sa RCC8Graph
*
* \ingroup OTBRCC8
*/
template <class TOutputGraph>
class ITK_EXPORT RCC8GraphFileReader : public RCC8GraphSource<TOutputGraph>
{
public:
/** Standards typedef */
typedef RCC8GraphFileReader Self;
typedef RCC8GraphSource<TOutputGraph> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Creation through the object factory */
itkNewMacro(Self);
/** Runtime type information */
itkTypeMacro(RCC8GraphFileReader, RCC8GraphSource);
/** Output related typedefs */
typedef TOutputGraph OutputGraphType;
typedef typename Superclass::OutputGraphPointerType OutputGraphPointerType;
typedef typename OutputGraphType::VertexType VertexType;
typedef typename VertexType::Pointer VertexPointerType;
typedef typename OutputGraphType::RCC8ValueType RCC8ValueType;
/** Set the filename */
itkSetStringMacro(FileName);
/** Get the filename */
itkGetStringMacro(FileName);
protected:
/** Constructor */
RCC8GraphFileReader();
/** Destructor */
~RCC8GraphFileReader() ITK_OVERRIDE;
/** Main computation method */
void GenerateData() ITK_OVERRIDE;
/**
* Parse edge information from a given line.
* \param line The line to parse.
*/
void ParseEdge(const std::string& line);
/**
* Parse vertex information from a given line.
* \param line The line to parse.
*/
void ParseVertex(const std::string& line);
/** PrintSelf method */
void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE;
private:
/** File name */
std::string m_FileName;
};
}
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbRCC8GraphFileReader.txx"
#endif
#endif
|