/usr/include/KChart/KChartPolarCoordinatePlane.h is in libkchart-dev 2.6.0-1.
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 | /**
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* 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 program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KCHART_POLAR_COORDINATEPLANE_H
#define KCHART_POLAR_COORDINATEPLANE_H
#include "KChartAbstractCoordinatePlane.h"
namespace KChart {
class Chart;
class PaintContext;
/**
* @brief Polar coordinate plane
*/
class KCHART_EXPORT PolarCoordinatePlane : public AbstractCoordinatePlane
{
Q_OBJECT
Q_DISABLE_COPY( PolarCoordinatePlane )
KCHART_DECLARE_PRIVATE_DERIVED_PARENT( PolarCoordinatePlane, Chart* )
public:
struct CoordinateTransformation;
typedef QList<CoordinateTransformation> CoordinateTransformationList;
explicit PolarCoordinatePlane ( Chart* parent = 0 );
~PolarCoordinatePlane();
void addDiagram ( AbstractDiagram* diagram );
const QPointF translate ( const QPointF& diagramPoint ) const;
const QPointF translatePolar ( const QPointF& diagramPoint ) const;
/** \brief Specify the rotation of the coordinate plane.
*
* In a pie diagram this indicates the position where the first pie starts,
* in a polar diagram it specifies the Zero position of the circular axis:
*
* \image html polar-plane-start-position.png "Illustration of \"start position\" property"
*
* \sa startPosition
*/
void setStartPosition( qreal degrees );
/** Retrieve the rotation of the coordinate plane.
* \sa setStartPosition
*/
qreal startPosition() const;
virtual qreal zoomFactorX() const;
virtual qreal zoomFactorY() const;
virtual void setZoomFactors( qreal factorX, qreal factorY );
virtual void setZoomFactorX( qreal factor );
virtual void setZoomFactorY( qreal factor );
virtual QPointF zoomCenter() const;
virtual void setZoomCenter( const QPointF& center );
/**
* Set the attributes to be used for grid lines drawn in circular
* direction (or in sagittal direction, resp.).
*
* To disable circular grid painting, for example, your code should like this:
* \code
* GridAttributes ga = plane->gridAttributes( bool );
* ga.setGridVisible( false );
* plane-setGridAttributes( bool, ga );
* \endcode
*
* \note setGridAttributes overwrites the global attributes that
* were set by AbstractCoordinatePlane::setGlobalGridAttributes.
* To re-activate these global attributes you can call
* resetGridAttributes.
*
* \sa resetGridAttributes, gridAttributes
* \sa AbstractCoordinatePlane::setGlobalGridAttributes
* \sa hasOwnGridAttributes
*/
void setGridAttributes( bool circular, const GridAttributes & );
/**
* Reset the attributes to be used for grid lines drawn in circular
* direction (or in sagittal direction, resp.).
* By calling this method you specify that the global attributes set by
* AbstractCoordinatePlane::setGlobalGridAttributes be used.
*
* \sa setGridAttributes, gridAttributes
* \sa AbstractCoordinatePlane::globalGridAttributes
* \sa hasOwnGridAttributes
*/
void resetGridAttributes( bool circular );
/**
* \return The attributes used for grid lines drawn in circular
* direction (or in sagittal direction, resp.).
*
* \note This function always returns a valid set of grid attributes:
* If no special grid attributes were set for this direction
* the global attributes are returned, as returned by
* AbstractCoordinatePlane::globalGridAttributes.
*
* \sa setGridAttributes
* \sa resetGridAttributes
* \sa AbstractCoordinatePlane::globalGridAttributes
* \sa hasOwnGridAttributes
*/
const GridAttributes gridAttributes( bool circular ) const;
/**
* \return Returns whether the grid attributes have been set for the
* respective direction via setGridAttributes( bool circular ).
*
* If false, the grid will use the global attributes set
* by AbstractCoordinatePlane::globalGridAttributes (or the default
* attributes, resp.)
*
* \sa setGridAttributes
* \sa resetGridAttributes
* \sa AbstractCoordinatePlane::globalGridAttributes
*/
bool hasOwnGridAttributes( bool circular ) const;
qreal angleUnit() const;
qreal radiusUnit() const;
/** reimpl */
virtual void paint( QPainter* );
protected:
virtual DataDimensionsList getDataDimensionsList() const;
void paintEvent ( QPaintEvent* );
void resizeEvent ( QResizeEvent* );
void layoutDiagrams();
protected Q_SLOTS:
void slotLayoutChanged( AbstractDiagram* diagram );
void adjustZoomAndRepaint();
private:
void setHasOwnGridAttributes( bool circular, bool on );
};
}
#endif
|