#include <SMESHGUI_Selection.h>

Public Member Functions | |
| SMESHGUI_Selection () | |
| virtual | ~SMESHGUI_Selection () |
| virtual void | init (const QString &, LightApp_SelectionMgr *) |
| virtual QVariant | parameter (const int, const QString &) const |
| virtual bool | processOwner (const LightApp_DataOwner *) |
| virtual bool | isAutoColor (int) const |
| virtual int | numberOfNodes (int) const |
| virtual int | dim (int) const |
| return dimension of elements of the selected object | |
| virtual QVariant | isComputable (int) const |
| virtual QVariant | isPreComputable (int) const |
| virtual QVariant | hasReference (int) const |
| virtual QVariant | isVisible (int) const |
| virtual QString | quadratic2DMode (int) const |
| virtual bool | isDistributionVisible (int) const |
| virtual QList< QVariant > | elemTypes (int) const |
| virtual QList< QVariant > | labeledTypes (int) const |
| virtual QString | displayMode (int) const |
| virtual QString | shrinkMode (int) const |
| virtual QList< QVariant > | entityMode (int) const |
| virtual QString | controlMode (int) const |
| virtual bool | isNumFunctor (int) const |
| virtual QString | facesOrientationMode (int) const |
| virtual QString | groupType (int) const |
| SMESH_Actor * | getActor (int) const |
| bool | isImported (const int) const |
Static Public Member Functions | |
| static int | type (const QString &, _PTR(Study)) |
| static QString | typeName (const int) |
Private Attributes | |
| QStringList | myTypes |
| QList< SMESH_Actor * > | myActors |
Definition at line 44 of file SMESHGUI_Selection.h.
| SMESHGUI_Selection::SMESHGUI_Selection | ( | ) |
Definition at line 54 of file SMESHGUI_Selection.cxx.
: LightApp_Selection() { }
| SMESHGUI_Selection::~SMESHGUI_Selection | ( | ) | [virtual] |
Definition at line 63 of file SMESHGUI_Selection.cxx.
{
}
| QString SMESHGUI_Selection::controlMode | ( | int | ind | ) | const [virtual] |
Definition at line 273 of file SMESHGUI_Selection.cxx.
References SMESH_Actor.eArea, SMESH_Actor.eAspectRatio, SMESH_Actor.eAspectRatio3D, SMESH_Actor.eBareBorderFace, SMESH_Actor.eBareBorderVolume, SMESH_Actor.eFreeBorders, SMESH_Actor.eFreeEdges, SMESH_Actor.eFreeFaces, SMESH_Actor.eFreeNodes, SMESH_Actor.eLength, SMESH_Actor.eLength2D, SMESH_Actor.eMaxElementLength2D, SMESH_Actor.eMaxElementLength3D, SMESH_Actor.eMinimumAngle, SMESH_Actor.eMultiConnection, SMESH_Actor.eMultiConnection2D, SMESH_Actor.eOverConstrainedFace, SMESH_Actor.eOverConstrainedVolume, SMESH_Actor.eSkew, SMESH_Actor.eTaper, SMESH_Actor.eVolume3D, SMESH_Actor.eWarping, getActor(), and SMESH_Actor.GetControlMode().
Referenced by parameter().
{
SMESH_Actor* actor = getActor( ind );
QString mode = "eNone";
if ( actor ) {
switch( actor->GetControlMode() ) {
case SMESH_Actor::eLength: mode = "eLength"; break;
case SMESH_Actor::eLength2D: mode = "eLength2D"; break;
case SMESH_Actor::eFreeEdges: mode = "eFreeEdges"; break;
case SMESH_Actor::eFreeNodes: mode = "eFreeNodes"; break;
case SMESH_Actor::eFreeBorders: mode = "eFreeBorders"; break;
case SMESH_Actor::eFreeFaces: mode = "eFreeFaces"; break;
case SMESH_Actor::eMultiConnection: mode = "eMultiConnection"; break;
case SMESH_Actor::eMultiConnection2D: mode = "eMultiConnection2D"; break;
case SMESH_Actor::eArea: mode = "eArea"; break;
case SMESH_Actor::eVolume3D: mode = "eVolume3D"; break;
case SMESH_Actor::eMaxElementLength2D: mode = "eMaxElementLength2D"; break;
case SMESH_Actor::eMaxElementLength3D: mode = "eMaxElementLength3D"; break;
case SMESH_Actor::eTaper: mode = "eTaper"; break;
case SMESH_Actor::eAspectRatio: mode = "eAspectRatio"; break;
case SMESH_Actor::eAspectRatio3D: mode = "eAspectRatio3D"; break;
case SMESH_Actor::eMinimumAngle: mode = "eMinimumAngle"; break;
case SMESH_Actor::eWarping: mode = "eWarping"; break;
case SMESH_Actor::eSkew: mode = "eSkew"; break;
case SMESH_Actor::eBareBorderFace: mode = "eBareBorderFace"; break;
case SMESH_Actor::eBareBorderVolume: mode = "eBareBorderVolume"; break;
case SMESH_Actor::eOverConstrainedFace: mode = "eOverConstrainedFace"; break;
case SMESH_Actor::eOverConstrainedVolume: mode = "eOverConstrainedVolume"; break;
default:break;
}
}
return mode;
}
return dimension of elements of the selected object
| int | - 0 for 0D elements, -1 for an empty object (the rest as usual) |
Definition at line 408 of file SMESHGUI_Selection.cxx.
References _PTR(), SMESH.EDGE, SMESH.ELEM0D, SMESH.FACE, SMESH_test.ind, myTypes, SMESH.SObjectToObject(), and SMESH.VOLUME.
Referenced by parameter().
{
int dim = -1;
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
_PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
if ( ! CORBA::is_nil( obj )) {
SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
if ( ! idSrc->_is_nil() )
{
SMESH::array_of_ElementType_var types = idSrc->GetTypes();
for ( int i = 0; i < types->length(); ++ i)
switch ( types[i] ) {
case SMESH::EDGE : dim = std::max( dim, 1 ); break;
case SMESH::FACE : dim = std::max( dim, 2 ); break;
case SMESH::VOLUME: dim = std::max( dim, 3 ); break;
case SMESH::ELEM0D: dim = std::max( dim, 0 ); break;
default:;
}
}
}
}
return dim;
}
| QString SMESHGUI_Selection::displayMode | ( | int | ind | ) | const [virtual] |
Definition at line 191 of file SMESHGUI_Selection.cxx.
References SMESH_Actor.eEdge, SMESH_Actor.ePoint, SMESH_Actor.eSurface, and getActor().
Referenced by parameter().
{
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
switch( actor->GetRepresentation() ) {
case SMESH_Actor::eEdge: return "eEdge";
case SMESH_Actor::eSurface: return "eSurface";
case SMESH_Actor::ePoint: return "ePoint";
default: break;
}
}
return "Unknown";
}
| QList< QVariant > SMESHGUI_Selection::elemTypes | ( | int | ind | ) | const [virtual] |
Definition at line 154 of file SMESHGUI_Selection.cxx.
References getActor(), SMESH_Actor.GetObject(), SMDSAbs_0DElement, SMDSAbs_Edge, SMDSAbs_Face, and SMDSAbs_Volume.
Referenced by parameter().
{
QList<QVariant> types;
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
TVisualObjPtr object = actor->GetObject();
if ( object ) {
if ( object->GetNbEntities( SMDSAbs_0DElement )) types.append( "Elem0d" );
if ( object->GetNbEntities( SMDSAbs_Edge )) types.append( "Edge" );
if ( object->GetNbEntities( SMDSAbs_Face )) types.append( "Face" );
if ( object->GetNbEntities( SMDSAbs_Volume )) types.append( "Volume" );
}
}
return types;
}
| QList< QVariant > SMESHGUI_Selection::entityMode | ( | int | ind | ) | const [virtual] |
Definition at line 254 of file SMESHGUI_Selection.cxx.
References SMESH_Actor.e0DElements, SMESH_Actor.eEdges, SMESH_Actor.eFaces, SMESH_Actor.eVolumes, getActor(), and SMESH_Actor.GetEntityMode().
Referenced by parameter().
{
QList<QVariant> types;
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
unsigned int aMode = actor->GetEntityMode();
if ( aMode & SMESH_Actor::eVolumes ) types.append( "Volume" );
if ( aMode & SMESH_Actor::eFaces ) types.append( "Face" );
if ( aMode & SMESH_Actor::eEdges ) types.append( "Edge" );
if ( aMode & SMESH_Actor::e0DElements ) types.append( "Elem0d" );
}
return types;
}
| QString SMESHGUI_Selection::facesOrientationMode | ( | int | ind | ) | const [virtual] |
Definition at line 341 of file SMESHGUI_Selection.cxx.
References getActor(), and SMESH_Actor.GetFacesOriented().
Referenced by parameter().
{
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
if ( actor->GetFacesOriented() )
return "IsOriented";
return "IsNotOriented";
}
return "Unknown";
}
| SMESH_Actor * SMESHGUI_Selection::getActor | ( | int | ind | ) | const |
Definition at line 141 of file SMESHGUI_Selection.cxx.
References myActors.
Referenced by controlMode(), displayMode(), elemTypes(), entityMode(), facesOrientationMode(), isDistributionVisible(), isNumFunctor(), labeledTypes(), quadratic2DMode(), and shrinkMode().
| QString SMESHGUI_Selection::groupType | ( | int | ind | ) | const [virtual] |
Definition at line 660 of file SMESHGUI_Selection.cxx.
References _PTR(), SMESH_controls.aGroup, SMESH.SObjectToObject(), and type().
Referenced by parameter().
{
QString e = entry( ind );
_PTR(SObject) SO = SMESH::GetActiveStudyDocument()->FindObjectID( e.toLatin1().constData() );
QString type;
if( SO )
{
CORBA::Object_var obj = SMESH::SObjectToObject( SO );
SMESH::SMESH_Group_var aGroup = SMESH::SMESH_Group::_narrow( obj );
SMESH::SMESH_GroupOnGeom_var aGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( obj );
if( !aGroup->_is_nil() )
type = QString( "Group" );
else if ( !aGroupOnGeom->_is_nil() )
type = QString( "GroupOnGeom" );
}
return type;
}
| QVariant SMESHGUI_Selection::hasReference | ( | int | ind | ) | const [virtual] |
Definition at line 500 of file SMESHGUI_Selection.cxx.
Referenced by parameter().
{
return QVariant( isReference( ind ) );
}
| void SMESHGUI_Selection::init | ( | const QString & | client, |
| LightApp_SelectionMgr * | mgr | ||
| ) | [virtual] |
Definition at line 71 of file SMESHGUI_Selection.cxx.
References _PTR(), myTypes, type(), and typeName().
{
LightApp_Selection::init( client, mgr );
if( mgr && study() )
{
SalomeApp_Study* aSStudy = dynamic_cast<SalomeApp_Study*>(study());
if (!aSStudy)
return;
_PTR(Study) aStudy = aSStudy->studyDS();
for( int i=0, n=count(); i<n; i++ )
myTypes.append( typeName( type( entry( i ), aStudy ) ) );
}
}
Definition at line 357 of file SMESHGUI_Selection.cxx.
References _PTR(), SMESH_test.ind, PAL_MESH_041_mesh.mesh, myTypes, and SMESH.SObjectToObject().
Referenced by parameter().
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
_PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
if ( ! CORBA::is_nil( obj )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
if ( ! mesh->_is_nil() )
return mesh->GetAutoColor();
}
}
return false;
}
| QVariant SMESHGUI_Selection::isComputable | ( | int | ind | ) | const [virtual] |
Definition at line 440 of file SMESHGUI_Selection.cxx.
References _PTR(), SMESH.GetShapeOnMeshOrSubMesh(), SMESH_test.ind, PAL_MESH_041_mesh.mesh, myTypes, SMESH_fixation.shape, and SMESH.SObjectToObject().
Referenced by parameter().
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
/* Handle(SALOME_InteractiveObject) io =
static_cast<LightApp_DataOwner*>( myDataOwners[ ind ].get() )->IO();
if ( !io.IsNull() ) {
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m
if ( !mesh->_is_nil() ) {*/
_PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
//FindSObject( mesh );
if ( so ) {
CORBA::Object_var obj = SMESH::SObjectToObject(so, SMESH::GetActiveStudyDocument());
if(!CORBA::is_nil(obj)){
SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
if (!mesh->_is_nil()){
if(mesh->HasShapeToMesh()) {
GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
return QVariant( !shape->_is_nil() );
}
else
{
return QVariant(!mesh->NbFaces()==0);
}
}
else
{
GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
return QVariant( !shape->_is_nil() );
}
}
}
// }
// }
}
return QVariant( false );
}
Definition at line 228 of file SMESHGUI_Selection.cxx.
References getActor(), SMESH_ScalarBarActor.GetDistributionVisibility(), and SMESH_Actor.GetScalarBarActor().
Referenced by parameter().
{
SMESH_Actor* actor = getActor( ind );
return (actor && actor->GetScalarBarActor() && actor->GetScalarBarActor()->GetDistributionVisibility());
}
Definition at line 638 of file SMESHGUI_Selection.cxx.
References _PTR(), SMESH_AdvancedEditor.res, and SMESH.SObjectToObject().
Referenced by parameter().
{
QString e = entry( ind );
_PTR(SObject) SO = SMESH::GetActiveStudyDocument()->FindObjectID( e.toLatin1().constData() );
bool res = false;
if( SO )
{
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( SO ) );
if( !aMesh->_is_nil() )
{
SALOME_MED::MedFileInfo* inf = aMesh->GetMEDFileInfo();
res = strlen( (char*)inf->fileName ) > 0;
}
}
return res;
}
Definition at line 307 of file SMESHGUI_Selection.cxx.
References SMESH_Actor.eArea, SMESH_Actor.eAspectRatio, SMESH_Actor.eAspectRatio3D, SMESH_Actor.eLength, SMESH_Actor.eLength2D, SMESH_Actor.eMaxElementLength2D, SMESH_Actor.eMaxElementLength3D, SMESH_Actor.eMinimumAngle, SMESH_Actor.eMultiConnection, SMESH_Actor.eMultiConnection2D, SMESH_Actor.eSkew, SMESH_Actor.eTaper, SMESH_Actor.eVolume3D, SMESH_Actor.eWarping, getActor(), and SMESH_Actor.GetControlMode().
Referenced by parameter().
{
bool result = false;
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
switch( actor->GetControlMode() ) {
case SMESH_Actor::eLength:
case SMESH_Actor::eLength2D:
case SMESH_Actor::eMultiConnection:
case SMESH_Actor::eMultiConnection2D:
case SMESH_Actor::eArea:
case SMESH_Actor::eVolume3D:
case SMESH_Actor::eMaxElementLength2D:
case SMESH_Actor::eMaxElementLength3D:
case SMESH_Actor::eTaper:
case SMESH_Actor::eAspectRatio:
case SMESH_Actor::eAspectRatio3D:
case SMESH_Actor::eMinimumAngle:
case SMESH_Actor::eWarping:
case SMESH_Actor::eSkew:
result = true;
break;
default:
break;
}
}
return result;
}
| QVariant SMESHGUI_Selection::isPreComputable | ( | int | ind | ) | const [virtual] |
Definition at line 483 of file SMESHGUI_Selection.cxx.
References _PTR(), SMESHGUI_PrecomputeOp.getAssignedAlgos(), SMESH_test.ind, and myTypes.
Referenced by parameter().
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
QMap<int,int> modeMap;
_PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
return QVariant( modeMap.size() > 1 );
}
return QVariant( false );
}
| QVariant SMESHGUI_Selection::isVisible | ( | int | ind | ) | const [virtual] |
Definition at line 510 of file SMESHGUI_Selection.cxx.
References SMESH.FindActorByEntry(), SMESH.GetCurrentVtkView(), SMESH_test.ind, and myTypes.
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
QString ent = entry( ind );
SMESH_Actor* actor = SMESH::FindActorByEntry( ent.toLatin1().data() );
if ( actor && actor->hasIO() ) {
if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView())
return QVariant( aViewWindow->isVisible( actor->getIO() ) );
}
}
return QVariant( false );
}
| QList< QVariant > SMESHGUI_Selection::labeledTypes | ( | int | ind | ) | const [virtual] |
Definition at line 175 of file SMESHGUI_Selection.cxx.
References getActor(), SMESH_Actor.GetCellsLabeled(), and SMESH_Actor.GetPointsLabeled().
Referenced by parameter().
{
QList<QVariant> types;
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
if ( actor->GetPointsLabeled()) types.append( "Point" );
if ( actor->GetCellsLabeled()) types.append( "Cell" );
}
return types;
}
Definition at line 378 of file SMESHGUI_Selection.cxx.
References _PTR(), SMESH_test.ind, PAL_MESH_041_mesh.mesh, myTypes, and SMESH.SObjectToObject().
Referenced by parameter().
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
_PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
if ( ! CORBA::is_nil( obj )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
if ( ! mesh->_is_nil() )
return mesh->NbNodes();
SMESH::SMESH_subMesh_var aSubMeshObj = SMESH::SMESH_subMesh::_narrow( obj );
if ( !aSubMeshObj->_is_nil() )
return aSubMeshObj->GetNumberOfNodes(true);
SMESH::SMESH_GroupBase_var aGroupObj = SMESH::SMESH_GroupBase::_narrow( obj );
if ( !aGroupObj->_is_nil() )
return aGroupObj->Size();
}
}
return 0;
}
| QVariant SMESHGUI_Selection::parameter | ( | const int | ind, |
| const QString & | p | ||
| ) | const [virtual] |
Definition at line 106 of file SMESHGUI_Selection.cxx.
References controlMode(), dim(), displayMode(), elemTypes(), entityMode(), facesOrientationMode(), groupType(), hasReference(), isAutoColor(), isComputable(), isDistributionVisible(), isImported(), isNumFunctor(), isPreComputable(), labeledTypes(), myTypes, numberOfNodes(), quadratic2DMode(), and shrinkMode().
{
QVariant val;
if ( p=="client" ) val = QVariant( LightApp_Selection::parameter( p ) );
else if ( p=="type" ) val = QVariant( myTypes[ind] );
else if ( p=="elemTypes" ) val = QVariant( elemTypes( ind ) );
else if ( p=="isAutoColor" ) val = QVariant( isAutoColor( ind ) );
else if ( p=="numberOfNodes" ) val = QVariant( numberOfNodes( ind ) );
else if ( p=="dim" ) val = QVariant( dim( ind ) );
else if ( p=="labeledTypes" ) val = QVariant( labeledTypes( ind ) );
else if ( p=="shrinkMode" ) val = QVariant( shrinkMode( ind ) );
else if ( p=="entityMode" ) val = QVariant( entityMode( ind ) );
else if ( p=="controlMode" ) val = QVariant( controlMode( ind ) );
else if ( p=="isNumFunctor" ) val = QVariant( isNumFunctor( ind ) );
else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) );
else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) );
else if ( p=="isPreComputable" ) val = QVariant( isPreComputable( ind ) );
else if ( p=="hasReference" ) val = QVariant( hasReference( ind ) );
else if ( p=="isImported" ) val = QVariant( isImported( ind ) );
else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) );
else if ( p=="groupType" ) val = QVariant( groupType( ind ) );
else if ( p=="quadratic2DMode") val = QVariant(quadratic2DMode(ind));
else if ( p=="isDistributionVisible") val = QVariant(isDistributionVisible(ind));
if( val.isValid() )
return val;
else
return LightApp_Selection::parameter( ind, p );
}
| bool SMESHGUI_Selection::processOwner | ( | const LightApp_DataOwner * | ow | ) | [virtual] |
Definition at line 91 of file SMESHGUI_Selection.cxx.
References myActors.
| QString SMESHGUI_Selection::quadratic2DMode | ( | int | ind | ) | const [virtual] |
Definition at line 210 of file SMESHGUI_Selection.cxx.
References SMESH_Actor.eArcs, SMESH_Actor.eLines, getActor(), and SMESH_Actor.GetQuadratic2DRepresentation().
Referenced by parameter().
{
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
switch( actor->GetQuadratic2DRepresentation() ) {
case SMESH_Actor::eLines: return "eLines";
case SMESH_Actor::eArcs: return "eArcs";
default: break;
}
}
return "Unknown";
}
| QString SMESHGUI_Selection::shrinkMode | ( | int | ind | ) | const [virtual] |
Definition at line 238 of file SMESHGUI_Selection.cxx.
References getActor().
Referenced by parameter().
{
SMESH_Actor* actor = getActor( ind );
if ( actor && actor->IsShrunkable() ) {
if ( actor->IsShrunk() )
return "IsShrunk";
return "IsNotShrunk";
}
return "IsNotShrinkable";
}
| int SMESHGUI_Selection::type | ( | const QString & | entry, |
| _PTR(Study) | study | ||
| ) | [static] |
Definition at line 529 of file SMESHGUI_Selection.cxx.
References _PTR(), ALGORITHM, COMPONENT, GROUP, HYPOTHESIS, MESH, SMESH_AdvancedEditor.res, SUBMESH, SUBMESH_COMPOUND, SUBMESH_EDGE, SUBMESH_FACE, SUBMESH_SOLID, SUBMESH_VERTEX, SMESH.Tag_AlgorithmsRoot, SMESH.Tag_FirstGroup, SMESH.Tag_FirstMeshRoot, SMESH.Tag_HypothesisRoot, SMESH.Tag_SubMeshOnCompound, SMESH.Tag_SubMeshOnEdge, SMESH.Tag_SubMeshOnFace, SMESH.Tag_SubMeshOnSolid, and SMESH.Tag_SubMeshOnVertex.
Referenced by groupType(), init(), SMESH.ModifiedMesh(), SMESHGUI.renameAllowed(), SMESHGUI.renameObject(), and SMESHGUI_SelectionOp.typeById().
{
_PTR(SObject) obj (study->FindObjectID(entry.toLatin1().data()));
if( !obj )
return -1;
_PTR(SObject) ref;
if( obj->ReferencedObject( ref ) )
obj = ref;
_PTR(SObject) objFather = obj->GetFather();
_PTR(SComponent) objComponent = obj->GetFatherComponent();
if( objComponent->ComponentDataType()!="SMESH" )
return -1;
if( objComponent->GetIOR()==obj->GetIOR() )
return COMPONENT;
int aLevel = obj->Depth() - objComponent->Depth(),
aFTag = objFather->Tag(),
anOTag = obj->Tag(),
res = -1;
switch (aLevel)
{
case 1:
if (anOTag >= SMESH::Tag_FirstMeshRoot)
res = MESH;
break;
case 2:
switch (aFTag)
{
case SMESH::Tag_HypothesisRoot:
res = HYPOTHESIS;
break;
case SMESH::Tag_AlgorithmsRoot:
res = ALGORITHM;
break;
}
break;
case 3:
switch (aFTag)
{
case SMESH::Tag_SubMeshOnVertex:
res = SUBMESH_VERTEX;
break;
case SMESH::Tag_SubMeshOnEdge:
res = SUBMESH_EDGE;
break;
case SMESH::Tag_SubMeshOnFace:
res = SUBMESH_FACE;
break;
case SMESH::Tag_SubMeshOnSolid:
res = SUBMESH_SOLID;
break;
case SMESH::Tag_SubMeshOnCompound:
res = SUBMESH_COMPOUND;
break;
default:
if (aFTag >= SMESH::Tag_FirstGroup)
res = GROUP;
else
res = SUBMESH;
}
break;
}
return res;
}
| QString SMESHGUI_Selection::typeName | ( | const int | t | ) | [static] |
Definition at line 605 of file SMESHGUI_Selection.cxx.
References ALGORITHM, COMPONENT, GROUP, HYPOTHESIS, MESHorSUBMESH, SUBMESH, SUBMESH_COMPOUND, SUBMESH_EDGE, SUBMESH_FACE, SUBMESH_SOLID, and SUBMESH_VERTEX.
Referenced by init(), and SMESHGUI.initialize().
{
switch( t )
{
case HYPOTHESIS:
return "Hypothesis";
case ALGORITHM:
return "Algorithm";
case MESH:
return "Mesh";
case SUBMESH:
return "SubMesh";
case MESHorSUBMESH:
return "Mesh or submesh";
case SUBMESH_VERTEX:
return "Mesh vertex";
case SUBMESH_EDGE:
return "Mesh edge";
case SUBMESH_FACE:
return "Mesh face";
case SUBMESH_SOLID:
return "Mesh solid";
case SUBMESH_COMPOUND:
return "Mesh compound";
case GROUP:
return "Group";
case COMPONENT:
return "Component";
default:
return "Unknown";
}
}
QList<SMESH_Actor*> SMESHGUI_Selection.myActors [private] |
Definition at line 87 of file SMESHGUI_Selection.h.
Referenced by getActor(), and processOwner().
QStringList SMESHGUI_Selection.myTypes [private] |
Definition at line 86 of file SMESHGUI_Selection.h.
Referenced by dim(), init(), isAutoColor(), isComputable(), isPreComputable(), isVisible(), numberOfNodes(), and parameter().