// File : GEOMBase_Skeleton.cxx
// Author : Damien COQUERET
// Module : GEOM
-// $Header:
+// $Header$
using namespace std;
#include "GEOMBase_Skeleton.h"
+#include "GeometryGUI.h"
+#include "SALOME_Selection.h"
+
+#include <qpushbutton.h>
//=================================================================================
// class : GEOMBase_Skeleton()
// TRUE to construct a modal dialog.
//=================================================================================
GEOMBase_Skeleton::GEOMBase_Skeleton(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
- :DlgRef_Skeleton_QTD(parent, name, modal, fl)
+:DlgRef_Skeleton_QTD(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ), GEOMBase_Helper()
{
if (!name)
setName("GEOMBase_Skeleton");
//=================================================================================
GEOMBase_Skeleton::~GEOMBase_Skeleton()
{
- // no need to delete child widgets, Qt does it all for us
- this->destroy(TRUE, TRUE);
+ myGeomGUI->SetActiveDialogBox( 0 );
}
//=================================================================================
void GEOMBase_Skeleton::Init(SALOME_Selection* Sel)
{
+ myGeomGUI = GeometryGUI::GetGeomGUI();
+
/* init variables */
mySelection = Sel;
- mySimulationTopoDs.Nullify();
- myGeomBase = new GEOMBase();
- myGeomGUI = GEOMContext::GetGeomGUI();
- myGeomGUI->SetActiveDialogBox((QDialog*)this);
- myGeom = myGeomGUI->myComponentGeom;
+ myGeomBase = new GEOMBase(); // SAN -- TO BE REMOVED !!!
+ myGeomGUI->SetActiveDialogBox(this);
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
/* displays Dialog */
RadioButton1->setChecked(TRUE);
+ RadioButton4->hide();
return;
}
//=================================================================================
void GEOMBase_Skeleton::ClickOnCancel()
{
- myGeomBase->EraseSimulationShape();
- mySimulationTopoDs.Nullify();
-
- mySelection->ClearFilters();
- disconnect(mySelection, 0, this, 0);
-
- //myGeomGUI->ResetState();
- reject();
-
- return;
+ close();
}
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text();
QWidget* thisWidget = (QWidget*)this;
- if(myGeomBase->SelectionByNameInDialogs(thisWidget, objectUserName, mySelection))
+ if(GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, mySelection))
myEditCurrentArgument->setText(objectUserName);
return;
void GEOMBase_Skeleton::DeactivateActiveDialog()
{
this->setEnabled(false);
- mySelection->ClearFilters();
+ globalSelection();
//myGeomGUI->ResetState();
disconnect(mySelection, 0, this, 0);
- myGeomBase->EraseSimulationShape();
- myGeomGUI->SetActiveDialogBox(0);
+ GeometryGUI::GetGeomGUI()->SetActiveDialogBox(0);
return;
}
void GEOMBase_Skeleton::ActivateThisDialog()
{
/* Emit a signal to deactivate the active dialog */
- myGeomGUI->EmitSignalDeactivateDialog();
+ GeometryGUI::GetGeomGUI()->EmitSignalDeactivateDialog();
this->setEnabled(true);
- myGeomGUI->SetActiveDialogBox((QDialog*)this);
+ GeometryGUI::GetGeomGUI()->SetActiveDialogBox((QDialog*)this);
return;
}
//=================================================================================
// function : closeEvent()
-// purpose :
+// purpose : same than click on cancel button
//=================================================================================
void GEOMBase_Skeleton::closeEvent(QCloseEvent* e)
{
- /* same than click on cancel button */
- this->ClickOnCancel();
- return;
+ disconnect(mySelection, 0, this, 0);
+ QDialog::closeEvent( e );
+}
+
+//=================================================================================
+// function : initName()
+// purpose : initialize the Name field with a string "thePrefix_X" (Vertex_3)
+//=================================================================================
+void GEOMBase_Skeleton::initName( const char* thePrefix )
+{
+ if ( thePrefix )
+ setPrefix( thePrefix );
+ ResultName->setText( GEOMBase::GetDefaultName( getPrefix() ) );
+}
+
+//=================================================================================
+// function : getNewObjectName()
+// purpose : returns contents of Name field
+//=================================================================================
+const char* GEOMBase_Skeleton::getNewObjectName() const
+{
+ return ResultName->text();
+}
+
+//=================================================================================
+// function : getConstructorId()
+// purpose :
+//=================================================================================
+int GEOMBase_Skeleton::getConstructorId() const
+{
+ if ( GroupConstructors != NULL && GroupConstructors->selected() != NULL )
+ return GroupConstructors->id( GroupConstructors->selected() );
+ return -1;
}