-// Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2015-2023 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
public:
- DimensionsProperty( SalomeApp_Study* theStudy, const std::string& theEntry ) :
- myStudy( theStudy ), myEntry( theEntry ) {
- myAttr.LoadFromAttribute( theStudy, theEntry );
+ DimensionsProperty( const std::string& theEntry ) :
+ myEntry( theEntry ) {
+ myAttr.LoadFromAttribute( theEntry );
}
virtual int GetNumber() Standard_OVERRIDE {
return myAttr.GetNumber();
myAttr.SetVisible( theIndex, theIsVisible );
}
virtual void Save() Standard_OVERRIDE {
- myAttr.SaveToAttribute( myStudy, myEntry );
+ myAttr.SaveToAttribute( myEntry );
}
GEOMGUI_DimensionProperty& Attr() { return myAttr; }
private:
GEOMGUI_DimensionProperty myAttr;
- SalomeApp_Study* myStudy;
std::string myEntry;
};
{
public:
- AnnotationsProperty( SalomeApp_Study* theStudy, const std::string& theEntry ) {
+ AnnotationsProperty( const std::string& theEntry ) {
myEntry = theEntry.c_str();
- myStudy = theStudy;
- _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry );
+ _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry );
if ( aSObj ) {
myAttr = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );
}
protected:
GEOMGUI_AnnotationMgr* annotationMgr() const
{
- CAM_Application* anApp = dynamic_cast<CAM_Application*>(myStudy->application());
+ CAM_Application* anApp = dynamic_cast<CAM_Application*>(SUIT_Session::session()->activeApplication());
GeometryGUI* aModule = dynamic_cast<GeometryGUI*>(anApp->activeModule());
if (!aModule) {
return NULL;
private:
QString myEntry;
Handle(GEOMGUI_AnnotationAttrs) myAttr;
- SalomeApp_Study* myStudy;
};
}
// purpose :
//=================================================================================
GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app )
- : myDisplayer(NULL)
{
myStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- myDisplayer = GEOM_Displayer( myStudy );
+ myDisplayer = GEOM_Displayer();
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
myVisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
headerItem->setIcon( 1, myVisibleIcon );
setHeaderItem ( headerItem );
header()->moveSection( 1, 0 );
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- header()->setResizeMode( 1, QHeaderView::ResizeToContents );
-#else
header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
-#endif
+
QStringList rootNames;
rootNames << tr("GEOM_DIMENSIONS") << "";
myDimensionsItem = new QTreeWidgetItem( this, rootNames );
//=================================================================================
void GEOMGUI_TextTreeWdg::updateObjectName( const QString& theEntry )
{
- QTreeWidgetItem* anObjectItem;
+ QTreeWidgetItem* anObjectItem = 0;
QHash<QString, QTreeWidgetItem*> anObjects = getObjects( DimensionShape );
if ( anObjects.contains( theEntry ) )
//=================================================================================
QSharedPointer<GEOMGUI_TextTreeWdg::VisualProperty>
GEOMGUI_TextTreeWdg::getVisualProperty( const BranchType& theBranchType,
- SalomeApp_Study* theStudy,
+ SalomeApp_Study* /*theStudy*/,
const std::string& theEntry )
{
switch ( theBranchType )
{
- case DimensionShape : return QSharedPointer<VisualProperty>( new DimensionsProperty( theStudy, theEntry ) );
- case AnnotationShape : return QSharedPointer<VisualProperty>( new AnnotationsProperty( theStudy, theEntry ) );
+ case DimensionShape : return QSharedPointer<VisualProperty>( new DimensionsProperty( theEntry ) );
+ case AnnotationShape : return QSharedPointer<VisualProperty>( new AnnotationsProperty( theEntry ) );
default: break;
}
return QSharedPointer<VisualProperty>();
QSharedPointer<VisualProperty> aProp = getVisualProperty( aBranchType, myStudy, anEntry );
- CAM_Application* anApp = dynamic_cast<CAM_Application*>(myStudy->application());
+ SalomeApp_Application* anApp =
+ dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
GeometryGUI* aModule = dynamic_cast<GeometryGUI*>(anApp->activeModule());
if ( aProp->GetIsVisible( aDimIndex ) ) {
aModule->GetAnnotationMgr()->Erase(anEntry.c_str(), aDimIndex);
//=================================================================================
void GEOMGUI_TextTreeWdg::redisplay( QString theEntry )
{
- Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( theEntry.toLatin1().constData(), "GEOM", "TEMP_IO" );
+ Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( theEntry.toUtf8().constData(), "GEOM", "TEMP_IO" );
myDisplayer.Redisplay( io );
}