-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: Model_ResultCompSolid.cpp
-// Created: 20 Jul 2015
-// Author: Natalia ERMOLAEVA
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
#include <Model_ResultCompSolid.h>
updateSubs(theNewShape);
}
+void Model_ResultCompSolid::loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS,
+ std::shared_ptr<GeomAPI_Shape> theShapeIn, const int theKindOfShape, const int theTag,
+ const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes,
+ const bool theIsStoreSeparate,
+ const bool theIsStoreAsGenerated)
+{
+ if (mySubs.size()) { // consists of subs
+ std::vector<std::shared_ptr<ModelAPI_ResultBody> >::const_iterator aSubIter = mySubs.cbegin();
+ for(; aSubIter != mySubs.cend(); aSubIter++) {
+ (*aSubIter)->loadAndOrientModifiedShapes(
+ theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate,
+ theIsStoreAsGenerated);
+ }
+ } else { // do for this directly
+ ModelAPI_ResultCompSolid::loadAndOrientModifiedShapes(
+ theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate,
+ theIsStoreAsGenerated);
+ }
+}
+
+
int Model_ResultCompSolid::numberOfSubs(bool forTree) const
{
return int(mySubs.size());
theDefault = DEFAULT_COLOR();
}
-bool Model_ResultCompSolid::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, const bool theFlag)
+bool Model_ResultCompSolid::setDisabled(std::shared_ptr<ModelAPI_Result> theThis,
+ const bool theFlag)
{
bool aChanged = ModelAPI_ResultBody::setDisabled(theThis, theFlag);
if (aChanged) { // state is changed, so modifications are needed
myBuilder->evolutionToSelection(theFlag);
- updateSubs(shape()); // to set disabled/enabled
+ updateSubs(shape()); // to set disabled/enabled
}
return aChanged;
}
if (aResult) { // hidden unit must be redisplayed (hidden)
ModelAPI_EventCreator::get()->sendDeleted(document(), (*aSubIter)->groupName());
// redisplay for the viewer (it must be disappeared also)
- static Events_ID EVENT_DISP =
+ static Events_ID EVENT_DISP =
Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
ModelAPI_EventCreator::get()->sendUpdated(*aSubIter, EVENT_DISP);
} else { // was not concealed become concealed => delete event
}
}
}
+ // update the display state of the subs: explicitly call Model_ResultBody::isConcealed
+ for(aSubIter = mySubs.cbegin(); aSubIter != mySubs.cend(); aSubIter++) {
+ (*aSubIter)->isConcealed();
+ }
}
return aResult;
}
if (theValue) { // hidden unit must be redisplayed (hidden)
ModelAPI_EventCreator::get()->sendDeleted(document(), (*aSubIter)->groupName());
// redisplay for the viewer (it must be disappeared also)
- static Events_ID EVENT_DISP =
+ static Events_ID EVENT_DISP =
Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
ModelAPI_EventCreator::get()->sendUpdated(*aSubIter, EVENT_DISP);
} else { // was not concealed become concealed => delete event