Salome HOME
+//=======================================================================
authoreap <eap@opencascade.com>
Fri, 12 Mar 2010 08:30:20 +0000 (08:30 +0000)
committereap <eap@opencascade.com>
Fri, 12 Mar 2010 08:30:20 +0000 (08:30 +0000)
+/*!
+ * \brief SMESH_TLink knowing its orientation
+ */
+//=======================================================================
+
+struct SMESH_OrientedLink: public SMESH_TLink
+{
+  bool _reversed;
+  SMESH_OrientedLink(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2 )
+    : SMESH_TLink( n1, n2 ), _reversed( n1 != node1() ) {}
+};

src/SMESH/SMESH_MeshEditor.hxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_MesherHelper.hxx

index 45666d05d0e1a60f30f4d34056ec262933eba345..f5f0981a4b02e2cfed574ce011e3783fb27cde8d 100644 (file)
@@ -109,6 +109,18 @@ struct SMESH_TLink: public NLink
   const SMDS_MeshNode* node2() const { return second; }
 };
 
+//=======================================================================
+/*!
+ * \brief SMESH_TLink knowing its orientation
+ */
+//=======================================================================
+
+struct SMESH_OrientedLink: public SMESH_TLink
+{
+  bool _reversed;
+  SMESH_OrientedLink(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2 )
+    : SMESH_TLink( n1, n2 ), _reversed( n1 != node1() ) {}
+};
 
 // ============================================================
 /*!
@@ -540,6 +552,11 @@ public:
                                    SMESHDS_Mesh *          aMesh);
   // replace elemToRm by elemToAdd in the all groups
 
+//   static void ReplaceElemInGroups (const SMDS_MeshElement*                     elemToRm,
+//                                    const std::vector<const SMDS_MeshElement*>& elemToAdd,
+//                                    SMESHDS_Mesh *                              aMesh);
+  // replace elemToRm by elemToAdd in the all groups
+
   /*!
    * \brief Return nodes linked to the given one in elements of the type
    */
index 39d34fd75aa5fc7b8694425074e71d58da29c961..4e4b409796939b90d5030a67730d2fb7e1fd0b79 100644 (file)
@@ -1366,6 +1366,27 @@ int SMESH_MesherHelper::NbAncestors(const TopoDS_Shape& shape,
   return ancestors.Extent();
 }
 
+//=======================================================================
+//function : GetSubShapeOri
+//purpose  : Return orientation of sub-shape in the main shape
+//=======================================================================
+
+TopAbs_Orientation SMESH_MesherHelper::GetSubShapeOri(const TopoDS_Shape& shape,
+                                                      const TopoDS_Shape& subShape)
+{
+  TopAbs_Orientation ori = TopAbs_Orientation(-1);
+  if ( !shape.IsNull() && !subShape.IsNull() )
+  {
+    TopExp_Explorer e( shape, subShape.ShapeType() );
+    for ( ; e.More(); e.Next())
+      if ( subShape.IsSame( e.Current() ))
+        break;
+    if ( e.More() )
+      ori = e.Current().Orientation();
+  }
+  return ori;
+}
+
 //=======================================================================
 //function : IsQuadraticMesh
 //purpose  : Check mesh without geometry for: if all elements on this shape are quadratic,
index 930b7ecc0a14660f54460dd1fb8c52bf449b0d1d..84b7035300762d7cac74528eb54c9a5bb5a3f84f 100644 (file)
@@ -113,6 +113,12 @@ public:
                          const SMESH_Mesh&   mesh,
                          TopAbs_ShapeEnum    ancestorType=TopAbs_SHAPE);
 
+  /*!
+   * \brief Return orientation of sub-shape in the main shape
+   */
+  static TopAbs_Orientation GetSubShapeOri(const TopoDS_Shape& shape,
+                                           const TopoDS_Shape& subShape);
+
 public:
   // ---------- PUBLIC INSTANCE METHODS ----------