Version: 6.3.1
Public Member Functions | Private Attributes

SMESHDS_Document Class Reference

#include <SMESHDS_Document.hxx>

Public Member Functions

 SMESHDS_Document (int UserID)
int NewMesh (bool theIsEmbeddedMode)
void RemoveMesh (int MeshID)
SMESHDS_MeshGetMesh (int MeshID)
void AddHypothesis (SMESHDS_Hypothesis *H)
void RemoveHypothesis (int HypID)
SMESHDS_HypothesisGetHypothesis (int HypID)
int NbMeshes ()
int NbHypothesis ()
void InitMeshesIterator ()
SMESHDS_MeshNextMesh ()
bool MoreMesh ()
void InitHypothesisIterator ()
SMESHDS_HypothesisNextHypothesis ()
bool MoreHypothesis ()
 ~SMESHDS_Document ()

Private Attributes

int myUserID
std::map< int, SMESHDS_Mesh * > myMeshes
std::map< int,
SMESHDS_Hypothesis * > 
myHypothesis
std::map< int, SMESHDS_Mesh * >
::iterator 
myMeshesIt
std::map< int,
SMESHDS_Hypothesis * >
::iterator 
myHypothesisIt

Detailed Description

Definition at line 37 of file SMESHDS_Document.hxx.


Constructor & Destructor Documentation

SMESHDS_Document::SMESHDS_Document ( int  UserID)

Definition at line 38 of file SMESHDS_Document.cxx.

                                            :myUserID(UserID)
{
}
SMESHDS_Document::~SMESHDS_Document ( )

Definition at line 47 of file SMESHDS_Document.cxx.

References InitMeshesIterator(), MoreMesh(), and NextMesh().

{
  InitMeshesIterator();
  while ( MoreMesh() )
    delete NextMesh();
}

Member Function Documentation

void SMESHDS_Document::AddHypothesis ( SMESHDS_Hypothesis H)

Definition at line 98 of file SMESHDS_Document.cxx.

References SMESHDS_Hypothesis.GetID(), and myHypothesis.

{
        myHypothesis[H->GetID()]=H;
}
SMESHDS_Hypothesis * SMESHDS_Document::GetHypothesis ( int  HypID)

Definition at line 107 of file SMESHDS_Document.cxx.

References MESSAGE, and myHypothesis.

{
        map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
        if (it==myHypothesis.end())
        {
                MESSAGE("SMESHDS_Document::GetHypothesis : ID not found");
                return NULL;
        }
        else return (*it).second;
}
SMESHDS_Mesh * SMESHDS_Document::GetMesh ( int  MeshID)

Definition at line 71 of file SMESHDS_Document.cxx.

References MESSAGE, and myMeshes.

Referenced by SMESH_Mesh.SMESH_Mesh().

{
        map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
        if (it==myMeshes.end())
        {
                MESSAGE("SMESHDS_Document::GetMesh : ID not found");
                return NULL;
        }
        else return (*it).second;
}
void SMESHDS_Document::InitHypothesisIterator ( )

Definition at line 181 of file SMESHDS_Document.cxx.

References myHypothesis, and myHypothesisIt.

void SMESHDS_Document::InitMeshesIterator ( )

Definition at line 152 of file SMESHDS_Document.cxx.

References myMeshes, and myMeshesIt.

Referenced by ~SMESHDS_Document().

{
        myMeshesIt=myMeshes.begin();
}
bool SMESHDS_Document::MoreHypothesis ( )

Definition at line 201 of file SMESHDS_Document.cxx.

References myHypothesis, and myHypothesisIt.

{
        return myHypothesisIt!=myHypothesis.end();
}
bool SMESHDS_Document::MoreMesh ( )

Definition at line 172 of file SMESHDS_Document.cxx.

References myMeshes, and myMeshesIt.

Referenced by ~SMESHDS_Document().

{
        return myMeshesIt!=myMeshes.end();
}
int SMESHDS_Document::NbHypothesis ( )

Definition at line 143 of file SMESHDS_Document.cxx.

References myHypothesis.

{
        return myHypothesis.size();
}
int SMESHDS_Document::NbMeshes ( )

Definition at line 134 of file SMESHDS_Document.cxx.

References myMeshes.

{
        return myMeshes.size();
}
int SMESHDS_Document::NewMesh ( bool  theIsEmbeddedMode)

Definition at line 58 of file SMESHDS_Document.cxx.

References myMeshes.

Referenced by SMESH_Mesh.SMESH_Mesh().

{
  static int aNewMeshID = 0;
  aNewMeshID++;
  SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(aNewMeshID,theIsEmbeddedMode);
  myMeshes[aNewMeshID] = aNewMesh;
  return aNewMeshID;
}
SMESHDS_Hypothesis * SMESHDS_Document::NextHypothesis ( )

Definition at line 190 of file SMESHDS_Document.cxx.

References myHypothesisIt.

{
        SMESHDS_Hypothesis * toReturn=(*myHypothesisIt).second;
        myHypothesisIt++;
        return toReturn;
}
SMESHDS_Mesh * SMESHDS_Document::NextMesh ( )

Definition at line 161 of file SMESHDS_Document.cxx.

References myMeshesIt.

Referenced by ~SMESHDS_Document().

{
        SMESHDS_Mesh * toReturn=(*myMeshesIt).second;
        myMeshesIt++;
        return toReturn;
}
void SMESHDS_Document::RemoveHypothesis ( int  HypID)

Definition at line 122 of file SMESHDS_Document.cxx.

References MESSAGE, and myHypothesis.

{
        map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
        if (it==myHypothesis.end())
                MESSAGE("SMESHDS_Document::RemoveHypothesis : ID not found");   
        myHypothesis.erase(it);
}
void SMESHDS_Document::RemoveMesh ( int  MeshID)

Definition at line 86 of file SMESHDS_Document.cxx.

References MESSAGE, and myMeshes.

{
        map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
        if (it==myMeshes.end())
                MESSAGE("SMESHDS_Document::RemoveMesh : ID not found"); 
        myMeshes.erase(it);
}

Field Documentation

std::map<int,SMESHDS_Hypothesis*>::iterator SMESHDS_Document.myHypothesisIt [private]

Definition at line 62 of file SMESHDS_Document.hxx.

Referenced by InitHypothesisIterator(), MoreHypothesis(), and NextHypothesis().

std::map<int,SMESHDS_Mesh*>::iterator SMESHDS_Document.myMeshesIt [private]

Definition at line 61 of file SMESHDS_Document.hxx.

Referenced by InitMeshesIterator(), MoreMesh(), and NextMesh().

Definition at line 58 of file SMESHDS_Document.hxx.

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