From b324f4d8976eb751b20c447e24c7369a47c3cf2b Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 11 Sep 2014 16:52:47 +0400 Subject: [PATCH] Issue #83: some methods rename --- src/Model/Model_Data.cpp | 2 +- src/Model/Model_Data.h | 2 +- src/Model/Model_ResultPart.cpp | 4 ++-- src/ModelAPI/ModelAPI_Data.h | 2 +- src/PartSetPlugin/PartSetPlugin_Duplicate.cpp | 4 ++-- src/PartSetPlugin/PartSetPlugin_Remove.cpp | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index b384b49d7..2530dd567 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -89,7 +89,7 @@ void Model_Data::addAttribute(const std::string& theID, const std::string theAtt } } -boost::shared_ptr Model_Data::docRef(const std::string& theID) +boost::shared_ptr Model_Data::document(const std::string& theID) { std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { diff --git a/src/Model/Model_Data.h b/src/Model/Model_Data.h index f6a82a099..94490d4aa 100644 --- a/src/Model/Model_Data.h +++ b/src/Model/Model_Data.h @@ -63,7 +63,7 @@ class Model_Data : public ModelAPI_Data /// Defines the name of the feature visible by the user in the object browser MODEL_EXPORT virtual void setName(const std::string& theName); /// Returns the attribute that references to another document - MODEL_EXPORT virtual boost::shared_ptr docRef(const std::string& theID); + MODEL_EXPORT virtual boost::shared_ptr document(const std::string& theID); /// Returns the attribute that contains real value with double precision MODEL_EXPORT virtual boost::shared_ptr real(const std::string& theID); /// Returns the attribute that contains integer value diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index 6767ffee6..98319c474 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -9,7 +9,7 @@ boost::shared_ptr Model_ResultPart::partDoc() { - return data()->docRef("PartDocument")->value(); + return data()->document("PartDocument")->value(); } boost::shared_ptr Model_ResultPart::owner() @@ -31,7 +31,7 @@ void Model_ResultPart::setData(boost::shared_ptr theData) void Model_ResultPart::activate() { - boost::shared_ptr aDocRef = data()->docRef(DOC_REF()); + boost::shared_ptr aDocRef = data()->document(DOC_REF()); if (!aDocRef->value()) { // create (or open) a document if it is not yet created boost::shared_ptr aDoc = document()->subDocument(data()->name()); diff --git a/src/ModelAPI/ModelAPI_Data.h b/src/ModelAPI/ModelAPI_Data.h index 2daf2302b..36838a6ef 100644 --- a/src/ModelAPI/ModelAPI_Data.h +++ b/src/ModelAPI/ModelAPI_Data.h @@ -39,7 +39,7 @@ class MODELAPI_EXPORT ModelAPI_Data virtual void setName(const std::string& theName) = 0; /// Returns the attribute that references to another document - virtual boost::shared_ptr docRef(const std::string& theID) = 0; + virtual boost::shared_ptr document(const std::string& theID) = 0; /// Returns the attribute that contains real value with double precision virtual boost::shared_ptr real(const std::string& theID) = 0; /// Returns the attribute that contains integer value diff --git a/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp b/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp index b8919426b..a2f006fa4 100644 --- a/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp @@ -26,14 +26,14 @@ void PartSetPlugin_Duplicate::initAttributes() for (int a = aRoot->size(getGroup()) - 1; a >= 0; a--) { aSource = boost::dynamic_pointer_cast(aRoot->object(getGroup(), a)); if (aSource && aSource->data() - && aSource->data()->docRef(ModelAPI_ResultPart::DOC_REF())->value() + && aSource->data()->document(ModelAPI_ResultPart::DOC_REF())->value() == aPManager->activeDocument()) break; aSource.reset(); } if (aSource) { boost::shared_ptr aCopy = aPManager->copy( - aSource->data()->docRef(ModelAPI_ResultPart::DOC_REF())->value(), data()->name()); + aSource->data()->document(ModelAPI_ResultPart::DOC_REF())->value(), data()->name()); data()->refattr(ORIGIN_REF())->setObject(aSource); } } diff --git a/src/PartSetPlugin/PartSetPlugin_Remove.cpp b/src/PartSetPlugin/PartSetPlugin_Remove.cpp index f764ddc48..5494949d8 100644 --- a/src/PartSetPlugin/PartSetPlugin_Remove.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Remove.cpp @@ -19,12 +19,12 @@ void PartSetPlugin_Remove::execute() ResultPartPtr aPart = boost::dynamic_pointer_cast( aRoot->object(ModelAPI_ResultPart::group(), a)); if (aPart - && aPart->data()->docRef(ModelAPI_ResultPart::DOC_REF())->value() + && aPart->data()->document(ModelAPI_ResultPart::DOC_REF())->value() == aPManager->activeDocument()) { FeaturePtr aFeature = aRoot->feature(aPart); if (aFeature) { // do remove - aPart->data()->docRef(ModelAPI_ResultPart::DOC_REF())->value()->close(); + aPart->data()->document(ModelAPI_ResultPart::DOC_REF())->value()->close(); aRoot->removeFeature(aFeature); } } -- 2.39.2