Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5652 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Nov 20, 2005, 6:32:39 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new LoadParam procedure with all NON-cycling load-options, and it works perfectly (on first sight :))

now going to make the same for cycling LoadOptions

Location:
trunk/src/lib
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/p_node.cc

    r5438 r5652  
    141141  static_cast<BaseObject*>(this)->loadParams(root);
    142142
    143   LoadParam<PNode>(root, "rel-coor", this, &PNode::setRelCoor)
     143  LoadParamNEW(root, "rel-coor", this, PNode, setRelCoor)
    144144      .describe("Sets The relative position of the Node to its parent.");
    145145
    146   LoadParam<PNode>(root, "abs-coor", this, &PNode::setAbsCoor)
     146  LoadParamNEW(root, "abs-coor", this, PNode, setAbsCoor)
    147147      .describe("Sets The absolute Position of the Node.");
    148148
    149   LoadParam<PNode>(root, "rel-dir", this, &PNode::setRelDir)
     149  LoadParamNEW(root, "rel-dir", this, PNode, setRelDir)
    150150      .describe("Sets The relative rotation of the Node to its parent.");
    151151
    152   LoadParam<PNode>(root, "abs-dir", this, &PNode::setAbsDir)
     152  LoadParamNEW(root, "abs-dir", this, PNode, setAbsDir)
    153153      .describe("Sets The absolute rotation of the Node.");
    154154
    155   LoadParam<PNode>(root, "parent", this, &PNode::setParent)
     155  LoadParamNEW(root, "parent", this, PNode, setParent)
    156156      .describe("the Name of the Parent of this PNode");
    157157
    158   LoadParam<PNode>(root, "parent-mode", this, &PNode::setParentMode)
     158  LoadParamNEW(root, "parent-mode", this, PNode, setParentMode)
    159159      .describe("the mode to connect this node to its parent ()");
    160160
  • trunk/src/lib/graphics/light.cc

    r5357 r5652  
    8888  static_cast<PNode*>(this)->loadParams(root);
    8989
    90   LoadParam<Light>(root, "diffuse-color", this, &Light::setDiffuseColor)
     90  LoadParamNEW(root, "diffuse-color", this, Light, setDiffuseColor)
    9191      .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
    9292
    93   LoadParam<Light>(root, "specular-color", this, &Light::setSpecularColor)
     93  LoadParamNEW(root, "specular-color", this, Light, setSpecularColor)
    9494      .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
    9595
    96   LoadParam<Light>(root, "attenuation", this, &Light::setAttenuation)
     96  LoadParamNEW(root, "attenuation", this, Light, setAttenuation)
    9797      .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
    9898
    99   LoadParam<Light>(root, "spot-direction", this, &Light::setSpotDirection)
     99  LoadParamNEW(root, "spot-direction", this, Light, setSpotDirection)
    100100      .describe("sets the Direction of the Spot");
    101101
    102   LoadParam<Light>(root, "spot-cutoff", this, &Light::setSpotCutoff)
     102  LoadParamNEW(root, "spot-cutoff", this, Light, setSpotCutoff)
    103103      .describe("the cuttoff of the Spotlight");
    104104}
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5418 r5652  
    130130{
    131131  // ELEMENT2D-native settings.
    132   LoadParam<Element2D>(root, "alignment", this, &Element2D::setAlignment)
     132  LoadParamNEW(root, "alignment", this, Element2D, setAlignment)
    133133      .describe("loads the alignment: (either: center, left, right or screen-center)");
    134134
    135   LoadParam<Element2D>(root, "layer", this, &Element2D::setLayer)
     135  LoadParamNEW(root, "layer", this, Element2D, setLayer)
    136136      .describe("loads the layer onto which to project: (either: top, medium, bottom, below-all)");
    137137
    138   LoadParam<Element2D>(root, "bind-node", this, &Element2D::setBindNode)
     138  LoadParamNEW(root, "bind-node", this, Element2D, setBindNode)
    139139      .describe("sets a node, this 2D-Element should be shown upon (name of the node)");
    140140
    141   LoadParam<Element2D>(root, "visibility", this, &Element2D::setVisibility)
     141  LoadParamNEW(root, "visibility", this, Element2D, setVisibility)
    142142      .describe("if the Element is visible or not");
    143143
    144144
    145145// PNode-style:
    146   LoadParam<Element2D>(root, "rel-coor", this, &Element2D::setRelCoor2D)
     146  LoadParamNEW(root, "rel-coor", this, Element2D, setRelCoor2D)
    147147      .describe("Sets The relative position of the Node to its parent.");
    148148
    149   LoadParam<Element2D>(root, "abs-coor", this, &Element2D::setAbsCoor2D)
     149  LoadParamNEW(root, "abs-coor", this, Element2D, setAbsCoor2D)
    150150      .describe("Sets The absolute Position of the Node.");
    151151
    152   LoadParam<Element2D>(root, "rel-dir", this, &Element2D::setRelDir2D)
     152  LoadParamNEW(root, "rel-dir", this, Element2D, setRelDir2D)
    153153      .describe("Sets The relative rotation of the Node to its parent.");
    154154
    155   LoadParam<Element2D>(root, "abs-dir", this, &Element2D::setAbsDir2D)
     155  LoadParamNEW(root, "abs-dir", this, Element2D, setAbsDir2D)
    156156      .describe("Sets The absolute rotation of the Node.");
    157157
    158   LoadParam<Element2D>(root, "parent", this, &Element2D::setParent2D)
     158  LoadParamNEW(root, "parent", this, Element2D, setParent2D)
    159159      .describe("the Name of the Parent of this Element2D");
    160160
    161   LoadParam<Element2D>(root, "parent-mode", this, &Element2D::setParentMode2D)
     161  LoadParamNEW(root, "parent-mode", this, Element2D, setParentMode2D)
    162162      .describe("the mode to connect this node to its parent ()");
    163163
  • trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc

    r5373 r5652  
    5757void GLMenuImageScreen::loadParams(const TiXmlElement* root)
    5858{
    59   LoadParam<GLMenuImageScreen>(root, "BackgroundImage", this, &GLMenuImageScreen::setBackgroundImage)
     59  LoadParamNEW(root, "BackgroundImage", this, GLMenuImageScreen, setBackgroundImage)
    6060    .describe("sets the image to load onto the loadscreen");
    6161
    62   LoadParam<GLMenuImageScreen>(root, "BackgroundPS", this, &GLMenuImageScreen::setPosScale)
     62  LoadParamNEW(root, "BackgroundPS", this, GLMenuImageScreen, setPosScale)
    6363    .describe("The Position and Scale of the Background Image in %(0-1.0). PosX, PosY, SizeX, SizeY");
    6464
    65   LoadParam<GLMenuImageScreen>(root, "BarImage", this, &GLMenuImageScreen::setBarImage)
     65  LoadParamNEW(root, "BarImage", this, GLMenuImageScreen, setBarImage)
    6666    .describe("sets the image of the LoadingBar");
    6767
    68   LoadParam<GLMenuImageScreen>(root, "BarPS", this, &GLMenuImageScreen::setBarPosScale)
     68  LoadParamNEW(root, "BarPS", this, GLMenuImageScreen, setBarPosScale)
    6969    .describe("The Position and Scale of the Loading Bar in %(0-1.0). PosX, PosY, SizeX, SizeY");
    7070
    71   LoadParam<GLMenuImageScreen>(root, "ElementCount", this, &GLMenuImageScreen::setMaximum)
     71  LoadParamNEW(root, "ElementCount", this, GLMenuImageScreen, setMaximum)
    7272    .describe("The Count of elements to load into the bar (this is only a maximum value)");
    7373}
     
    123123void GLMenuImageScreen::setPosScale(float offsetX, float offsetY, float scaleX, float scaleY)
    124124{
     125  printf("IMG: %f %f %f %f\n", offsetX, offsetY,offsetX, offsetY);
    125126  this->setPosition(offsetX, offsetY);
    126127  this->setScale(scaleX, scaleY);
     
    144145void GLMenuImageScreen::setBarPosScale(float barX, float barY, float barW, float barH)
    145146{
     147  printf("BAR: %f %f %f %f\n", barX, barY, barW, barH);
     148
    146149  this->barX = barX;
    147150  this->barY = barY;
  • trunk/src/lib/lang/base_object.cc

    r5646 r5652  
    6363  // name setup
    6464  LoadParamNEW(root, "name", this, BaseObject, setName)
    65   //LoadParamBase(root, "name", this, ExecutorObjective<BaseObject>(&BaseObject::setName))
    6665      .describe("the Name of the Object.");
    67 //  LoadParam<BaseObject>(root, "name", this, &BaseObject::setName)
    68       //.describe("the name of the Object at hand");
    6966}
    7067
  • trunk/src/lib/particles/particle_emitter.cc

    r5445 r5652  
    2222
    2323#include "load_param.h"
     24#include "factory.h"
    2425#include "debug.h"
    2526#include "stdlibincl.h"
     
    9495  static_cast<PNode*>(this)->loadParams(root);
    9596
    96   LoadParam<ParticleEmitter>(root, "type", this, &ParticleEmitter::setType)
     97  LoadParamNEW(root, "type", this, ParticleEmitter, setType)
    9798    .describe("What type of emitter is this [dot, plane, cube, sphere].");
    9899
    99   LoadParam<ParticleEmitter>(root, "size", this, &ParticleEmitter::setSize)
     100  LoadParamNEW(root, "size", this, ParticleEmitter, setSize)
    100101    .describe("How big the emitter is (no effect on dot-emitters)");
    101102
    102   LoadParam<ParticleEmitter>(root, "rate", this, &ParticleEmitter::setEmissionRate)
     103  LoadParamNEW(root, "rate", this, ParticleEmitter, setEmissionRate)
    103104    .describe("How many particles should be emittet from this emitter");
    104105
    105   LoadParam<ParticleEmitter>(root, "inherit-speed", this, &ParticleEmitter::setInheritSpeed)
     106  LoadParamNEW(root, "inherit-speed", this, ParticleEmitter, setInheritSpeed)
    106107    .describe("the extent, the speed of the emitter has on the particles");
    107108
    108   LoadParam<ParticleEmitter>(root, "emission-velocity", this, &ParticleEmitter::setEmissionVelocity)
     109  LoadParamNEW(root, "emission-velocity", this, ParticleEmitter, setEmissionVelocity)
    109110    .describe("How fast the particles are emittet (their initial speed)");
    110111
    111   LoadParam<ParticleEmitter>(root, "emission-momentum", this, &ParticleEmitter::setEmissionMomentum)
     112  LoadParamNEW(root, "emission-momentum", this, ParticleEmitter, setEmissionMomentum)
    112113      .describe("How fast the particles rotation is at emissiontime (their initial momentum)");
    113114
    114   LoadParam<ParticleEmitter>(root, "spread", this, &ParticleEmitter::setSpread)
     115  LoadParamNEW(root, "spread", this, ParticleEmitter, setSpread)
    115116    .describe("The angle the particles are emitted from (angle, deviation)");
    116117
  • trunk/src/lib/particles/particle_system.cc

    r5511 r5652  
    2525
    2626#include "load_param.h"
    27 #include "compiler.h"
     27#include "factory.h"
    2828#include "material.h"
    2929#include "state.h"
     
    119119  static_cast<PhysicsInterface*>(this)->loadParams(root);
    120120
    121   LoadParam<ParticleSystem>(root, "max-count", this, &ParticleSystem::setMaxCount)
     121  LoadParamNEW(root, "max-count", this, ParticleSystem, setMaxCount)
    122122      .describe("the maximal count of Particles, that can be emitted into this system");
    123123
    124124  //LoadParam<ParticleSystem>(root, "type", this, &ParticleSystem::setType);
    125   LoadParam<ParticleSystem>(root, "life-span", this, &ParticleSystem::setLifeSpan)
     125  LoadParamNEW(root, "life-span", this, ParticleSystem, setLifeSpan)
    126126      .describe("sets the life-span of the Particles.");
    127127
    128   LoadParam<ParticleSystem>(root, "conserve", this, &ParticleSystem::setConserve)
    129       .describe("sets the Conserve facrot of the Particles (1.0: they keep all their energy, 0.0:they keep no energy)");
    130 
    131   LoadParam<ParticleSystem>(root, "type", this, &ParticleSystem::setType)
     128  LoadParamNEW(root, "conserve", this, ParticleSystem, setConserve)
     129      .describe("sets the Conserve factor of the Particles (1.0: they keep all their energy, 0.0:they keep no energy)");
     130
     131  LoadParamNEW(root, "type", this, ParticleSystem, setType)
    132132      .describe("sets the type of the Particles, (dot, spark, sprite or model)");
    133133
  • trunk/src/lib/physics/fields/field.cc

    r5357 r5652  
    6060  static_cast<PNode*>(this)->loadParams(root);
    6161
    62   LoadParam<Field>(root, "magnitude", this, &Field::setMagnitude)
    63       .describe("sets the magnitude of this Field");
     62  LoadParamNEW(root, "magnitude", this, Field, setMagnitude)
     63      .describe("sets the magnitude of this Field")
     64      ->defaultValues(1, 1);
    6465
    65   LoadParam<Field>(root, "attenuation", this, &Field::setAttenuation)
     66  LoadParamNEW(root, "attenuation", this, Field, setAttenuation)
    6667      .describe("sets the attenuation of this Field.");
    6768
  • trunk/src/lib/physics/physics_connection.cc

    r5357 r5652  
    5252  static_cast<BaseObject*>(this)->loadParams(root);
    5353
    54   LoadParam<PhysicsConnection>(root, "subject", this, &PhysicsConnection::setSubject)
     54  LoadParamNEW(root, "subject", this, PhysicsConnection, setSubject)
    5555      .describe("set the subject by a name");
    5656
    57   LoadParam<PhysicsConnection>(root, "field", this, &PhysicsConnection::setField)
     57  LoadParamNEW(root, "field", this, PhysicsConnection, setField)
    5858      .describe("set the field by name");
    5959
  • trunk/src/lib/physics/physics_engine.cc

    r5217 r5652  
    9393void PhysicsEngine::loadParams(const TiXmlElement* root)
    9494{
    95   LoadParam<PhysicsEngine>(root, "Fields", this, &PhysicsEngine::loadFields)
     95  LoadParamXML(root, "Fields", this, PhysicsEngine, loadFields)
    9696      .describe("loads a list of fields");
    9797
    98   LoadParam<PhysicsEngine>(root, "Connections", this, &PhysicsEngine::loadConnections)
     98  LoadParamXML(root, "Connections", this, PhysicsEngine, loadConnections)
    9999      .describe("loads a list of fields");
    100100}
  • trunk/src/lib/shell/shell_command.cc

    r5642 r5652  
    7474
    7575}
    76 
    77 
    78 
    7976
    8077/**
     
    256253          if (!strcmp(enumCMD->getName(), inputSplits.getString(fktPos)))
    257254          {
    258             if (objectPointer == NULL && enumCMD->executor->getType() == Executor_Objective)
     255            if (objectPointer == NULL && enumCMD->executor->getType() & Executor_Objective)
    259256            {
    260257              delete itCMD;
  • trunk/src/lib/util/executor/executor.h

    r5642 r5652  
    2121//! an enumerator for the definition of the Type.
    2222typedef enum {
    23   Executor_Objective   = 1,
    24   Executor_Static      = 2,
     23  Executor_Objective         = 0x00000001,
     24  Executor_Static            = 0x00000002,
     25
     26  Executor_NoLoadString      = 0x00000010,
    2527} Executor_Type;
    2628
     
    4345
    4446    /** @returns the Type of this Function (either static or objective) */
    45     inline Executor_Type getType() const { return this->functorType; };
     47    inline long getType() const { return this->functorType; };
    4648    /** @returns the Count of Parameters this Executor takes */
    4749    inline unsigned int getParamCount() const { return this->paramCount; };
     
    5658
    5759  protected:
    58     Executor_Type                    functorType;      //!< The type of Function we've got (either static or objective).
    59     unsigned int                     paramCount;       //!< the count of parameters.
    60     MultiType*                       defaultValue;     //!< Default Values.
     60    long                        functorType;      //!< The type of Function we've got (either static or objective).
     61    unsigned int                paramCount;       //!< the count of parameters.
     62    MultiType*                  defaultValue;     //!< Default Values.
    6163};
    6264
     
    196198#define ExecutorExecute4(t1,t2,t3,t4) \
    197199   else if (this->paramCount == 4 && this->defaultValue[0].getType() == t1##_PARAM && this->defaultValue[1].getType() == t2##_PARAM && this->defaultValue[2].getType() == t3##_PARAM && this->defaultValue[3].getType() == t4##_PARAM) \
    198     EXECUTOREXECUTER(_4_##t1##_##t2##_##t3##_##t4)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3)))
     200    EXECUTOREXECUTER(_4_##t1##_##t2##_##t3##_##t4)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3))) \
     201
    199202
    200203//! execute-macro for functions with five parameters
     
    258261    virtual void execute (BaseObject* object, const char* parameters)
    259262    {
    260       SubString sub(parameters, true);
     263      SubString sub(parameters, ',');  /// FIXME ///
    261264//! FUNCTOR_LIST is the List of Executive Functions
    262265#define FUNCTOR_LIST(x) ExecutorExecute ## x
  • trunk/src/lib/util/executor/executor_specials.h

    r5651 r5652  
    3838
    3939      this->functionPointer = function;
     40      this->functorType = Executor_Objective | Executor_NoLoadString;
    4041    }
    4142
     
    6667  private:
    6768    /**
    68      * used for the copy-constructor
     69     * used for the copy-(Clone)-constructor
    6970     */
    7071    ExecutorXML() : Executor() { };
Note: See TracChangeset for help on using the changeset viewer.