]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
22874: [CEA 1425] Performance SMESH Module
authoreap <eap@opencascade.com>
Thu, 26 Feb 2015 09:50:03 +0000 (12:50 +0300)
committereap <eap@opencascade.com>
Thu, 26 Feb 2015 09:50:03 +0000 (12:50 +0300)
+ SObject::GetLastChildTag();

idl/SALOMEDS.idl
src/DF/DF_Label.cxx
src/DF/DF_Label.hxx
src/SALOMEDS/SALOMEDS_SObject_i.cxx
src/SALOMEDS/SALOMEDS_SObject_i.hxx
src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx
src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx

index 20f10df82a9b86309b713a8c8f8335ab45085fda..8ddffd4d322703f4c0a101d9fe7bc1eaef49cd21 100644 (file)
@@ -1093,39 +1093,42 @@ Gets the list of open studies
     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.
 
@@ -1133,29 +1136,28 @@ Gets the list of open studies
 */
     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();
index 9c2f292482c64b5972be0cd3f2e2ce4247ef66d7..6ba881612da83e3bed90d97c4178766b0ff402a3 100644 (file)
@@ -374,6 +374,12 @@ DF_Label DF_Label::NewChild()
   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
 {
index 810bec7aae2da58729053314c490ce11ef89c7b7..02fb88729cb8b3269a4b8526d5f44a6a9d265766 100644 (file)
@@ -152,6 +152,9 @@ public:
   //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;
 
index ccc2779ecdadb9b1a0053c7bd41fe9a6dbf5fa8e..8914aad8a047baef566d8bb1eca81eea2191ab54 100644 (file)
@@ -265,6 +265,17 @@ CORBA::Short SALOMEDS_SObject_i::Tag()
   return _impl->Tag();
 }
 
+//============================================================================
+/*! Function : GetLastChildTag
+ *  Purpose  :
+ */
+//============================================================================
+CORBA::Short SALOMEDS_SObject_i::GetLastChildTag()
+{
+  SALOMEDS::Locker lock;
+  return (CORBA::Short) _impl->GetLastChildTag();
+}
+
 //============================================================================
 /*! Function : Depth
  *  Purpose  :
index 280c907de8e731343dbad977992a6af9c1502d69..976a0499717ff7ba7998d78ac10f97340e06f7da 100644 (file)
@@ -75,6 +75,7 @@ public:
   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);
index 77831f2619c02f99ab4124b29e70f7026b152757..4f90d776854afd91971d70ffcf25eea9d292b8b0 100644 (file)
@@ -88,39 +88,48 @@ std::string SALOMEDSImpl_SObject::GetID() const
 {
   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
index 9a5bbe0fa99ac5e93cbabb7072e57c929b12a2d6..ad90da65414ba63be21f48c8c7aca6f4caf8c9cd 100644 (file)
@@ -55,6 +55,7 @@ public:
   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);