//!< True if all blocks this side belongs to have beem found
bool isBound() const { return _nbBlocksExpected <= _nbBlocksFound; }
//!< Return coordinates of node at XY
- gp_XYZ getXYZ(int x, int y) const { return SMESH_MeshEditor::TNodeXYZ( getNode( x, y )); }
+ gp_XYZ getXYZ(int x, int y) const { return SMESH_TNodeXYZ( getNode( x, y )); }
//!< Return gravity center of the four corners and the middle node
gp_XYZ getGC() const
{
//!< return coordinates by XY
gp_XYZ xyz(int x, int y) const
{
- return SMESH_MeshEditor::TNodeXYZ( _grid_access_(_side, _index( x, y )) );
+ return SMESH_TNodeXYZ( _grid_access_(_side, _index( x, y )) );
}
//!< safely return a node by XY
const SMDS_MeshNode* node(int x, int y) const
gp_Vec p1p2( p1, p2 );
const SMDS_MeshElement* face1 = side1->getCornerFace( n1 );
- gp_XYZ p1Op = SMESH_MeshEditor::TNodeXYZ( oppositeNode( face1, face1->GetNodeIndex(n1)));
+ gp_XYZ p1Op = SMESH_TNodeXYZ( oppositeNode( face1, face1->GetNodeIndex(n1)));
gp_Vec side1Dir( p1, p1Op );
gp_Ax2 pln( p1, p1p2, side1Dir ); // plane with normal p1p2 and X dir side1Dir
_DUMP_(" Select adjacent for "<< side1._side << " - side dir ("
{
_BlockSide* sideI = *sideIt;
const SMDS_MeshElement* faceI = sideI->getCornerFace( n1 );
- gp_XYZ p1Op = SMESH_MeshEditor::TNodeXYZ( oppositeNode( faceI, faceI->GetNodeIndex(n1)));
+ gp_XYZ p1Op = SMESH_TNodeXYZ( oppositeNode( faceI, faceI->GetNodeIndex(n1)));
gp_Vec sideIDir( p1, p1Op );
// compute angle of (sideIDir projection to pln) and (X dir of pln)
gp_Vec2d sideIDirProj( sideIDir * pln.XDirection(), sideIDir * pln.YDirection());
}
gp_XYZ GetXYZ(int iCol, int iRow) const
{
- return SMESH_MeshEditor::TNodeXYZ( GetNode( iCol, iRow ));
+ return SMESH_TNodeXYZ( GetNode( iCol, iRow ));
}
};
subShapeIDs.insert( shapeID );
// get nodes on vertices
- list < SMESH_MeshEditor::TNodeXYZ > vertexNodes;
- list < SMESH_MeshEditor::TNodeXYZ >::iterator vNIt;
+ list < SMESH_TNodeXYZ > vertexNodes;
+ list < SMESH_TNodeXYZ >::iterator vNIt;
TopExp_Explorer vExp( theShape, TopAbs_VERTEX );
for ( ; vExp.More(); vExp.Next() )
{
n = SMESH_Algo::VertexNode( v, tgtMesh );
if ( !n ) return false; // very strange
}
- vertexNodes.push_back( SMESH_MeshEditor::TNodeXYZ( n ));
+ vertexNodes.push_back( SMESH_TNodeXYZ( n ));
}
// import edges from groups
const SMDS_MeshElement* edge = srcElems->next();
// find out if edge is located on geomEdge by projecting
// a middle of edge to geomEdge
- SMESH_MeshEditor::TNodeXYZ p1( edge->GetNode(0));
- SMESH_MeshEditor::TNodeXYZ p2( edge->GetNode(1));
+ SMESH_TNodeXYZ p1( edge->GetNode(0));
+ SMESH_TNodeXYZ p2( edge->GetNode(1));
gp_XYZ middle = ( p1 + p2 ) / 2.;
tmpNode->setXYZ( middle.X(), middle.Y(), middle.Z());
double u = 0;
subShapeIDs.insert( shapeID );
// get nodes on vertices
- list < SMESH_MeshEditor::TNodeXYZ > vertexNodes;
- list < SMESH_MeshEditor::TNodeXYZ >::iterator vNIt;
+ list < SMESH_TNodeXYZ > vertexNodes;
+ list < SMESH_TNodeXYZ >::iterator vNIt;
TopExp_Explorer exp( theShape, TopAbs_VERTEX );
for ( ; exp.More(); exp.Next() )
{
n = SMESH_Algo::VertexNode( v, tgtMesh );
if ( !n ) return false; // very strange
}
- vertexNodes.push_back( SMESH_MeshEditor::TNodeXYZ( n ));
+ vertexNodes.push_back( SMESH_TNodeXYZ( n ));
}
// to count now many times a link between nodes encounters
int iNext = helper.WrapIndex( iNode+1, face->NbCornerNodes() );
int iPrev = helper.WrapIndex( iNode-1, face->NbCornerNodes() );
- SMESH_MeshEditor::TNodeXYZ prevNode( newNodes[iPrev] );
- SMESH_MeshEditor::TNodeXYZ curNode ( newNodes[iNode] );
- SMESH_MeshEditor::TNodeXYZ nextNode( newNodes[iNext] );
+ SMESH_TNodeXYZ prevNode( newNodes[iPrev] );
+ SMESH_TNodeXYZ curNode ( newNodes[iNode] );
+ SMESH_TNodeXYZ nextNode( newNodes[iNext] );
gp_Vec n1n0( prevNode - curNode);
gp_Vec n1n2( nextNode - curNode );
gp_Vec meshNorm = n1n2 ^ n1n0;
else
{
// std-like iterator used to get coordinates of nodes of mesh element
- typedef SMDS_StdIterator< SMESH_MeshEditor::TNodeXYZ, SMDS_ElemIteratorPtr > TXyzIterator;
+ typedef SMDS_StdIterator< SMESH_TNodeXYZ, SMDS_ElemIteratorPtr > TXyzIterator;
SMESH_MesherHelper helper(theMesh);
helper.SetSubShape(theShape);
#include "SMESH_Block.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_Hypothesis.hxx"
-#include "SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include <TopTools_Array1OfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
const TopoDS_Edge& theEdge,
const TopoDS_Edge& fromEdge)
{
- SMESH_IndexedMapOfShape aChain;
+ TopTools_IndexedMapOfShape aChain;
int step = 0;
// List of edges, added to chain on the previous cycle pass
SMDS_NodeIteratorPtr nIt = srcSmds->GetNodes();
while ( nIt->more() )
{
- SMESH_MeshEditor::TNodeXYZ p ( nIt->next());
+ SMESH_TNodeXYZ p ( nIt->next());
bool pOK = false;
switch ( srcPP.size() )
{
while ( nItT->more() && !pOK )
{
const SMDS_MeshNode* n = nItT->next();
- tgtP = SMESH_MeshEditor::TNodeXYZ( n );
+ tgtP = SMESH_TNodeXYZ( n );
pOK = ( fabs( srcDist - tgtPP[0].Distance( tgtP )) < 2*eTol );
//cout << "E - nS " << p._node->GetID() << " - nT " << n->GetID()<< " OK - " << pOK<< " " << fabs( srcDist - tgtPP[0].Distance( tgtP ))<< " tol " << eTol<< endl;
}
if ( !tgtEdge.IsPartner( srcEdge.Current() ))
{
// check that transformation is OK by three nodes
- gp_Pnt p0S = SMESH_MeshEditor::TNodeXYZ( (srcNodes.begin()) ->second);
- gp_Pnt p1S = SMESH_MeshEditor::TNodeXYZ( (srcNodes.rbegin()) ->second);
- gp_Pnt p2S = SMESH_MeshEditor::TNodeXYZ( (++srcNodes.begin())->second);
+ gp_Pnt p0S = SMESH_TNodeXYZ( (srcNodes.begin()) ->second);
+ gp_Pnt p1S = SMESH_TNodeXYZ( (srcNodes.rbegin()) ->second);
+ gp_Pnt p2S = SMESH_TNodeXYZ( (++srcNodes.begin())->second);
- gp_Pnt p0T = SMESH_MeshEditor::TNodeXYZ( (tgtNodes.begin()) ->second);
- gp_Pnt p1T = SMESH_MeshEditor::TNodeXYZ( (tgtNodes.rbegin()) ->second);
- gp_Pnt p2T = SMESH_MeshEditor::TNodeXYZ( (++tgtNodes.begin())->second);
+ gp_Pnt p0T = SMESH_TNodeXYZ( (tgtNodes.begin()) ->second);
+ gp_Pnt p1T = SMESH_TNodeXYZ( (tgtNodes.rbegin()) ->second);
+ gp_Pnt p2T = SMESH_TNodeXYZ( (++tgtNodes.begin())->second);
// transform source points, they must coincide with target ones
if ( p0T.SquareDistance( p0S.Transformed( trsf )) > tol ||
enum EQuadNature { NOT_QUAD, QUAD, DEGEN_QUAD, PYRAM_APEX = 4, TRIA_APEX = 0 };
// std-like iterator used to get coordinates of nodes of mesh element
-typedef SMDS_StdIterator< SMESH_MeshEditor::TNodeXYZ, SMDS_ElemIteratorPtr > TXyzIterator;
+typedef SMDS_StdIterator< SMESH_TNodeXYZ, SMDS_ElemIteratorPtr > TXyzIterator;
namespace
{
if ( !baseNodes[1] ) return false; // not adjacent
// Get normals of triangles sharing baseNodes
- gp_XYZ apexI = SMESH_MeshEditor::TNodeXYZ( nApexI );
- gp_XYZ apexJ = SMESH_MeshEditor::TNodeXYZ( nApexJ );
- gp_XYZ base1 = SMESH_MeshEditor::TNodeXYZ( baseNodes[0]);
- gp_XYZ base2 = SMESH_MeshEditor::TNodeXYZ( baseNodes[1]);
+ gp_XYZ apexI = SMESH_TNodeXYZ( nApexI );
+ gp_XYZ apexJ = SMESH_TNodeXYZ( nApexJ );
+ gp_XYZ base1 = SMESH_TNodeXYZ( baseNodes[0]);
+ gp_XYZ base2 = SMESH_TNodeXYZ( baseNodes[1]);
gp_Vec baseVec( base1, base2 );
gp_Vec baI( base1, apexI );
gp_Vec baJ( base1, apexJ );
continue; // f is a base quadrangle
// check projections of face direction (baOFN) to triange normals (nI and nJ)
- gp_Vec baOFN( base1, SMESH_MeshEditor::TNodeXYZ( otherFaceNode ));
+ gp_Vec baOFN( base1, SMESH_TNodeXYZ( otherFaceNode ));
( isOutI ? nJ : nI ).Reverse();
if ( nI * baOFN > 0 && nJ * baOFN > 0 )
{
{
const SMDS_MeshNode* Nrem = PrmJ->GetNode(4); // node to remove
int nbJ = Nrem->NbInverseElements( SMDSAbs_Volume );
- SMESH_MeshEditor::TNodeXYZ Pj( Nrem );
+ SMESH_TNodeXYZ Pj( Nrem );
// an apex node to make common to all merged pyramids
SMDS_MeshNode* CommonNode = const_cast<SMDS_MeshNode*>(PrmI->GetNode(4));
if ( CommonNode == Nrem ) return; // already merged
int nbI = CommonNode->NbInverseElements( SMDSAbs_Volume );
- SMESH_MeshEditor::TNodeXYZ Pi( CommonNode );
+ SMESH_TNodeXYZ Pi( CommonNode );
gp_XYZ Pnew = ( nbI*Pi + nbJ*Pj ) / (nbI+nbJ);
CommonNode->setXYZ( Pnew.X(), Pnew.Y(), Pnew.Z() );
vector< const SMDS_MeshElement* > suspectElems;
searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems);
-// for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next()) {
-// const TopoDS_Shape& aShapeFace = exp.Current();
-// if(aShapeFace==NotCheckedFace)
-// continue;
-// const SMESHDS_SubMesh * aSubMeshDSFace = meshDS->MeshElements(aShapeFace);
-// if ( aSubMeshDSFace ) {
-// SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
-// while ( iteratorElem->more() ) { // loop on elements on a face
-// const SMDS_MeshElement* face = iteratorElem->next();
for ( int i = 0; i < suspectElems.size(); ++i )
{
const SMDS_MeshElement* face = suspectElems[i];
if ( face == NotCheckedFace ) continue;
Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
for ( int i = 0; i < face->NbCornerNodes(); ++i )
- aContour->Append( SMESH_MeshEditor::TNodeXYZ( face->GetNode(i) ));
+ aContour->Append( SMESH_TNodeXYZ( face->GetNode(i) ));
if( HasIntersection(P, PC, Pres, aContour) ) {
res = true;
double tmp = PC.Distance(Pres);
{
if( face->NbCornerNodes() != 4 )
{
- //myNbTriangles += int( face->NbCornerNodes() == 3 );
return NOT_QUAD;
}
gp_XYZ xyzC(0., 0., 0.);
for ( i = 0; i < 4; ++i )
{
- gp_XYZ p = SMESH_MeshEditor::TNodeXYZ( FNodes[i] = face->GetNode(i) );
+ gp_XYZ p = SMESH_TNodeXYZ( FNodes[i] = face->GetNode(i) );
PN->SetValue( i+1, p );
xyzC += p;
}
PC = xyzC/4;
- //cout<<" PC("<<PC.X()<<","<<PC.Y()<<","<<PC.Z()<<")"<<endl;
int nbp = 4;
if(F==face) continue;
Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
for ( int i = 0; i < 4; ++i )
- aContour->Append( SMESH_MeshEditor::TNodeXYZ( F->GetNode(i) ));
+ aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) ));
gp_Pnt PPP;
if( !volumes[0] && HasIntersection(Ptmp1, PC, PPP, aContour) ) {
IsOK1 = true;
Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
int nbN = F->NbNodes() / ( F->IsQuadratic() ? 2 : 1 );
for ( i = 0; i < nbN; ++i )
- aContour->Append( SMESH_MeshEditor::TNodeXYZ( F->GetNode(i) ));
+ aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) ));
gp_Pnt intP;
for ( int isRev = 0; isRev < 2; ++isRev )
{
for(k=0; k<5; k++) // loop on 4 base nodes of PrmI
{
const SMDS_MeshNode* n = PrmI->GetNode(k);
- PsI[k] = SMESH_MeshEditor::TNodeXYZ( n );
+ PsI[k] = SMESH_TNodeXYZ( n );
SMDS_ElemIteratorPtr vIt = n->GetInverseElementIterator( SMDSAbs_Volume );
while ( vIt->more() )
checkedPyrams.insert( vIt->next() );
if ( nextN->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ||
curN->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE )
{
- double dist = SMESH_MeshEditor::TNodeXYZ( face->GetNode(i)).Distance( nextN );
+ double dist = SMESH_TNodeXYZ( face->GetNode(i)).Distance( nextN );
if ( dist < minSize )
minSize = dist, iN = i;
}
if ( data._stepSizeNodes[0] )
{
double dist =
- SMESH_MeshEditor::TNodeXYZ(data._stepSizeNodes[0]).Distance(data._stepSizeNodes[1]);
+ SMESH_TNodeXYZ(data._stepSizeNodes[0]).Distance(data._stepSizeNodes[1]);
data._stepSizeCoeff = data._stepSize / dist;
}
}
}
else
{
- edge._pos.push_back( SMESH_MeshEditor::TNodeXYZ( node ));
+ edge._pos.push_back( SMESH_TNodeXYZ( node ));
if ( posType == SMDS_TOP_FACE )
{
double avgNormProj = 0, avgLen = 0;
for ( unsigned i = 0; i < edge._simplices.size(); ++i )
{
- gp_XYZ vec = edge._pos.back() - SMESH_MeshEditor::TNodeXYZ( edge._simplices[i]._nPrev );
+ gp_XYZ vec = edge._pos.back() - SMESH_TNodeXYZ( edge._simplices[i]._nPrev );
avgNormProj += edge._normal * vec;
avgLen += vec.Modulus();
}
if ( _nodes[0]->GetPosition()->GetTypeOfPosition() != SMDS_TOP_EDGE )
return;
- gp_XYZ pos = SMESH_MeshEditor::TNodeXYZ( _nodes[0] );
- gp_XYZ vec1 = pos - SMESH_MeshEditor::TNodeXYZ( n1 );
- gp_XYZ vec2 = pos - SMESH_MeshEditor::TNodeXYZ( n2 );
+ gp_XYZ pos = SMESH_TNodeXYZ( _nodes[0] );
+ gp_XYZ vec1 = pos - SMESH_TNodeXYZ( n1 );
+ gp_XYZ vec2 = pos - SMESH_TNodeXYZ( n2 );
// Set _curvature
for ( unsigned j = 0 ; j < _sdVec[i]._edges.size(); ++j )
{
_LayerEdge& edge = *_sdVec[i]._edges[j];
- SMESH_MeshEditor::TNodeXYZ nXYZ( edge._nodes[0] );
+ SMESH_TNodeXYZ nXYZ( edge._nodes[0] );
nXYZ += edge._normal * _sdVec[i]._stepSize;
dumpCmd(SMESH_Comment("mesh.AddEdge([ ") <<edge._nodes[0]->GetID()
<< ", mesh.AddNode( " << nXYZ.X()<<","<< nXYZ.Y()<<","<< nXYZ.Z()<<")])");
limitStepSize( data, 0.25 * distToIntersection );
if ( data._stepSizeNodes[0] )
data._stepSize = data._stepSizeCoeff *
- SMESH_MeshEditor::TNodeXYZ(data._stepSizeNodes[0]).Distance(data._stepSizeNodes[1]);
+ SMESH_TNodeXYZ(data._stepSizeNodes[0]).Distance(data._stepSizeNodes[1]);
}
if (nbSteps == 0 )
for ( int i = iBeg; i < iEnd; ++i )
{
_LayerEdge* edge = data._edges[i];
- SMESH_MeshEditor::TNodeXYZ tgtXYZ( edge->_nodes.back() );
+ SMESH_TNodeXYZ tgtXYZ( edge->_nodes.back() );
for ( unsigned j = 0; j < edge->_simplices.size(); ++j )
if ( !edge->_simplices[j].IsForward( edge->_nodes[0], &tgtXYZ ))
{
gp_Ax1 segDir;
if ( iPrev < 0 )
{
- segDir.SetLocation( SMESH_MeshEditor::TNodeXYZ( _nodes[0] ));
+ segDir.SetLocation( SMESH_TNodeXYZ( _nodes[0] ));
segDir.SetDirection( _normal );
segLen = 0;
}
Handle(Geom_Surface) surface = BRep_Tool::Surface( TopoDS::Face(_sWOL), loc );
pPrev = surface->Value( pPrev.X(), pPrev.Y() ).Transformed( loc );
}
- dir = SMESH_MeshEditor::TNodeXYZ( _nodes.back() ) - pPrev.XYZ();
+ dir = SMESH_TNodeXYZ( _nodes.back() ) - pPrev.XYZ();
}
segDir.SetLocation( pPrev );
segDir.SetDirection( dir );
gp_XYZ orig = lastSegment.Location().XYZ();
gp_XYZ dir = lastSegment.Direction().XYZ();
- SMESH_MeshEditor::TNodeXYZ vert0( n0 );
- SMESH_MeshEditor::TNodeXYZ vert1( n1 );
- SMESH_MeshEditor::TNodeXYZ vert2( n2 );
+ SMESH_TNodeXYZ vert0( n0 );
+ SMESH_TNodeXYZ vert1( n1 );
+ SMESH_TNodeXYZ vert2( n2 );
/* calculate distance from vert0 to ray origin */
gp_XYZ tvec = orig - vert0;
ASSERT( IsOnEdge() );
SMDS_MeshNode* tgtNode = const_cast<SMDS_MeshNode*>( _nodes.back() );
- SMESH_MeshEditor::TNodeXYZ oldPos( tgtNode );
+ SMESH_TNodeXYZ oldPos( tgtNode );
double dist01, distNewOld;
- SMESH_MeshEditor::TNodeXYZ p0( _2neibors->_nodes[0]);
- SMESH_MeshEditor::TNodeXYZ p1( _2neibors->_nodes[1]);
+ SMESH_TNodeXYZ p0( _2neibors->_nodes[0]);
+ SMESH_TNodeXYZ p1( _2neibors->_nodes[1]);
dist01 = p0.Distance( _2neibors->_nodes[1] );
gp_Pnt newPos = p0 * _2neibors->_wgt[0] + p1 * _2neibors->_wgt[1];
if ( _2neibors->_plnNorm )
{
// put newPos on the plane defined by source node and _plnNorm
- gp_XYZ new2src = SMESH_MeshEditor::TNodeXYZ( _nodes[0] ) - newPos.XYZ();
+ gp_XYZ new2src = SMESH_TNodeXYZ( _nodes[0] ) - newPos.XYZ();
double new2srcProj = (*_2neibors->_plnNorm) * new2src;
newPos.ChangeCoord() += (*_2neibors->_plnNorm) * new2srcProj;
}
// compute new position for the last _pos
gp_XYZ newPos (0,0,0);
for ( unsigned i = 0; i < _simplices.size(); ++i )
- newPos += SMESH_MeshEditor::TNodeXYZ( _simplices[i]._nPrev );
+ newPos += SMESH_TNodeXYZ( _simplices[i]._nPrev );
newPos /= _simplices.size();
if ( _curvature )
// }
// count quality metrics (orientation) of tetras around _tgtNode
int nbOkBefore = 0;
- SMESH_MeshEditor::TNodeXYZ tgtXYZ( _nodes.back() );
+ SMESH_TNodeXYZ tgtXYZ( _nodes.back() );
for ( unsigned i = 0; i < _simplices.size(); ++i )
nbOkBefore += _simplices[i].IsForward( _nodes[0], &tgtXYZ );
SMDS_MeshNode* n = const_cast< SMDS_MeshNode* >( _nodes.back() );
- _len -= prevPos.Distance(SMESH_MeshEditor::TNodeXYZ( n ));
+ _len -= prevPos.Distance(SMESH_TNodeXYZ( n ));
_len += prevPos.Distance(newPos);
n->setXYZ( newPos.X(), newPos.Y(), newPos.Z());
}
SMDS_MeshNode* n = const_cast< SMDS_MeshNode*>( _nodes.back() );
- SMESH_MeshEditor::TNodeXYZ oldXYZ( n );
+ SMESH_TNodeXYZ oldXYZ( n );
gp_XYZ nXYZ = oldXYZ + _normal * ( len - _len ) * _lenFactor;
n->setXYZ( nXYZ.X(), nXYZ.Y(), nXYZ.Z() );