boolean IsNull();
/*! Gets an object %ID
-
\return ID of the %SObject.
*/
ID GetID();
-/*! Acquisition of the father %Component of the %SObject
+/*! Acquisition of the father %Component of the %SObject
\return The father %Component of the %SObject.
*/
SComponent GetFatherComponent();
-/*! Acquisition of the father %SObject of the %SObject
+/*! Acquisition of the father %SObject of the %SObject
\return the father %SObject of the given %SObject.
*/
SObject GetFather();
-/*! Gets the %tag of a %SObject
+/*! Gets the %tag of a %SObject
\return the %tag of a %SObject.
*/
short Tag();
-/*! Gets the depth of a %SObject
+/*! Returns a tag of the last child %SObject (if any) of this %SObject.
+ Returns zero if this %SObject has no children.
+*/
+ short GetLastChildTag();
+
+/*! Gets the depth of a %SObject
\return the depth of a %SObject.
*/
short Depth();
-/*! Looks for subobjects of a given %SObject.
+/*! Looks for subobjects of a given %SObject.
\param atag Tag of the given %SObject
\return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
*/
-
boolean FindSubObject (in long atag, out SObject obj);
-/*! Looks for attributes of a given %SObject
+/*! Looks for attributes of a given %SObject
\param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
\return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
*/
boolean FindAttribute(out GenericAttribute anAttribute,
in string aTypeOfAttribute);
-/*! Looks for a %SObject which the given %SObject refers to.
+/*! Looks for a %SObject which the given %SObject refers to.
\return The object which the given %SObject refers to as well as True if it finds
this object.
*/
boolean ReferencedObject(out SObject obj); // A REVOIR
-/*! Gets all attributes of a given %SObject
+/*! Gets all attributes of a given %SObject
\return The list of all attributes of the given %SObject.
<em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
*/
ListOfAttributes GetAllAttributes();
-/*! Gets the study of a given %SObject.
+/*! Gets the study of a given %SObject.
\return The study containing the given %SObject.
*/
Study GetStudy();
/*! Gets the CORBA object by its own IOR attribute.
Returns nil, if can't.
-
\return The CORBA object of the %SObject.
*/
Object GetObject();
return FindChild(tag, true);
}
+//Returns a tag of the last child
+int DF_Label::LastChildTag() const
+{
+ return _node->_lastChild ? _node->_lastChild->_tag : 0;
+}
+
//Returns a string entry of this Label
std::string DF_Label::Entry() const
{
//Creates a new child Label of this Label.
Standard_EXPORT DF_Label NewChild();
+ //Returns a tag of the last child
+ Standard_EXPORT int LastChildTag() const;
+
//Returns a string presentation of the entry
Standard_EXPORT std::string Entry() const;
return _impl->Tag();
}
+//============================================================================
+/*! Function : GetLastChildTag
+ * Purpose :
+ */
+//============================================================================
+CORBA::Short SALOMEDS_SObject_i::GetLastChildTag()
+{
+ SALOMEDS::Locker lock;
+ return (CORBA::Short) _impl->GetLastChildTag();
+}
+
//============================================================================
/*! Function : Depth
* Purpose :
virtual void SetAttrString(const char*, const char*);
virtual CORBA::Short Tag();
+ virtual CORBA::Short GetLastChildTag();
virtual CORBA::Short Depth();
virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
{
return _lab.Entry();
}
-
+
//============================================================================
/*! Function : GetFatherComponent
- * Purpose :
+ * Purpose :
*/
//============================================================================
SALOMEDSImpl_SComponent SALOMEDSImpl_SObject::GetFatherComponent() const
{
- SALOMEDSImpl_SComponent sco;
+ SALOMEDSImpl_SComponent sco;
DF_Label LF = _lab;
while (!SALOMEDSImpl_SComponent::IsA(LF) && !LF.IsRoot()) {
LF = LF.Father();
}
-
+
if(LF.IsRoot()) return sco;
-
+
return GetStudy()->GetSComponent(LF);
}
-
+
//============================================================================
/*! Function : GetFather
- * Purpose :
+ * Purpose :
*/
//============================================================================
SALOMEDSImpl_SObject SALOMEDSImpl_SObject::GetFather() const
{
- return GetStudy()->GetSObject(_lab.Father());
+ return GetStudy()->GetSObject(_lab.Father());
}
+//============================================================================
+/*! Function : GetLastChild
+ * Purpose :
+ */
+//============================================================================
+int SALOMEDSImpl_SObject::GetLastChildTag() const
+{
+ return _lab.LastChildTag();
+}
//============================================================================
/*! Function : GetStudy
- * Purpose :
+ * Purpose :
*/
//============================================================================
SALOMEDSImpl_Study* SALOMEDSImpl_SObject::GetStudy() const
virtual std::string GetID() const;
virtual SALOMEDSImpl_SComponent GetFatherComponent() const;
virtual SALOMEDSImpl_SObject GetFather() const ;
+ virtual int GetLastChildTag() const ;
virtual bool FindAttribute(DF_Attribute*& theAttribute, const std::string& theTypeOfAttribute) const;
virtual bool ReferencedObject(SALOMEDSImpl_SObject& theObject) const ;
virtual bool FindSubObject(int theTag, SALOMEDSImpl_SObject& theObject);