From 52edf90f5ac962f2b8ac86489b3e22c6a21c6731 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 21 Feb 2005 14:48:43 +0000 Subject: [PATCH] Correct for case of _EDF_NODE_IDS_ --- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 42 ++++++++++++++++++---- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 2 +- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 89a1a7bd4..1a0074604 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -286,9 +286,24 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() TInt aCurrPG_FirstNodeIndex = aIndex[iPG] - 1; int nbNodes = aPolygoneInfo->GetNbConn(iPG); std::vector nodes_ids (nbNodes); - for (TInt inode = 0; inode < nbNodes; inode++) { - nodes_ids[inode] = aConn[aCurrPG_FirstNodeIndex + inode]; - } + //for (TInt inode = 0; inode < nbNodes; inode++) { + // nodes_ids[inode] = aConn[aCurrPG_FirstNodeIndex + inode]; + //} +#ifdef _EDF_NODE_IDS_ + if (anIsNodeNum) { + for (TInt inode = 0; inode < nbNodes; inode++) { + nodes_ids[inode] = aNodeInfo->GetElemNum(aConn[aCurrPG_FirstNodeIndex + inode] - 1); + } + } else { + for (TInt inode = 0; inode < nbNodes; inode++) { + nodes_ids[inode] = aConn[aCurrPG_FirstNodeIndex + inode]; + } + } +#else + for (TInt inode = 0; inode < nbNodes; inode++) { + nodes_ids[inode] = aConn[aCurrPG_FirstNodeIndex + inode]; + } +#endif bool isRenum = false; SMDS_MeshElement* anElement = NULL; @@ -359,9 +374,24 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() int aCurrPE_FirstNodeIndex = aFacesIndex[aCurrPE_FirstFaceIndex] - 1; int nbPENodes = aPolyedreInfo->GetNbConn(iPE); std::vector nodes_ids (nbPENodes); - for (int inode = 0; inode < nbPENodes; inode++) { - nodes_ids[inode] = aConn[aCurrPE_FirstNodeIndex + inode]; - } + //for (int inode = 0; inode < nbPENodes; inode++) { + // nodes_ids[inode] = aConn[aCurrPE_FirstNodeIndex + inode]; + //} +#ifdef _EDF_NODE_IDS_ + if (anIsNodeNum) { + for (int inode = 0; inode < nbPENodes; inode++) { + nodes_ids[inode] = aNodeInfo->GetElemNum(aConn[aCurrPE_FirstNodeIndex + inode] - 1); + } + } else { + for (int inode = 0; inode < nbPENodes; inode++) { + nodes_ids[inode] = aConn[aCurrPE_FirstNodeIndex + inode]; + } + } +#else + for (int inode = 0; inode < nbPENodes; inode++) { + nodes_ids[inode] = aConn[aCurrPE_FirstNodeIndex + inode]; + } +#endif bool isRenum = false; SMDS_MeshElement* anElement = NULL; diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index 9d8e62f88..dfae6f824 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -620,7 +620,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() if (anElem->IsPoly()) { const SMDS_PolyhedralVolumeOfNodes* aPolyedre = (const SMDS_PolyhedralVolumeOfNodes*) anElem; - if (!anElem) { + if (!aPolyedre) { MESSAGE("Warning: bad volumic element"); continue; } -- 2.39.2