qwt_painter_command.h
Go to the documentation of this file.
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 
10 #ifndef QWT_PAINTER_COMMAND_H
11 #define QWT_PAINTER_COMMAND_H
12 
13 #include "qwt_global.h"
14 
15 #include <qpaintengine.h>
16 #include <qpixmap.h>
17 #include <qimage.h>
18 #include <qpolygon.h>
19 #include <qpainterpath.h>
20 
21 class QPainterPath;
22 
33 {
34  public:
36  enum Type
37  {
39  Invalid = -1,
40 
43 
46 
49 
51  State
52  };
53 
55  struct PixmapData
56  {
57  QRectF rect;
58  QPixmap pixmap;
59  QRectF subRect;
60  };
61 
63  struct ImageData
64  {
65  QRectF rect;
66  QImage image;
67  QRectF subRect;
68  Qt::ImageConversionFlags flags;
69  };
70 
72  struct StateData
73  {
74  QPaintEngine::DirtyFlags flags;
75 
76  QPen pen;
77  QBrush brush;
78  QPointF brushOrigin;
80  Qt::BGMode backgroundMode;
81  QFont font;
82  QTransform transform;
83 
84  Qt::ClipOperation clipOperation;
85  QRegion clipRegion;
86  QPainterPath clipPath;
88 
89  QPainter::RenderHints renderHints;
90  QPainter::CompositionMode compositionMode;
91  qreal opacity;
92  };
93 
96 
97  explicit QwtPainterCommand( const QPainterPath& );
98 
99  QwtPainterCommand( const QRectF& rect,
100  const QPixmap&, const QRectF& subRect );
101 
102  QwtPainterCommand( const QRectF& rect,
103  const QImage&, const QRectF& subRect,
104  Qt::ImageConversionFlags );
105 
106  explicit QwtPainterCommand( const QPaintEngineState& );
107 
109 
110  QwtPainterCommand& operator=(const QwtPainterCommand& );
111 
112  Type type() const;
113 
114  QPainterPath* path();
115  const QPainterPath* path() const;
116 
117  PixmapData* pixmapData();
118  const PixmapData* pixmapData() const;
119 
120  ImageData* imageData();
121  const ImageData* imageData() const;
122 
123  StateData* stateData();
124  const StateData* stateData() const;
125 
126  private:
127  void copy( const QwtPainterCommand& );
128  void reset();
129 
131 
132  union
133  {
134  QPainterPath* m_path;
138  };
139 };
140 
143 {
144  return m_type;
145 }
146 
148 inline const QPainterPath* QwtPainterCommand::path() const
149 {
150  return m_path;
151 }
152 
154 inline const QwtPainterCommand::PixmapData*
156 {
157  return m_pixmapData;
158 }
159 
161 inline const QwtPainterCommand::ImageData*
163 {
164  return m_imageData;
165 }
166 
168 inline const QwtPainterCommand::StateData*
170 {
171  return m_stateData;
172 }
173 
174 #endif
QwtPainterCommand::PixmapData
Attributes how to paint a QPixmap.
Definition: qwt_painter_command.h:55
QwtPainterCommand::StateData::clipOperation
Qt::ClipOperation clipOperation
Definition: qwt_painter_command.h:84
QwtPainterCommand::StateData::opacity
qreal opacity
Definition: qwt_painter_command.h:91
QwtPainterCommand::StateData::backgroundBrush
QBrush backgroundBrush
Definition: qwt_painter_command.h:79
QwtPainterCommand::StateData::compositionMode
QPainter::CompositionMode compositionMode
Definition: qwt_painter_command.h:90
detail::copy
auto copy(const Range &range, OutputIt out) -> OutputIt
Definition: ranges.h:22
backward::ColorMode::type
type
Definition: backward.hpp:3600
QwtPainterCommand::StateData::brushOrigin
QPointF brushOrigin
Definition: qwt_painter_command.h:78
QwtPainterCommand::ImageData::rect
QRectF rect
Definition: qwt_painter_command.h:65
QwtPainterCommand::m_type
Type m_type
Definition: qwt_painter_command.h:130
QwtPainterCommand
Definition: qwt_painter_command.h:32
QwtPainterCommand::type
Type type() const
Definition: qwt_painter_command.h:142
QwtPainterCommand::m_pixmapData
PixmapData * m_pixmapData
Definition: qwt_painter_command.h:135
QwtPainterCommand::PixmapData::subRect
QRectF subRect
Definition: qwt_painter_command.h:59
QwtPainterCommand::StateData::brush
QBrush brush
Definition: qwt_painter_command.h:77
qwt_global.h
QwtPainterCommand::ImageData
Attributes how to paint a QImage.
Definition: qwt_painter_command.h:63
QwtPainterCommand::Type
Type
Type of the paint command.
Definition: qwt_painter_command.h:36
QwtPainterCommand::Pixmap
@ Pixmap
Draw a QPixmap.
Definition: qwt_painter_command.h:45
QwtPainterCommand::path
QPainterPath * path()
Definition: qwt_painter_command.cpp:216
QwtPainterCommand::StateData::pen
QPen pen
Definition: qwt_painter_command.h:76
QwtPainterCommand::ImageData::flags
Qt::ImageConversionFlags flags
Definition: qwt_painter_command.h:68
QwtPainterCommand::StateData::backgroundMode
Qt::BGMode backgroundMode
Definition: qwt_painter_command.h:80
QwtPainterCommand::StateData::flags
QPaintEngine::DirtyFlags flags
Definition: qwt_painter_command.h:74
QwtPainterCommand::Path
@ Path
Draw a QPainterPath.
Definition: qwt_painter_command.h:42
QwtPainterCommand::m_imageData
ImageData * m_imageData
Definition: qwt_painter_command.h:136
QwtPainterCommand::m_stateData
StateData * m_stateData
Definition: qwt_painter_command.h:137
QwtPainterCommand::pixmapData
PixmapData * pixmapData()
Definition: qwt_painter_command.cpp:222
QwtPainterCommand::StateData::isClipEnabled
bool isClipEnabled
Definition: qwt_painter_command.h:87
QwtPainterCommand::Image
@ Image
Draw a QImage.
Definition: qwt_painter_command.h:48
backward::Color::reset
@ reset
Definition: backward.hpp:3678
QwtPainterCommand::StateData::clipRegion
QRegion clipRegion
Definition: qwt_painter_command.h:85
QwtPainterCommand::StateData::clipPath
QPainterPath clipPath
Definition: qwt_painter_command.h:86
QwtPainterCommand::ImageData::subRect
QRectF subRect
Definition: qwt_painter_command.h:67
QwtPainterCommand::StateData::transform
QTransform transform
Definition: qwt_painter_command.h:82
QWT_EXPORT
#define QWT_EXPORT
Definition: qwt_global.h:38
QwtPainterCommand::m_path
QPainterPath * m_path
Definition: qwt_painter_command.h:134
QwtPainterCommand::PixmapData::rect
QRectF rect
Definition: qwt_painter_command.h:57
QwtPainterCommand::stateData
StateData * stateData()
Definition: qwt_painter_command.cpp:234
QwtPainterCommand::ImageData::image
QImage image
Definition: qwt_painter_command.h:66
QwtPainterCommand::StateData::renderHints
QPainter::RenderHints renderHints
Definition: qwt_painter_command.h:89
QwtPainterCommand::PixmapData::pixmap
QPixmap pixmap
Definition: qwt_painter_command.h:58
QwtPainterCommand::StateData
Attributes of a state change.
Definition: qwt_painter_command.h:72
QwtPainterCommand::imageData
ImageData * imageData()
Definition: qwt_painter_command.cpp:228
QwtPainterCommand::StateData::font
QFont font
Definition: qwt_painter_command.h:81


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:24