return myIsDisabled;
}
+bool ModelAPI_Feature::setStable(const bool theFlag)
+{
+ if (myIsStable != theFlag) {
+ myIsStable = theFlag;
+ return true;
+ }
+ return false;
+}
+
+bool ModelAPI_Feature::isStable()
+{
+ return myIsStable;
+}
+
bool ModelAPI_Feature::isPreviewNeeded() const
{
return true;
void ModelAPI_Feature::init()
{
myIsDisabled = false;
+ myIsStable = true;
}
std::list<std::shared_ptr<ModelAPI_Result> > myResults;
///< is feature disabled or not
bool myIsDisabled;
+ ///< is feature is stable (not editing)
+ bool myIsStable;
+
public:
/// Returns the unique kind of a feature (like "Point")
virtual const std::string& getKind() = 0;
/// Returns the feature by the object (result).
MODELAPI_EXPORT static std::shared_ptr<ModelAPI_Feature> feature(ObjectPtr theObject);
+ /// Set the stable feature flag. If feature is currently editing then it is not stable.
+ /// \returns true if state is really changed
+ MODELAPI_EXPORT virtual bool setStable(const bool theFlag);
+
+ /// Returns the feature is stable or not.
+ MODELAPI_EXPORT virtual bool isStable();
+
//
// Helper methods, aliases for data()->method()
// -----------------------------------------------------------------------------------------------
if (myVisualizedObjects.find(aFeature) != myVisualizedObjects.end()) {
aFeature->setDisplayed(false);
}
+ aFeature->setStable(true);
if (myVisualizedObjects.size() > 0)
Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
}
void ModuleBase_OperationFeature::setFeature(FeaturePtr theFeature)
{
myFeature = theFeature;
+ myFeature->setStable(false);
myIsEditing = true;
}