File: qwt_plot_renderer.sip

package info (click to toggle)
pyqt-qwt 1.02.02-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 796 kB
  • sloc: python: 5,663; cpp: 273; makefile: 16; sh: 13
file content (150 lines) | stat: -rw-r--r-- 4,143 bytes parent folder | download | duplicates (2)
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
/* 
 * python-qwt. Python wrapper for the Qwt Widget Library
 * Copyright (C) 1997   Josef Wilgen
 * Copyright (C) 2002   Uwe Rathmann
 * Copyright (C) 2015   Gudjon I. Gudjonsson
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the Qwt License, Version 1.0
 *****************************************************************************/

class QPrinter;

class QwtPlotRenderer: QObject
{
%TypeHeaderCode
#include <qwt_plot_renderer.h>
%End
public:
    //! Disard flags
    enum DiscardFlag
    {
        //! Render all components of the plot
        DiscardNone             = 0x00,

        //! Don't render the background of the plot
        DiscardBackground       = 0x01,

        //! Don't render the title of the plot
        DiscardTitle            = 0x02,

        //! Don't render the legend of the plot
        DiscardLegend           = 0x04,

        //! Don't render the background of the canvas
        DiscardCanvasBackground = 0x08,

        //! Don't render the footer of the plot
        DiscardFooter           = 0x10,

        /*! 
            Don't render the frame of the canvas

            \note This flag has no effect when using
                  style sheets, where the frame is part
                  of the background
         */
        DiscardCanvasFrame           = 0x20

    };

    //! Disard flags
    typedef QFlags<QwtPlotRenderer::DiscardFlag> DiscardFlags;

    /*!
       \brief Layout flags
       \sa setLayoutFlag(), testLayoutFlag()
     */
    enum LayoutFlag
    {
        //! Use the default layout as on screen
        DefaultLayout   = 0x00,

        /*!
          Instead of the scales a box is painted around the plot canvas,
          where the scale ticks are aligned to.
         */
        FrameWithScales = 0x01
    };

    //! Layout flags
    typedef QFlags<QwtPlotRenderer::LayoutFlag> LayoutFlags;

    explicit QwtPlotRenderer( QObject * /Transfer/ = NULL );
    virtual ~QwtPlotRenderer();

    void setDiscardFlag( DiscardFlag flag, bool on = true );
    bool testDiscardFlag( DiscardFlag flag ) const;

    void setDiscardFlags( DiscardFlags flags );
    DiscardFlags discardFlags() const;

    void setLayoutFlag( LayoutFlag flag, bool on = true );
    bool testLayoutFlag( LayoutFlag flag ) const;

    void setLayoutFlags( LayoutFlags flags );
    LayoutFlags layoutFlags() const;

    void renderDocument( QwtPlot *, const QString &fileName,
        const QSizeF &sizeMM, int resolution = 85 );

    void renderDocument( QwtPlot *,
        const QString &fileName, const QString &format,
        const QSizeF &sizeMM, int resolution = 85 );

/*
#ifndef QWT_NO_SVG
#ifdef QT_SVG_LIB
#if QT_VERSION >= 0x040500
*/
    //void renderTo( QwtPlot *, QSvgGenerator & ) const;
/*
#endif
#endif
#endif
*/
//#ifndef QT_NO_PRINTER
    void renderTo( QwtPlot *, QPrinter & ) const;
//#endif

    void renderTo( QwtPlot *, QPaintDevice &p ) const;

    virtual void render( QwtPlot *,
        QPainter *, const QRectF &rect ) const;

    virtual void renderTitle( const QwtPlot *,
        QPainter *, const QRectF & ) const;

    virtual void renderFooter( const QwtPlot *,
        QPainter *, const QRectF & ) const;

    virtual void renderScale( const QwtPlot *, QPainter *,
        int axisId, int startDist, int endDist,
        int baseDist, const QRectF & ) const;

    virtual void renderCanvas( const QwtPlot *,
        QPainter *, const QRectF &canvasRect,
        const QwtScaleMap* maps ) const;

    virtual void renderLegend( 
        const QwtPlot *, QPainter *, const QRectF & ) const;

    bool exportTo( QwtPlot *, const QString &documentName,
        const QSizeF &sizeMM = QSizeF( 300, 200 ), int resolution = 85 );

/*private:
    void buildCanvasMaps( const QwtPlot *,
        const QRectF &, QwtScaleMap maps[] ) const;

    bool updateCanvasMargins( QwtPlot *,
        const QRectF &, const QwtScaleMap maps[] ) const;

private:
    class PrivateData;
    PrivateData *d_data;*/
};

/*
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotRenderer::DiscardFlags )
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotRenderer::LayoutFlags )
*/