X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMGUI%2FGeometryGUI.cxx;h=f2d36230ae88e578cb6c2240ffca8777d039665d;hb=81eb14d32092a9cb23b23b2253de1dfb97103de2;hp=b4eb41733dabc70dcdf88cffca48e93fce9acdb0;hpb=df260abc619ded3d424fed72772226ca63e3c90b;p=modules%2Fgeom.git diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index b4eb41733..f2d36230a 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -91,6 +91,7 @@ #include #include +#include // External includes #include @@ -176,6 +177,17 @@ CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject) } return anObj._retn(); } +//================================================================================= +// function : IsInGeomComponent +// purpose : Check if an SObject is under GEOM component +//================================================================================= +bool GeometryGUI::IsInGeomComponent( _PTR(SObject) sobject ) +{ + if ( sobject ) + if ( _PTR(SComponent) aComp = sobject->GetFatherComponent() ) + return aComp->ComponentDataType() == "GEOM"; + return false; +} //======================================================================= // function : GetStudy @@ -1829,12 +1841,58 @@ void GeometryGUI::addPluginActions() } } +namespace +{ + QString wrap(const QString& text, const QString& tag) + { return QString("<%1>%2").arg(tag).arg(text).arg(tag);} +} + //======================================================================= // function : GeometryGUI::activateModule() // purpose : Called when GEOM module is activated //======================================================================= bool GeometryGUI::activateModule( SUIT_Study* study ) { + // Fill in: Help Panel + SalomeApp_Application* app = dynamic_cast( application() ); + app->infoPanel()->setTitle(tr("INFO_WELCOME_TO_GEOM")); + + int gb = app->infoPanel()->addGroup(tr("INFO_GRP_CREATE_MODEL")); + QString lab; + QStringList items; + items << wrap(tr("INFO_VERTICES"), "li") + << wrap(tr("INFO_EDGES"), "li") + << wrap(tr("INFO_WIRES"), "li") + << wrap(tr("INFO_FACES"), "li") + << wrap(tr("INFO_SHELLS"), "li") + << wrap(tr("INFO_SOLIDS"), "li"); + lab = tr("INFO_BOTTOM_UP_CONSTRUCTION") + ":" + wrap(items.join(""), "ul"); + items.clear(); + + items << wrap(tr("INFO_BOX"), "li") + << wrap(tr("INFO_CYLINDER"), "li") + << wrap(tr("INFO_CONE"), "li") + << wrap("...", "li"); + lab = lab + tr("INFO_PRIMITIVES") + ":" + wrap(items.join(""), "ul"); + items.clear(); + + lab = lab + tr("INFO_BOOLEANS") + "
"; + lab = lab + tr("INFO_TRANSFORMATIONS"); + + app->infoPanel()->addLabel(lab, gb); + + gb = app->infoPanel()->addGroup(tr("INFO_GRP_IMPORT_MODEL")); + items << wrap("BREP", "li") + << wrap("STEP", "li") + << wrap("IGES", "li") + << wrap("STL", "li") + << wrap("XAO", "li"); + lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul"); + items.clear(); + + app->infoPanel()->addLabel(lab, gb); + // << Help Panel + if ( CORBA::is_nil( myComponentGeom ) ) return false; @@ -1931,6 +1989,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) } Py_XDECREF(pluginsmanager); + return true; } @@ -2016,6 +2075,7 @@ void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win ) void GeometryGUI::windows( QMap& mappa ) const { mappa.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea ); + mappa.insert( SalomeApp_Application::WT_InfoPanel, Qt::RightDockWidgetArea ); mappa.insert( SalomeApp_Application::WT_NoteBook, Qt::LeftDockWidgetArea ); #ifndef DISABLE_PYCONSOLE mappa.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea ); @@ -2128,7 +2188,7 @@ void GeometryGUI::updateCreationInfo() Handle(SALOME_InteractiveObject) io = selIt.Value(); if ( !io->hasEntry() ) continue; _PTR(SObject) sobj = study->FindObjectID( io->getEntry() ); - if ( !sobj ) continue; + if ( !GeometryGUI::IsInGeomComponent( sobj )) continue; CORBA::Object_var obj = GeometryGUI::ClientSObjectToObject( sobj ); GEOM::GEOM_BaseObject_var gobj = GEOM::GEOM_BaseObject::_narrow( obj ); if ( !gobj->_is_nil() ) @@ -2430,16 +2490,9 @@ void GeometryGUI::createPreferences() aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf"; // add enginier font into combobox /*int fontID =*/ QFontDatabase::addApplicationFont( aFontFile ); -#if OCC_VERSION_LARGE <= 0x07030000 - Handle(Font_SystemFont) sf = new Font_SystemFont( - new TCollection_HAsciiString("Y14.5M-2009"), - Font_FA_Regular, - new TCollection_HAsciiString(aFontFile.toLatin1().data()) ); -# else Handle(Font_SystemFont) sf = new Font_SystemFont( TCollection_AsciiString("Y14.5M-2009") ); sf->SetFontPath( Font_FA_Regular, TCollection_AsciiString( aFontFile.toLatin1().data() ) ); -#endif // register font in OCC font manager fmgr->RegisterFont( sf, Standard_False );