27 #ifndef SMESH_Pattern_HeaderFile
28 #define SMESH_Pattern_HeaderFile
38 #include <TopoDS_Vertex.hxx>
39 #include <TopTools_IndexedMapOfOrientedShape.hxx>
68 bool Load (
const char* theFileContents);
72 const TopoDS_Face& theFace,
73 bool theProject =
false,
74 TopoDS_Vertex the1stVertex=TopoDS_Vertex(),
75 bool theKeepNodes =
false );
81 const TopoDS_Shell& theBlock,
82 bool theKeepNodes =
false);
85 bool Save (std::ostream& theFile);
88 bool Apply (
const TopoDS_Face& theFace,
89 const TopoDS_Vertex& theVertexOnKeyPoint1,
90 const bool theReverse);
96 bool Apply (
const TopoDS_Shell& theBlock,
97 const TopoDS_Vertex& theVertex000,
98 const TopoDS_Vertex& theVertex001);
105 const int theNodeIndexOnKeyPoint1,
106 const bool theReverse);
113 const TopoDS_Shape& theSurface,
114 const int theNodeIndexOnKeyPoint1,
115 const bool theReverse);
121 std::set<const SMDS_MeshFace*>& theFaces,
122 const int theNodeIndexOnKeyPoint1,
123 const bool theReverse);
129 const int theNode000Index,
130 const int theNode001Index);
137 bool Apply (std::set<const SMDS_MeshVolume*>& theVolumes,
138 const int theNode000Index,
139 const int theNode001Index);
146 bool GetMappedPoints ( std::list<const gp_XYZ *> & thePoints )
const;
150 const bool toCreatePolygons =
false,
151 const bool toCreatePolyedrs =
false);
204 bool IsLoaded()
const {
return !myPoints.empty() && !myElemPointIDs.empty(); }
207 bool Is2D()
const {
return myIs2D; }
210 bool GetPoints ( std::list<const gp_XYZ *> & thePoints )
const;
218 {
return myElemXYZIDs.empty() || !applied ? myElemPointIDs : myElemXYZIDs; }
222 std::vector< const SMDS_MeshNode* > *& outNodes )
223 { inNodes = & myInNodes; outNodes = & myOutNodes; }
226 void DumpPoints()
const;
234 if ( i < 1 || i > myShapeIDMap.Extent() )
return TopoDS_Shape();
235 return myShapeIDMap( i );
254 bool setErrorCode(
const ErrorCode theErrorCode );
257 bool setShapeToMesh(
const TopoDS_Shape& theShape);
260 std::list< TPoint* > & getShapePoints(
const TopoDS_Shape& theShape);
266 std::list< TPoint* > & getShapePoints(
const int theShapeID);
269 bool findBoundaryPoints();
273 void arrangeBoundaries (std::list< std::list< TPoint* > >& boundaryPoints);
279 void computeUVOnEdge(
const TopoDS_Edge& theEdge,
const std::list< TPoint* > & ePoints );
282 bool compUVByIsoIntersection (
const std::list< std::list< TPoint* > >& boundaryPoints,
283 const gp_XY& theInitUV,
285 bool & theIsDeformed);
288 bool compUVByElasticIsolines(
const std::list< std::list< TPoint* > >& boundaryPoints,
289 const std::list< TPoint* >& pointsToCompute);
293 double setFirstEdge (std::list< TopoDS_Edge > & theWire,
int theFirstEdgeID);
301 const TListOfEdgesList::iterator& theFromWire,
302 const TListOfEdgesList::iterator& theToWire,
303 const int theFirstEdgeID,
304 std::list< std::list< TPoint* > >& theEdgesPointsList );
313 void mergePoints (
const bool uniteGroups);
316 void makePolyElements(
const std::vector< const SMDS_MeshNode* >& theNodes,
317 const bool toCreatePolygons,
318 const bool toCreatePolyedrs);
322 const std::vector<const SMDS_MeshNode* >& theNodesVector,
323 const std::list< std::list< int > > & theElemNodeIDs,
324 const std::vector<const SMDS_MeshElement*>& theElements);
328 const int theNbBndNodes,
329 const std::vector< const SMDS_MeshNode* >& theNodes,
330 std::list< int >& theFaceDefs,
331 std::vector<int>& theQuantity);
337 const std::list< int >& theIdsList)
const;
345 const TopoDS_Shape& S,
346 const std::list< TPoint* > & points,
347 std::vector< const SMDS_MeshNode* > & nodes);
351 const TopoDS_Shape& theShape);
ostream & operator<<(ostream &OS, const SMDS_MeshElement *e)
Definition: SMDS_MeshElement.cxx:212
#define SMESH_EXPORT
Definition: SMESH_SMESH.hxx:37
Base class for elements.
Definition: SMDS_MeshElement.hxx:56
Mesh face.
Definition: SMDS_MeshFace.hxx:41
Definition: SMDS_MeshNode.hxx:36
Mesh volume.
Definition: SMDS_MeshVolume.hxx:40
Definition: SMESHDS_SubMesh.hxx:48
Definition: SMESH_Mesh.hxx:80
Definition: SMESH_Pattern.hxx:60
std::list< TElemDef > myElemPointIDs
Definition: SMESH_Pattern.hxx:362
std::list< int > TElemDef
Definition: SMESH_Pattern.hxx:357
std::vector< const SMDS_MeshElement * > myPolyElems
Definition: SMESH_Pattern.hxx:392
ErrorCode GetErrorCode() const
Definition: SMESH_Pattern.hxx:201
TopTools_IndexedMapOfOrientedShape myShapeIDMap
Definition: SMESH_Pattern.hxx:371
ErrorCode myErrorCode
Definition: SMESH_Pattern.hxx:364
std::set< const SMDS_MeshNode * > TNodeSet
Definition: SMESH_Pattern.hxx:311
bool myIsBoundaryPointsFound
Definition: SMESH_Pattern.hxx:366
const std::list< int > & GetKeyPointIDs() const
Definition: SMESH_Pattern.hxx:213
std::map< TNodeSet, std::list< std::list< int > > > myIdsOnBoundary
Definition: SMESH_Pattern.hxx:400
ErrorCode
Definition: SMESH_Pattern.hxx:159
@ ERR_APPL_NOT_LOADED
Definition: SMESH_Pattern.hxx:184
@ ERR_APPLF_BAD_VERTEX
Definition: SMESH_Pattern.hxx:189
@ ERR_READ_BAD_INDEX
Definition: SMESH_Pattern.hxx:167
@ ERR_READ_POINT_COORDS
Definition: SMESH_Pattern.hxx:163
@ ERR_LOADV_BAD_SHAPE
Definition: SMESH_Pattern.hxx:180
@ ERR_LOADF_NARROW_FACE
Definition: SMESH_Pattern.hxx:176
@ ERR_READ_TOO_FEW_POINTS
Definition: SMESH_Pattern.hxx:164
@ ERR_READ_NB_POINTS
Definition: SMESH_Pattern.hxx:162
@ ERR_MAKEM_NOT_COMPUTED
Definition: SMESH_Pattern.hxx:196
@ ERR_APPL_BAD_NB_VERTICES
Definition: SMESH_Pattern.hxx:186
@ ERR_READ_NO_KEYPOINT
Definition: SMESH_Pattern.hxx:166
@ ERR_LOADV_COMPUTE_PARAMS
Definition: SMESH_Pattern.hxx:181
@ ERR_APPLF_INTERNAL_EEROR
Definition: SMESH_Pattern.hxx:190
@ ERR_OK
Definition: SMESH_Pattern.hxx:160
@ ERR_READ_BAD_KEY_POINT
Definition: SMESH_Pattern.hxx:170
@ ERR_APPLF_BAD_TOPOLOGY
Definition: SMESH_Pattern.hxx:188
@ ERR_LOADF_CLOSED_FACE
Definition: SMESH_Pattern.hxx:177
@ ERR_READ_NO_ELEMS
Definition: SMESH_Pattern.hxx:169
@ ERR_READ_3D_COORD
Definition: SMESH_Pattern.hxx:165
@ ERR_LOADF_CANT_PROJECT
Definition: SMESH_Pattern.hxx:178
@ ERR_READ_ELEM_POINTS
Definition: SMESH_Pattern.hxx:168
@ ERR_SAVE_NOT_LOADED
Definition: SMESH_Pattern.hxx:172
@ ERR_APPL_BAD_DIMENTION
Definition: SMESH_Pattern.hxx:185
@ ERR_APPLV_BAD_SHAPE
Definition: SMESH_Pattern.hxx:192
@ ERR_APPLF_BAD_FACE_GEOM
Definition: SMESH_Pattern.hxx:194
@ ERR_LOAD_EMPTY_SUBMESH
Definition: SMESH_Pattern.hxx:174
@ ERR_APPL_NOT_COMPUTED
Definition: SMESH_Pattern.hxx:183
std::map< int, std::list< TPoint * > > myShapeIDToPointsMap
Definition: SMESH_Pattern.hxx:372
std::list< TElemDef > myPolyElemXYZIDs
Definition: SMESH_Pattern.hxx:394
const std::list< std::list< int > > & GetElementPointIDs(bool applied) const
Definition: SMESH_Pattern.hxx:217
std::list< std::list< TopoDS_Edge > > TListOfEdgesList
Definition: SMESH_Pattern.hxx:298
std::vector< gp_XYZ > myXYZ
Definition: SMESH_Pattern.hxx:385
TopoDS_Shape GetSubShape(const int i) const
Definition: SMESH_Pattern.hxx:233
bool myIs2D
Definition: SMESH_Pattern.hxx:359
std::list< int > myKeyPointIDs
Definition: SMESH_Pattern.hxx:361
std::vector< const SMDS_MeshNode * > myOutNodes
Definition: SMESH_Pattern.hxx:381
bool myIsComputed
Definition: SMESH_Pattern.hxx:365
std::vector< const SMDS_MeshElement * > myElements
Definition: SMESH_Pattern.hxx:388
std::vector< const SMDS_MeshNode * > myInNodes
Definition: SMESH_Pattern.hxx:380
bool myToKeepNodes
Definition: SMESH_Pattern.hxx:379
bool Is2D() const
Definition: SMESH_Pattern.hxx:207
std::map< int, const SMDS_MeshNode * > myXYZIdToNodeMap
Definition: SMESH_Pattern.hxx:387
std::vector< TPoint > myPoints
Definition: SMESH_Pattern.hxx:360
std::list< std::vector< int > > myPolyhedronQuantities
Definition: SMESH_Pattern.hxx:395
bool IsLoaded() const
Definition: SMESH_Pattern.hxx:204
std::vector< const SMDS_MeshNode * > myOrderedNodes
Definition: SMESH_Pattern.hxx:389
std::list< TElemDef > myElemXYZIDs
Definition: SMESH_Pattern.hxx:386
void GetInOutNodes(std::vector< const SMDS_MeshNode * > *&inNodes, std::vector< const SMDS_MeshNode * > *&outNodes)
Definition: SMESH_Pattern.hxx:221
TopoDS_Shape myShape
Definition: SMESH_Pattern.hxx:368
std::map< int, std::list< TElemDef * > > myReverseConnectivity
Definition: SMESH_Pattern.hxx:402
std::list< int > myNbKeyPntInBoundary
Definition: SMESH_Pattern.hxx:376
Definition: SMESH_Pattern.hxx:243
gp_XY myUV
Definition: SMESH_Pattern.hxx:248
gp_XYZ myInitXYZ
Definition: SMESH_Pattern.hxx:244
gp_XY myInitUV
Definition: SMESH_Pattern.hxx:245
double myU
Definition: SMESH_Pattern.hxx:249
gp_Pnt myXYZ
Definition: SMESH_Pattern.hxx:247
double myInitU
Definition: SMESH_Pattern.hxx:246