mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-30 10:40:33 +05:00
Add access to subshape by shape ID
This commit is contained in:
parent
3b19e7ce9f
commit
a2797078a4
@ -107,11 +107,36 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
|
void SMESH_MesherHelper::SetSubShape(const int aShID)
|
||||||
|
{
|
||||||
|
if ( aShID == myShapeID )
|
||||||
|
return;
|
||||||
|
if ( aShID > 1 )
|
||||||
|
SetSubShape( GetMesh()->GetMeshDS()->IndexToShape( aShID ));
|
||||||
|
else
|
||||||
|
SetSubShape( TopoDS_Shape() );
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Set geomerty to make elements on
|
||||||
|
* \param aSh - geomertic shape
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
|
void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS();
|
if ( !myShape.IsNull() && !aSh.IsNull() && myShape.IsSame( aSh ))
|
||||||
|
return;
|
||||||
|
|
||||||
myShape = aSh;
|
myShape = aSh;
|
||||||
|
mySeamShapeIds.clear();
|
||||||
|
|
||||||
|
if ( myShape.IsNull() ) {
|
||||||
|
myShapeID = -1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS();
|
||||||
myShapeID = meshDS->ShapeToIndex(aSh);
|
myShapeID = meshDS->ShapeToIndex(aSh);
|
||||||
|
|
||||||
// treatment of periodic faces
|
// treatment of periodic faces
|
||||||
@ -151,6 +176,27 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
|
||||||
|
* \param F - the face
|
||||||
|
* \retval bool - return true if the face is periodic
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
bool SMESH_MesherHelper::GetNodeUVneedInFaceNode(const TopoDS_Face& F) const
|
||||||
|
{
|
||||||
|
if ( F.IsNull() ) return !mySeamShapeIds.empty();
|
||||||
|
|
||||||
|
if ( !F.IsNull() && !myShape.IsNull() && myShape.IsSame( F ))
|
||||||
|
return !mySeamShapeIds.empty();
|
||||||
|
|
||||||
|
Handle(Geom_Surface) aSurface = BRep_Tool::Surface( F );
|
||||||
|
if ( !aSurface.IsNull() )
|
||||||
|
return ( aSurface->IsUPeriodic() || aSurface->IsVPeriodic() );
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsMedium
|
//function : IsMedium
|
||||||
@ -206,7 +252,7 @@ gp_Pnt2d SMESH_MesherHelper::GetUVOnSeam( const gp_Pnt2d& uv1, const gp_Pnt2d& u
|
|||||||
* \brief Return node UV on face
|
* \brief Return node UV on face
|
||||||
* \param F - the face
|
* \param F - the face
|
||||||
* \param n - the node
|
* \param n - the node
|
||||||
* \param n2 - a medium node will be placed between n and n2
|
* \param n2 - a node of element being created located inside a face
|
||||||
* \retval gp_XY - resulting UV
|
* \retval gp_XY - resulting UV
|
||||||
*
|
*
|
||||||
* Auxilary function called form GetMediumNode()
|
* Auxilary function called form GetMediumNode()
|
||||||
|
@ -55,7 +55,7 @@ class SMESH_MesherHelper
|
|||||||
|
|
||||||
/// Empty constructor
|
/// Empty constructor
|
||||||
SMESH_MesherHelper(SMESH_Mesh& theMesh)
|
SMESH_MesherHelper(SMESH_Mesh& theMesh)
|
||||||
{ myMesh=(void *)&theMesh; myCreateQuadratic = false; }
|
{ myMesh=(void *)&theMesh; myCreateQuadratic = false; myShapeID=-1;}
|
||||||
|
|
||||||
SMESH_Mesh* GetMesh() const
|
SMESH_Mesh* GetMesh() const
|
||||||
{ return (SMESH_Mesh*)myMesh; }
|
{ return (SMESH_Mesh*)myMesh; }
|
||||||
@ -106,14 +106,24 @@ class SMESH_MesherHelper
|
|||||||
* \brief Return node UV on face
|
* \brief Return node UV on face
|
||||||
* \param F - the face
|
* \param F - the face
|
||||||
* \param n - the node
|
* \param n - the node
|
||||||
* \param n2 - a medium node will be placed between n and n2
|
* \param inFaceNode - a node of element being created located inside a face
|
||||||
* \retval gp_XY - resulting UV
|
* \retval gp_XY - resulting UV
|
||||||
*
|
*
|
||||||
* Auxilary function called form GetMediumNode()
|
* Auxilary function called form GetMediumNode()
|
||||||
*/
|
*/
|
||||||
gp_XY GetNodeUV(const TopoDS_Face& F,
|
gp_XY GetNodeUV(const TopoDS_Face& F,
|
||||||
const SMDS_MeshNode* n,
|
const SMDS_MeshNode* n,
|
||||||
const SMDS_MeshNode* n2=0);
|
const SMDS_MeshNode* inFaceNode=0);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
|
||||||
|
* \param F - the face
|
||||||
|
* \retval bool - return true if the face is periodic
|
||||||
|
*
|
||||||
|
* if F is Null, answer about subshape set through IsQuadraticSubMesh() or
|
||||||
|
* SetSubShape()
|
||||||
|
*/
|
||||||
|
bool GetNodeUVneedInFaceNode(const TopoDS_Face& F = TopoDS_Face()) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return U on edge
|
* \brief Return U on edge
|
||||||
@ -198,11 +208,30 @@ class SMESH_MesherHelper
|
|||||||
bool force3d = true);
|
bool force3d = true);
|
||||||
|
|
||||||
|
|
||||||
void SetKeyIsQuadratic(const bool theKey)
|
/*!
|
||||||
{myCreateQuadratic = theKey;};
|
* \brief Set order of elements to create
|
||||||
|
* \param theBuildQuadratic - to build quadratic or not
|
||||||
|
*
|
||||||
|
* To be used for quadratic elements creation without preceding
|
||||||
|
* IsQuadraticSubMesh() or AddQuadraticEdge() call
|
||||||
|
*/
|
||||||
|
void SetKeyIsQuadratic(const bool theBuildQuadratic)
|
||||||
|
{ myCreateQuadratic = theBuildQuadratic; }
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Set shape to make elements on
|
||||||
|
* \param subShape, subShapeID - shape or its ID (==SMESHDS_Mesh::ShapeToIndex(shape))
|
||||||
|
*/
|
||||||
|
void SetSubShape(const int subShapeID);
|
||||||
void SetSubShape(const TopoDS_Shape& subShape);
|
void SetSubShape(const TopoDS_Shape& subShape);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Return shape or its ID, on which created elements are added
|
||||||
|
* \retval TopoDS_Shape, int - shape or its ID
|
||||||
|
*/
|
||||||
|
int GetSubShapeID() { return myShapeID; }
|
||||||
|
TopoDS_Shape GetSubShape() { return myShape; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user