+//=======================================================================

+/*!
+ * \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() ) {}
+};
This commit is contained in:
eap 2010-03-12 08:30:20 +00:00
parent 22395fddea
commit 8baf98a974
3 changed files with 44 additions and 0 deletions

View 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
*/

View 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,

View 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 ----------