Changeset View
Changeset View
Standalone View
Standalone View
step/particlegraphics.cc
Show All 25 Lines | |||||
26 | #include <QPainter> | 26 | #include <QPainter> | ||
27 | 27 | | |||
28 | ParticleGraphicsItem::ParticleGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | 28 | ParticleGraphicsItem::ParticleGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | ||
29 | : StepGraphicsItem(item, worldModel) | 29 | : StepGraphicsItem(item, worldModel) | ||
30 | { | 30 | { | ||
31 | Q_ASSERT(dynamic_cast<StepCore::Particle*>(_item) != NULL); | 31 | Q_ASSERT(dynamic_cast<StepCore::Particle*>(_item) != NULL); | ||
32 | setFlag(QGraphicsItem::ItemIsSelectable); | 32 | setFlag(QGraphicsItem::ItemIsSelectable); | ||
33 | setFlag(QGraphicsItem::ItemIsMovable); | 33 | setFlag(QGraphicsItem::ItemIsMovable); | ||
34 | setAcceptsHoverEvents(true); | 34 | setAcceptHoverEvents(true); | ||
35 | _lastArrowRadius = -1; | 35 | _lastArrowRadius = -1; | ||
36 | _velocityHandler = new ArrowHandlerGraphicsItem(item, worldModel, this, | 36 | _velocityHandler = new ArrowHandlerGraphicsItem(item, worldModel, this, | ||
37 | _item->metaObject()->property("velocity")); | 37 | _item->metaObject()->property("velocity")); | ||
38 | _velocityHandler->setVisible(false); | 38 | _velocityHandler->setVisible(false); | ||
39 | //scene()->addItem(_velocityHandler); | 39 | //scene()->addItem(_velocityHandler); | ||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | QPainterPath ParticleGraphicsItem::shape() const | 42 | QPainterPath ParticleGraphicsItem::shape() const | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |