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>
57 typedef std::vector<const SMDS_MeshNode* >
TNodeColumn;
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(); }
189 {
return myShapeIDMap( shapeID ); }
197 {
return myShapeIDMap.FindIndex( shape ); }
209 const TopoDS_Edge & bottomEdge,
210 const int sideFaceID);
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);
256 TSideFace(
const std::vector< TSideFace* >& components,
257 const std::vector< std::pair< double, double> > & params);
261 {
return ( NbComponents() > 0 || myParams[0].first != 0. || myParams[0].second != 1. ); }
265 {
return myHelper->GetNodeUV( F, n ); }
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; }
275 TSideFace* GetComponent(
const double U,
double& localU)
const;
280 Adaptor2d_Curve2d* HorizPCurve(
const bool isTop,
const TopoDS_Face& horFace)
const;
283 TopoDS_Edge GetEdge(
const int edge )
const;
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();
397 static void AddPrisms( std::vector<const TNodeColumn*> & nodeColumns,
408 bool assocOrProjBottom2Top();
415 bool projectBottomToTop();
423 bool setFaceAndEdgesXYZ(
const int faceID,
const gp_XYZ& params,
int z );
const SMDS_PositionPtr & GetPosition() const
Class representing a part of a geom face or a union of seleral faces. Or just an ordinary geom face...
SMESH_MesherHelper * myHelper
Adaptor3d_Surface * Surface() const
std::vector< std::pair< double, double > > myParams
Class emulating geometry of a vertical edge.
TParam2ColumnMap * GetColumns() const
Algo building prisms on a prism shape.
TPCurveOnHorFaceAdaptor(const TSideFace *sideFace, const bool isTop, const TopoDS_Face &horFace)
virtual bool CheckHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)=0
Check hypothesis definition to mesh a shape.
std::vector< TSideFace * > myComponents
Tool analyzing and giving access to a prism geometry treating it like a block, i.e. the four side faces are emulated by division/uniting of missing/excess faces. It also manage associations between block subshapes and a mesh.
std::map< double, TNodeColumn >::const_iterator TParam2ColumnIt
StdMeshers_PrismAsBlock myBlock
Class emulating geometry of a hirizontal edge.
void SetComponent(const int i, TSideFace *c)
bool HasNotQuadElemOnTop() const
TNode(const SMDS_MeshNode *node=0)
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
Structure containing node relative data.
std::map< double, TNodeColumn > TParam2ColumnMap
const SMDS_MeshNode * myNode
const TNodeColumn * myNodeColumn
BRepAdaptor_Surface mySurface
gp_XY GetNodeUV(const TopoDS_Face &F, const SMDS_MeshNode *n) const
SMDS_TypeOfPosition GetPositionType() const
std::vector< const SMDS_MeshNode * > TNodeColumn
bool error(int error, const SMESH_Comment &comment="")
store error and comment and then return ( error == COMPERR_OK )
std::vector< gp_XYZ > myShapeXYZ
TNode2ColumnMap myBotToColumnMap
std::map< TNode, TNodeColumn > TNode2ColumnMap
Standard_Real LastParameter() const
Standard_Real LastParameter() const
TBlockShapes myShapeIDMap
const TParam2ColumnMap & GetParam2ColumnMap(const int baseEdgeID, bool &isReverse)
Return TParam2ColumnMap for a base edge.
Standard_Real LastParameter() const
TopTools_IndexedMapOfOrientedShape TBlockShapes
std::map< double, TNodeColumn > TParam2ColumnMap
const TopoDS_Shape & Shape(const int shapeID) const
Return a in-block shape.
SMESH_ComputeErrorPtr GetError() const
Return problem description.
std::map< int, std::pair< TParam2ColumnMap *, bool > > myShapeIndex2ColumnMap
#define STDMESHERS_EXPORT
Class emulating pcurve on a hirizontal face.
bool IsNeighbor(const TNode &other) const
const TopoDS_Edge & BaseEdge() const
virtual bool Compute(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)=0
Computes mesh on a shape.
int ShapeID(const TopoDS_Shape &shape) const
Return in-block ID of a shape.
TSideFace * GetComponent(const int i) const
Standard_Real FirstParameter() const
int VerticalSize() const
Return number of nodes on every vertical edge.
SMESHDS_Mesh * MeshDS() const
Return pointer to mesh DS.
Standard_Real FirstParameter() const
static bool IsForwardEdge(const TopoDS_Edge &theEdge, const TopTools_IndexedMapOfOrientedShape &theShapeIDMap)
SMESHDS_SubMesh * SubMeshDS(const int shapeID) const
Return submesh DS of a shape.
void ProjectTriangles()
Enable removal of quadrangles from the bottom face and triangles creation there by projection from th...
static SMESH_ComputeErrorPtr New(int error=COMPERR_OK, std::string comment="", const SMESH_Algo *algo=0)
TParam2ColumnMap * myParamToColumnMap
SMESH_Mesh * Mesh() const
Return pointer to mesh.
SMESH_subMesh * SubMesh(const int shapeID) const
Return submesh of a shape.
SMESH_MesherHelper * myHelper
std::vector< TParam2ColumnMap > myParam2ColumnMaps
SMESH_MesherHelper * myHelper
THorizontalEdgeAdaptor(const TSideFace *sideFace, const bool isTop)
SMESH_ComputeErrorPtr myError
bool operator<(const TNode &other) const
Standard_Real FirstParameter() const
std::vector< const SMDS_MeshNode * > TNodeColumn
It helps meshers to add elements.