From f6e1bc3f3a0538c875a4dd55c5b9d88f8e731264 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 8 Dec 2012 11:27:18 +0100 Subject: [PATCH] Changed: Methods constification --- .../src/plugins/object_viewer/entity.cpp | 10 ++++----- .../src/plugins/object_viewer/entity.h | 22 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp index 1aaacbf6e..f5a1b5094 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp @@ -117,7 +117,7 @@ CEntity::~CEntity(void) } } -void CEntity::loadAnimation(std::string &fileName) +void CEntity::loadAnimation(const std::string &fileName) { uint id = _AnimationSet->addAnimation(fileName.c_str(),CFile::getFilenameWithoutExtension(fileName).c_str()); _AnimationList.push_back(_AnimationSet->getAnimationName(id)); @@ -128,13 +128,13 @@ void CEntity::loadAnimation(std::string &fileName) _PlayList->registerTransform(_Instance); } -void CEntity::loadSWT(std::string &fileName) +void CEntity::loadSWT(const std::string &fileName) { uint id = _AnimationSet->addSkeletonWeight(fileName.c_str(),CFile::getFilenameWithoutExtension(fileName).c_str()); _SWTList.push_back(_AnimationSet->getSkeletonWeightName(id)); } -void CEntity::addAnimToPlayList(std::string &name) +void CEntity::addAnimToPlayList(const std::string &name) { _PlayListAnimation.push_back(name); @@ -176,7 +176,7 @@ void CEntity::reset() _PlayList->resetAllChannels(); } -float CEntity::getPlayListLength() +float CEntity::getPlayListLength() const { // Accumul all the time float time = 0; @@ -185,7 +185,7 @@ float CEntity::getPlayListLength() return time; } -float CEntity::getAnimLength(std::string name) +float CEntity::getAnimLength(const std::string &name) const { uint id = _AnimationSet->getAnimationIdByName(name.c_str()); NL3D::UAnimation *anim = _AnimationSet->getAnimation(id); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.h index ea1d53e25..47dad0386 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.h @@ -109,14 +109,14 @@ public: /// Loads a file animations /// @param fileName - name animation file - void loadAnimation(std::string &fileName); + void loadAnimation(const std::string &fileName); /// Loads a file skeleton weight - void loadSWT(std::string &fileName); + void loadSWT(const std::string &fileName); /// Adds an animation to a playlist /// @param name - name loaded animations - void addAnimToPlayList(std::string &name); + void addAnimToPlayList(const std::string &name); /// Removes the animation from a playlist /// @param row - number of animations in the playlist @@ -135,10 +135,10 @@ public: /// Get the total time of animation playlist /// @return total time of animation - float getPlayListLength(); + float getPlayListLength() const; /// get time length single animation - float getAnimLength(std::string name); + float getAnimLength(const std::string &name) const; /// Get slot infomation void setSlotInfo(uint num, CSlotInfo &slotInfo) @@ -159,7 +159,7 @@ public: } /// Get in place mode - bool getInPlace() + bool getInPlace() const { return _inPlace; } @@ -171,35 +171,35 @@ public: } /// Get inc position - bool getIncPos() + bool getIncPos() const { return _incPos; } /// Get information about the current status of playing a playlist /// @return struct containing current information playback - SAnimationStatus getStatus() + SAnimationStatus getStatus() const { return _AnimationStatus; } /// Get name entity /// @return name entity - std::string getName() + std::string getName() const { return _Name; } /// Get file name shape /// @return file name shape - std::string getFileNameShape() + std::string getFileNameShape() const { return _FileNameShape; } /// Get file name skeleton /// @return file name skeleton - std::string getFileNameSkeleton() + std::string getFileNameSkeleton() const { return _FileNameSkeleton; }