|
ATLAS Offline Software
|
#include <VP1GraphicsView.h>
Definition at line 22 of file VP1GraphicsView.h.
◆ Mode
Enumerator |
---|
PICK | |
CHANGEVIEW | |
SEEK | |
DRAGZOOM | |
DRAGZOOMHOLD | |
Definition at line 37 of file VP1GraphicsView.h.
◆ VP1GraphicsView() [1/2]
VP1GraphicsView::VP1GraphicsView |
( |
QWidget * |
parent = 0 | ) |
|
◆ VP1GraphicsView() [2/2]
VP1GraphicsView::VP1GraphicsView |
( |
QGraphicsScene * |
scene, |
|
|
QWidget * |
parent = 0 |
|
) |
| |
◆ ~VP1GraphicsView()
VP1GraphicsView::~VP1GraphicsView |
( |
| ) |
|
|
virtual |
◆ abortZoomAnimation
void VP1GraphicsView::abortZoomAnimation |
( |
| ) |
|
|
slot |
◆ addItemCollection
◆ clearSelections
void VP1GraphicsView::clearSelections |
( |
| ) |
|
|
slot |
◆ drawForeground()
void VP1GraphicsView::drawForeground |
( |
QPainter * |
painter, |
|
|
const QRectF & |
rect |
|
) |
| |
|
protected |
Definition at line 987 of file VP1GraphicsView.cxx.
992 QRect imgrect = viewport()->rect();
993 imgrect.setWidth(imgrect.width()*3);
994 imgrect.setHeight(imgrect.height()*3);
997 painter->setRenderHint(QPainter::Antialiasing,
false);
998 painter->drawImage(mapToScene(viewport()->rect()).boundingRect(),*(
m_d->
helptextimage),
◆ drawItems()
void VP1GraphicsView::drawItems |
( |
QPainter * |
painter, |
|
|
int |
numItems, |
|
|
QGraphicsItem * |
items[], |
|
|
const QStyleOptionGraphicsItem |
options[] |
|
) |
| |
|
protected |
Definition at line 1091 of file VP1GraphicsView.cxx.
1097 QGraphicsView::drawItems(painter,numItems,
items,
options);
1102 for (
int i = 0;
i < numItems; ++
i) {
1105 painter->setTransform(
item->sceneTransform(),
true);
◆ emitSelectionChanged()
◆ fitViewToContents
void VP1GraphicsView::fitViewToContents |
( |
| ) |
|
|
slot |
Definition at line 220 of file VP1GraphicsView.cxx.
225 fitInView( scene()->sceneRect(), Qt::KeepAspectRatio );
◆ initiateAnimatedZoomTo
void VP1GraphicsView::initiateAnimatedZoomTo |
( |
QRectF |
goal | ) |
|
|
slot |
Definition at line 780 of file VP1GraphicsView.cxx.
788 QRectF currentview = mapToScene(viewport()->rect()).boundingRect();
790 double w1 = currentview.width(),
h1 = currentview.height();
791 double x1 = currentview.x(),
y1 = currentview.y();
793 double w2 = goal.width(), h2 = goal.height();
794 double x2 = goal.x(),
y2 = goal.y();
797 for (
double f = eps;
f < 1.0+0.5*eps;
f+=eps ) {
807 setRenderHints(QPainter::RenderHints());
◆ keyPressEvent()
void VP1GraphicsView::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
protected |
Definition at line 244 of file VP1GraphicsView.cxx.
253 viewport()->update();
256 switch (
event->key()) {
258 if (
event->modifiers() & Qt::ControlModifier)
266 viewport()->update();
293 if (
event->modifiers() & Qt::ControlModifier)
315 QGraphicsView::keyPressEvent(
event);
◆ mode()
◆ mouseDoubleClickEvent()
void VP1GraphicsView::mouseDoubleClickEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
Definition at line 406 of file VP1GraphicsView.cxx.
410 viewport()->update();
414 QGraphicsView::mouseDoubleClickEvent(
event);
420 if (
ic->itemBelongsAndIsPresentlyActive(
item)) {
426 QGraphicsView::mouseDoubleClickEvent(
event);
◆ mouseMoveEvent()
void VP1GraphicsView::mouseMoveEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
Definition at line 432 of file VP1GraphicsView.cxx.
440 ViewportAnchor
save = transformationAnchor();
441 setTransformationAnchor(AnchorViewCenter);
443 setTransformationAnchor(
save);
450 if (
ic->itemBelongsAndIsPresentlyActive(
item)) {
457 QGraphicsView::mouseMoveEvent(
event);
◆ mousePressEvent()
void VP1GraphicsView::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
Definition at line 462 of file VP1GraphicsView.cxx.
464 setFocus(Qt::MouseFocusReason);
468 viewport()->update();
486 if (
event->buttons()==(Qt::LeftButton|Qt::MiddleButton|Qt::RightButton)) {
503 if (
event->buttons()!=Qt::LeftButton) {
504 QGraphicsView::mousePressEvent(
event);
516 QPoint pickpoint =
event->pos();
517 if (continueselection) {
522 QGraphicsView::mousePressEvent(
event);
534 ic->itemPickedPrivate(
item);
554 QGraphicsView::mousePressEvent(
event);
◆ mouseReleaseEvent()
void VP1GraphicsView::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
protected |
◆ print
void VP1GraphicsView::print |
( |
| ) |
|
|
slot |
Definition at line 935 of file VP1GraphicsView.cxx.
939 QPrintDialog dialog(&printer,
this);
941 QPainter painter(&printer);
◆ removeItemCollection
Definition at line 393 of file VP1GraphicsView.cxx.
398 ic->setTemporaryIgnoreInteractions(
false);
399 ic->setTemporaryIgnoreMovable(
false);
400 ic->real_detachFromView();
◆ saveImage
void VP1GraphicsView::saveImage |
( |
| ) |
|
|
slot |
Definition at line 947 of file VP1GraphicsView.cxx.
961 QString
filename = QFileDialog::getSaveFileName(0,
"Select target image file", guess,
962 "Image (*.png *.bmp)",
963 0,QFileDialog::DontResolveSymlinks);
967 QPixmap pm = viewport()->grab();
968 if (!(
filename.endsWith(
".png",Qt::CaseInsensitive)||
filename.endsWith(
".bmp",Qt::CaseInsensitive)))
◆ scaleView
void VP1GraphicsView::scaleView |
( |
qreal |
scaleFactor | ) |
|
|
slot |
Definition at line 210 of file VP1GraphicsView.cxx.
213 qreal factor =
transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width();
214 if (factor < 1e-5 || factor > 1e5)
216 scale(scaleFactor, scaleFactor);
◆ seekToPoint
void VP1GraphicsView::seekToPoint |
( |
QPointF |
targetpoint | ) |
|
|
slot |
Definition at line 770 of file VP1GraphicsView.cxx.
772 QRectF currentview = mapToScene(viewport()->rect()).boundingRect();
773 double w1= currentview.width(),
h1= currentview.height();
775 double x2 = targetpoint.x()-0.5*w2,
y2 = targetpoint.y()-0.5*h2;
◆ setAnimatedZoomSteps
void VP1GraphicsView::setAnimatedZoomSteps |
( |
int |
n | ) |
|
|
slot |
◆ setAnimatedZoomTime
void VP1GraphicsView::setAnimatedZoomTime |
( |
double |
t | ) |
|
|
slot |
◆ setDisallowInteractions
Definition at line 901 of file VP1GraphicsView.cxx.
909 ic->setTemporaryIgnoreInteractions(
true);
913 ic->setTemporaryIgnoreInteractions(
false);
◆ setDisallowMovable
Definition at line 918 of file VP1GraphicsView.cxx.
926 ic->setTemporaryIgnoreMovable(
true);
930 ic->setTemporaryIgnoreMovable(
false);
◆ setHome
void VP1GraphicsView::setHome |
( |
| ) |
|
|
slot |
◆ setMode
void VP1GraphicsView::setMode |
( |
const Mode & |
m | ) |
|
|
slot |
Definition at line 319 of file VP1GraphicsView.cxx.
332 setDragMode(QGraphicsView::ScrollHandDrag);
334 setDragMode(QGraphicsView::NoDrag);
340 setCursor(Qt::ArrowCursor);
343 setCursor(Qt::OpenHandCursor);
347 setCursor(Qt::SizeVerCursor);
350 setCursor(Qt::CrossCursor);
361 ic->setTemporaryIgnoreInteractions(
false);
364 ic->setTemporaryIgnoreMovable(
false);
367 ic->setTemporaryIgnoreMovable(
true);
369 ic->setTemporaryIgnoreInteractions(
true);
◆ setZoomFactorOnSeek
void VP1GraphicsView::setZoomFactorOnSeek |
( |
double |
zf | ) |
|
|
slot |
◆ updateZoomAnimation
void VP1GraphicsView::updateZoomAnimation |
( |
| ) |
|
|
privateslot |
◆ viewHome
void VP1GraphicsView::viewHome |
( |
| ) |
|
|
slot |
◆ wheelEvent()
void VP1GraphicsView::wheelEvent |
( |
QWheelEvent * |
event | ) |
|
|
protected |
Definition at line 229 of file VP1GraphicsView.cxx.
233 viewport()->update();
235 double ratefact = 0.8;
236 if (
event->modifiers() & Qt::ControlModifier)
238 if (
event->modifiers() & Qt::ShiftModifier)
◆ HighLightItem
◆ m_d
Imp* VP1GraphicsView::m_d |
|
private |
The documentation for this class was generated from the following files:
QSet< VP1GraphicsItemCollection * > cols_override_unmovable
void abortZoomAnimation()
QList< VP1GraphicsItemCollection * > cols_act
void createNewHelptextImage(const QRect &imrect)
IVP12DViewTransformation * transform
QSet< VP1GraphicsItemCollection * > cols_override_inactive
QPainter::RenderHints savedrenderhints
QMap< QGraphicsItem *, HighLightItem * > selecteditems
def save(self, fileName="./columbo.out")
static QString defaultFileSelectDirectory()
POOL::TEvent event(POOL::TEvent::kClassAccess)
void locateActiveItemAtPoint(QGraphicsItem *&, VP1GraphicsItemCollection *&ic, const QPoint &pos, VP1GraphicsItemCollection *searchic=0)
QList< VP1GraphicsItemCollection * > cols_all
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
void emitSelectionChanged(VP1GraphicsItemCollection *)
void setMode(const Mode &)
QString currentsaveimagefile
void init(VP1GraphicsView *)
bool clearselectionsemitsignals
QList< QGraphicsItem * > lastemittedselecteditems
void setNewSelected(QGraphicsItem *, const bool &multimode=false)
QPoint dragzoom_startpoint
VP1GraphicsItemCollection * ic_multiselection
void initiateAnimatedZoomTo(QRectF)
void seekToPoint(QPointF)
constexpr int pow(int base, int exp) noexcept
QQueue< QRectF > zoomanim_queue
double zoomanim_totaltime
void scaleView(qreal scaleFactor)