File indexing completed on 2024-05-05 03:51:47
0001 /*. 0002 SPDX-FileCopyrightText: 2007 Vladimir Kuznetsov <ks.vladimir@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef STEP_PARTICLEGRAPHICS_H 0008 #define STEP_PARTICLEGRAPHICS_H 0009 0010 #include "worldgraphics.h" 0011 #include "stepgraphicsitem.h" 0012 0013 #include <stepcore/particle.h> 0014 0015 class ParticleGraphicsItem: public StepGraphicsItem { 0016 public: 0017 ParticleGraphicsItem(StepCore::Item* item, WorldModel* worldModel); 0018 0019 QPainterPath shape() const override; 0020 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; 0021 0022 void viewScaleChanged() override; 0023 void stateChanged() override; 0024 void worldDataChanged(bool) override; 0025 0026 protected: 0027 StepCore::Particle* particle() const { 0028 return static_cast<StepCore::Particle*>(_item); } 0029 0030 ArrowHandlerGraphicsItem *_velocityHandler; 0031 double _lastArrowRadius; 0032 0033 static const int RADIUS = 7; 0034 }; 0035 0036 #endif 0037