Version: 6.3.1
Public Member Functions | Private Attributes

SMESH_Block.TFace Class Reference

#include <SMESH_Block.hxx>

Public Member Functions

void Set (const int faceID, Adaptor3d_Surface *S, Adaptor2d_Curve2d *c2d[4], const bool isForward[4])
 Set face data.
void Set (const int faceID, const TEdge &edgeU0, const TEdge &edgeU1)
 Set face data to work with mesh block.
gp_XY GetUV (const gp_XYZ &theParams) const
gp_XYZ Point (const gp_XYZ &theParams) const
int GetUInd () const
int GetVInd () const
void GetCoefs (int i, const gp_XYZ &theParams, double &eCoef, double &vCoef) const
 TFace ()
 ~TFace ()
 Destructor.

Private Attributes

int myCoordInd [4]
double myFirst [4]
double myLast [4]
Adaptor2d_Curve2dmyC2d [4]
gp_XY myCorner [4]
Adaptor3d_SurfacemyS
gp_XYZ myNodes [4]

Detailed Description

Definition at line 334 of file SMESH_Block.hxx.


Constructor & Destructor Documentation

SMESH_Block.TFace.TFace ( )

Definition at line 355 of file SMESH_Block.hxx.

: myS(0) { myC2d[0]=myC2d[1]=myC2d[2]=myC2d[3]=0; }
SMESH_Block.TFace::~TFace ( )

Destructor.

Definition at line 211 of file SMESH_Block.cxx.

{
  if ( myS ) delete myS;
  for ( int i = 0 ; i < 4; ++i )
    if ( myC2d[ i ]) delete myC2d[ i ];
}

Member Function Documentation

void SMESH_Block.TFace::GetCoefs ( int  i,
const gp_XYZ &  theParams,
double &  eCoef,
double &  vCoef 
) const

Definition at line 223 of file SMESH_Block.cxx.

{
  double dU = theParams.Coord( GetUInd() );
  double dV = theParams.Coord( GetVInd() );
  switch ( iE ) {
  case 0:
    Ecoef = ( 1 - dV ); // u0
    Vcoef = ( 1 - dU ) * ( 1 - dV ); break; // 00
  case 1:
    Ecoef = dV; // u1
    Vcoef = dU * ( 1 - dV ); break; // 10
  case 2:
    Ecoef = ( 1 - dU ); // 0v
    Vcoef = dU * dV  ; break; // 11
  case 3:
    Ecoef = dU  ; // 1v
    Vcoef = ( 1 - dU ) * dV  ; break; // 01
  default: ASSERT(0);
  }
}
int SMESH_Block.TFace.GetUInd ( ) const

Definition at line 352 of file SMESH_Block.hxx.

{ return myCoordInd[ 0 ]; }
gp_XY SMESH_Block.TFace::GetUV ( const gp_XYZ &  theParams) const

Definition at line 252 of file SMESH_Block.cxx.

{
  gp_XY uv(0.,0.);
  for ( int iE = 0; iE < 4; iE++ ) // loop on 4 edges
  {
    double Ecoef = 0, Vcoef = 0;
    GetCoefs( iE, theParams, Ecoef, Vcoef );
    // edge addition
    double u = theParams.Coord( myCoordInd[ iE ] );
    u = ( 1 - u ) * myFirst[ iE ] + u * myLast[ iE ];
    uv += Ecoef * myC2d[ iE ]->Value( u ).XY();
    // corner addition
    uv -= Vcoef * myCorner[ iE ];
  }
  return uv;
}
int SMESH_Block.TFace.GetVInd ( ) const

Definition at line 353 of file SMESH_Block.hxx.

{ return myCoordInd[ 2 ]; }
gp_XYZ SMESH_Block.TFace::Point ( const gp_XYZ &  theParams) const

Definition at line 274 of file SMESH_Block.cxx.

References SMESH_test.i1, and SMESH_test.i2.

