Salome HOME
projects
/
modules
/
shaper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
738202d
)
Parts results debug
author
mpv
<mikhail.ponikarov@opencascade.com>
Tue, 15 Jul 2014 12:23:46 +0000
(16:23 +0400)
committer
mpv
<mikhail.ponikarov@opencascade.com>
Tue, 15 Jul 2014 12:23:46 +0000
(16:23 +0400)
src/Model/Model_Document.cpp
patch
|
blob
|
history
diff --git
a/src/Model/Model_Document.cpp
b/src/Model/Model_Document.cpp
index 79406ba8cd6033bfa359da0c7c8c30aee3d01ddc..c6fe4e3c0f036a2445b663eb4d25db73b2ce65ca 100644
(file)
--- a/
src/Model/Model_Document.cpp
+++ b/
src/Model/Model_Document.cpp
@@
-485,11
+485,19
@@
boost::shared_ptr<ModelAPI_Document> Model_Document::subDocument(std::string the
ObjectPtr Model_Document::object(const std::string& theGroupID, const int theIndex)
{
if (theGroupID == ModelAPI_Feature::group()) {
ObjectPtr Model_Document::object(const std::string& theGroupID, const int theIndex)
{
if (theGroupID == ModelAPI_Feature::group()) {
- std::map<std::string, std::vector<ObjectPtr> >::iterator aFind = myObjs.find(theGroupID);
+ // features may be not in history but in the myObjs, so, iterate all
+ int anIndex = 0;
+ std::map<std::string, std::vector<ObjectPtr> >::iterator aFind =
+ myObjs.find(ModelAPI_Feature::group());
if (aFind != myObjs.end()) {
if (aFind != myObjs.end()) {
- int aSize = aFind->second.size();
- if (theIndex >= 0 && theIndex < aSize)
- return aFind->second[theIndex];
+ std::vector<ObjectPtr>::iterator aFIter = aFind->second.begin();
+ for(; aFIter != aFind->second.end(); aFIter++) {
+ if ((*aFIter)->isInHistory()) {
+ if (theIndex == anIndex)
+ return *aFIter;
+ anIndex++;
+ }
+ }
}
} else {
// iterate all features in order to find the needed result
}
} else {
// iterate all features in order to find the needed result
@@
-519,9
+527,16
@@
int Model_Document::size(const std::string& theGroupID)
{
int aResult = 0;
if (theGroupID == ModelAPI_Feature::group()) {
{
int aResult = 0;
if (theGroupID == ModelAPI_Feature::group()) {
- std::map<std::string, std::vector<ObjectPtr> >::iterator aFind = myObjs.find(theGroupID);
+ // features may be not in history but in the myObjs, so, iterate all
+ std::map<std::string, std::vector<ObjectPtr> >::iterator aFind =
+ myObjs.find(ModelAPI_Feature::group());
if (aFind != myObjs.end()) {
if (aFind != myObjs.end()) {
- aResult = aFind->second.size();
+ std::vector<ObjectPtr>::iterator aFIter = aFind->second.begin();
+ for(; aFIter != aFind->second.end(); aFIter++) {
+ if ((*aFIter)->isInHistory()) {
+ aResult++;
+ }
+ }
}
} else {
// iterate all features in order to find the needed result
}
} else {
// iterate all features in order to find the needed result