Version: 8.3.0
SMESH_Pattern Class Reference

#include <SMESH_Pattern.hxx>

Data Structures

struct  TPoint
 

Public Types

enum  ErrorCode {
  ERR_OK, ERR_READ_NB_POINTS, ERR_READ_POINT_COORDS, ERR_READ_TOO_FEW_POINTS,
  ERR_READ_3D_COORD, ERR_READ_NO_KEYPOINT, ERR_READ_BAD_INDEX, ERR_READ_ELEM_POINTS,
  ERR_READ_NO_ELEMS, ERR_READ_BAD_KEY_POINT, ERR_SAVE_NOT_LOADED, ERR_LOAD_EMPTY_SUBMESH,
  ERR_LOADF_NARROW_FACE, ERR_LOADF_CLOSED_FACE, ERR_LOADF_CANT_PROJECT, ERR_LOADV_BAD_SHAPE,
  ERR_LOADV_COMPUTE_PARAMS, ERR_APPL_NOT_COMPUTED, ERR_APPL_NOT_LOADED, ERR_APPL_BAD_DIMENTION,
  ERR_APPL_BAD_NB_VERTICES, ERR_APPLF_BAD_TOPOLOGY, ERR_APPLF_BAD_VERTEX, ERR_APPLF_INTERNAL_EEROR,
  ERR_APPLV_BAD_SHAPE, ERR_APPLF_BAD_FACE_GEOM, ERR_MAKEM_NOT_COMPUTED, ERR_UNEXPECTED
}
 

Public Member Functions

 SMESH_Pattern ()
 
void Clear ()
 
bool Load (const char *theFileContents)
 
bool Load (SMESH_Mesh *theMesh, const TopoDS_Face &theFace, bool theProject=false, TopoDS_Vertex the1stVertex=TopoDS_Vertex(), bool theKeepNodes=false)
 
bool Load (SMESH_Mesh *theMesh, const TopoDS_Shell &theBlock, bool theKeepNodes=false)
 
bool Save (std::ostream &theFile)
 
bool Apply (const TopoDS_Face &theFace, const TopoDS_Vertex &theVertexOnKeyPoint1, const bool theReverse)
 
bool Apply (const TopoDS_Shell &theBlock, const TopoDS_Vertex &theVertex000, const TopoDS_Vertex &theVertex001)
 
bool Apply (const SMDS_MeshFace *theFace, const int theNodeIndexOnKeyPoint1, const bool theReverse)
 
bool Apply (SMESH_Mesh *theMesh, const SMDS_MeshFace *theFace, const TopoDS_Shape &theSurface, const int theNodeIndexOnKeyPoint1, const bool theReverse)
 
bool Apply (SMESH_Mesh *theMesh, std::set< const SMDS_MeshFace * > &theFaces, const int theNodeIndexOnKeyPoint1, const bool theReverse)
 
bool Apply (const SMDS_MeshVolume *theVolume, const int theNode000Index, const int theNode001Index)
 
bool Apply (std::set< const SMDS_MeshVolume * > &theVolumes, const int theNode000Index, const int theNode001Index)
 
bool GetMappedPoints (std::list< const gp_XYZ * > &thePoints) const
 
bool MakeMesh (SMESH_Mesh *theMesh, const bool toCreatePolygons=false, const bool toCreatePolyedrs=false)
 
ErrorCode GetErrorCode () const
 
bool IsLoaded () const
 
bool Is2D () const
 
bool GetPoints (std::list< const gp_XYZ * > &thePoints) const
 
const std::list< int > & GetKeyPointIDs () const
 
const std::list< std::list
< int > > & 
GetElementPointIDs (bool applied) const
 
void GetInOutNodes (std::vector< const SMDS_MeshNode * > *&inNodes, std::vector< const SMDS_MeshNode * > *&outNodes)
 
void DumpPoints () const
 
TopoDS_Shape GetSubShape (const int i) const
 

Private Types

typedef std::list< std::list
< TopoDS_Edge > > 
TListOfEdgesList
 
typedef std::set< const
SMDS_MeshNode * > 
TNodeSet
 
typedef std::list< intTElemDef
 

Private Member Functions

bool setErrorCode (const ErrorCode theErrorCode)
 set ErrorCode and return true if it is Ok More...
 
bool setShapeToMesh (const TopoDS_Shape &theShape)
 
std::list< TPoint * > & getShapePoints (const TopoDS_Shape &theShape)
 
std::list< TPoint * > & getShapePoints (const int theShapeID)
 
