Commit 0d44402f authored by Inge Wallin's avatar Inge Wallin

Make Body inherit Item

Previously Body was a root class and all subclasses of Body inherited both
Item and Body. This seemed strange.
parent 3c723680
......@@ -30,7 +30,7 @@ Legend
* GslSolver
* GslAdaptiveSolver
* Item{world.h} Root class for world items (bodies, forces)
* Item{item.h} Root class for world items (bodies, forces)
[world, group, objectErrors, color]
* NoteImage Image embedded in a Note
......@@ -42,17 +42,18 @@ Legend
* World The root object for everything visible
[time, timeScale, bodies, forces, joints, solvers...]
* Body{world.h} Anything that has dynamic variables that
* Body{body.h} Anything that has dynamic variables that
require ODE integration
* Particle(Item, Body)
* ChargedParticle
* GasParticle
* RigidBody(Item, Body)
* Disk
* BasePolygon
* Box
* Polygon
* Plane(Item, Body) Unmovable rigid plane
* Particle(Item, Body)
* ChargedParticle
* GasParticle
* RigidBody(Item, Body)
* Disk
* BasePolygon
* Box
* Polygon
* Plane(Item, Body) Unmovable rigid plane
* Force{world.h} Anything that acts upon bodies changing
derivatives of dynamic variables
......
......@@ -28,31 +28,27 @@
#include <vector> // XXX: Replace if Qt is enabled.
#include "types.h"
#include "object.h"
#include "item.h"
namespace StepCore
{
//class World;
//class Solver;
//class Item;
//class ItemGroup;
//class CollisionSolver;
//class ConstraintSolver;
/** \ingroup bodies
* \brief Interface for bodies
*
* Body is anything that has dynamic variables that require ODE integration
*/
class Body
class Body : public Item
{
STEPCORE_OBJECT(Body)
public:
Body(): _variablesOffset(0) {}
Body(const QString& name = QString())
: Item(name)
, _variablesOffset(0)
{}
virtual ~Body() {}
/** Get count of dynamic variables (not including velocities) */
......
......@@ -100,7 +100,7 @@ protected:
/** \ingroup bodies
* \brief Particle with mass
*/
class Particle: public Item, public Body
class Particle: public Body
{
STEPCORE_OBJECT(Particle)
......
......@@ -141,7 +141,7 @@ protected:
/** \ingroup bodies
* \brief Rigid body
*/
class RigidBody: public Item, public Body
class RigidBody: public Body
{
STEPCORE_OBJECT(RigidBody)
......@@ -358,7 +358,7 @@ public:
/** \ingroup bodies
* \brief Unmovable rigid plane
*/
class Plane: public Item, public Body
class Plane: public Body
{
STEPCORE_OBJECT(Plane)
......
......@@ -21,8 +21,7 @@
#include <stepcore/solver.h>
#include <stepcore/types.h>
class WorldCopyTestItem: public StepCore::Item,
public StepCore::Body,
class WorldCopyTestItem: public StepCore::Body,
public StepCore::Force
{
STEPCORE_OBJECT(WorldCopyTestItem)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment