Version: 6.3.1
Public Member Functions

SMESH_GroupOnGeom_i Class Reference

#include <SMESH_Group_i.hxx>

Inheritance diagram for SMESH_GroupOnGeom_i:
Inheritance graph
[legend]

Public Member Functions

 SMESH_GroupOnGeom_i (PortableServer::POA_ptr thePOA, SMESH_Mesh_i *theMeshServant, const int theLocalID)
GEOM::GEOM_Object_ptr GetShape ()
void SetName (const char *name)
char * GetName ()
SMESH::ElementType GetType ()
CORBA::Long Size ()
CORBA::Boolean IsEmpty ()
CORBA::Boolean Contains (CORBA::Long elem_id)
CORBA::Long GetID (CORBA::Long elem_index)
SMESH::long_arrayGetListOfID ()
SMESH::SMESH_Mesh_ptr GetMesh ()
virtual SMESH::long_arrayGetMeshInfo ()
 Returns statistic of mesh elements Result array of number enityties Inherited from SMESH_IDSource.
virtual SMESH::long_arrayGetIDs ()
virtual
SMESH::array_of_ElementType
GetTypes ()
 Returns types of elements it contains Inherited from SMESH_IDSource interface.
int GetLocalID () const
SMESH_Mesh_iGetMeshServant () const
SMESH_GroupGetSmeshGroup () const
SMESHDS_GroupBaseGetGroupDS () const
void SetColor (const SALOMEDS::Color &color)
SALOMEDS::Color GetColor ()
void SetColorNumber (CORBA::Long color)
CORBA::Long GetColorNumber ()

Detailed Description

Definition at line 130 of file SMESH_Group_i.hxx.


Constructor & Destructor Documentation

SMESH_GroupOnGeom_i::SMESH_GroupOnGeom_i ( PortableServer::POA_ptr  thePOA,
SMESH_Mesh_i theMeshServant,
const int  theLocalID 
)

Definition at line 68 of file SMESH_Group_i.cxx.

     : SALOME::GenericObj_i( thePOA ),
       SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
{
  //MESSAGE("SMESH_GroupOnGeom_i; this = "<<this );
}

Member Function Documentation

CORBA::Boolean SMESH_GroupBase_i::Contains ( CORBA::Long  elem_id) [inherited]

Definition at line 241 of file SMESH_Group_i.cxx.

References SMESHDS_GroupBase.Contains(), SMESH_GroupBase_i.GetGroupDS(), and MESSAGE.

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS)
    return aGroupDS->Contains(theID);
  MESSAGE("attempt to check contents of a vague group");
  return false;
}
SALOMEDS::Color SMESH_GroupBase_i::GetColor ( ) [inherited]

Definition at line 453 of file SMESH_Group_i.cxx.

References SMESHDS_GroupBase.GetColor(), SMESH_GroupBase_i.GetGroupDS(), and MESSAGE.

Referenced by SMESH_Gen_i.Save().

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS)
  {
    Quantity_Color aQColor = aGroupDS->GetColor();
    SALOMEDS::Color aColor;
    aColor.R = aQColor.Red();
    aColor.G = aQColor.Green();
    aColor.B = aQColor.Blue();

    return aColor;
  }
  MESSAGE("get color of a group");
  return SALOMEDS::Color();
}
CORBA::Long SMESH_GroupBase_i::GetColorNumber ( ) [inherited]

Definition at line 491 of file SMESH_Group_i.cxx.

References SMESHDS_GroupBase.GetColorGroup(), SMESH_GroupBase_i.GetGroupDS(), and MESSAGE.

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS)
    return aGroupDS->GetColorGroup();
  MESSAGE("get color number of a group");
  return 0;
}
SMESHDS_GroupBase * SMESH_GroupBase_i::GetGroupDS ( ) const [inherited]
CORBA::Long SMESH_GroupBase_i::GetID ( CORBA::Long  elem_index) [inherited]

Definition at line 389 of file SMESH_Group_i.cxx.

References SMESH_GroupBase_i.GetGroupDS(), SMESHDS_GroupBase.GetID(), and MESSAGE.

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS)
    return aGroupDS->GetID(theIndex);
  MESSAGE("attempt to iterate on a vague group");
  return -1;
}
SMESH::long_array * SMESH_GroupBase_i::GetIDs ( ) [virtual, inherited]

Definition at line 561 of file SMESH_Group_i.cxx.

References SMESH_GroupBase_i.GetListOfID().

{
  SMESH::long_array_var aResult = GetListOfID();
  return aResult._retn();
}
SMESH::long_array * SMESH_GroupBase_i::GetListOfID ( ) [inherited]

Definition at line 404 of file SMESH_Group_i.cxx.

References SMESHDS_GroupBase.Extent(), SMESH_GroupBase_i.GetGroupDS(), SMESHDS_GroupBase.GetID(), and MESSAGE.

Referenced by SMESH_GroupBase_i.GetIDs(), and SMESH_Mesh_i.RemoveGroupWithContents().

{
  SMESH::long_array_var aRes = new SMESH::long_array();
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS) {
    int aSize = aGroupDS->Extent();
    aRes->length(aSize);
    for (int i = 0; i < aSize; i++)
      aRes[i] = aGroupDS->GetID(i+1);
    return aRes._retn();
  }
  MESSAGE("get list of IDs of a vague group");
  return aRes._retn();
}
int SMESH_GroupBase_i.GetLocalID ( ) const [inherited]
SMESH::SMESH_Mesh_ptr SMESH_GroupBase_i::GetMesh ( ) [inherited]

Definition at line 424 of file SMESH_Group_i.cxx.

References SMESH_GroupBase_i.myMeshServant.

{
  SMESH::SMESH_Mesh_var aMesh;
  if ( myMeshServant )
    aMesh = SMESH::SMESH_Mesh::_narrow( myMeshServant->_this() );
  return aMesh._retn();
}
SMESH::long_array * SMESH_GroupBase_i::GetMeshInfo ( ) [virtual, inherited]

Returns statistic of mesh elements Result array of number enityties Inherited from SMESH_IDSource.

Definition at line 524 of file SMESH_Group_i.cxx.

References SMESH_Mesh_i.CollectMeshInfo(), SMESH.Entity_Last, SMESH.Entity_Node, SMESHDS_GroupBase.Extent(), SMESHDS_GroupBase.GetElements(), SMESH_GroupBase_i.GetGroupDS(), SMESH_GroupBase_i.GetType(), and SMESH.NODE.

{
  SMESH::long_array_var aRes = new SMESH::long_array();
  aRes->length(SMESH::Entity_Last);
  for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
    aRes[i] = 0;

  SMESHDS_GroupBase* aGrpDS = GetGroupDS();
  if ( !aGrpDS )
    return aRes._retn();
  if ( GetType() == NODE )
    aRes[ SMESH::Entity_Node ] = aGrpDS->Extent();
  else
    SMESH_Mesh_i::CollectMeshInfo( aGrpDS->GetElements(), aRes);

//   SMDS_ElemIteratorPtr it = aGrpDS->GetElements();
//   if ( it->more() )
//   {
//     cout << "START" << endl;
//     set< const SMDS_MeshElement* > nodes;
//     const SMDS_MeshElement* e = it->next();
//     for ( int i = 0; i < 1000000; ++i)
//     {
//       SMDS_ElemIteratorPtr it = e->nodesIterator();
//       nodes.insert( e + i );
//     }
//     cout << "END "<< nodes.size() << endl;
//   }
 
  return aRes._retn();
}
SMESH_Mesh_i* SMESH_GroupBase_i.GetMeshServant ( ) const [inherited]

Definition at line 86 of file SMESH_Group_i.hxx.

Referenced by GetShape().

{ return myMeshServant; }
char * SMESH_GroupBase_i::GetName ( ) [inherited]

Definition at line 149 of file SMESH_Group_i.cxx.

References SMESH_controls.aGroup, SMESH_GroupBase_i.GetSmeshGroup(), and MESSAGE.

Referenced by SMESH_Gen_i.Save().

{
  ::SMESH_Group* aGroup = GetSmeshGroup();
  if (aGroup)
    return CORBA::string_dup (aGroup->GetName());
  MESSAGE("get name of a vague group");
  return CORBA::string_dup( "NO_NAME" );
}
GEOM::GEOM_Object_ptr SMESH_GroupOnGeom_i::GetShape ( )

Definition at line 437 of file SMESH_Group_i.cxx.

References SMESH_Mesh_i.GetGen(), SMESH_GroupBase_i.GetGroupDS(), SMESH_GroupBase_i.GetMeshServant(), SMESHDS_GroupOnGeom.GetShape(), and SMESH_Gen_i.ShapeToGeomObject().

{
  GEOM::GEOM_Object_var aGeomObj;
  SMESHDS_GroupOnGeom* aGroupDS = dynamic_cast<SMESHDS_GroupOnGeom*>( GetGroupDS() );
  if ( aGroupDS ) {
    SMESH_Gen_i* aGen = GetMeshServant()->GetGen();
    aGeomObj = aGen->ShapeToGeomObject( aGroupDS->GetShape() );
  }
  return aGeomObj._retn();
}
SMESH_Group * SMESH_GroupBase_i::GetSmeshGroup ( ) const [inherited]
SMESH::ElementType SMESH_GroupBase_i::GetType ( ) [inherited]

Definition at line 164 of file SMESH_Group_i.cxx.

References SMESH.ALL, EDGE, SMESH.ELEM0D, FACE, SMESH_GroupBase_i.GetGroupDS(), SMESHDS_GroupBase.GetType(), MESSAGE, SMESH.NODE, SMDSAbs_0DElement, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, SMDSAbs_Volume, and VOLUME.

Referenced by SMESH_Group_i.AddFrom(), SMESH_GroupBase_i.GetMeshInfo(), SMESH_GroupBase_i.GetTypes(), and SMESH_Mesh_i.RemoveGroupWithContents().

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS) {
    SMDSAbs_ElementType aSMDSType = aGroupDS->GetType();
    SMESH::ElementType aType;
    switch (aSMDSType) {
    case SMDSAbs_Node:      aType = SMESH::NODE;   break;
    case SMDSAbs_Edge:      aType = SMESH::EDGE;   break;
    case SMDSAbs_Face:      aType = SMESH::FACE;   break;
    case SMDSAbs_Volume:    aType = SMESH::VOLUME; break;
    case SMDSAbs_0DElement: aType = SMESH::ELEM0D; break;
    default:                aType = SMESH::ALL;    break;
    }
    return aType;
  }
  MESSAGE("get type of a vague group");
  return SMESH::ALL;
}
SMESH::array_of_ElementType * SMESH_GroupBase_i::GetTypes ( ) [virtual, inherited]

Returns types of elements it contains Inherited from SMESH_IDSource interface.

Definition at line 572 of file SMESH_Group_i.cxx.

References SMESH_GroupBase_i.GetGroupDS(), and SMESH_GroupBase_i.GetType().

{
  SMESH::array_of_ElementType_var types = new SMESH::array_of_ElementType;
  if ( SMESHDS_GroupBase* ds = GetGroupDS() )
    if ( !ds->IsEmpty() )
    {
      types->length( 1 );
      types[0] = GetType();
    }
  return types._retn();
}
CORBA::Boolean SMESH_GroupBase_i::IsEmpty ( ) [inherited]

Definition at line 206 of file SMESH_Group_i.cxx.

References SMESH_GroupBase_i.GetGroupDS(), SMESHDS_GroupBase.IsEmpty(), and MESSAGE.

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS)
    return aGroupDS->IsEmpty();
  MESSAGE("checking IsEmpty of a vague group");
  return true;
}
void SMESH_GroupBase_i::SetColor ( const SALOMEDS::Color &  color) [inherited]

Definition at line 475 of file SMESH_Group_i.cxx.

References SMESH_GroupBase_i.GetGroupDS(), and SMESHDS_GroupBase.SetColor().

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS)
  {
    Quantity_Color aQColor( color.R, color.G, color.B, Quantity_TOC_RGB );
    aGroupDS->SetColor(aQColor);
    TPythonDump()<<_this()<<".SetColor( SALOMEDS.Color( "<<color.R<<", "<<color.G<<", "<<color.B<<" ))";
  }
}
void SMESH_GroupBase_i::SetColorNumber ( CORBA::Long  color) [inherited]

Definition at line 505 of file SMESH_Group_i.cxx.

References SMESH_GroupBase_i.GetGroupDS(), MESSAGE, and SMESHDS_GroupBase.SetColorGroup().

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS)
  {
    aGroupDS->SetColorGroup(color);
    TPythonDump()<<_this()<<".SetColorNumber( "<<color<<" )";
  }
  MESSAGE("set color number of a group");
  return ;
}
void SMESH_GroupBase_i::SetName ( const char *  name) [inherited]

Definition at line 121 of file SMESH_Group_i.cxx.

References SMESH_controls.aGroup, SMESH_Gen_i.GetCurrentStudy(), SMESH_Mesh_i.GetGen(), SMESH_GroupBase_i.GetSmeshGroup(), MESSAGE, SMESH_GroupBase_i.myMeshServant, SMESH_Gen_i.ObjectToSObject(), and SMESH_Gen_i.SetName().

{
  // Perform renaming
  ::SMESH_Group* aGroup = GetSmeshGroup();
  if (!aGroup) {
    MESSAGE("can't set name of a vague group");
    return;
  }

  if ( aGroup->GetName() && !strcmp( aGroup->GetName(), theName ) )
    return; // nothing to rename

  aGroup->SetName(theName);

  // Update group name in a study
  SMESH_Gen_i* aGen = myMeshServant->GetGen();
  aGen->SetName( aGen->ObjectToSObject( aGen->GetCurrentStudy(), _this() ), theName );
  
  // Update Python script
  TPythonDump() <<  _this() << ".SetName( '" << theName << "' )";
}
CORBA::Long SMESH_GroupBase_i::Size ( ) [inherited]

Definition at line 191 of file SMESH_Group_i.cxx.

References SMESHDS_GroupBase.Extent(), SMESH_GroupBase_i.GetGroupDS(), and MESSAGE.

{
  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
  if (aGroupDS)
    return aGroupDS->Extent();
  MESSAGE("get size of a vague group");
  return 0;
}
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