/usr/include/qgis/qgsgraph.h is in libqgis-dev 2.8.6+dfsg-1build1.
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 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | /***************************************************************************
graph.h
--------------------------------------
Date : 2011-04-01
Copyright : (C) 2010 by Yakushev Sergey
Email : YakushevS <at> list.ru
****************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/*
* This file describes the built-in QGIS classes modeling a mathematical graph.
* Vertex is identified by its geographic coordinates (but you can add two vertex
* with unique coordinate), no additional properties it can not be assigned.
* Count the number of properties not limited along the arc. Graph may
* be have incidence arcs.
*
* \file qgsgraph.h
*/
#ifndef QGSGRAPHH
#define QGSGRAPHH
// QT4 includes
#include <QList>
#include <QVector>
#include <QVariant>
// QGIS includes
#include "qgspoint.h"
class QgsGraphVertex;
/**
* \ingroup networkanalysis
* \class QgsGraphArc
* \brief This class implement a graph edge
*/
class ANALYSIS_EXPORT QgsGraphArc
{
public:
QgsGraphArc();
/**
* return property value
* @param propertyIndex property index
*/
QVariant property( int propertyIndex ) const;
/**
* get array of proertyes
*/
QVector< QVariant > properties() const;
/**
* return index of outgoing vertex
*/
int outVertex() const;
/**
* return index of incoming vertex
*/
int inVertex() const;
private:
QVector< QVariant > mProperties;
int mOut;
int mIn;
friend class QgsGraph;
};
typedef QList< int > QgsGraphArcIdList;
/**
* \ingroup networkanalysis
* \class QgsGraphVertex
* \brief This class implement a graph vertex
*/
class ANALYSIS_EXPORT QgsGraphVertex
{
public:
/**
* default constructor. It need for QT's container, e.g. QVector
*/
QgsGraphVertex() {}
/**
* This constructor initializes QgsGraphVertex object and associates a vertex with a point
*/
QgsGraphVertex( const QgsPoint& point );
/**
* return outgoing edges
*/
QgsGraphArcIdList outArc() const;
/**
* return incoming edges
*/
QgsGraphArcIdList inArc() const;
/**
* return vertex point
*/
QgsPoint point() const;
private:
QgsPoint mCoordinate;
QgsGraphArcIdList mOutArc;
QgsGraphArcIdList mInArc;
friend class QgsGraph;
};
/**
* \ingroup networkanalysis
* \class QgsGraph
* \brief Mathematics graph representation
*/
class ANALYSIS_EXPORT QgsGraph
{
public:
QgsGraph();
~QgsGraph();
// begin graph constructing methods
/**
* add vertex to a grap
*/
int addVertex( const QgsPoint& pt );
/**
* add edge to a graph
*/
int addArc( int outVertexIdx, int inVertexIdx, const QVector< QVariant >& properties );
/**
* return vertex count
*/
int vertexCount() const;
/**
* return vertex at index
*/
const QgsGraphVertex& vertex( int idx ) const;
/**
* return edge count
*/
int arcCount() const;
/**
* return edge at index
*/
const QgsGraphArc& arc( int idx ) const;
/**
* find vertex by point
* \return vertex index
*/
int findVertex( const QgsPoint& pt ) const;
private:
QVector<QgsGraphVertex> mGraphVertexes;
QVector<QgsGraphArc> mGraphArc;
};
#endif //QGSGRAPHH
|