Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7221 in orxonox.OLD for trunk/src/lib/coord


Ignore:
Timestamp:
Mar 15, 2006, 3:10:45 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the std-branche back, it runs on windows and Linux

svn merge https://svn.orxonox.net/orxonox/branches/std . -r7202:HEAD

Location:
trunk/src/lib/coord
Files:
2 edited

Legend:

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

    r7193 r7221  
    540540 * @param childName the name of the child to add to this PNode
    541541 */
    542 void PNode::addChild (const char* childName)
     542void PNode::addChild (const std::string& childName)
    543543{
    544544  PNode* childNode = dynamic_cast<PNode*>(ClassList::getObject(childName, CL_PARENT_NODE));
     
    624624 * @param parentName the name of the Parent to set to this PNode
    625625 */
    626 void PNode::setParent (const char* parentName)
     626void PNode::setParent (const std::string& parentName)
    627627{
    628628  PNode* parentNode = dynamic_cast<PNode*>(ClassList::getObject(parentName, CL_PARENT_NODE));
     
    631631  else
    632632    PRINTF(2)("Not Found PNode's (%s::%s) new Parent by Name: %s\n",
    633               this->getClassName(), this->getName(), parentName);
     633        this->getClassName(), this->getName(), parentName.c_str());
    634634}
    635635
     
    680680 * @param bias the speed to iterate to this new Positions
    681681 */
    682 void PNode::setParentSoft(const char* parentName, float bias)
     682void PNode::setParentSoft(const std::string& parentName, float bias)
    683683{
    684684  PNode* parentNode = dynamic_cast<PNode*>(ClassList::getObject(parentName, CL_PARENT_NODE));
     
    699699 * @param parentMode a String representing this parentingMode
    700700 */
    701 void PNode::setParentMode (const char* parentingMode)
    702 {
    703   this->setParentMode(PNode::charToParentingMode(parentingMode));
     701void PNode::setParentMode (const std::string& parentingMode)
     702{
     703  this->setParentMode(PNode::stringToParentingMode(parentingMode));
    704704}
    705705
     
    927927           this->getAbsDirV().y,
    928928           this->getAbsDirV().z,
    929            this->parentingModeToChar(parentMode),
     929           this->parentingModeToString(parentMode),
    930930           childNodeCount);
    931931  if (depth >= 2 || depth == 0)
     
    10491049 * @return the converted string
    10501050 */
    1051 const char* PNode::parentingModeToChar(int parentingMode)
     1051const char* PNode::parentingModeToString(int parentingMode)
    10521052{
    10531053  if (parentingMode == PNODE_LOCAL_ROTATE)
     
    10681068 * @return the int corresponding to the named parentingMode
    10691069 */
    1070 PARENT_MODE PNode::charToParentingMode(const char* parentingMode)
    1071 {
    1072   if (!strcmp(parentingMode, "local-rotate"))
     1070PARENT_MODE PNode::stringToParentingMode(const std::string& parentingMode)
     1071{
     1072  if (parentingMode == "local-rotate")
    10731073    return (PNODE_LOCAL_ROTATE);
    1074   else  if (!strcmp(parentingMode, "rotate-movement"))
     1074  else  if (parentingMode == "rotate-movement")
    10751075    return (PNODE_ROTATE_MOVEMENT);
    1076   else  if (!strcmp(parentingMode, "movement"))
     1076  else  if (parentingMode == "movement")
    10771077    return (PNODE_MOVEMENT);
    1078   else  if (!strcmp(parentingMode, "all"))
     1078  else  if (parentingMode == "all")
    10791079    return (PNODE_ALL);
    1080   else  if (!strcmp(parentingMode, "rotate-and-move"))
     1080  else  if (parentingMode == "rotate-and-move")
    10811081    return (PNODE_ROTATE_AND_MOVE);
    10821082}
  • trunk/src/lib/coord/p_node.h

    r7076 r7221  
    143143  // PARENTING //
    144144  void addChild (PNode* child);
    145   void addChild (const char* childName);
     145  void addChild (const std::string& childName);
    146146  void removeChild (PNode* child);
    147147  void removeNode();
     
    151151  /** @param parent the new parent of this node */
    152152  inline void setParent (PNode* parent) { parent->addChild(this); };
    153   void setParent (const char* parentName);
     153  void setParent (const std::string& parentName);
    154154  /** @returns the parent of this PNode */
    155155  inline PNode* getParent () const { return this->parent; };
     
    158158
    159159  void setParentSoft(PNode* parentNode, float bias = 1.0);
    160   void setParentSoft(const char* parentName, float bias = 1.0);
     160  void setParentSoft(const std::string& parentName, float bias = 1.0);
    161161
    162162  // PARENTING_MODE AND OTHER FLAGS //
    163163  void setParentMode (PARENT_MODE parentMode);
    164   void setParentMode (const char* parentingMode);
     164  void setParentMode (const std::string& parentingMode);
    165165  /** @returns the Parenting mode of this node */
    166166  int getParentMode() const { return 0x000f & this->parentMode; };
     
    183183
    184184  // HELPER_FUNCTIONS //
    185   static const char* parentingModeToChar(int parentingMode);
    186   static PARENT_MODE charToParentingMode(const char* parentingMode);
     185  static const char* parentingModeToString(int parentingMode);
     186  static PARENT_MODE stringToParentingMode(const std::string& parentingMode);
    187187  float distance(const PNode* node) const { return (this->getAbsCoor() - node->getAbsCoor()).len(); };
    188188
Note: See TracChangeset for help on using the changeset viewer.