Changeset 7216 in orxonox.OLD for branches/std/src/lib/coord/p_node.cc
- Timestamp:
- Mar 12, 2006, 8:54:30 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/coord/p_node.cc
r7193 r7216 540 540 * @param childName the name of the child to add to this PNode 541 541 */ 542 void PNode::addChild (const char*childName)542 void PNode::addChild (const std::string& childName) 543 543 { 544 544 PNode* childNode = dynamic_cast<PNode*>(ClassList::getObject(childName, CL_PARENT_NODE)); … … 624 624 * @param parentName the name of the Parent to set to this PNode 625 625 */ 626 void PNode::setParent (const char*parentName)626 void PNode::setParent (const std::string& parentName) 627 627 { 628 628 PNode* parentNode = dynamic_cast<PNode*>(ClassList::getObject(parentName, CL_PARENT_NODE)); … … 631 631 else 632 632 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()); 634 634 } 635 635 … … 699 699 * @param parentMode a String representing this parentingMode 700 700 */ 701 void PNode::setParentMode (const char*parentingMode)701 void PNode::setParentMode (const std::string& parentingMode) 702 702 { 703 703 this->setParentMode(PNode::charToParentingMode(parentingMode)); … … 1068 1068 * @return the int corresponding to the named parentingMode 1069 1069 */ 1070 PARENT_MODE PNode::charToParentingMode(const char*parentingMode)1071 { 1072 if ( !strcmp(parentingMode, "local-rotate"))1070 PARENT_MODE PNode::charToParentingMode(const std::string& parentingMode) 1071 { 1072 if (parentingMode == "local-rotate") 1073 1073 return (PNODE_LOCAL_ROTATE); 1074 else if ( !strcmp(parentingMode, "rotate-movement"))1074 else if (parentingMode == "rotate-movement") 1075 1075 return (PNODE_ROTATE_MOVEMENT); 1076 else if ( !strcmp(parentingMode, "movement"))1076 else if (parentingMode == "movement") 1077 1077 return (PNODE_MOVEMENT); 1078 else if ( !strcmp(parentingMode, "all"))1078 else if (parentingMode == "all") 1079 1079 return (PNODE_ALL); 1080 else if ( !strcmp(parentingMode, "rotate-and-move"))1080 else if (parentingMode == "rotate-and-move") 1081 1081 return (PNODE_ROTATE_AND_MOVE); 1082 1082 }
Note: See TracChangeset
for help on using the changeset viewer.