bool findBoundaryPoints ()
 
void arrangeBoundaries (std::list< std::list< TPoint * > > &boundaryPoints)
 
void computeUVOnEdge (const TopoDS_Edge &theEdge, const std::list< TPoint * > &ePoints)
 
bool compUVByIsoIntersection (const std::list< std::list< TPoint * > > &boundaryPoints, const gp_XY &theInitUV, gp_XY &theUV, bool &theIsDeformed)
 
bool compUVByElasticIsolines (const std::list< std::list< TPoint * > > &boundaryPoints, const std::list< TPoint * > &pointsToCompute)
 
double setFirstEdge (std::list< TopoDS_Edge > &theWire, int theFirstEdgeID)
 
bool sortSameSizeWires (TListOfEdgesList &theWireList, const TListOfEdgesList::iterator &theFromWire, const TListOfEdgesList::iterator &theToWire, const int theFirstEdgeID, std::list< std::list< TPoint * > > &theEdgesPointsList)
 
void mergePoints (const bool uniteGroups)
 
void makePolyElements (const std::vector< const SMDS_MeshNode * > &theNodes, const bool toCreatePolygons, const bool toCreatePolyedrs)
 
void createElements (SMESH_Mesh *theMesh, const std::vector< const SMDS_MeshNode * > &theNodesVector, const std::list< std::list< int > > &theElemNodeIDs, const std::vector< const SMDS_MeshElement * > &theElements)
 
bool getFacesDefinition (const SMDS_MeshNode **theBndNodes, const int theNbBndNodes, const std::vector< const SMDS_MeshNode * > &theNodes, std::list< int > &theFaceDefs, std::vector< int > &theQuantity)
 
bool isReversed (const SMDS_MeshNode *theFirstNode, const std::list< int > &theIdsList) const
 
void clearMesh (SMESH_Mesh *theMesh) const
 
bool findExistingNodes (SMESH_Mesh *mesh, const TopoDS_Shape &S, const std::list< TPoint * > &points, std::vector< const SMDS_MeshNode * > &nodes)
 

Static Private Member Functions

