// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "TransformationGUI_PositionDlg.h"
-#include "QAD_Desktop.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include <qlabel.h>
#include <qcheckbox.h>
+#include "TColStd_MapOfInteger.hxx"
+
#include "GEOMImpl_Types.hxx"
#include "utilities.h"
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-TransformationGUI_PositionDlg::TransformationGUI_PositionDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+TransformationGUI_PositionDlg::TransformationGUI_PositionDlg
+ (GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl)
+ : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_POSITION")));
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_POSITION2")));
- QPixmap imageselect(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
+ QPixmap image0(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_POSITION")));
+ QPixmap image1(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_POSITION2")));
+ QPixmap imageselect(aResMgr->loadPixmap("GEOM",tr("ICON_SELECT")));
setCaption(tr("GEOM_POSITION_TITLE"));
Layout1->addWidget(Group1, 2, 0);
/***************************************************************/
+
+ setHelpFileName("modify_the_location.htm");
Init();
}
connect(Group1->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName( tr( "GEOM_POSITION" ) );
ConstructorsClicked( 0 );
//=================================================================================
void TransformationGUI_PositionDlg::ConstructorsClicked(int constructorId)
{
- disconnect( mySelection, 0, this, 0 );
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
globalSelection();
myEditCurrentArgument = Group1->LineEdit1;
break;
}
}
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
SelectionIntoArgument();
}
-
//=================================================================================
// function : ClickOnOk()
// purpose :
}
-//=======================================================================
-// function : ClickOnCancel()
-// purpose :
-//=======================================================================
-void TransformationGUI_PositionDlg::ClickOnCancel()
-{
- GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection has changed
QString aName;
if(myEditCurrentArgument == Group1->LineEdit1) {
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects(mySelection, aName);
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
if(aNbSel < 1) {
myObjects.length(0);
displayPreview();
return;
}
- GEOMBase::ConvertListOfIOInListOfGO(mySelection->StoredIObjects(), myObjects);
+ GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
if (!myObjects.length()) {
displayPreview();
return;
}
- if(aNbSel != 1)
- aName = tr("%1_objects").arg(aNbSel);
}
else if(myEditCurrentArgument == Group1->LineEdit2) {
myStartLCS = GEOM::GEOM_Object::_nil();
- if(mySelection->IObjectCount() != 1) {
+ if(IObjectCount() != 1) {
displayPreview();
return;
}
Standard_Boolean testResult = Standard_False;
- myStartLCS = GEOMBase::ConvertIOinGEOMObject(mySelection->firstIObject(), testResult );
+ myStartLCS = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
if(!testResult || CORBA::is_nil( myStartLCS )) {
displayPreview();
return;
}
else if(myEditCurrentArgument == Group1->LineEdit3) {
myEndLCS = GEOM::GEOM_Object::_nil();
- if(mySelection->IObjectCount() != 1) {
+ if(IObjectCount() != 1) {
displayPreview();
return;
}
Standard_Boolean testResult = Standard_False;
- myEndLCS = GEOMBase::ConvertIOinGEOMObject(mySelection->firstIObject(), testResult );
+ myEndLCS = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
if(!testResult || CORBA::is_nil( myEndLCS )) {
displayPreview();
return;
void TransformationGUI_PositionDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
}
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose : public slot to deactivate if active
-//=================================================================================
-void TransformationGUI_PositionDlg::DeactivateActiveDialog()
-{
- GEOMBase_Skeleton::DeactivateActiveDialog();
-}
-
-
//=================================================================================
// function : enterEvent()
// purpose : when mouse enter onto the QWidget