Version: 6.3.1
Public Member Functions | Private Member Functions | Private Attributes

LinkID_Gen Class Reference

Public Member Functions

 LinkID_Gen (const SMESHDS_Mesh *theMesh)
long GetLinkID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2) const
bool GetNodes (const long theLinkID, const SMDS_MeshNode *&theNode1, const SMDS_MeshNode *&theNode2) const

Private Member Functions

 LinkID_Gen ()

Private Attributes

const SMESHDS_MeshmyMesh
long myMaxID

Detailed Description

Definition at line 2045 of file SMESH_MeshEditor.cxx.


Constructor & Destructor Documentation

LinkID_Gen.LinkID_Gen ( const SMESHDS_Mesh theMesh)

Definition at line 2048 of file SMESH_MeshEditor.cxx.

    :myMesh( theMesh ), myMaxID( theMesh->MaxNodeID() + 1)
  {}
LinkID_Gen.LinkID_Gen ( ) [private]

Member Function Documentation

long LinkID_Gen.GetLinkID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2 
) const

Definition at line 2052 of file SMESH_MeshEditor.cxx.

References SMDS_MeshElement.GetID(), Max(), and Min().

Referenced by SMESH_MeshEditor.SewFreeBorder().

  {
    return ( Min(n1->GetID(),n2->GetID()) * myMaxID + Max(n1->GetID(),n2->GetID()));
  }
bool LinkID_Gen.GetNodes ( const long  theLinkID,
const SMDS_MeshNode *&  theNode1,
const SMDS_MeshNode *&  theNode2 
) const

Definition at line 2058 of file SMESH_MeshEditor.cxx.

  {
    theNode1 = myMesh->FindNode( theLinkID / myMaxID );
    if ( !theNode1 ) return false;
    theNode2 = myMesh->FindNode( theLinkID % myMaxID );
    if ( !theNode2 ) return false;
    return true;
  }

Field Documentation

long LinkID_Gen.myMaxID [private]

Definition at line 2072 of file SMESH_MeshEditor.cxx.

const SMESHDS_Mesh* LinkID_Gen.myMesh [private]

Definition at line 2071 of file SMESH_MeshEditor.cxx.

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