Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 14, 2005, 12:28:44 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: simple definition of a PhisicsConnection

File:
1 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/util/physics/physics_connection.h

    r4178 r4181  
    11/*!
    2     \file proto_class.h
    3     \brief Definition of ...
    4 
     2    \file physics_connection.h
     3    \brief Definition of The Physical Connection Class.
    54*/
    65
    7 #ifndef _PROTO_CLASS_H
    8 #define _PROTO_CLASS_H
     6#ifndef _PHYSICS_CONNECTION_H
     7#define _PHYSICS_CONNECTION_H
    98
    109#include "base_object.h"
    1110
    12 // FORWARD DEFINITION
     11//! An enumerator for different ConnectionTypes
     12typedef enum PCON_Type { PCON_IPhysIPhys = 0,
     13                         PCON_IPhysField = 1,
     14                         PCON_ParticlesField = 2 };
    1315
    1416
     17// Forward Declaration
     18class Field;
     19class IPhysics;
     20class ParticleSystem;
    1521
    16 //! A class for ...
    17 class ProtoClass : public BaseObject {
     22
     23typedef struct PhysConnection
     24{
     25  PCON_Type type;                    //!< What kind of connection this is.
     26
     27  IPhysics* subject;                 //!< The main Subject of this Connection.
     28  IPhysics* partner2;                //!< The second partner of this Connection.
     29
     30  ParticleSystem* particleSystem;    //!< A ParticleSystem in this Connection
     31 
     32  Field* field;                      //!< The field to connect either subject of ParticleSystem to.
     33};
     34
     35//! A class that Handles Physical Connection between subjects
     36class PhysicsConnection : public BaseObject {
    1837
    1938 public:
    20   ProtoClass();
    21   virtual ~ProtoClass();
     39  PhysicsConnection();
     40  virtual ~PhysicsConnection();
    2241
     42  bool addConnection(IPhysics* partnerOne, IPhysics* partnerTwo);
     43  bool addConnection(IPhysics* subject, Field* field);
     44  bool addConnection(ParticleSystem* particleSystem, Field* field);
     45
     46  inline PhysConnection* getConnection(void) const {return this->connection;}
    2347
    2448 private:
    25 
     49  PhysConnection* connection;        //!< The Physical Connection.
    2650};
    2751
    28 #endif /* _PROTO_CLASS_H */
     52#endif /* _PHYSICS_CONNECTION_H */
Note: See TracChangeset for help on using the changeset viewer.