27#ifndef _SMESH_Prism_3D_HXX_
28#define _SMESH_Prism_3D_HXX_
42#include <Adaptor2d_Curve2d.hxx>
43#include <Adaptor3d_Curve.hxx>
44#include <Adaptor3d_Surface.hxx>
45#include <BRepAdaptor_Surface.hxx>
46#include <TColStd_DataMapOfIntegerInteger.hxx>
47#include <TopTools_IndexedMapOfOrientedShape.hxx>
48#include <TopoDS_Face.hxx>
159 size_t VerticalSize()
const {
return myParam2ColumnMaps[0].begin()->second.size(); }
177 bool & isReverse)
const
179 std::map< int, std::pair< TParam2ColumnMap*, bool > >::const_iterator i_mo =
180 myShapeIndex2ColumnMap.find( baseEdgeID );
181 if ( i_mo == myShapeIndex2ColumnMap.end() )
return 0;
183 const std::pair< TParam2ColumnMap*, bool >& col_frw = i_mo->second;
184 isReverse = !col_frw.second;
185 return col_frw.first;
195 return myShapeIndex2ColumnMap.count( node->
getshapeId() );
203 bool GetLayersTransformation(std::vector<gp_Trsf> & trsf,
224 {
return Mesh()->GetSubMesh( Shape( shapeID )); }
232 {
return SubMesh(shapeID)->GetSubMeshDS(); }
239 const TopoDS_Shape&
Shape(
const int shapeID)
const
240 {
return myShapeIDMap( shapeID ); }
248 {
return myShapeIDMap.FindIndex( shape ); }
260 const TopoDS_Edge & bottomEdge,
261 const int sideFaceID);
276 typedef boost::shared_ptr<BRepAdaptor_Surface>
PSurface;
285 std::vector< std::pair< double, double> >
myParams;
293 const TopoDS_Edge& baseEdge,
295 const double first = 0.0,
296 const double last = 1.0);
298 const std::vector< TSideFace* >& components,
299 const std::vector< std::pair< double, double> > & params);
303 {
return ( NbComponents() > 0 || myParams[0].first != 0. || myParams[0].second != 1. ); }
309 const TopoDS_Edge &
BaseEdge()
const {
return myBaseEdge; }
311 if ( NbComponents() )
return GetComponent(0)->GetColumns()->begin()->second.size();
312 else return GetColumns()->begin()->second.size(); }
314 void GetNodesAtZ(
const int Z, std::map<double, const SMDS_MeshNode* >& nodes )
const;
318 {
if ( myComponents[i] )
delete myComponents[i]; myComponents[i]=c; }
319 TSideFace* GetComponent(
const double U,
double& localU)
const;
324 Adaptor2d_Curve2d* HorizPCurve(
const bool isTop,
const TopoDS_Face& horFace)
const;
327 TopoDS_Edge GetEdge(
const int edge )
const;
330 gp_Pnt Value(
const Standard_Real U,
const Standard_Real V)
const;
332 void dumpNodes(
int nbNodes)
const;
345 gp_Pnt
Value(
const Standard_Real U)
const;
349 void dumpNodes(
int nbNodes)
const;
363 :mySide(sideFace), myV( isTop ? 1.0 : 0.0 ) {}
364 gp_Pnt
Value(
const Standard_Real U)
const;
368 void dumpNodes(
int nbNodes)
const;
382 const TopoDS_Face& horFace);
383 gp_Pnt2d
Value(
const Standard_Real U)
const;
405 return myError->IsOK();
430 const bool allowHighBndError );
447 const std::vector< gp_XYZ >& toBndPoints,
448 const std::vector< gp_XYZ >& fromIntPoints,
449 std::vector< gp_XYZ >& toIntPoints,
452 std::vector< gp_XYZ > * bndError);
488 virtual bool CheckHypothesis(
SMESH_Mesh& aMesh,
489 const TopoDS_Shape& aShape,
492 virtual bool Compute(
SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
494 virtual bool Evaluate(
SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
512 static bool AddPrisms( std::vector<const TNodeColumn*> & nodeColumns,
515 static bool IsApplicable(
const TopoDS_Shape & aShape,
bool toCheckAll);
528 const TopoDS_Shape& theSolid,
529 const bool selectBottom =
true);
535 const int totalNbFaces);
556 std::multimap< int, int >& wgt2quad,
557 std::map< int, FaceQuadStruct >& iW2oiQuads);
561 TopoDS_Edge findPropagationSource(
const TopoDS_Edge& E );
569 bool assocOrProjBottom2Top(
const gp_Trsf & bottomToTopTrsf,
577 bool projectBottomToTop(
const gp_Trsf & bottomToTopTrsf,
600 bool project2dMesh(
const TopoDS_Face& source,
const TopoDS_Face& target);
608 bool setFaceAndEdgesXYZ(
const int faceID,
const gp_XYZ& params,
int z );
613 bool toSM(
bool isOK );
618 int shapeID(
const TopoDS_Shape& S );
SMDS_TypeOfPosition
Definition: SMDS_TypeOfPosition.hxx:31
@ SMDS_TOP_UNSPEC
Definition: SMDS_TypeOfPosition.hxx:32
std::map< SMESH_subMesh *, std::vector< smIdType > > MapShapeNbElems
Definition: SMESH_Algo.hxx:63
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
Definition: SMESH_ComputeError.hxx:38
std::map< double, TNodeColumn > TParam2ColumnMap
Definition: SMESH_MesherHelper.hxx:65
std::vector< const SMDS_MeshNode * > TNodeColumn
Definition: SMESH_MesherHelper.hxx:64
#define STDMESHERS_EXPORT
Definition: SMESH_StdMeshers.hxx:38
std::map< double, TNodeColumn > TParam2ColumnMap
Definition: StdMeshers_Prism_3D.hxx:64
TopTools_IndexedMapOfOrientedShape TBlockShapes
Definition: StdMeshers_Prism_3D.hxx:62
std::map< Prism_3D::TNode, TNodeColumn > TNode2ColumnMap
Definition: StdMeshers_Prism_3D.hxx:68
std::map< double, TNodeColumn >::const_iterator TParam2ColumnIt
Definition: StdMeshers_Prism_3D.hxx:65
std::vector< const SMDS_MeshNode * > TNodeColumn
Definition: StdMeshers_Prism_3D.hxx:63
virtual int getshapeId() const
Definition: SMDS_MeshElement.hxx:133
virtual smIdType GetID() const
Return ID of an element.
Definition: SMDS_MeshElement.cxx:108
Definition: SMDS_MeshNode.hxx:36
double X() const
Definition: SMDS_MeshNode.cxx:217
double Z() const
Definition: SMDS_MeshNode.cxx:229
double Y() const
Definition: SMDS_MeshNode.cxx:223
SMDS_PositionPtr GetPosition() const
Definition: SMDS_MeshNode.cxx:90
Definition: SMESHDS_Mesh.hxx:98
Definition: SMESHDS_SubMesh.hxx:48
Definition: SMESH_Algo.hxx:511
Definition: SMESH_Block.hxx:63
Standard_Boolean Value(const math_Vector &X, math_Vector &F)
Definition: SMESH_Block.cxx:507
TShapeID
Definition: SMESH_Block.hxx:65
static bool IsForwardEdge(const TopoDS_Edge &theEdge, const TopTools_IndexedMapOfOrientedShape &theShapeIDMap)
Definition: SMESH_Block.hxx:274
Definition: SMESH_Gen.hxx:68
Hypothesis_Status
Definition: SMESH_Hypothesis.hxx:51
Definition: SMESH_Mesh.hxx:80
It helps meshers to add elements and provides other utilities.
Definition: SMESH_MesherHelper.hxx:84
gp_XY GetNodeUV(const TopoDS_Face &F, const SMDS_MeshNode *n, const SMDS_MeshNode *inFaceNode=0, bool *check=0) const
Return node UV on face.
Definition: SMESH_MesherHelper.cxx:639
SMESH_Mesh * GetMesh() const
Definition: SMESH_MesherHelper.hxx:272
Definition: SMESH_subMesh.hxx:61
Class emulating geometry of a hirizontal edge.
Definition: StdMeshers_Prism_3D.hxx:358
THorizontalEdgeAdaptor(const TSideFace *sideFace, const bool isTop)
Definition: StdMeshers_Prism_3D.hxx:362
double myV
Definition: StdMeshers_Prism_3D.hxx:360
const TSideFace * mySide
Definition: StdMeshers_Prism_3D.hxx:359
Standard_Real FirstParameter() const
Definition: StdMeshers_Prism_3D.hxx:365
Standard_Real LastParameter() const
Definition: StdMeshers_Prism_3D.hxx:366
Class emulating pcurve on a hirizontal face.
Definition: StdMeshers_Prism_3D.hxx:377
Standard_Real FirstParameter() const
Definition: StdMeshers_Prism_3D.hxx:384
Standard_Real LastParameter() const
Definition: StdMeshers_Prism_3D.hxx:385
std::map< double, gp_XY > myUVmap
Definition: StdMeshers_Prism_3D.hxx:378
Class representing a part of a geom face or a union of seleral faces.
Definition: StdMeshers_Prism_3D.hxx:275
int myID
in-block ID
Definition: StdMeshers_Prism_3D.hxx:278
TSideFace(SMESH_Mesh &mesh, const std::vector< TSideFace * > &components, const std::vector< std::pair< double, double > > ¶ms)
bool IsForward() const
Definition: StdMeshers_Prism_3D.hxx:320
SMESH_MesherHelper myHelper
Definition: StdMeshers_Prism_3D.hxx:288
bool myIsForward
Definition: StdMeshers_Prism_3D.hxx:286
const TopoDS_Edge & BaseEdge() const
Definition: StdMeshers_Prism_3D.hxx:309
TParam2ColumnMap * GetColumns() const
Definition: StdMeshers_Prism_3D.hxx:306
TParam2ColumnMap * myParamToColumnMap
Definition: StdMeshers_Prism_3D.hxx:280
TopoDS_Edge myBaseEdge
Definition: StdMeshers_Prism_3D.hxx:282
PSurface mySurface
Definition: StdMeshers_Prism_3D.hxx:281
std::map< int, PSurface > myShapeID2Surf
Definition: StdMeshers_Prism_3D.hxx:283
int NbComponents() const
Definition: StdMeshers_Prism_3D.hxx:315
boost::shared_ptr< BRepAdaptor_Surface > PSurface
Definition: StdMeshers_Prism_3D.hxx:276
int FaceID() const
Definition: StdMeshers_Prism_3D.hxx:304
Adaptor3d_Surface * Surface() const
Definition: StdMeshers_Prism_3D.hxx:322
std::vector< std::pair< double, double > > myParams
Definition: StdMeshers_Prism_3D.hxx:285
void SetComponent(const int i, TSideFace *c)
Definition: StdMeshers_Prism_3D.hxx:317
TSideFace * GetComponent(const int i) const
Definition: StdMeshers_Prism_3D.hxx:316
bool IsComplex() const
Definition: StdMeshers_Prism_3D.hxx:302
SMESH_Mesh * GetMesh() const
Definition: StdMeshers_Prism_3D.hxx:305
gp_XY GetNodeUV(const TopoDS_Face &F, const SMDS_MeshNode *n, const SMDS_MeshNode *n2=0) const
Definition: StdMeshers_Prism_3D.hxx:307
int ColumnHeight() const
Definition: StdMeshers_Prism_3D.hxx:310
std::vector< TSideFace * > myComponents
Definition: StdMeshers_Prism_3D.hxx:287
Class emulating geometry of a vertical edge.
Definition: StdMeshers_Prism_3D.hxx:341
Standard_Real FirstParameter() const
Definition: StdMeshers_Prism_3D.hxx:346
const TNodeColumn * myNodeColumn
Definition: StdMeshers_Prism_3D.hxx:342
Standard_Real LastParameter() const
Definition: StdMeshers_Prism_3D.hxx:347
Tool analyzing and giving access to a prism geometry treating it like a block, i.e.
Definition: StdMeshers_Prism_3D.hxx:128
SMESHDS_Mesh * MeshDS() const
Return pointer to mesh DS.
Definition: StdMeshers_Prism_3D.hxx:216
const TParam2ColumnMap * GetParam2ColumnMap(const int baseEdgeID, bool &isReverse) const
Return TParam2ColumnMap for a base edge.
Definition: StdMeshers_Prism_3D.hxx:176
bool HasNotQuadElemOnTop() const
Definition: StdMeshers_Prism_3D.hxx:161
SMESH_ComputeErrorPtr GetError() const
Return problem description.
Definition: StdMeshers_Prism_3D.hxx:148
SMESHDS_SubMesh * SubMeshDS(const int shapeID) const
Return submesh DS of a shape.
Definition: StdMeshers_Prism_3D.hxx:231
TBlockShapes myShapeIDMap
Definition: StdMeshers_Prism_3D.hxx:390
std::map< int, std::pair< TParam2ColumnMap *, bool > > myShapeIndex2ColumnMap
Definition: StdMeshers_Prism_3D.hxx:398
SMESH_subMesh * SubMesh(const int shapeID) const
Return submesh of a shape.
Definition: StdMeshers_Prism_3D.hxx:223
bool HasNodeColumn(const SMDS_MeshNode *node) const
Return pointer to column of nodes.
Definition: StdMeshers_Prism_3D.hxx:193
std::vector< TParam2ColumnMap > myParam2ColumnMaps
Definition: StdMeshers_Prism_3D.hxx:396
bool error(int error, const SMESH_Comment &comment="")
store error and comment and then return ( error == COMPERR_OK )
Definition: StdMeshers_Prism_3D.hxx:403
size_t VerticalSize() const
Return number of nodes on every vertical edge.
Definition: StdMeshers_Prism_3D.hxx:159
int ShapeID(const TopoDS_Shape &shape) const
Return in-block ID of a shape.
Definition: StdMeshers_Prism_3D.hxx:247
SMESH_MesherHelper * myHelper
Definition: StdMeshers_Prism_3D.hxx:389
SMESH_ComputeErrorPtr myError
Definition: StdMeshers_Prism_3D.hxx:391
TSideFace * mySide
Definition: StdMeshers_Prism_3D.hxx:394
SMESH_Mesh * Mesh() const
Return pointer to mesh.
Definition: StdMeshers_Prism_3D.hxx:210
bool myNotQuadOnTop
Definition: StdMeshers_Prism_3D.hxx:388
const TopoDS_Shape & Shape(const int shapeID) const
Return a in-block shape.
Definition: StdMeshers_Prism_3D.hxx:239
Algo building prisms on a prism shape.
Definition: StdMeshers_Prism_3D.hxx:483
StdMeshers_PrismAsBlock myBlock
Definition: StdMeshers_Prism_3D.hxx:626
TopTools_IndexedMapOfShape * myPropagChains
Definition: StdMeshers_Prism_3D.hxx:636
SMESH_MesherHelper * myHelper
Definition: StdMeshers_Prism_3D.hxx:627
virtual bool IsApplicableToShape(const TopoDS_Shape &shape, bool toCheckAll) const
Return true if the algorithm can mesh a given shape.
Definition: StdMeshers_Prism_3D.hxx:516
bool mySetErrorToSM
Definition: StdMeshers_Prism_3D.hxx:623
TNode2ColumnMap myBotToColumnMap
Definition: StdMeshers_Prism_3D.hxx:634
void ProjectTriangles()
Enable removal of quadrangles from the bottom face and triangles creation there by projection from th...
Definition: StdMeshers_Prism_3D.hxx:505
bool myUseBlock
Definition: StdMeshers_Prism_3D.hxx:624
bool myProjectTriangles
Definition: StdMeshers_Prism_3D.hxx:622
SMESH_subMesh * myPrevBottomSM
Definition: StdMeshers_Prism_3D.hxx:628
std::vector< gp_XYZ > myShapeXYZ
Definition: StdMeshers_Prism_3D.hxx:630
Finds transformation between two sets of 3D points using a least square approximation.
Definition: StdMeshers_ProjectionUtils.hxx:125
Definition: StdMeshers_Prism_3D.cxx:3523
std::list< TFaceQuadStructPtr > TQuadList
Topological data of the prism.
Definition: StdMeshers_Prism_3D.hxx:97
bool IsApplicable(const QString &aHypType, GEOM::GEOM_Object_ptr theGeomObject, const bool toCheckAll)
Definition: SMESHGUI_HypothesesUtils.cxx:617
boost::shared_ptr< Delaunay > DelaunayPtr
Definition: StdMeshers_ProjectionUtils.hxx:173
Structure containing node relative data.
Definition: StdMeshers_Prism_3D.hxx:78
gp_XYZ myParams
Definition: StdMeshers_Prism_3D.hxx:80
gp_XYZ GetCoords() const
Definition: StdMeshers_Prism_3D.hxx:82
TNode(const SMDS_MeshNode *node=0)
Definition: StdMeshers_Prism_3D.hxx:90
bool HasParams() const
Definition: StdMeshers_Prism_3D.hxx:85
gp_XYZ & ChangeParams() const
Definition: StdMeshers_Prism_3D.hxx:84
const SMDS_MeshNode * myNode
Definition: StdMeshers_Prism_3D.hxx:79
gp_XYZ GetParams() const
Definition: StdMeshers_Prism_3D.hxx:83
SMDS_TypeOfPosition GetPositionType() const
Definition: StdMeshers_Prism_3D.hxx:86
bool IsNeighbor(const TNode &other) const
Return true if this node and other one belong to one face.
Definition: StdMeshers_Prism_3D.cxx:3530
bool operator<(const TNode &other) const
Definition: StdMeshers_Prism_3D.hxx:91
Definition: StdMeshers_Prism_3D.hxx:100
std::vector< int > myRightQuadIndex
Definition: StdMeshers_Prism_3D.hxx:106
bool myNotQuadOnTop
Definition: StdMeshers_Prism_3D.hxx:109
SMESH_subMesh * myAlgoSM
Definition: StdMeshers_Prism_3D.hxx:110
TPrismTopo()
Definition: StdMeshers_Prism_3D.hxx:114
std::vector< TQuadList > myWallQuads
Definition: StdMeshers_Prism_3D.hxx:105
TopoDS_Shape myShape3D
Definition: StdMeshers_Prism_3D.hxx:101
size_t NbWires() const
Definition: StdMeshers_Prism_3D.hxx:112
void SetUpsideDown()
Set upside-down.
Definition: StdMeshers_Prism_3D.cxx:3566
void Clear()
Prism initialization.
Definition: StdMeshers_Prism_3D.cxx:3547
std::list< int > myNbEdgesInWires
Definition: StdMeshers_Prism_3D.hxx:107
TopoDS_Face myTop
Definition: StdMeshers_Prism_3D.hxx:103
TopoDS_Face myBottom
Definition: StdMeshers_Prism_3D.hxx:102
std::list< TopoDS_Edge > myBottomEdges
Definition: StdMeshers_Prism_3D.hxx:104
static SMESH_ComputeErrorPtr New(int error=COMPERR_OK, std::string comment="", const SMESH_Algo *algo=0)
Definition: SMESH_ComputeError.hxx:79
SMDS_MeshNode -> gp_XYZ converter.
Definition: SMESH_TypeDefs.hxx:215
Definition: StdMeshers_Prism_3D.hxx:469
double myBotBC[3]
Definition: StdMeshers_Prism_3D.hxx:470
void SetTopByBottom()
Set top data equal to bottom data.
Definition: StdMeshers_Prism_3D.cxx:5821
int myTopTriaNodes[3]
Definition: StdMeshers_Prism_3D.hxx:471
int myBotTriaNodes[3]
Definition: StdMeshers_Prism_3D.hxx:471
TopBotTriangles()
Initialize fields.
Definition: StdMeshers_Prism_3D.cxx:5808
double myTopBC[3]
Definition: StdMeshers_Prism_3D.hxx:470
Tool building internal nodes in a prism.
Definition: StdMeshers_Prism_3D.hxx:420
StdMeshers_ProjectionUtils::DelaunayPtr myBotDelaunay
Definition: StdMeshers_Prism_3D.hxx:464
bool ComputeNodesOnStraightSameZ()
Create internal nodes of the prism all located on straight lines with the same distribution along the...
Definition: StdMeshers_Prism_3D.cxx:5581
bool findDelaunayTriangles()
For each internal node column, find Delaunay triangles including it and Barycentric Coordinates withi...
Definition: StdMeshers_Prism_3D.cxx:5759
TopoDS_Face myTopFace
Definition: StdMeshers_Prism_3D.hxx:424
std::vector< TZColumn > myZColumns
Definition: StdMeshers_Prism_3D.hxx:461
TopoDS_Face myBotFace
Definition: StdMeshers_Prism_3D.hxx:423
bool ComputeNodesByTrsf(const double tol, const bool allowHighBndError)
Create internal nodes of the prism by computing an affine transformation from layer to layer.
Definition: StdMeshers_Prism_3D.cxx:5274
std::vector< TNodeColumn * > myIntColumns
Definition: StdMeshers_Prism_3D.hxx:427
bool ComputeNodesOnStraight()
Create internal nodes of the prism all located on straight lines with different distributions along t...
Definition: StdMeshers_Prism_3D.cxx:5607
void prepareTopBotDelaunay()
Initialize *Delaunay members.
Definition: StdMeshers_Prism_3D.cxx:5684
std::vector< double > TZColumn
Definition: StdMeshers_Prism_3D.hxx:454
std::vector< TNodeColumn * > myBndColumns
Definition: StdMeshers_Prism_3D.hxx:425
static void fillZColumn(TZColumn &zColumn, TNodeColumn &nodes)
Compute Z of nodes of a straight column.
Definition: StdMeshers_Prism_3D.cxx:5660
std::vector< TopBotTriangles > myTopBotTriangles
Definition: StdMeshers_Prism_3D.hxx:475
TColStd_DataMapOfIntegerInteger myNodeID2ColID
Definition: StdMeshers_Prism_3D.hxx:465
bool projectIntPoints(const std::vector< gp_XYZ > &fromBndPoints, const std::vector< gp_XYZ > &toBndPoints, const std::vector< gp_XYZ > &fromIntPoints, std::vector< gp_XYZ > &toIntPoints, const double r, StdMeshers_ProjectionUtils::TrsfFinder3D &trsf, std::vector< gp_XYZ > *bndError)
Projects internal nodes using transformation found by boundary nodes.
Definition: StdMeshers_Prism_3D.cxx:5219
bool CheckSameZ()
Check if all nodes of each layers have same logical Z.
Definition: StdMeshers_Prism_3D.cxx:5523
SMESH_MesherHelper * myHelper
Definition: StdMeshers_Prism_3D.hxx:422
gp_XYZ intPoint(int iP, int z) const
Definition: StdMeshers_Prism_3D.hxx:443
gp_XYZ bndPoint(int iP, int z) const
Definition: StdMeshers_Prism_3D.hxx:440
StdMeshers_ProjectionUtils::DelaunayPtr myTopDelaunay
Definition: StdMeshers_Prism_3D.hxx:463