{
  gp_XYZ p(0.,0.,0.);
  if ( !myS ) // if mesh block
  {
    for ( int iE = 0; iE < 4; iE++ ) // loop on 4 edges
    {
      double Ecoef = 0, Vcoef = 0;
      GetCoefs( iE, theParams, Ecoef, Vcoef );
      // edge addition
      double u = theParams.Coord( myCoordInd[ iE ] );
      int i1 = 0, i2 = 1;
      switch ( iE ) {
      case 1: i1 = 3; i2 = 2; break;
      case 2: i1 = 1; i2 = 2; break;
      case 3: i1 = 0; i2 = 3; break;
      }
      p += Ecoef * ( myNodes[ i1 ] * ( 1 - u ) + myNodes[ i2 ] * u );
      // corner addition
      p -= Vcoef * myNodes[ iE ];
    }
    
  }
  else // shape block
  {
    gp_XY uv = GetUV( theParams );
    p = myS->Value( uv.X(), uv.Y() ).XYZ();
  }
  return p;
}
void SMESH_Block.TFace::Set ( const int  faceID,
Adaptor3d_Surface S,
Adaptor2d_Curve2d c2D[4],
const bool  isForward[4] 
)

Set face data.

Parameters:
faceID- block subshape ID
S- face surface geometry
c2d- 4 pcurves in the order as returned by GetFaceEdgesIDs(faceID)
isForward- orientation of pcurves comparing with block edge direction

Definition at line 153 of file SMESH_Block.cxx.

Referenced by StdMeshers_PrismAsBlock.Init(), SMESH_Block.LoadFace(), and SMESH_Block.LoadMeshBlock().

{
  if ( myS ) delete myS;
  myS = S;
  // pcurves
  vector< int > edgeIdVec;
  GetFaceEdgesIDs( faceID, edgeIdVec );
  for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
  {
    myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] );
    if ( myC2d[ iE ]) delete myC2d[ iE ];
    myC2d[ iE ] = c2D[ iE ];
    myFirst[ iE ] = myC2d[ iE ]->FirstParameter();
    myLast [ iE ] = myC2d[ iE ]->LastParameter();
    if ( !isForward[ iE ])
      std::swap( myFirst[ iE ], myLast[ iE ] );
  }
  // 2d corners
  myCorner[ 0 ] = myC2d[ 0 ]->Value( myFirst[0] ).XY();
  myCorner[ 1 ] = myC2d[ 0 ]->Value( myLast[0] ).XY();
  myCorner[ 2 ] = myC2d[ 1 ]->Value( myLast[1] ).XY();
  myCorner[ 3 ] = myC2d[ 1 ]->Value( myFirst[1] ).XY();
}
void SMESH_Block.TFace::Set ( const int  faceID,
const TEdge edgeU0,
const TEdge edgeU1 
)

Set face data to work with mesh block.

Parameters:
faceID- block subshape ID
edgeU0- filled data of edge u0 = GetFaceEdgesIDs(faceID)[ 0 ]
edgeU1- filled data of edge u1 = GetFaceEdgesIDs(faceID)[ 1 ]

Definition at line 189 of file SMESH_Block.cxx.

References SMESH_Block.TEdge.NodeXYZ().

{
  vector< int > edgeIdVec;
  GetFaceEdgesIDs( faceID, edgeIdVec );
  myNodes[ 0 ] = edgeU0.NodeXYZ( 1 );
  myNodes[ 1 ] = edgeU0.NodeXYZ( 0 );
  myNodes[ 2 ] = edgeU1.NodeXYZ( 0 );
  myNodes[ 3 ] = edgeU1.NodeXYZ( 1 );
  myCoordInd[ 0 ] = GetCoordIndOnEdge( edgeIdVec[ 0 ] );
  myCoordInd[ 1 ] = GetCoordIndOnEdge( edgeIdVec[ 1 ] );
  myCoordInd[ 2 ] = GetCoordIndOnEdge( edgeIdVec[ 2 ] );
  myCoordInd[ 3 ] = GetCoordIndOnEdge( edgeIdVec[ 3 ] );
  if ( myS ) delete myS;
  myS = 0;
}

Field Documentation

Definition at line 339 of file SMESH_Block.hxx.

Definition at line 336 of file SMESH_Block.hxx.

gp_XY SMESH_Block.TFace.myCorner[4] [private]

Definition at line 341 of file SMESH_Block.hxx.

double SMESH_Block.TFace.myFirst[4] [private]

Definition at line 337 of file SMESH_Block.hxx.

double SMESH_Block.TFace.myLast[4] [private]

Definition at line 338 of file SMESH_Block.hxx.

gp_XYZ SMESH_Block.TFace.myNodes[4] [private]

Definition at line 345 of file SMESH_Block.hxx.

Definition at line 343 of file SMESH_Block.hxx.

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