QWT API (中文)
7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
src
plot
qwt_compass_rose.h
1
/******************************************************************************
2
* Qwt Widget Library
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the Qwt License, Version 1.0
8
*
9
* Modified by ChenZongYan in 2024 <czy.t@163.com>
10
* Summary of major modifications (see ChangeLog.md for full history):
11
* 1. CMake build system & C++11 throughout.
12
* 2. Core panner/ zoomer refactored:
13
* - QwtPanner → QwtCachePanner (pixmap-cache version)
14
* - New real-time QwtPlotPanner derived from QwtPicker.
15
* 3. Zoomer supports multi-axis.
16
* 4. Parasite-plot framework:
17
* - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18
* - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19
* 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20
* 6. Raster & color-map extensions:
21
* - QwtGridRasterData (2-D table + interpolation)
22
* - QwtLinearColorMap::stopColors(), stopPos() API rename.
23
* 7. Bar-chart: expose pen/brush control.
24
* 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25
*****************************************************************************/
26
27
#ifndef QWT_COMPASS_ROSE_H
28
#define QWT_COMPASS_ROSE_H
29
30
#include "qwt_global.h"
31
#include <qpalette.h>
32
33
class
QPainter;
34
46
class
QWT_EXPORT
QwtCompassRose
47
{
48
public
:
49
// Constructor
50
QwtCompassRose
();
51
// Destructor
52
virtual
~QwtCompassRose
();
53
54
// Sets the palette for the rose
55
virtual
void
setPalette(
const
QPalette& );
56
// Returns the palette of the rose
57
const
QPalette& palette()
const
;
58
77
virtual
void
draw
( QPainter* painter,
78
const
QPointF& center,
double
radius,
double
north,
79
QPalette::ColorGroup colorGroup = QPalette::Active )
const
= 0;
80
81
private
:
82
Q_DISABLE_COPY(
QwtCompassRose
)
83
84
QPalette m_palette;
85
};
86
99
class
QWT_EXPORT
QwtSimpleCompassRose
:
public
QwtCompassRose
100
{
101
public
:
102
// Constructs a simple compass rose with specified number of thorns and levels
103
QwtSimpleCompassRose
(
int
numThorns = 8,
int
numThornLevels = -1 );
104
// Destructor
105
virtual
~QwtSimpleCompassRose
();
106
107
// Sets the width of the rose heads (range: 0.03 to 0.4)
108
void
setWidth(
double
);
109
// Returns the width of the rose heads
110
double
width()
const
;
111
112
// Sets the number of thorns on one level (aligned to multiple of 4, minimum 4)
113
void
setNumThorns(
int
);
114
// Returns the number of thorns
115
int
numThorns()
const
;
116
117
// Sets the number of thorn levels
118
void
setNumThornLevels(
int
);
119
// Returns the number of thorn levels
120
int
numThornLevels()
const
;
121
122
// Sets the shrink factor for thorns with each level (default: 0.9)
123
void
setShrinkFactor(
double
factor );
124
// Returns the shrink factor for thorns
125
double
shrinkFactor()
const
;
126
127
// Draw the rose (override from base class)
128
virtual
void
draw( QPainter*,
129
const
QPointF& center,
double
radius,
double
north,
130
QPalette::ColorGroup = QPalette::Active )
const override
;
131
132
// Static helper to draw a rose with specified parameters
133
static
void
drawRose( QPainter*,
const
QPalette&,
134
const
QPointF& center,
double
radius,
double
north,
double
width,
135
int
numThorns,
int
numThornLevels,
double
shrinkFactor );
136
137
private
:
138
class
PrivateData;
139
PrivateData* m_data;
140
};
141
142
#endif
QwtCompassRose
罗盘花的抽象基类
Definition
qwt_compass_rose.h:47
QwtCompassRose::draw
virtual void draw(QPainter *painter, const QPointF ¢er, double radius, double north, QPalette::ColorGroup colorGroup=QPalette::Active) const =0
绘制罗盘花
QwtSimpleCompassRose
QwtCompass的简单罗盘花
Definition
qwt_compass_rose.h:100
制作者
1.9.8