// 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
//
//
//
//#include "SMDS_ElemIterator.hxx"
#include "SMDS_VolumeTool.hxx"
#include "SMESH_MesherHelper.hxx"
+#include "SMESH_MeshEditor.hxx"
// OCCT Includes
#include <OSD_Path.hxx>
//=============================================================================
SMESH::long_array* SMESH_Mesh_i::GetIDs()
{
- SMESH::long_array_var aResult = new SMESH::long_array();
- SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
- int aMinId = aSMESHDS_Mesh->MinElementID();
- int aMaxId = aSMESHDS_Mesh->MaxElementID();
+// SMESH::long_array_var aResult = new SMESH::long_array();
+// SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
+// int aMinId = aSMESHDS_Mesh->MinElementID();
+// int aMaxId = aSMESHDS_Mesh->MaxElementID();
- aResult->length(aMaxId - aMinId + 1);
+// aResult->length(aMaxId - aMinId + 1);
- for (int i = 0, id = aMinId; id <= aMaxId; id++ )
- aResult[i++] = id;
+// for (int i = 0, id = aMinId; id <= aMaxId; id++ )
+// aResult[i++] = id;
- return aResult._retn();
+// return aResult._retn();
+ // PAL12398
+ return GetElementsId();
}
//=============================================================================
//=============================================================================
/*!
* If given element is node returns IDs of shape from position
- * else - return ID of result shape after ::FindShape()
- * from SMESH_MeshEditor
- * If there is not element for given ID - returns -1
+ * If there is not node for given ID - returns -1
*/
//=============================================================================
return pos->GetShapeId();
}
+ return -1;
+}
+
+
+//=============================================================================
+/*!
+ * For given element returns ID of result shape after
+ * ::FindShape() from SMESH_MeshEditor
+ * If there is not element for given ID - returns -1
+ */
+//=============================================================================
+
+CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const CORBA::Long id)
+{
+ SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
+ if ( aSMESHDS_Mesh == NULL )
+ return -1;
+
// try to find element
const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
if(!elem)
return -1;
- // need implementation???????????????????????????????????????????????
+ //SMESH::SMESH_MeshEditor_var aMeshEditor = SMESH_Mesh_i::GetMeshEditor();
+ ::SMESH_MeshEditor aMeshEditor(_impl);
+ int index = aMeshEditor.FindShape( elem );
+ if(index>0)
+ return index;
+
return -1;
}