static SMESHDS_SubMeshgetSubmeshWithElements (SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 

Private Attributes

bool myIs2D
 
std::vector< TPointmyPoints
 
std::list< intmyKeyPointIDs
 
std::list< TElemDefmyElemPointIDs
 
ErrorCode myErrorCode
 
bool myIsComputed
 
bool myIsBoundaryPointsFound
 
TopoDS_Shape myShape
 
TopTools_IndexedMapOfOrientedShape myShapeIDMap
 
std::map< int, std::list
< TPoint * > > 
myShapeIDToPointsMap
 
std::list< intmyNbKeyPntInBoundary
 
bool myToKeepNodes
 
std::vector< const
SMDS_MeshNode * > 
myInNodes
 
std::vector< const
SMDS_MeshNode * > 
myOutNodes
 
std::vector< gp_XYZ > myXYZ
 
std::list< TElemDefmyElemXYZIDs
 
std::map< int, const
SMDS_MeshNode * > 
myXYZIdToNodeMap
 
std::vector< const
SMDS_MeshElement * > 
myElements
 
std::vector< const
SMDS_MeshNode * > 
myOrderedNodes
 
std::vector< const
SMDS_MeshElement * > 
myPolyElems
 
std::list< TElemDefmyPolyElemXYZIDs
 
std::list< std::vector< int > > myPolyhedronQuantities
 
std::map< TNodeSet, std::list
< std::list< int > > > 
myIdsOnBoundary
 
std::map< int, std::list
< TElemDef * > > 
myReverseConnectivity
 

Friends

std::ostream & operator<< (std::ostream &OS, const TPoint &p)
 

Member Typedef Documentation

typedef std::list< int > SMESH_Pattern::TElemDef
private
typedef std::list< std::list< TopoDS_Edge > > SMESH_Pattern::TListOfEdgesList
private
typedef std::set<const SMDS_MeshNode*> SMESH_Pattern::TNodeSet
private

Member Enumeration Documentation

Enumerator
ERR_OK 
ERR_READ_NB_POINTS 
ERR_READ_POINT_COORDS 
ERR_READ_TOO_FEW_POINTS 
ERR_READ_3D_COORD 
ERR_READ_NO_KEYPOINT 
ERR_READ_BAD_INDEX 
ERR_READ_ELEM_POINTS 
ERR_READ_NO_ELEMS 
ERR_READ_BAD_KEY_POINT 
ERR_SAVE_NOT_LOADED 
ERR_LOAD_EMPTY_SUBMESH 
ERR_LOADF_NARROW_FACE 
ERR_LOADF_CLOSED_FACE 
ERR_LOADF_CANT_PROJECT 
ERR_LOADV_BAD_SHAPE 
ERR_LOADV_COMPUTE_PARAMS 
ERR_APPL_NOT_COMPUTED 
ERR_APPL_NOT_LOADED 
ERR_APPL_BAD_DIMENTION 
ERR_APPL_BAD_NB_VERTICES 
ERR_APPLF_BAD_TOPOLOGY 
ERR_APPLF_BAD_VERTEX 
ERR_APPLF_INTERNAL_EEROR 
ERR_APPLV_BAD_SHAPE 
ERR_APPLF_BAD_FACE_GEOM 
ERR_MAKEM_NOT_COMPUTED 
ERR_UNEXPECTED 

Constructor & Destructor Documentation

SMESH_Pattern::SMESH_Pattern ( )

Member Function Documentation

bool SMESH_Pattern::Apply ( const TopoDS_Face &  theFace,
const TopoDS_Vertex &  theVertexOnKeyPoint1,
const bool  theReverse 
)
bool SMESH_Pattern::Apply ( const TopoDS_Shell &  theBlock,
const TopoDS_Vertex &  theVertex000,
const TopoDS_Vertex &  theVertex001 
)
bool SMESH_Pattern::Apply ( const SMDS_MeshFace theFace,
const int  theNodeIndexOnKeyPoint1,
const bool  theReverse 
)
bool SMESH_Pattern::Apply ( SMESH_Mesh theMesh,
std::set< const SMDS_MeshFace * > &  theFaces,
const int  theNodeIndexOnKeyPoint1,
const bool  theReverse 
)

References MESSAGE, and undefinedXYZ().

bool SMESH_Pattern::Apply ( std::set< const SMDS_MeshVolume * > &  theVolumes,
const int  theNode000Index,
const int  theNode001Index 
)
void SMESH_Pattern::arrangeBoundaries ( std::list< std::list< TPoint * > > &  boundaryPoints)
private
void SMESH_Pattern::Clear ( )
void SMESH_Pattern::clearMesh ( SMESH_Mesh theMesh) const
private

References clearSubMesh().

void SMESH_Pattern::computeUVOnEdge ( const TopoDS_Edge &  theEdge,
const std::list< TPoint * > &  ePoints 
)
private
bool SMESH_Pattern::compUVByElasticIsolines ( const std::list< std::list< TPoint * > > &  boundaryPoints,
const std::list< TPoint * > &  pointsToCompute 
)
private
bool SMESH_Pattern::compUVByIsoIntersection ( const std::list< std::list< TPoint * > > &  boundaryPoints,
const gp_XY &  theInitUV,
gp_XY &  theUV,
bool theIsDeformed 
)
private
void SMESH_Pattern::DumpPoints ( ) const
bool SMESH_Pattern::findExistingNodes ( SMESH_Mesh mesh,
const TopoDS_Shape &  S,
const std::list< TPoint * > &  points,
std::vector< const SMDS_MeshNode * > &  nodes 
)
private
const std::list< std::list< int > >& SMESH_Pattern::GetElementPointIDs ( bool  applied) const
ErrorCode SMESH_Pattern::GetErrorCode ( ) const
bool SMESH_Pattern::getFacesDefinition ( const SMDS_MeshNode **  theBndNodes,
const int  theNbBndNodes,
const std::vector< const SMDS_MeshNode * > &  theNodes,
std::list< int > &  theFaceDefs,
std::vector< int > &  theQuantity 
)
private
void SMESH_Pattern::GetInOutNodes ( std::vector< const SMDS_MeshNode * > *&  inNodes,
std::vector< const SMDS_MeshNode * > *&  outNodes 
)
const std::list< int >& SMESH_Pattern::GetKeyPointIDs ( ) const
bool SMESH_Pattern::GetMappedPoints ( std::list< const gp_XYZ * > &  thePoints) const

References isDefined().

bool SMESH_Pattern::GetPoints ( std::list< const gp_XYZ * > &  thePoints) const
list< SMESH_Pattern::TPoint * > & SMESH_Pattern::getShapePoints ( const TopoDS_Shape &  theShape)
private
list< SMESH_Pattern::TPoint * > & SMESH_Pattern::getShapePoints ( const int  theShapeID)
private
SMESHDS_SubMesh * SMESH_Pattern::getSubmeshWithElements ( SMESH_Mesh theMesh,
const TopoDS_Shape &  theShape 
)
staticprivate
TopoDS_Shape SMESH_Pattern::GetSubShape ( const int  i) const
bool SMESH_Pattern::Is2D ( ) const
bool SMESH_Pattern::IsLoaded ( ) const
bool SMESH_Pattern::isReversed ( const SMDS_MeshNode theFirstNode,
const std::list< int > &  theIdsList 
) const
private
bool SMESH_Pattern::Load ( const char *  theFileContents)
bool SMESH_Pattern::Load ( SMESH_Mesh theMesh,
const TopoDS_Face &  theFace,
bool  theProject = false,
TopoDS_Vertex  the1stVertex = TopoDS_Vertex(),
bool  theKeepNodes = false 
)
bool SMESH_Pattern::Load ( SMESH_Mesh theMesh,
const TopoDS_Shell &  theBlock,
bool  theKeepNodes = false 
)
bool SMESH_Pattern::MakeMesh ( SMESH_Mesh theMesh,
const bool  toCreatePolygons = false,
const bool  toCreatePolyedrs = false 
)
void SMESH_Pattern::makePolyElements ( const std::vector< const SMDS_MeshNode * > &  theNodes,
const bool  toCreatePolygons,
const bool  toCreatePolyedrs 
)
private
void SMESH_Pattern::mergePoints ( const bool  uniteGroups)
private

References isDefined(), and undefinedXYZ().

bool SMESH_Pattern::Save ( std::ostream &  theFile)

References MESSAGE.

bool SMESH_Pattern::setErrorCode ( const ErrorCode  theErrorCode)
private

set ErrorCode and return true if it is Ok

double SMESH_Pattern::setFirstEdge ( std::list< TopoDS_Edge > &  theWire,
int  theFirstEdgeID 
)
private
bool SMESH_Pattern::setShapeToMesh ( const TopoDS_Shape &  theShape)
private

References Edge, Face, and MESSAGE.

bool SMESH_Pattern::sortSameSizeWires ( TListOfEdgesList theWireList,
const TListOfEdgesList::iterator &  theFromWire,
const TListOfEdgesList::iterator &  theToWire,
const int  theFirstEdgeID,
std::list< std::list< TPoint * > > &  theEdgesPointsList 
)
private

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  OS,
const TPoint p 
)
friend

