-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
QString anEntry = entry( idx );
if ( study && !anEntry.isEmpty() ) {
_PTR(SObject) aSO( study->FindObjectID( anEntry.toStdString() ) );
- if ( aSO ) {
+ if ( GeometryGUI::IsInGeomComponent( aSO )) {
CORBA::Object_var varObj = GeometryGUI::ClientSObjectToObject( aSO );
myObjects[idx] = GEOM::GEOM_BaseObject::_narrow( varObj );
}
v = hasHiddenAnnotations(idx);
else if ( p == "hasVisibleAnnotations" )
v = hasVisibleAnnotations(idx);
+ else if ( p == "matMenu" )
+ v = SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "predef_materials", false );
else
v = LightApp_Selection::parameter( idx, p );
GEOM::GEOM_Object_var obj = getObject( index );
SALOME_View* view = GEOM_Displayer::GetActiveView();
if ( !CORBA::is_nil( obj ) && view ) {
- Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( entry( index ).toLatin1().constData(), "GEOM", "TEMP_IO" );
+ Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( entry( index ).toUtf8().constData(), "GEOM", "TEMP_IO" );
res = view->isVisible( io );
}
bool GEOMGUI_Selection::isImported( const int index ) const
{
+ bool result = false;
GEOM::GEOM_Object_var obj = getObject( index );
- if ( !CORBA::is_nil( obj ) )
- return obj->GetType() == GEOM_IMPORT;
- return false;
+ if ( !CORBA::is_nil( obj ) && obj->GetType() == GEOM_IMPORT )
+ {
+ QString fileName;
+ GEOM::CreationInformationSeq_var info = obj->GetCreationInformation();
+ if ( info->length() > 0 )
+ {
+ for ( uint i = 0, nb = info->length(); i < nb; ++i )
+ {
+ GEOM::CreationInformation iInfo = info[i];
+ for ( uint j = 0; j < iInfo.params.length(); ++j )
+ {
+ QString param = (char*)(CORBA::String_var)(iInfo.params[j].name);
+ if ( param == "File name" )
+ fileName = (char*)(CORBA::String_var)(iInfo.params[j].value);
+ }
+ }
+ }
+ result = !fileName.isEmpty() && !fileName.toLower().endsWith(".xao");
+ }
+ return result;
}
bool GEOMGUI_Selection::hasImported() const
SALOME_View* view = GEOM_Displayer::GetActiveView();
if ( view /*fix for 9320==>*/&& ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) {
- SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
+ SALOME_Prs* prs = view->CreatePrs( entry( index ).toUtf8().constData() );
if ( prs ) {
if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
SOCC_Prs* occPrs = (SOCC_Prs*) prs;
bool GEOMGUI_Selection::autoBringToFront( const int /*index*/ ) const
{
- return SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "auto_bring_to_front", "false" );
+ return SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "auto_bring_to_front", false );
}
bool GEOMGUI_Selection::isVectorsMode( const int index ) const
SALOME_View* view = GEOM_Displayer::GetActiveView();
QString viewType = activeViewType();
if ( view && ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) {
- SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
+ SALOME_Prs* prs = view->CreatePrs( entry( index ).toUtf8().constData() );
if ( prs ) {
if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
SOCC_Prs* occPrs = (SOCC_Prs*) prs;
SALOME_View* view = GEOM_Displayer::GetActiveView();
QString viewType = activeViewType();
if ( view && ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) {
- SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
+ SALOME_Prs* prs = view->CreatePrs( entry( index ).toUtf8().constData() );
if ( prs ) {
if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
SOCC_Prs* occPrs = (SOCC_Prs*) prs;
SALOME_View* view = GEOM_Displayer::GetActiveView();
QString viewType = activeViewType();
if ( view && ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) {
- SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
+ SALOME_Prs* prs = view->CreatePrs( entry( index ).toUtf8().constData() );
if ( prs ) {
if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
SOCC_Prs* occPrs = (SOCC_Prs*) prs;
SALOME_View* view = GEOM_Displayer::GetActiveView();
QString viewType = activeViewType();
if ( view && viewType == OCCViewer_Viewer::Type() ) {
- SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
+ SALOME_Prs* prs = view->CreatePrs( entry( index ).toUtf8().constData() );
if ( prs ) {
if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
SOCC_Prs* occPrs = (SOCC_Prs*) prs;
SALOME_View* view = GEOM_Displayer::GetActiveView();
QString viewType = activeViewType();
if ( view ) {
- SALOME_Prs* prs = view->CreatePrs( entry( idx ).toLatin1().constData() );
+ SALOME_Prs* prs = view->CreatePrs( entry( idx ).toUtf8().constData() );
if ( prs ) {
if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
SOCC_Prs* occPrs = (SOCC_Prs*) prs;