This file is indexed.

/usr/include/qgis/qgsatlascomposition.h is in libqgis-dev 2.0.1-2build2.

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
/***************************************************************************
                             qgsatlascomposermap.h
                             ---------------------
    begin                : October 2012
    copyright            : (C) 2005 by Hugo Mercier
    email                : hugo dot mercier at oslandia dot com
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef QGSATLASCOMPOSITION_H
#define QGSATLASCOMPOSITION_H

#include "qgscoordinatetransform.h"
#include "qgsfeature.h"

#include <memory>
#include <QString>
#include <QDomElement>
#include <QDomDocument>

class QgsComposerMap;
class QgsComposition;
class QgsVectorLayer;
class QgsExpression;

/** \ingroup MapComposer
 * Class used to render an Atlas, iterating over geometry features.
 * prepareForFeature() modifies the atlas map's extent to zoom on the given feature.
 * This class is used for printing, exporting to PDF and images.
 * */
class CORE_EXPORT QgsAtlasComposition : public QObject
{
    Q_OBJECT
  public:
    QgsAtlasComposition( QgsComposition* composition );
    ~QgsAtlasComposition();

    /** Is the atlas generation enabled ? */
    bool enabled() const { return mEnabled; }
    void setEnabled( bool e ) { mEnabled = e; }

    QgsComposerMap* composerMap() const { return mComposerMap; }
    void setComposerMap( QgsComposerMap* map ) { mComposerMap = map; }

    bool hideCoverage() const { return mHideCoverage; }
    void setHideCoverage( bool hide ) { mHideCoverage = hide; }

    bool fixedScale() const { return mFixedScale; }
    void setFixedScale( bool fixed ) { mFixedScale = fixed; }

    float margin() const { return mMargin; }
    void setMargin( float margin ) { mMargin = margin; }

    QString filenamePattern() const { return mFilenamePattern; }
    void setFilenamePattern( const QString& pattern ) { mFilenamePattern = pattern; }

    QgsVectorLayer* coverageLayer() const { return mCoverageLayer; }
    void setCoverageLayer( QgsVectorLayer* lmap );

    bool singleFile() const { return mSingleFile; }
    void setSingleFile( bool single ) { mSingleFile = single; }

    bool sortFeatures() const { return mSortFeatures; }
    void setSortFeatures( bool doSort ) { mSortFeatures = doSort; }

    bool sortAscending() const { return mSortAscending; }
    void setSortAscending( bool ascending ) { mSortAscending = ascending; }

    bool filterFeatures() const { return mFilterFeatures; }
    void setFilterFeatures( bool doFilter ) { mFilterFeatures = doFilter; }

    QString featureFilter() const { return mFeatureFilter; }
    void setFeatureFilter( const QString& expression ) { mFeatureFilter = expression; }

    size_t sortKeyAttributeIndex() const { return mSortKeyAttributeIdx; }
    void setSortKeyAttributeIndex( size_t idx ) { mSortKeyAttributeIdx = idx; }

    /** Begins the rendering. */
    void beginRender();
    /** Ends the rendering. Restores original extent */
    void endRender();

    /** Returns the number of features in the coverage layer */
    size_t numFeatures() const;

    /** Prepare the atlas map for the given feature. Sets the extent and context variables */
    void prepareForFeature( size_t i );

    /** Returns the current filename. Must be called after prepareForFeature( i ) */
    const QString& currentFilename() const;

    void writeXML( QDomElement& elem, QDomDocument& doc ) const;
    void readXML( const QDomElement& elem, const QDomDocument& doc );

    QgsComposition* composition() { return mComposition; }

  signals:
    /** emitted when one of the parameters changes */
    void parameterChanged();

  private:
    QgsComposition* mComposition;

    bool mEnabled;
    QgsComposerMap* mComposerMap;
    bool mHideCoverage;
    bool mFixedScale;
    double mMargin;
    QString mFilenamePattern;
    QgsVectorLayer* mCoverageLayer;
    bool mSingleFile;

    QgsCoordinateTransform mTransform;
    QString mCurrentFilename;
    // feature ordering
    bool mSortFeatures;
    // sort direction
    bool mSortAscending;
  public:
    typedef std::map< QgsFeatureId, QVariant > SorterKeys;
  private:
    // value of field that is used for ordering of features
    SorterKeys mFeatureKeys;
    // key (attribute index) used for ordering
    size_t mSortKeyAttributeIdx;

    // feature filtering
    bool mFilterFeatures;
    // feature expression filter
    QString mFeatureFilter;

    // id of each iterated feature (after filtering and sorting)
    std::vector<QgsFeatureId> mFeatureIds;

    QgsFeature mCurrentFeature;
    QgsRectangle mOrigExtent;
    bool mRestoreLayer;
    std::auto_ptr<QgsExpression> mFilenameExpr;
};

#endif