Field Documentation

std::vector<const SMDS_MeshElement*> SMESH_Pattern::myElements
private
std::list< TElemDef > SMESH_Pattern::myElemPointIDs
private
std::list< TElemDef > SMESH_Pattern::myElemXYZIDs
private
ErrorCode SMESH_Pattern::myErrorCode
private
std::map<TNodeSet,std::list<std::list<int> > > SMESH_Pattern::myIdsOnBoundary
private
std::vector< const SMDS_MeshNode* > SMESH_Pattern::myInNodes
private
bool SMESH_Pattern::myIs2D
private
bool SMESH_Pattern::myIsBoundaryPointsFound
private
bool SMESH_Pattern::myIsComputed
private
std::list< int > SMESH_Pattern::myKeyPointIDs
private
std::list< int > SMESH_Pattern::myNbKeyPntInBoundary
private
std::vector<const SMDS_MeshNode*> SMESH_Pattern::myOrderedNodes
private
std::vector< const SMDS_MeshNode* > SMESH_Pattern::myOutNodes
private
std::vector< TPoint > SMESH_Pattern::myPoints
private
std::vector<const SMDS_MeshElement*> SMESH_Pattern::myPolyElems
private
std::list< TElemDef > SMESH_Pattern::myPolyElemXYZIDs
private
std::list< std::vector<int> > SMESH_Pattern::myPolyhedronQuantities
private
std::map< int, std::list< TElemDef* > > SMESH_Pattern::myReverseConnectivity
private
TopoDS_Shape SMESH_Pattern::myShape
private
TopTools_IndexedMapOfOrientedShape SMESH_Pattern::myShapeIDMap
private
std::map< int, std::list< TPoint*> > SMESH_Pattern::myShapeIDToPointsMap
private
bool SMESH_Pattern::myToKeepNodes
private
std::vector<gp_XYZ> SMESH_Pattern::myXYZ
private
std::map< int, const SMDS_MeshNode*> SMESH_Pattern::myXYZIdToNodeMap
private