Go to the documentation of this file.
26 #ifndef _SMESH_Prism_3D_HXX_
27 #define _SMESH_Prism_3D_HXX_
43 #include <Adaptor3d_Curve.hxx>
44 #include <Adaptor3d_Surface.hxx>
45 #include <Adaptor2d_Curve2d.hxx>
46 #include <BRepAdaptor_Surface.hxx>
47 #include <TopTools_IndexedMapOfOrientedShape.hxx>
129 int VerticalSize()
const {
return myParam2ColumnMaps[0].begin()->second.size(); }
149 std::pair< TParam2ColumnMap*, bool > & col_frw =
150 myShapeIndex2ColumnMap[ baseEdgeID ];
151 isReverse = !col_frw.second;
152 return * col_frw.first;
173 {
return Mesh()->GetSubMesh( Shape( shapeID )); }
181 {
return SubMesh(shapeID)->GetSubMeshDS(); }
188 const TopoDS_Shape&
Shape(
const int shapeID)
const
189 {
return myShapeIDMap( shapeID ); }
197 {
return myShapeIDMap.FindIndex( shape ); }
209 const TopoDS_Edge & bottomEdge,
210 const int sideFaceID);
220 const TopoDS_Shape & mainShape,
221 const TopoDS_Shape & bottomFace,
222 const std::list< TopoDS_Edge >& bottomEdges,
223 std::list< TopoDS_Face >& wallFaces);
244 std::vector< std::pair< double, double> >
myParams;
251 const TopoDS_Face& face,
252 const TopoDS_Edge& baseEdge,
254 const double first = 0.0,
255 const double last = 1.0);
257 const std::vector< std::pair< double, double> > & params);
261 {
return ( NbComponents() > 0 || myParams[0].first != 0. || myParams[0].second != 1. ); }
266 const TopoDS_Edge &
BaseEdge()
const {
return myBaseEdge; }
268 if ( NbComponents() )
return GetComponent(0)->GetColumns()->begin()->second.size();
269 else return GetColumns()->begin()->second.size(); }
274 {
if ( myComponents[i] )
delete myComponents[i]; myComponents[i]=c; }
286 gp_Pnt
Value(
const Standard_Real U,
const Standard_Real V)
const;
299 gp_Pnt
Value(
const Standard_Real U)
const;
315 :mySide(sideFace), myV( isTop ? 1.0 : 0.0 ) {}
316 gp_Pnt
Value(
const Standard_Real U)
const;
334 const TopoDS_Face& horFace)
335 : mySide(sideFace), myFace(horFace), myZ(isTop ? mySide->ColumnHeight() - 1 : 0 ) {}
336 gp_Pnt2d
Value(
const Standard_Real U)
const;
359 return myError->IsOK();
377 const TopoDS_Shape& aShape,
400 static void AddPrisms( std::vector<const TNodeColumn*> & nodeColumns,
Tool analyzing and giving access to a prism geometry treating it like a block, i.e....
std::vector< TSideFace * > myComponents
Structure containing node relative data.
bool assocOrProjBottom2Top()
Find correspondence between bottom and top nodes. If elements on the bottom and top faces are topolog...
std::vector< TParam2ColumnMap > myParam2ColumnMaps
gp_XY GetNodeUV(const TopoDS_Face &F, const SMDS_MeshNode *n) const
TParam2ColumnMap * myParamToColumnMap
void SetComponent(const int i, TSideFace *c)
StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen *gen)
SMESH_MesherHelper * myHelper
Class emulating geometry of a vertical edge.
bool HasNotQuadElemOnTop() const
bool error(int error, const SMESH_Comment &comment="")
store error and comment and then return ( error == COMPERR_OK )
double GetColumns(const double U, TParam2ColumnIt &col1, TParam2ColumnIt &col2) const
Class representing a part of a geom face or a union of seleral faces. Or just an ordinary geom face.
BRepAdaptor_Surface mySurface
Adaptor3d_Surface * Surface() const
StdMeshers_PrismAsBlock()
Constructor. Initialization is needed.
const SMDS_MeshNode * myNode
TSideFace(const TSideFace &other)
SMESHDS_Mesh * MeshDS() const
Return pointer to mesh DS.
virtual bool Compute(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)
Computes mesh on a shape.
TNode2ColumnMap myBotToColumnMap
const TopoDS_Shape & Shape(const int shapeID) const
Return a in-block shape.
std::map< int, std::pair< TParam2ColumnMap *, bool > > myShapeIndex2ColumnMap
TSideFace(const std::vector< TSideFace * > &components, const std::vector< std::pair< double, double > > ¶ms)
std::vector< const SMDS_MeshNode * > TNodeColumn
It helps meshers to add elements.
gp_Pnt Value(const Standard_Real U) const
bool projectBottomToTop()
Remove quadrangles from the top face and create triangles there by projection from the bottom.
gp_Pnt2d Value(const Standard_Real U) const
TopoDS_Edge GetEdge(const int edge) const
SMESH_MesherHelper * myHelper
const TNodeColumn * myNodeColumn
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
const SMDS_PositionPtr & GetPosition() const
void ProjectTriangles()
Enable removal of quadrangles from the bottom face and triangles creation there by projection from th...
Standard_Real FirstParameter() const
bool IsNeighbor(const TNode &other) const
StdMeshers_PrismAsBlock myBlock
~StdMeshers_PrismAsBlock()
bool setFaceAndEdgesXYZ(const int faceID, const gp_XYZ ¶ms, int z)
Set projection coordinates of a node to a face and it's subshapes.
SMESH_subMesh * SubMesh(const int shapeID) const
Return submesh of a shape.
SMESH_Mesh * Mesh() const
Return pointer to mesh.
Standard_Real LastParameter() const
Adaptor3d_Curve * HorizCurve(const bool isTop) const
int ShapeID(const TopoDS_Shape &shape) const
Return in-block ID of a shape.
TSideFace * GetComponent(const int i) const
TVerticalEdgeAdaptor(const TParam2ColumnMap *columnsMap, const double parameter)
std::map< TNode, TNodeColumn > TNode2ColumnMap
TParam2ColumnMap * GetColumns() const
std::map< SMESH_subMesh *, std::vector< int > > MapShapeNbElems
Class emulating geometry of a hirizontal edge.
virtual bool CheckHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)
Check hypothesis definition to mesh a shape.
static bool GetWallFaces(SMESH_Mesh *mesh, const TopoDS_Shape &mainShape, const TopoDS_Shape &bottomFace, const std::list< TopoDS_Edge > &bottomEdges, std::list< TopoDS_Face > &wallFaces)
Find wall faces by bottom edges.
Adaptor2d_Curve2d * HorizPCurve(const bool isTop, const TopoDS_Face &horFace) const
static void AddPrisms(std::vector< const TNodeColumn * > &nodeColumns, SMESH_MesherHelper *helper)
Create prisms.
bool operator<(const TNode &other) const
Standard_Real FirstParameter() const
const TParam2ColumnMap & GetParam2ColumnMap(const int baseEdgeID, bool &isReverse)
Return TParam2ColumnMap for a base edge.
virtual bool Evaluate(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap)
evaluates size of prospective mesh on a shape
TBlockShapes myShapeIDMap
std::map< double, TNodeColumn >::const_iterator TParam2ColumnIt
std::map< double, TNodeColumn > TParam2ColumnMap
SMESH_ComputeErrorPtr myError
Standard_Real FirstParameter() const
SMESH_MesherHelper * myHelper
SMESHDS_SubMesh * SubMeshDS(const int shapeID) const
Return submesh DS of a shape.
#define STDMESHERS_EXPORT
Standard_Real LastParameter() const
THorizontalEdgeAdaptor(const TSideFace *sideFace, const bool isTop)
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.
TopTools_IndexedMapOfOrientedShape TBlockShapes
TNode(const SMDS_MeshNode *node=0)
const TopoDS_Edge & BaseEdge() const
int VerticalSize() const
Return number of nodes on every vertical edge.
bool Init(SMESH_MesherHelper *helper, const TopoDS_Shape &shape3D)
Initialization.
Class emulating pcurve on a hirizontal face.
bool GetPCurves(Adaptor2d_Curve2d *pcurv[4]) const
const TNodeColumn * GetNodeColumn(const SMDS_MeshNode *node) const
Return pointer to column of nodes.
std::vector< const SMDS_MeshNode * > TNodeColumn
SMDS_TypeOfPosition GetPositionType() const
std::vector< gp_XYZ > myShapeXYZ
gp_Pnt Value(const Standard_Real U) const
int InsertSubShapes(TBlockShapes &shapeMap) const
std::map< double, TNodeColumn > TParam2ColumnMap
Adaptor3d_Curve * VertiCurve(const bool isMax) const
gp_Pnt Value(const Standard_Real U, const Standard_Real V) const
Standard_Real LastParameter() const
TSideFace * GetComponent(const double U, double &localU) const
SMESH_ComputeErrorPtr GetError() const
Return problem description.
static SMESH_ComputeErrorPtr New(int error=COMPERR_OK, std::string comment="", const SMESH_Algo *algo=0)
std::vector< std::pair< double, double > > myParams
Algo building prisms on a prism shape.
virtual ~StdMeshers_Prism_3D()
TSideFace(SMESH_MesherHelper *helper, const int faceID, const TopoDS_Face &face, const TopoDS_Edge &baseEdge, TParam2ColumnMap *columnsMap, const double first=0.0, const double last=1.0)
TPCurveOnHorFaceAdaptor(const TSideFace *sideFace, const bool isTop, const TopoDS_Face &horFace)
static bool IsForwardEdge(SMESHDS_Mesh *meshDS, const TParam2ColumnMap &columnsMap, const TopoDS_Edge &bottomEdge, const int sideFaceID)
Check curve orientation of a bootom edge.