ATLAS Offline Software
Loading...
Searching...
No Matches
PhiSectionWidget.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef PHISECTIONWIDGET_H
6#define PHISECTIONWIDGET_H
7
9// //
10// Header file for class PhiSectionWidget //
11// //
12// Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
13// //
14// Initial VP1 version: September 2007 //
15// Major update: January 2009 //
16// //
18
20#include "VP1Base/VP1Interval.h"
21#include "VP1Base/VP1Msg.h"
22
23#include <QGraphicsView>
24#include <QByteArray>
25
26class PhiSectionWidget : public QGraphicsView, public VP1HelperClassBase {
27
28
29 Q_OBJECT
30
31public:
32
33 PhiSectionWidget(QWidget * parent,IVP1System * sys = 0);
34 virtual ~PhiSectionWidget();
35
36 int numberOfSectors() const;
37 void setNumberOfSectors(int,bool forceAllEnabled = false);//(default is 12)
38
39 bool allSectorsOn() const;
40 bool allSectorsOff() const;
41
42 //Return disjoint intervals of allowed phi values. If all sectors
43 //are off, an empty list is returned. If all are on, a single
44 //interval of 0..2*M_PI is returned:
45 QList<VP1Interval> enabledPhiRanges() const;
46
47 QString enabledRangesToString() const;
48
49 //This further imposes a condition of phi in [phi_min,phi_max]:
50 QList<VP1Interval> enabledPhiRanges( double phi_min, double phi_max ) const;
51
52 QByteArray state() const;
53 void setState(QByteArray);
54
55 void launchContextMenu(QPoint);
56 void setSectorStatus(int,bool);
57
58 //Convenience methods for dealing with "sectors" outside the widget:
59 bool virtualSectorEnabled(int iSector, int nSectors) const;
60 QVector<bool> virtualSectorsEnabled(int nSectors) const;
61 static int phiToVirtualSectorIndex(double phi,int nSectors);
62 void setAllowedNumberOfSectors(QList<int> allowedNSectors, bool allowCustom = false);//If current number is not
63 //among the allowed values,
64 //the lowest of the allowed
65 //sectors will be chosen
66 //(unless allowCustom=true).
67 //Call ignored if invalid list.
68
69signals:
70 void enabledPhiRangesChanged(const QList<VP1Interval>&);
71
72protected:
73 void mousePressEvent(QMouseEvent *);
74 void resizeEvent(QResizeEvent *);
75 void mouseMoveEvent(QMouseEvent *event);
76 void dropEvent(QDropEvent *event);
77 void dragEnterEvent(QDragEnterEvent *event);
78 void dragLeaveEvent(QDragLeaveEvent * event);
79 void dragMoveEvent(QDragMoveEvent * event);
80private:
81
82 class Imp;
84
85};
86
87#endif
Scalar phi() const
phi method
bool virtualSectorEnabled(int iSector, int nSectors) const
void setAllowedNumberOfSectors(QList< int > allowedNSectors, bool allowCustom=false)
static int phiToVirtualSectorIndex(double phi, int nSectors)
void dragLeaveEvent(QDragLeaveEvent *event)
void mouseMoveEvent(QMouseEvent *event)
bool allSectorsOn() const
void setNumberOfSectors(int, bool forceAllEnabled=false)
QList< VP1Interval > enabledPhiRanges() const
bool allSectorsOff() const
void enabledPhiRangesChanged(const QList< VP1Interval > &)
void launchContextMenu(QPoint)
void setSectorStatus(int, bool)
QString enabledRangesToString() const
void setState(QByteArray)
void resizeEvent(QResizeEvent *)
int numberOfSectors() const
void dragEnterEvent(QDragEnterEvent *event)
QVector< bool > virtualSectorsEnabled(int nSectors) const
void dropEvent(QDropEvent *event)
void mousePressEvent(QMouseEvent *)
void dragMoveEvent(QDragMoveEvent *event)
PhiSectionWidget(QWidget *parent, IVP1System *sys=0)
QByteArray state() const
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")