return myRef->Extent();
}
+bool Model_AttributeRefList::isInitialized()
+{
+ if (size() == 0) { // empty list is not initialized list: sketch will be not valid after add/undo
+ return false;
+ }
+ return ModelAPI_AttributeRefList::isInitialized();
+}
+
list<ObjectPtr> Model_AttributeRefList::list()
{
std::list<ObjectPtr> aResult;
/// Returns the list of features
MODEL_EXPORT virtual ObjectPtr object(const int theIndex) const;
+ /// Returns true if attribute was initialized by some value
+ MODEL_EXPORT virtual bool isInitialized();
protected:
/// Objects are created for features automatically
MODEL_EXPORT Model_AttributeRefList(TDF_Label& theLabel);
}
}
+bool Model_AttributeSelectionList::isInitialized()
+{
+ if (size() == 0) { // empty list is not initialized list: sketch will be not valid after add/undo
+ return false;
+ }
+ return ModelAPI_AttributeSelectionList::isInitialized();
+}
+
Model_AttributeSelectionList::Model_AttributeSelectionList(TDF_Label& theLabel)
{
myIsInitialized = theLabel.FindAttribute(TDataStd_Integer::GetID(), mySize) == Standard_True;
/// Returns all attributes
MODEL_EXPORT virtual void clear();
+ /// Returns true if attribute was initialized by some value
+ MODEL_EXPORT virtual bool isInitialized();
+
protected:
/// Objects are created for features automatically
MODEL_EXPORT Model_AttributeSelectionList(TDF_Label& theLabel);
MODELAPI_EXPORT const std::shared_ptr<ModelAPI_Object>& owner() const;
/// Returns true if attribute was initialized by some value
- MODELAPI_EXPORT bool isInitialized();
+ MODELAPI_EXPORT virtual bool isInitialized();
/// Makes attribute initialized
MODELAPI_EXPORT void setInitialized();