#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_Curve2d * | myC2d [4] |
| gp_XY | myCorner [4] |
| Adaptor3d_Surface * | myS |
| gp_XYZ | myNodes [4] |
Definition at line 334 of file SMESH_Block.hxx.
| SMESH_Block.TFace.TFace | ( | ) |
| SMESH_Block.TFace::~TFace | ( | ) |
| 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.
| 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();
}
Set face data to work with mesh block.
| 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;
}
Adaptor2d_Curve2d* SMESH_Block.TFace.myC2d[4] [private] |
Definition at line 339 of file SMESH_Block.hxx.
int SMESH_Block.TFace.myCoordInd[4] [private] |
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.
Adaptor3d_Surface* SMESH_Block.TFace.myS [private] |
Definition at line 343 of file SMESH_Block.hxx.