Salome HOME
PLEIADES. fix WrapperIndex(index) for negative index
[modules/smesh.git] / src / SMDS / SMDS_MeshElement.hxx
index 67ac8f2473f36f7dd7fa00afcd795353a9102b4b..54f5067726fdcbe0629e1f374b25643ffcf9847f 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -103,11 +103,18 @@ public:
     * \retval int - valid node index
    */
   int WrappedIndex(const int ind) const {
-    if ( ind < 0 ) return -( ind % NbNodes());
+    if ( ind < 0 ) return NbNodes() + ind % NbNodes();
     if ( ind >= NbNodes() ) return ind % NbNodes();
     return ind;
   }
 
+  /*!
+   * \brief Check if a node belongs to the element
+    * \param node - the node to check
+    * \retval int - node index within the element, -1 if not found
+   */
+  int GetNodeIndex( const SMDS_MeshNode* node ) const;
+
 protected:
   SMDS_MeshElement(int ID=-1);
   virtual void Print(std::ostream & OS) const;