Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5091 in orxonox.OLD for trunk


Ignore:
Timestamp:
Aug 21, 2005, 10:14:59 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: doxygen-tags

Location:
trunk/src/lib
Files:
2 edited

Legend:

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

    r5089 r5091  
    147147    while (element != NULL)
    148148    {
    149       LoadParam<PNode>(root, "parent", this, &PNode::addChild, true)
     149      LoadParam<PNode>(element, "parent", this, &PNode::addChild, true)
    150150          .describe("adds a new Child to the current Node.");
    151151
     
    210210/**
    211211 * @param absCoord set absolute coordinate
    212 
    213    it is very importand, that you use this function, if you want to update the
    214    absCoordinates. If you don't use this, the PNode won't recognize, that something
    215    has changed and won't update the children Nodes.
    216 
    217 @todo check if this does what it should
    218 */
     212 */
    219213void PNode::setAbsCoor (const Vector& absCoord)
    220214{
     
    251245
    252246/**
    253  *  shift coordinate (abs and rel)
     247 *  shift coordinate relative
    254248 * @param shift shift vector
    255249
     
    269263   yea right... shorter...
    270264 *
    271  * @todo this is ambiguous, from the outside one does not know it absCoor has been changed
    272  * this might lead to strange artefacts !!
    273 
    274265*/
    275266void PNode::shiftCoor (const Vector& shift)
     
    282273 *  set relative direction
    283274 * @param relDir to its parent
    284 
    285    it is very importand, that you use this function, if you want to update the
    286    relDirection. If you don't use this, the PNode won't recognize, that something
    287    has changed and won't update the children Nodes.
    288 */
     275 */
    289276void PNode::setRelDir (const Quaternion& relDir)
    290277{
     
    335322
    336323/**
    337  *  sets the absolute direction (0,0,1)
     324 *  sets the absolute direction
    338325 * @param absDir absolute coordinates
    339  *
    340  * it is very importand, that you use this function, if you want to update the
    341  * absDirection. If you don't use this, the PNode won't recognize, that something
    342  * has changed and won't update the children Nodes.
    343 */
     326 */
    344327void PNode::setAbsDir (const Quaternion& absDir)
    345328{
     
    366349
    367350/**
    368  *  shift coordinate (abs and rel)
    369  * @param shift vector
    370  * @todo implement this
    371 */
     351 * shift Direction
     352 * @param shift the direction around which to shift.
     353 */
    372354void PNode::shiftDir (const Quaternion& shift)
    373355{
     
    378360/**
    379361 *  adds a child and makes this node to a parent
    380  * @param pNode child reference
     362 * @param child child reference
    381363 * @param parentMode on which changes the child should also change ist state
    382364 *
     
    397379
    398380/**
    399  * @see PNode::addChild(PNode* parent);
     381 * @see PNode::addChild(PNode* child);
    400382 * @param childName the name of the child to add to this PNode
    401383 */
     
    409391/**
    410392 *  removes a child from the node
    411  * @param pNode the child to remove from this pNode.
     393 * @param child the child to remove from this pNode.
    412394 *
    413395 * Children from pNode will not be lost, they are referenced to NullPointer
     
    423405 *  remove this pnode from the tree and adds all following to NullParent
    424406
    425    this can be the case, if an entity in the world is been destroyed.
     407   this can be the case, if an entity in the world is being destroyed.
    426408*/
    427409void PNode::remove()
     
    623605 *  displays some information about this pNode
    624606 * @param depth The deph into which to debug the children of this PNode to.
    625   (0: all children will be debugged, 1: only this PNode, 2: this and direct children...)
     607 * (0: all children will be debugged, 1: only this PNode, 2: this and direct children...)
    626608 * @param level The n-th level of the Node we draw (this is internal and only for nice output)
    627609*/
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5090 r5091  
    119119      .describe("if the Element is visible or not");
    120120
    121 //   LoadParam<Element2D>(root, "2d-position", this, &Element2D::setPosition2D)
    122 //       .describe("the _relative_ position (away from alignment) this 2d-element shows");
    123 
     121
     122  // PNode-style:
     123  LoadParam<Element2D>(root, "rel-coor", this, &Element2D::setRelCoor2D)
     124      .describe("Sets The relative position of the Node to its parent.");
     125
     126  LoadParam<Element2D>(root, "abs-coor", this, &Element2D::setAbsCoor2D)
     127      .describe("Sets The absolute Position of the Node.");
     128
     129  LoadParam<Element2D>(root, "rel-dir", this, &Element2D::setRelDir2D)
     130      .describe("Sets The relative rotation of the Node to its parent.");
     131
     132  LoadParam<Element2D>(root, "abs-dir", this, &Element2D::setAbsDir2D)
     133      .describe("Sets The absolute rotation of the Node.");
     134
     135  LoadParam<Element2D>(root, "parent", this, &Element2D::setParent2D)
     136      .describe("the Name of the Parent of this Element2D");
     137
     138  LoadParam<Element2D>(root, "parent-mode", this, &Element2D::setParentMode2D)
     139      .describe("the mode to connect this node to its parent ()");
     140
     141  // cycling properties
     142  if (root != NULL)
     143  {
     144    const TiXmlElement* element = root->FirstChildElement();
     145    while (element != NULL)
     146    {
     147      LoadParam<Element2D>(root, "parent", this, &Element2D::addChild2D, true)
     148          .describe("adds a new Child to the current Node.");
     149
     150      element = element->NextSiblingElement();
     151    }
     152  }
    124153}
    125154
     
    179208}
    180209
    181 
     210/**
     211 * sets the relative coordinate of the Element2D to its parent
     212 * @param relCoord the relative coordinate to the parent
     213 */
    182214void Element2D::setRelCoor2D (const Vector& relCoord)
    183215{
     
    187219
    188220
     221/**
     222 * sets the relative coordinate of the Element2D to its Parent
     223 * @param x the x coordinate
     224 * @param y the y coordinate
     225 * @param z the z coordinate
     226 */
    189227void Element2D::setRelCoor2D (float x, float y, float z)
    190228{
     
    192230}
    193231
     232/**
     233 * sets the Relative coordinate to the parent in Pixels
     234 * @param x the relCoord X
     235 * @param y the relCoord Y
     236 */
    194237void Element2D::setRelCoor2Dpx (int x, int y)
    195238{
     
    200243}
    201244
    202 
     245/**
     246 * sets a new relative position smoothely
     247 * @param relCoordSoft the new Position to iterate to
     248 * @param bias how fast to iterate to this position
     249 */
    203250void Element2D::setRelCoorSoft2D(const Vector& relCoordSoft, float bias)
    204251{
     
    210257}
    211258
     259/**
     260 * sets a new relative position smoothely
     261 * @param x the new x-coordinate in Pixels of the Position to iterate to
     262 * @param y the new y-coordinate in Pixels of the Position to iterate to
     263 * @param bias how fast to iterate to this position
     264 */
    212265void Element2D::setRelCoorSoft2Dpx (int x, int y, float bias)
    213266{
     
    218271}
    219272
    220 
     273/**
     274 * set relative coordinates smoothely
     275 * @param x x-relative coordinates to its parent
     276 * @param y y-relative coordinates to its parent
     277 * @param z z-relative coordinates to its parent
     278 * @see  void PNode::setRelCoorSoft (const Vector&, float)
     279 */
    221280void Element2D::setRelCoorSoft2D(float x, float y, float depth, float bias)
    222281{
     
    224283}
    225284
     285/**
     286 * @param absCoord set absolute coordinate
     287 */
    226288void Element2D::setAbsCoor2D (const Vector& absCoord)
    227289{
     
    245307}
    246308
     309/**
     310 * @param x x-coordinate.
     311 * @param y y-coordinate.
     312 * @param z z-coordinate.
     313 * @see void PNode::setAbsCoor (const Vector& absCoord)
     314 */
    247315void Element2D::setAbsCoor2D (float x, float y, float depth)
    248316{
     
    250318}
    251319
    252 
     320/**
     321 * @param x x-coordinate in Pixels
     322 * @param y y-coordinate in Pixels
     323 * @see void PNode::setAbsCoor (const Vector& absCoord)
     324 */
    253325void Element2D::setAbsCoor2Dpx (int x, int y)
    254326{
     
    259331}
    260332
     333/**
     334 *  shift coordinate ralative
     335 * @param shift shift vector
     336 *
     337 * This simply adds the shift-Vector to the relative Coordinate
     338 */
    261339void Element2D::shiftCoor2D (const Vector& shift)
    262340{
     
    266344}
    267345
    268 
     346/**
     347 * shifts in PixelSpace
     348 * @param x the pixels to shift in X
     349 * @param y the pixels to shift in Y
     350 */
    269351void Element2D::shiftCoor2Dpx (int x, int y)
    270352{
     
    274356}
    275357
    276 
     358/**
     359 *  set relative direction
     360 * @param relDir to its parent
     361 */
    277362void Element2D::setRelDir2D (float relDir)
    278363{
     
    281366}
    282367
     368/**
     369 * sets the Relative Direction of this node to its parent in a Smoothed way
     370 * @param relDirSoft the direction to iterate to smoothely.
     371 * @param bias how fast to iterate to the new Direction
     372 */
    283373void Element2D::setRelDirSoft2D(float relDirSoft, float bias)
    284374{
     
    290380}
    291381
     382/**
     383 *  sets the absolute direction
     384 * @param absDir absolute coordinates
     385 */
    292386void Element2D::setAbsDir2D (float absDir)
    293387{
     
    300394}
    301395
     396/**
     397 * shift Direction
     398 * @param shift the direction around which to shift.
     399 */
    302400void Element2D::shiftDir2D (float shiftDir)
    303401{
     
    306404}
    307405
    308 
     406/**
     407 *  adds a child and makes this node to a parent
     408 * @param child child reference
     409 * @param parentMode on which changes the child should also change ist state
     410 *
     411 * use this to add a child to this node.
     412 */
    309413void Element2D::addChild2D (Element2D* child, int parentingMod)
    310414{
     
    320424}
    321425
     426/**
     427 * @see Element2D::addChild(Element2D* child);
     428 * @param childName the name of the child to add to this PNode
     429 */
    322430void Element2D::addChild2D (const char* childName)
    323431{
     
    327435}
    328436
     437/**
     438 * removes a child from the node
     439 * @param child the child to remove from this Node..
     440 *
     441 * Children from nodes will not be lost, they are referenced to NullPointer
     442 */
    329443void Element2D::removeChild2D (Element2D* child)
    330444{
     
    334448}
    335449
     450/**
     451 * remove this pnode from the tree and adds all following to NullParent
     452 *
     453 * this can be the case, if an entity in the world is being destroyed.
     454 */
    336455void Element2D::remove2D()
    337456{
     
    348467}
    349468
    350 
     469/**
     470 * sets the parent of this Element2D
     471 * @param parent the Parent to set
     472 */
    351473void Element2D::setParent2D (Element2D* parent)
    352474{
     
    354476}
    355477
     478/**
     479 * @see Element2D::setParent(Element2D* parent);
     480 * @param parentName the name of the Parent to set to this Element2D
     481 */
    356482void Element2D::setParent2D (const char* parentName)
    357483{
     
    362488}
    363489
    364 
     490/**
     491 * does the reparenting in a very smooth way
     492 * @param parentNode the new Node to connect this node to.
     493 * @param bias the speed to iterate to this new Positions
     494 */
    365495void Element2D::softReparent2D(Element2D* parentNode, float bias)
    366496{
     
    394524}
    395525
     526/**
     527 * does the reparenting in a very smooth way
     528 * @param parentName the name of the Parent to reconnect to
     529 * @param bias the speed to iterate to this new Positions
     530 */
    396531void Element2D::softReparent2D(const char* parentName, float bias)
    397532{
     
    401536}
    402537
    403 
     538/**
     539 *  sets the mode of this parent manually
     540 * @param parentMode a String representing this parentingMode
     541 */
    404542void Element2D::setParentMode2D (const char* parentingMode)
    405543{
     
    407545}
    408546
    409 
     547/**
     548 *  updates the absCoordinate/absDirection
     549 * @param dt The time passed since the last update
     550
     551   this is used to go through the parent-tree to update all the absolute coordinates
     552   and directions. this update should be done by the engine, so you don't have to
     553   worry, normaly...
     554 */
    410555void Element2D::update2D (float dt)
    411556{
     
    541686}
    542687
    543 
     688/**
     689 *  displays some information about this pNode
     690 * @param depth The deph into which to debug the children of this Element2D to.
     691 * (0: all children will be debugged, 1: only this Element2D, 2: this and direct children...)
     692 * @param level The n-th level of the Node we draw (this is internal and only for nice output)
     693 */
    544694void Element2D::debug (unsigned int depth, unsigned int level) const
    545695{
     
    578728#include "color.h"
    579729
     730/**
     731 * displays the Element2D at its position with its rotation as a Plane.
     732 */
    580733void Element2D::debugDraw2D(unsigned int depth, float size, Vector color) const
    581734{
     
    585738
    586739// helper functions //
     740/**
     741 * converts a parentingMode into a string that is the name of it
     742 * @param parentingMode the ParentingMode to convert
     743 * @return the converted string
     744 */
    587745const char* Element2D::parentingModeToChar2D(int parentingMode)
    588746{
     
    599757}
    600758
     759/**
     760 * converts a parenting-mode-string into a int
     761 * @param parentingMode the string naming the parentingMode
     762 * @return the int corresponding to the named parentingMode
     763 */
    601764E2D_PARENT_MODE Element2D::charToParentingMode2D(const char* parentingMode)
    602765{
Note: See TracChangeset for help on using the changeset viewer.