myMainLayout->setMargin(0);
myMainLayout->setSpacing(6);
- PictureView = new DlgRef_PipeTShape_ScrollArea();
- PictureView->PipeTShape->setBackgroundRole(QPalette::Base);
- PictureView->PipeTShape->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
- PictureView->PipeTShape->setScaledContents(true);
+ tshapeScreenShotLabel = new QLabel();
+ tshapeScreenShotLabel->setSizePolicy(QSizePolicy::Expanding,
+ QSizePolicy::Expanding);
+ tshapeScreenShotLabel->setAlignment(Qt::AlignCenter);
+ tshapeScreenShotLabel->setMinimumSize(240, 304);
MainTubeGroupParams = new DlgRef_3Spin();
MainTubeGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_MPIPE"));
// 2nd row, height = 4, col 3
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(FilletGroupParams, rowFill, colFill, rowspanFill, colspanFill);
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
- PictureView->PipeTShape->setPixmap(imagePipeTShape);
- PictureView->PipeTShape->adjustSize();
-
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
myOkPoint1 = myOkPoint2 = myOkPoint3 = false;
//@@ put additional signal/slot connections here @@//
initName(tr("GEOM_PIPE_TSHAPE"));
+ updateTshapeScreenshotLabel();
DisplayPreview();
}
else
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
- PictureView->PipeTShape->setPixmap(imagePipeTShape);
- PictureView->PipeTShape->adjustSize();
+ updateTshapeScreenshotLabel();
}
//=================================================================================
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()
// purpose :
}
else
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
- PictureView->PipeTShape->setPixmap(imagePipeTShape);
+ updateTshapeScreenshotLabel();
if (myOkPoint1 && myOkPoint2 && myOkPoint3)
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
DisplayPreview();
}
else
imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
- PictureView->PipeTShape->setPixmap(imagePipeTShape);
+ updateTshapeScreenshotLabel();
if (myOkPoint1 && myOkPoint2 && myOkPoint3)
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
DisplayPreview();
class DlgRef_3Spin;
class DlgRef_3Sel;
class DlgRef_6Sel;
-class DlgRef_PipeTShape_ScrollArea;
class QCheckBox;
class QLineEdit;
+class QLabel;
//=================================================================================
// class : AdvancedGUI_PipeTShapeDlg
private:
void Init();
void enterEvent(QEvent*);
+ void resizeEvent(QResizeEvent *event);
+ void updateTshapeScreenshotLabel();
bool CheckCompatiblePosition(GEOM::GEOM_Object_var theP1,
GEOM::GEOM_Object_var theP2,
GEOM::GEOM_Object_var theP3, double theTolerance);
private:
QPixmap imagePipeTShape;
- DlgRef_PipeTShape_ScrollArea* PictureView;
+ QLabel* tshapeScreenShotLabel;
DlgRef_3Spin* MainTubeGroupParams;
DlgRef_3Spin* IncidentTubeGroupParams;
DlgRef_2Spin* ChamferGroupParams;
DlgRef_6Sel* JunctionPointsSel;
QPixmap imageImp;
QString CssNormal, CssAcceptable, CssRefused;
-// QLineEdit* NewPosValL1;
-// QLineEdit* NewPosValL2;
-// QPushButton* ApplyNewL1;
-// QPushButton* ApplyNewL2;
QCheckBox* HexMeshCheckBox;
GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
bool myOkPoint1, myOkPoint2, myOkPoint3;