* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
const SMDS_MeshNode* SMDS_FaceOfEdges::GetNode(const int ind) const
{
- int index = WrappedIndex( ind );
+ int index = ind;
for ( int i = 0; i < myNbEdges; ++i ) {
if ( index >= myEdges[ i ]->NbNodes() )
index -= myEdges[ i ]->NbNodes();
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
myElems.reserve( face->NbNodes() );
for ( int i = 0; i < face->NbNodes(); ++i ) {
const SMDS_MeshElement* edge =
- SMDS_Mesh::FindEdge( face->GetNode( i ), face->GetNode( i + 1 ));
+ SMDS_Mesh::FindEdge( face->GetNode( i ), face->GetNodeWrap( i + 1 ));
if ( edge )
myElems.push_back( edge );
}
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
const SMDS_MeshNode* SMDS_FaceOfNodes::GetNode(const int ind) const
{
- return myNodes[ WrappedIndex( ind )];
+ return myNodes[ ind ];
}
-
-/*bool operator<(const SMDS_FaceOfNodes& f1, const SMDS_FaceOfNodes& f2)
-{
- set<SMDS_MeshNode> set1,set2;
- SMDS_ElemIteratorPtr it;
- const SMDS_MeshNode * n;
-
- it=f1.nodesIterator();
-
- while(it->more())
- {
- n=static_cast<const SMDS_MeshNode *>(it->next());
- set1.insert(*n);
- }
-
- delete it;
- it=f2.nodesIterator();
-
- while(it->more())
- {
- n=static_cast<const SMDS_MeshNode *>(it->next());
- set2.insert(*n);
- }
-
- delete it;
- return set1<set2;
-
-}*/
-
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
const SMDS_MeshNode* SMDS_MeshEdge::GetNode(const int ind) const
{
- return myNodes[ WrappedIndex( ind )];
+ return myNodes[ ind ];
}
//=======================================================================
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
const SMDS_MeshNode* SMDS_MeshElement::GetNode(const int ind) const
{
- SMDS_ElemIteratorPtr it = nodesIterator();
- int i = 0, index = WrappedIndex( ind );
- while ( index != i++ )
- it->next();
- if ( it->more() )
- return static_cast<const SMDS_MeshNode*> (it->next());
+ if ( ind >= 0 ) {
+ SMDS_ElemIteratorPtr it = nodesIterator();
+ for ( int i = 0; i < ind; ++i )
+ it->next();
+ if ( it->more() )
+ return static_cast<const SMDS_MeshNode*> (it->next());
+ }
return 0;
}
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
virtual const SMDS_MeshNode* GetNode(const int) const { return this; }
myElems.reserve( face->NbNodes() );
for ( int i = 0; i < face->NbNodes(); ++i ) {
const SMDS_MeshElement* edge =
- SMDS_Mesh::FindEdge( face->GetNode( i ), face->GetNode( i + 1 ));
+ SMDS_Mesh::FindEdge( face->GetNode( i ), face->GetNodeWrap( i + 1 ));
if ( edge )
myElems.push_back( edge );
}
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
const SMDS_MeshNode* SMDS_PolygonalFaceOfNodes::GetNode(const int ind) const
{
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
const SMDS_MeshNode* SMDS_PolyhedralVolumeOfNodes::GetNode(const int ind) const
{
- return myNodesByFaces[ WrappedIndex( ind )];
+ return myNodesByFaces[ ind ];
}
_MyEdgeIterator(const SMDS_QuadraticFaceOfNodes* face):myIndex(0) {
myElems.reserve( face->NbNodes() );
SMDS_ElemIteratorPtr nIt = face->interlacedNodesElemIterator();
- const SMDS_MeshNode* n0 = face->GetNode( -1 );
+ const SMDS_MeshNode* n0 = face->GetNodeWrap( -1 );
while ( nIt->more() ) {
const SMDS_MeshNode* n1 = static_cast<const SMDS_MeshNode*>( nIt->next() );
const SMDS_MeshElement* edge = SMDS_Mesh::FindEdge( n0, n1 );
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
const SMDS_MeshNode* SMDS_QuadraticFaceOfNodes::GetNode(const int ind) const
{
- return myNodes[ WrappedIndex( ind )];
+ return myNodes[ ind ];
}
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
const SMDS_MeshNode* SMDS_QuadraticVolumeOfNodes::GetNode(const int ind) const
{
- return myNodes[ WrappedIndex( ind )];
+ return myNodes[ ind ];
}
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
{
OS << "volume <" << GetID() << "> : ";
int i;
- for (i = 0; i < NbNodes(); ++i) OS << myNodes[i] << ",";
+ for (i = 0; i < NbNodes()-1; ++i) OS << myNodes[i] << ",";
OS << myNodes[NbNodes()-1]<< ") " << endl;
}
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
const SMDS_MeshNode* SMDS_VolumeOfNodes::GetNode(const int ind) const
{
- return myNodes[ WrappedIndex( ind )];
+ return myNodes[ ind ];
}
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
- *
- * Index is wrapped if it is out of a valid range
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
iAfter = SMESH_MesherHelper::WrapIndex( iAfter, nb );
iBefore = SMESH_MesherHelper::WrapIndex( iBefore, nb );
}
- linkedNodes.insert( elem->GetNode( iAfter ));
- linkedNodes.insert( elem->GetNode( iBefore ));
+ linkedNodes.insert( elem->GetNodeWrap( iAfter ));
+ linkedNodes.insert( elem->GetNodeWrap( iBefore ));
}
}
}
if(elem->IsQuadratic())
nbn = nbn/2;
// loop on elem links: insert them in linkNbMap
- const SMDS_MeshNode* curNode, *prevNode = elem->GetNode( nbn );
+ const SMDS_MeshNode* curNode, *prevNode = elem->GetNodeWrap( nbn );
for ( int iN = 0; iN < nbn; ++iN ) {
curNode = elem->GetNode( iN );
NLink link;
const SMDS_MeshFace * f = aMesh->FindFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ]);
if ( !f )
myLastCreatedElems.Append(aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] ));
- else if ( nodes[ 1 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
+ else if ( nodes[ 1 ] != f->GetNodeWrap( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
aMesh->ChangeElementNodes( f, nodes, nbn );
break;
}
const SMDS_MeshFace * f = aMesh->FindFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ], nodes[ 3 ]);
if ( !f )
myLastCreatedElems.Append(aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ], nodes[ 3 ] ));
- else if ( nodes[ 1 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
+ else if ( nodes[ 1 ] != f->GetNodeWrap( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
aMesh->ChangeElementNodes( f, nodes, nbn );
break;
}
if ( !f )
myLastCreatedElems.Append(aMesh->AddFace(nodes[0], nodes[2], nodes[4],
nodes[1], nodes[3], nodes[5]));
- else if ( nodes[ 2 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
+ else if ( nodes[ 2 ] != f->GetNodeWrap( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
aMesh->ChangeElementNodes( f, nodes, nbn );
}
else { /////// quadratic quadrangle
if ( !f )
myLastCreatedElems.Append(aMesh->AddFace(nodes[0], nodes[2], nodes[4], nodes[6],
nodes[1], nodes[3], nodes[5], nodes[7]));
- else if ( nodes[ 2 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
+ else if ( nodes[ 2 ] != f->GetNodeWrap( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
aMesh->ChangeElementNodes( f, nodes, nbn );
}
}
const SMDS_MeshFace * f = aMesh->FindFace( polygon_nodes );
if ( !f )
myLastCreatedElems.Append(aMesh->AddPolygonalFace(polygon_nodes));
- else if ( nodes[ 1 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
+ else if ( nodes[ 1 ] != f->GetNodeWrap( f->GetNodeIndex( nodes[ 0 ] ) + 1 ))
aMesh->ChangeElementNodes( f, nodes, nbn );
}
}