owner()->data()->sendAttributeUpdated(this);
}
-int Model_AttributeRefList::size()
+int Model_AttributeRefList::size() const
{
return myRef->Extent();
}
return aResult;
}
+ObjectPtr Model_AttributeRefList::object(const int theIndex) const
+{
+ boost::shared_ptr<Model_Document> aDoc = boost::dynamic_pointer_cast<Model_Document>(
+ owner()->document());
+ if (aDoc) {
+ const TDF_LabelList& aList = myRef->List();
+ int anIndex = 0;
+ for (TDF_ListIteratorOfLabelList aLIter(aList); aLIter.More(); aLIter.Next(), anIndex++) {
+ if (anIndex == theIndex)
+ return aDoc->object(aLIter.Value());
+ }
+ }
+ return ObjectPtr();
+}
+
Model_AttributeRefList::Model_AttributeRefList(TDF_Label& theLabel)
{
myIsInitialized = theLabel.FindAttribute(TDataStd_ReferenceList::GetID(), myRef) == Standard_True;