mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-01 04:10:34 +05:00
Remove unnecessary widget
Picture aspect ratio is preserved
This commit is contained in:
parent
6cb787d382
commit
66a968300f
@ -65,10 +65,11 @@ AdvancedGUI_PipeTShapeDlg::AdvancedGUI_PipeTShapeDlg(GeometryGUI* theGeometryGUI
|
|||||||
myMainLayout->setMargin(0);
|
myMainLayout->setMargin(0);
|
||||||
myMainLayout->setSpacing(6);
|
myMainLayout->setSpacing(6);
|
||||||
|
|
||||||
PictureView = new DlgRef_PipeTShape_ScrollArea();
|
tshapeScreenShotLabel = new QLabel();
|
||||||
PictureView->PipeTShape->setBackgroundRole(QPalette::Base);
|
tshapeScreenShotLabel->setSizePolicy(QSizePolicy::Expanding,
|
||||||
PictureView->PipeTShape->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
QSizePolicy::Expanding);
|
||||||
PictureView->PipeTShape->setScaledContents(true);
|
tshapeScreenShotLabel->setAlignment(Qt::AlignCenter);
|
||||||
|
tshapeScreenShotLabel->setMinimumSize(240, 304);
|
||||||
|
|
||||||
MainTubeGroupParams = new DlgRef_3Spin();
|
MainTubeGroupParams = new DlgRef_3Spin();
|
||||||
MainTubeGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_MPIPE"));
|
MainTubeGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_MPIPE"));
|
||||||
@ -147,7 +148,7 @@ AdvancedGUI_PipeTShapeDlg::AdvancedGUI_PipeTShapeDlg(GeometryGUI* theGeometryGUI
|
|||||||
// 2nd row, height = 4, col 3
|
// 2nd row, height = 4, col 3
|
||||||
int rowNewPosVal = rowspanPict, colNewPosVal = 2, rowspanNewPosVal = 4, colspanNewPosVal = 1;
|
int rowNewPosVal = rowspanPict, colNewPosVal = 2, rowspanNewPosVal = 4, colspanNewPosVal = 1;
|
||||||
|
|
||||||
myMainLayout->addWidget(PictureView, rowPict, colPict, rowspanPict, colspanPict);
|
myMainLayout->addWidget(tshapeScreenShotLabel, rowPict, colPict, rowspanPict, colspanPict);
|
||||||
|
|
||||||
myMainLayout->addWidget(MainTubeGroupParams, rowMain, colMain, rowspanMain, colspanMain);
|
myMainLayout->addWidget(MainTubeGroupParams, rowMain, colMain, rowspanMain, colspanMain);
|
||||||
myMainLayout->addWidget(FilletGroupParams, rowFill, colFill, rowspanFill, colspanFill);
|
myMainLayout->addWidget(FilletGroupParams, rowFill, colFill, rowspanFill, colspanFill);
|
||||||
@ -180,9 +181,6 @@ void AdvancedGUI_PipeTShapeDlg::Init() {
|
|||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
|
double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
|
||||||
|
|
||||||
PictureView->PipeTShape->setPixmap(imagePipeTShape);
|
|
||||||
PictureView->PipeTShape->adjustSize();
|
|
||||||
|
|
||||||
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
|
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
|
||||||
myOkPoint1 = myOkPoint2 = myOkPoint3 = false;
|
myOkPoint1 = myOkPoint2 = myOkPoint3 = false;
|
||||||
|
|
||||||
@ -250,6 +248,7 @@ void AdvancedGUI_PipeTShapeDlg::Init() {
|
|||||||
//@@ put additional signal/slot connections here @@//
|
//@@ put additional signal/slot connections here @@//
|
||||||
|
|
||||||
initName(tr("GEOM_PIPE_TSHAPE"));
|
initName(tr("GEOM_PIPE_TSHAPE"));
|
||||||
|
updateTshapeScreenshotLabel();
|
||||||
DisplayPreview();
|
DisplayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,8 +349,7 @@ void AdvancedGUI_PipeTShapeDlg::UpdatePicture(QWidget* old, QWidget* now) {
|
|||||||
else
|
else
|
||||||
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
|
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
|
||||||
|
|
||||||
PictureView->PipeTShape->setPixmap(imagePipeTShape);
|
updateTshapeScreenshotLabel();
|
||||||
PictureView->PipeTShape->adjustSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -612,6 +610,28 @@ void AdvancedGUI_PipeTShapeDlg::enterEvent(QEvent*) {
|
|||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : resizeEvent [REDEFINED]
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void AdvancedGUI_PipeTShapeDlg::resizeEvent(QResizeEvent */*event*/) {
|
||||||
|
QSize scaledSize = imagePipeTShape.size();
|
||||||
|
scaledSize.scale(tshapeScreenShotLabel->size(), Qt::KeepAspectRatio);
|
||||||
|
if (!tshapeScreenShotLabel->pixmap()
|
||||||
|
|| scaledSize != tshapeScreenShotLabel->pixmap()->size())
|
||||||
|
updateTshapeScreenshotLabel();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : updateTshapeScreenshotLabel
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void AdvancedGUI_PipeTShapeDlg::updateTshapeScreenshotLabel() {
|
||||||
|
tshapeScreenShotLabel->setPixmap(imagePipeTShape.scaled(tshapeScreenShotLabel->size(),
|
||||||
|
Qt::KeepAspectRatio,
|
||||||
|
Qt::SmoothTransformation));
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ChamferOrFillet()
|
// function : ChamferOrFillet()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -628,7 +648,7 @@ void AdvancedGUI_PipeTShapeDlg::ChamferOrFillet(bool) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
|
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
|
||||||
PictureView->PipeTShape->setPixmap(imagePipeTShape);
|
updateTshapeScreenshotLabel();
|
||||||
if (myOkPoint1 && myOkPoint2 && myOkPoint3)
|
if (myOkPoint1 && myOkPoint2 && myOkPoint3)
|
||||||
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
|
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
|
||||||
DisplayPreview();
|
DisplayPreview();
|
||||||
@ -641,7 +661,7 @@ void AdvancedGUI_PipeTShapeDlg::ChamferOrFillet(bool) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
|
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
|
||||||
PictureView->PipeTShape->setPixmap(imagePipeTShape);
|
updateTshapeScreenshotLabel();
|
||||||
if (myOkPoint1 && myOkPoint2 && myOkPoint3)
|
if (myOkPoint1 && myOkPoint2 && myOkPoint3)
|
||||||
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
|
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
|
||||||
DisplayPreview();
|
DisplayPreview();
|
||||||
|
@ -27,9 +27,9 @@ class DlgRef_2Spin;
|
|||||||
class DlgRef_3Spin;
|
class DlgRef_3Spin;
|
||||||
class DlgRef_3Sel;
|
class DlgRef_3Sel;
|
||||||
class DlgRef_6Sel;
|
class DlgRef_6Sel;
|
||||||
class DlgRef_PipeTShape_ScrollArea;
|
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
|
class QLabel;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : AdvancedGUI_PipeTShapeDlg
|
// class : AdvancedGUI_PipeTShapeDlg
|
||||||
@ -52,13 +52,15 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent*);
|
void enterEvent(QEvent*);
|
||||||
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
void updateTshapeScreenshotLabel();
|
||||||
bool CheckCompatiblePosition(GEOM::GEOM_Object_var theP1,
|
bool CheckCompatiblePosition(GEOM::GEOM_Object_var theP1,
|
||||||
GEOM::GEOM_Object_var theP2,
|
GEOM::GEOM_Object_var theP2,
|
||||||
GEOM::GEOM_Object_var theP3, double theTolerance);
|
GEOM::GEOM_Object_var theP3, double theTolerance);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPixmap imagePipeTShape;
|
QPixmap imagePipeTShape;
|
||||||
DlgRef_PipeTShape_ScrollArea* PictureView;
|
QLabel* tshapeScreenShotLabel;
|
||||||
DlgRef_3Spin* MainTubeGroupParams;
|
DlgRef_3Spin* MainTubeGroupParams;
|
||||||
DlgRef_3Spin* IncidentTubeGroupParams;
|
DlgRef_3Spin* IncidentTubeGroupParams;
|
||||||
DlgRef_2Spin* ChamferGroupParams;
|
DlgRef_2Spin* ChamferGroupParams;
|
||||||
@ -66,10 +68,6 @@ private:
|
|||||||
DlgRef_6Sel* JunctionPointsSel;
|
DlgRef_6Sel* JunctionPointsSel;
|
||||||
QPixmap imageImp;
|
QPixmap imageImp;
|
||||||
QString CssNormal, CssAcceptable, CssRefused;
|
QString CssNormal, CssAcceptable, CssRefused;
|
||||||
// QLineEdit* NewPosValL1;
|
|
||||||
// QLineEdit* NewPosValL2;
|
|
||||||
// QPushButton* ApplyNewL1;
|
|
||||||
// QPushButton* ApplyNewL2;
|
|
||||||
QCheckBox* HexMeshCheckBox;
|
QCheckBox* HexMeshCheckBox;
|
||||||
GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
|
GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
|
||||||
bool myOkPoint1, myOkPoint2, myOkPoint3;
|
bool myOkPoint1, myOkPoint2, myOkPoint3;
|
||||||
|
Loading…
Reference in New Issue
Block a user