Version: 6.3.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes

TNodeDistributor Class Reference

Class computing layers distribution using data of StdMeshers_LayerDistribution hypothesis. More...

Inheritance diagram for TNodeDistributor:
Inheritance graph
[legend]

Public Member Functions

bool Compute (vector< double > &positions, gp_Pnt pIn, gp_Pnt pOut, SMESH_Mesh &aMesh, const StdMeshers_LayerDistribution *hyp)

Static Public Member Functions

static TNodeDistributorGetDistributor (SMESH_Mesh &aMesh)

Protected Member Functions

 TNodeDistributor (int hypId, int studyId, SMESH_Gen *gen)
virtual const list< const
SMESHDS_Hypothesis * > & 
GetUsedHypothesis (SMESH_Mesh &, const TopoDS_Shape &, const bool)

Private Attributes

list< const SMESHDS_Hypothesis * > myUsedHyps

Detailed Description

Class computing layers distribution using data of StdMeshers_LayerDistribution hypothesis.

Definition at line 301 of file StdMeshers_RadialPrism_3D.cxx.


Constructor & Destructor Documentation

TNodeDistributor.TNodeDistributor ( int  hypId,
int  studyId,
SMESH_Gen gen 
) [protected]

Definition at line 350 of file StdMeshers_RadialPrism_3D.cxx.

    : StdMeshers_Regular_1D( hypId, studyId, gen)
  {
  }

Member Function Documentation

bool TNodeDistributor.Compute ( vector< double > &  positions,
gp_Pnt  pIn,
gp_Pnt  pOut,
SMESH_Mesh aMesh,
const StdMeshers_LayerDistribution hyp 
)

Definition at line 316 of file StdMeshers_RadialPrism_3D.cxx.

References StdMeshers_Regular_1D.CheckHypothesis(), StdMeshers_Regular_1D.computeInternalParameters(), and SMESH_test.edge.

Referenced by StdMeshers_RadialQuadrangle_1D2D.computeLayerPositions().

  {
    double len = pIn.Distance( pOut );
    if ( len <= DBL_MIN ) return error("Too close points of inner and outer shells");

    if ( !hyp || !hyp->GetLayerDistribution() )
      return error( "Invalid LayerDistribution hypothesis");
    myUsedHyps.clear();
    myUsedHyps.push_back( hyp->GetLayerDistribution() );

    TopoDS_Edge edge = BRepBuilderAPI_MakeEdge( pIn, pOut );
    SMESH_Hypothesis::Hypothesis_Status aStatus;
    if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, edge, aStatus ))
      return error( "StdMeshers_Regular_1D::CheckHypothesis() failed "
                    "with LayerDistribution hypothesis");

    BRepAdaptor_Curve C3D(edge);
    double f = C3D.FirstParameter(), l = C3D.LastParameter();
    list< double > params;
    if ( !StdMeshers_Regular_1D::computeInternalParameters( aMesh, C3D, len, f, l, params, false ))
      return error("StdMeshers_Regular_1D failed to compute layers distribution");

    positions.clear();
    positions.reserve( params.size() );
    for (list<double>::iterator itU = params.begin(); itU != params.end(); itU++)
      positions.push_back( *itU / len );
    return true;
  }
static TNodeDistributor* TNodeDistributor.GetDistributor ( SMESH_Mesh aMesh) [static]

Definition at line 306 of file StdMeshers_RadialPrism_3D.cxx.

Referenced by StdMeshers_RadialQuadrangle_1D2D.computeLayerPositions().

  {
    const int myID = -1000;
    map < int, SMESH_1D_Algo * > & algoMap = aMesh.GetGen()->_map1D_Algo;
    map < int, SMESH_1D_Algo * >::iterator id_algo = algoMap.find( myID );
    if ( id_algo == algoMap.end() )
      return new TNodeDistributor( myID, 0, aMesh.GetGen() );
    return static_cast< TNodeDistributor* >( id_algo->second );
  }
virtual const list<const SMESHDS_Hypothesis *>& TNodeDistributor.GetUsedHypothesis ( SMESH_Mesh ,
const TopoDS_Shape &  ,
const bool   
) [protected, virtual]

Definition at line 356 of file StdMeshers_RadialPrism_3D.cxx.

  {
    return myUsedHyps;
  }

Field Documentation

Definition at line 303 of file StdMeshers_RadialPrism_3D.cxx.

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS