}
}
+ if (myIsCashed && !theTemporarily) {
+ myCash[theContext].push_back(theSubShape);
+ }
+
int aNewTag = mySize->Get() + 1;
TDF_Label aNewLab = mySize->Label().FindChild(aNewTag);
const std::shared_ptr<GeomAPI_Shape>& theSubShape,
const bool theTemporarily)
{
- if (!myCash.empty()) { // the cashing is active
+ if (myIsCashed) { // the cashing is active
std::map<ResultPtr, std::list<std::shared_ptr<GeomAPI_Shape> > >::iterator aContext =
myCash.find(theContext);
if (aContext != myCash.end()) {
}
}
-void Model_AttributeSelectionList::cashValues(const bool theEnabled) {
+void Model_AttributeSelectionList::cashValues(const bool theEnabled)
+{
+ myIsCashed = theEnabled;
myCash.clear(); // empty list as indicator that cash is not used
if (theEnabled) {
for(int anIndex = size() - 1; anIndex >= 0; anIndex--) {
std::shared_ptr<Model_AttributeSelection> myTmpAttr; ///< temporary attribute (the last one)
/// the cashed shapes to optimize isInList method: from context to set of shapes in this context
std::map<ResultPtr, std::list<std::shared_ptr<GeomAPI_Shape> > > myCash;
+ bool myIsCashed; ///< true if cashing is performed
public:
/// Adds the new reference to the end of the list
/// \param theContext object where the sub-shape was selected