File indexing completed on 2024-06-09 09:27:47

0001 /***************************************************************************
0002  *   Copyright (C) 2005 by David Saxton                                    *
0003  *   david@bluehaze.org                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #ifndef CHASSISCIRCULAR2_H
0012 #define CHASSISCIRCULAR2_H
0013 
0014 #include "mechanicsitem.h"
0015 
0016 /**
0017 @short Mechanics Framework, circular base, two wheels
0018 @author David Saxton
0019 */
0020 class ChassisCircular2 : public MechanicsItem
0021 {
0022 public:
0023     ChassisCircular2(MechanicsDocument *mechanicsDocument, bool newItem, const char *id = nullptr);
0024     ~ChassisCircular2() override;
0025 
0026     static Item *construct(ItemDocument *itemDocument, bool newItem, const char *id);
0027     static LibraryItem *libraryItem();
0028 
0029     virtual void advance(int phase);
0030 
0031 protected:
0032     void itemResized() override;
0033     void drawShape(QPainter &p) override;
0034 
0035     double m_theta1; // Angle of rotation of wheel 1 (used for drawing)
0036     double m_theta2; // Angle of rotation of wheel 1 (used for drawing)
0037 
0038     QRect m_wheel1Pos; // Position of first wheel, with respect to top left of item
0039     QRect m_wheel2Pos; // Position of second wheel, with respect to top left of item
0040 };
0041 
0042 #endif