Salome HOME
0021543: EDF 1978 SMESH: Viscous layer for 2D meshes
[modules/smesh.git] / src / StdMeshers / StdMeshers_Prism_3D.hxx
index 953bb9aef7cfac35a8477080c6973c5e04ba019f..42d56fe16ccfc70961435677c61aac61ff17454c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 #include "SMESH_StdMeshers.hxx"
 
-#include "SMESH_3D_Algo.hxx"
-#include "SMDS_TypeOfPosition.hxx"
 #include "SMDS_MeshNode.hxx"
+#include "SMDS_TypeOfPosition.hxx"
+#include "SMESHDS_Mesh.hxx"
+#include "SMESH_Algo.hxx"
 #include "SMESH_Block.hxx"
+#include "SMESH_Comment.hxx"
 #include "SMESH_Mesh.hxx"
-#include "SMESHDS_Mesh.hxx"
-#include "SMESH_subMesh.hxx"
 #include "SMESH_MesherHelper.hxx"
-#include "SMESH_Comment.hxx"
+#include "SMESH_subMesh.hxx"
 
 #include <vector>
 
+#include <Adaptor2d_Curve2d.hxx>
 #include <Adaptor3d_Curve.hxx>
 #include <Adaptor3d_Surface.hxx>
-#include <Adaptor2d_Curve2d.hxx>
 #include <BRepAdaptor_Surface.hxx>
 #include <TopTools_IndexedMapOfOrientedShape.hxx>
-#include <gp_XYZ.hxx>
 #include <gp_Trsf.hxx>
+#include <gp_XYZ.hxx>
 
 
 class SMESHDS_SubMesh;
@@ -55,7 +55,6 @@ class TopoDS_Edge;
 class TopoDS_Faces;
 struct TNode;
 
-//typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
 typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
 
 // map of bottom nodes to the column of nodes above them
@@ -94,7 +93,7 @@ struct TNode
  * \brief Tool analyzing and giving access to a prism geometry 
  *  treating it like a block, i.e. the four side faces are
  *  emulated by division/uniting of missing/excess faces.
- *  It also manage associations between block subshapes and a mesh.
+ *  It also manage associations between block sub-shapes and a mesh.
  */
 // ===============================================================
 
@@ -148,15 +147,18 @@ public:
    * \brief Return TParam2ColumnMap for a base edge
     * \param baseEdgeID - base edge SMESHDS Index
     * \param isReverse - columns in-block orientation
-    * \retval const TParam2ColumnMap& - map
+    * \retval const TParam2ColumnMap* - map
    */
-  const TParam2ColumnMap& GetParam2ColumnMap(const int baseEdgeID,
+  const TParam2ColumnMap* GetParam2ColumnMap(const int baseEdgeID,
                                              bool &    isReverse) const
   {
-    std::pair< TParam2ColumnMap*, bool > col_frw =
-      myShapeIndex2ColumnMap.find( baseEdgeID )->second;
+    std::map< int, std::pair< TParam2ColumnMap*, bool > >::const_iterator i_mo =
+      myShapeIndex2ColumnMap.find( baseEdgeID );
+    if ( i_mo == myShapeIndex2ColumnMap.end() ) return 0;
+
+    const std::pair< TParam2ColumnMap*, bool >& col_frw = i_mo->second;
     isReverse = !col_frw.second;
-    return col_frw.first;
+    return col_frw.first;
   }
 
   /*!
@@ -204,7 +206,7 @@ public:
 
   /*!
    * \brief Return in-block ID of a shape
-    * \param shape - block subshape
+    * \param shape - block sub-shape
     * \retval int - ID or zero if the shape has no ID
    */
   int ShapeID(const TopoDS_Shape& shape) const
@@ -437,7 +439,7 @@ private:
   bool projectBottomToTop();
 
   /*!
-   * \brief Set projection coordinates of a node to a face and it's subshapes
+   * \brief Set projection coordinates of a node to a face and it's sub-shapes
     * \param faceID - the face given by in-block ID
     * \param params - node normalized parameters
     * \retval bool - is a success