OpenStructure
seq_secstr_painter.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_SEQUENCE_VIEWER_SEQ_SECSTR_PAINTER
20 #define OST_SEQUENCE_VIEWER_SEQ_SECSTR_PAINTER
21 
22 /*
23  Author: Stefan Scheuber
24  */
25 
26 
27 #include "painter.hh"
28 #include <QObject>
29 #include <QVarLengthArray>
30 
31 namespace ost { namespace gui {
32 
33 class SeqSecStrPainter : public Painter
34 {
35  Q_OBJECT
36 public:
37  SeqSecStrPainter(QObject* parent = 0);
38  void Paint(QPainter *painter, const QStyleOptionViewItem &option,
39  const QModelIndex &index);
40 private:
41  void PaintRect(QPainter* painter, const QRect& rect, int center, int diff);
42  void DrawArrow(QPainter* painter, const QRect& rect, int center, int std_diff, int diff, int max_diff);
43  QBrush brush_;
44  QPen border_pen_;
45  QPen brush_pen_;
46 };
47 
48 }}
49 
50 #endif
SeqSecStrPainter(QObject *parent=0)
void Paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index)
Definition: base.dox:1