// TRUE to construct a modal dialog.
//=================================================================================
EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent, const char* name, bool modal, WFlags fl)
- :EntityGUI_Skeleton_QTD(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), GEOMBase_Helper(), myIsAllAdded( false ),
+ :EntityGUI_Skeleton_QTD(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), myIsAllAdded( false ),
+ GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeometryGUI( GUI )
{
myGeometryGUI->SetActiveDialogBox(this);
return true;
}
-//=================================================================================
-// function : getDesktop()
-// purpose :
-//=================================================================================
-SUIT_Desktop* EntityGUI_SketcherDlg::getDesktop() const
-{
- return dynamic_cast<SUIT_Desktop*>( parentWidget() );
-}
-
void closeEvent( QCloseEvent* e );
- virtual SUIT_Desktop* getDesktop() const;
-
private :
void Init();
void enterEvent(QEvent* e);
// Function : GEOMBase_Helper
// Purpose :
//================================================================
-GEOMBase_Helper::GEOMBase_Helper()
- : myViewWindow( 0 ), myDisplayer( 0 ), myCommand( 0 ), isPreview( false )
+GEOMBase_Helper::GEOMBase_Helper( SUIT_Desktop* desktop )
+ : myDesktop( desktop ), myViewWindow( 0 ), myDisplayer( 0 ), myCommand( 0 ), isPreview( false )
{
}
return aList.Extent() > 0 ? aList.Last() : Handle(SALOME_InteractiveObject)();
}
+//================================================================
+// Function : getDesktop
+// Purpose : Returns myDesktop field. Initialized in constructor, usually as dynamic_cast<SUIT_Desktop*>(parentWidget())
+//================================================================
+SUIT_Desktop* GEOMBase_Helper::getDesktop() const
+{
+ return myDesktop;
+}
+
class GEOMBase_Helper
{
public:
- GEOMBase_Helper();
+ GEOMBase_Helper( SUIT_Desktop* );
virtual ~GEOMBase_Helper();
protected:
bool IsPreview() {return isPreview;}
GEOM_Displayer* getDisplayer();
- virtual SUIT_Desktop* getDesktop() const = 0;
+ SUIT_Desktop* getDesktop() const;
private:
char* getEntry ( GEOM::GEOM_Object_ptr ) const;
QString myPrefix;
bool isPreview;
SALOME_ListIO mySelected;
+ SUIT_Desktop* myDesktop;
};
// TRUE to construct a modal dialog.
//=================================================================================
GEOMBase_Skeleton::GEOMBase_Skeleton(QWidget* parent, const char* name, bool modal, WFlags fl)
-:DlgRef_Skeleton_QTD(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ), GEOMBase_Helper()
+ :DlgRef_Skeleton_QTD( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
+ GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) )
{
if (!name)
setName("GEOMBase_Skeleton");
return GroupConstructors->id( GroupConstructors->selected() );
return -1;
}
-
-//=================================================================================
-// function : getDesktop()
-// purpose :
-//=================================================================================
-SUIT_Desktop* GEOMBase_Skeleton::getDesktop() const
-{
- return dynamic_cast<SUIT_Desktop*>( parentWidget() );
-}
void initName( const char* thePrefix = 0 ); // initialize "Name" field with a string "thePrefix_X" (Vertex_3)
virtual const char* getNewObjectName() const; // returns contents of "Name" field
int getConstructorId() const; // returns id of a selected "constructor" radio button or '-1' in case of error
- virtual SUIT_Desktop* getDesktop() const;
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
GEOMBase* myGeomBase; // SAN -- TO BE REMOVED !!!
const char* name )
: MeasureGUI_Skeleton_QTD( parent, name, false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
+ GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeomGUI( GUI )
{
return getGeomEngine()->GetIMeasureOperations( getStudyId() );
}
-//=================================================================================
-// function : getDesktop()
-// purpose :
-//=================================================================================
-SUIT_Desktop* MeasureGUI_Skeleton::getDesktop() const
-{
- return dynamic_cast<SUIT_Desktop*>( parentWidget() );
-}
virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual SUIT_Desktop* getDesktop() const;
-
protected:
QPushButton* mySelBtn;
RepairGUI_FreeBoundDlg::RepairGUI_FreeBoundDlg( GeometryGUI* theGUI, QWidget* theParent )
: QDialog( theParent, "RepairGUI_FreeBoundDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
+ GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( theParent ) ),
myGeomGUI ( theGUI )
{
setCaption( tr( "CAPTION" ) );
return result;
}
-//=================================================================================
-// function : getDesktop()
-// purpose :
-//=================================================================================
-SUIT_Desktop* RepairGUI_FreeBoundDlg::getDesktop() const
-{
- return dynamic_cast<SUIT_Desktop*>( parentWidget() );
-}
-
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool execute( ObjectList& objects );
virtual bool isValid( QString& );
- virtual SUIT_Desktop* getDesktop() const;
private:
RepairGUI_FreeFacesDlg::RepairGUI_FreeFacesDlg(GeometryGUI* GUI, QWidget* parent, const char* name, bool modal, WFlags fl)
:QDialog( parent, "RepairGUI_FreeBoundDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
+ GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeomGUI( GUI )
{
myDisplayer = 0;
onSelectionDone();
}
-//=================================================================================
-// function : getDesktop()
-// purpose :
-//=================================================================================
-SUIT_Desktop* RepairGUI_FreeFacesDlg::getDesktop() const
-{
- return dynamic_cast<SUIT_Desktop*>( parentWidget() );
-}
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects );
- virtual SUIT_Desktop* getDesktop() const;
private :