Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Mar 15, 2006, 3:10:45 PM (18 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

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.