diff --git a/stepcore/CLASSES b/stepcore/CLASSES index 220bacec81f36c0f4baf341dfb85a16d7260c8f5..3d5321391375886de1eb37175ff31ce495a70320 100644 --- a/stepcore/CLASSES +++ b/stepcore/CLASSES @@ -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 diff --git a/stepcore/body.h b/stepcore/body.h index ea1c1a08d87796c80ba9662ab8b48be20815b0b4..1212643fc7e105225dbce1199ab04c156d124cf8 100644 --- a/stepcore/body.h +++ b/stepcore/body.h @@ -28,31 +28,27 @@ #include // 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) */ diff --git a/stepcore/particle.h b/stepcore/particle.h index b9de3af0398291fd49b4028519d717f8abc914bd..595a675301607554f02bea7266ea8b534920220f 100644 --- a/stepcore/particle.h +++ b/stepcore/particle.h @@ -100,7 +100,7 @@ protected: /** \ingroup bodies * \brief Particle with mass */ -class Particle: public Item, public Body +class Particle: public Body { STEPCORE_OBJECT(Particle) diff --git a/stepcore/rigidbody.h b/stepcore/rigidbody.h index aff24888040a2f1035f1fdcfb34a88fcee4a95b2..26edd270e1b4ee07ca75d36f2914b65bd3bfb901 100644 --- a/stepcore/rigidbody.h +++ b/stepcore/rigidbody.h @@ -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) diff --git a/stepcore_tests/worldcopy.cc b/stepcore_tests/worldcopy.cc index e3fc5caf66dea13f063f8caf67f5ce9d08d846c4..c015ae29939bb647a0c9fa497e413d8c4ec29692 100644 --- a/stepcore_tests/worldcopy.cc +++ b/stepcore_tests/worldcopy.cc @@ -21,8 +21,7 @@ #include #include -class WorldCopyTestItem: public StepCore::Item, - public StepCore::Body, +class WorldCopyTestItem: public StepCore::Body, public StepCore::Force { STEPCORE_OBJECT(WorldCopyTestItem)