+//================================================================================
+/*!
+ * \brief Add quadratic links of edge to own data structure
+ */
+//================================================================================
+
+void SMESH_MesherHelper::AddTLinks(const SMDS_MeshEdge* edge)
+{
+ if ( edge->IsQuadratic() )
+ AddTLinkNode(edge->GetNode(0), edge->GetNode(1), edge->GetNode(2));
+}
+
+//================================================================================
+/*!
+ * \brief Add quadratic links of face to own data structure
+ */
+//================================================================================
+
+void SMESH_MesherHelper::AddTLinks(const SMDS_MeshFace* f)
+{
+ if ( !f->IsPoly() )
+ switch ( f->NbNodes() ) {
+ case 6:
+ AddTLinkNode(f->GetNode(0),f->GetNode(1),f->GetNode(3));
+ AddTLinkNode(f->GetNode(1),f->GetNode(2),f->GetNode(4));
+ AddTLinkNode(f->GetNode(2),f->GetNode(0),f->GetNode(5)); break;
+ case 8:
+ AddTLinkNode(f->GetNode(0),f->GetNode(1),f->GetNode(4));
+ AddTLinkNode(f->GetNode(1),f->GetNode(2),f->GetNode(5));
+ AddTLinkNode(f->GetNode(2),f->GetNode(3),f->GetNode(6));
+ AddTLinkNode(f->GetNode(3),f->GetNode(0),f->GetNode(7));
+ default:;
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Add quadratic links of volume to own data structure
+ */
+//================================================================================
+
+void SMESH_MesherHelper::AddTLinks(const SMDS_MeshVolume* volume)
+{
+ if ( volume->IsQuadratic() )
+ {
+ SMDS_VolumeTool vTool( volume );
+ const SMDS_MeshNode** nodes = vTool.GetNodes();
+ set<int> addedLinks;
+ for ( int iF = 1; iF < vTool.NbFaces(); ++iF )
+ {
+ const int nbN = vTool.NbFaceNodes( iF );
+ const int* iNodes = vTool.GetFaceNodesIndices( iF );
+ for ( int i = 0; i < nbN; )
+ {
+ int iN1 = iNodes[i++];
+ int iN12 = iNodes[i++];
+ int iN2 = iNodes[i++];
+ if ( iN1 > iN2 ) std::swap( iN1, iN2 );
+ int linkID = iN1 * vTool.NbNodes() + iN2;
+ pair< set<int>::iterator, bool > it_isNew = addedLinks.insert( linkID );
+ if ( it_isNew.second )
+ AddTLinkNode( nodes[iN1], nodes[iN2], nodes[iN12] );
+ else
+ addedLinks.erase( it_isNew.first ); // each link encounters only twice
+ }
+ }
+ }
+}
+