Commet for dicomimageview
This commit is contained in:
@@ -21,11 +21,13 @@
|
|||||||
DicomImageView::DicomImageView(QWidget* parent)
|
DicomImageView::DicomImageView(QWidget* parent)
|
||||||
: QFrame(parent)
|
: QFrame(parent)
|
||||||
{
|
{
|
||||||
|
//main container
|
||||||
QFrame *wrapper = new QFrame(this);
|
QFrame *wrapper = new QFrame(this);
|
||||||
wrapper->setObjectName("wrapper");
|
wrapper->setObjectName("wrapper");
|
||||||
|
|
||||||
QGridLayout *view_layout = new QGridLayout(this);
|
QGridLayout *view_layout = new QGridLayout(this);
|
||||||
|
|
||||||
|
//add container and title bar
|
||||||
_titleBar = createMyTitleBar();
|
_titleBar = createMyTitleBar();
|
||||||
view_layout->addWidget(_titleBar, 0, 0);
|
view_layout->addWidget(_titleBar, 0, 0);
|
||||||
view_layout->addWidget(wrapper, 1, 0);
|
view_layout->addWidget(wrapper, 1, 0);
|
||||||
@@ -33,37 +35,31 @@ DicomImageView::DicomImageView(QWidget* parent)
|
|||||||
view_layout->setSpacing(0);
|
view_layout->setSpacing(0);
|
||||||
this->setLayout(view_layout);
|
this->setLayout(view_layout);
|
||||||
|
|
||||||
|
// create layout for main container
|
||||||
QGridLayout* controlLayout = new QGridLayout(wrapper);
|
QGridLayout* controlLayout = new QGridLayout(wrapper);
|
||||||
|
|
||||||
_glWidt = new QVTKOpenGLNativeWidget(wrapper);
|
_glWidt = new QVTKOpenGLNativeWidget(wrapper);
|
||||||
|
|
||||||
|
//add QVTKOpenGLNativeWidget to container
|
||||||
m_glrenWin = vtkSmartPointer <vtkGenericOpenGLRenderWindow>::New();
|
m_glrenWin = vtkSmartPointer <vtkGenericOpenGLRenderWindow>::New();
|
||||||
_glWidt->SetRenderWindow(m_glrenWin);//set up interacte
|
_glWidt->SetRenderWindow(m_glrenWin);//set up interacte
|
||||||
|
|
||||||
controlLayout->addWidget(_glWidt, 0, 0);
|
controlLayout->addWidget(_glWidt, 0, 0);
|
||||||
|
|
||||||
|
//add scrollbar to container
|
||||||
_scrollBar = new QScrollBar(Qt::Orientation::Vertical);
|
_scrollBar = new QScrollBar(Qt::Orientation::Vertical);
|
||||||
_scrollBar->setFocusPolicy(Qt::StrongFocus);
|
_scrollBar->setFocusPolicy(Qt::StrongFocus);
|
||||||
_scrollBar->setVisible(false);
|
_scrollBar->setVisible(false);
|
||||||
_scrollBar->setObjectName("scrollbar");
|
_scrollBar->setObjectName("scrollbar");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
controlLayout->addWidget(_scrollBar, 0, 1);
|
controlLayout->addWidget(_scrollBar, 0, 1);
|
||||||
|
|
||||||
|
//config container UI
|
||||||
controlLayout->setContentsMargins(0, 0, 0, 0);
|
controlLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
controlLayout->setSpacing(0);
|
controlLayout->setSpacing(0);
|
||||||
wrapper->setLayout(controlLayout);
|
wrapper->setLayout(controlLayout);
|
||||||
//this->setLayout(controlLayout);
|
|
||||||
|
|
||||||
setAutoFillBackground(true);
|
setAutoFillBackground(true);
|
||||||
|
|
||||||
|
//config self
|
||||||
QWidget::setAcceptDrops(true);
|
QWidget::setAcceptDrops(true);
|
||||||
this->setObjectName("dicomview");
|
this->setObjectName("dicomview");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -75,21 +71,26 @@ DicomImageView::~DicomImageView()
|
|||||||
}
|
}
|
||||||
_thread.quit();//event loop
|
_thread.quit();//event loop
|
||||||
_thread.wait(); //wait until return,block mode
|
_thread.wait(); //wait until return,block mode
|
||||||
_vcr_toolbar->deleteLater();
|
if (_vcr_toolbar){
|
||||||
|
_vcr_toolbar->deleteLater();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DicomImageView::isVCRVisible()
|
bool DicomImageView::isVCRVisible()
|
||||||
{
|
{
|
||||||
|
if (!_vcr_toolbar) return false;
|
||||||
return _vcr_toolbar->isVisible();
|
return _vcr_toolbar->isVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DicomImageView::setVCRVisible(bool visible)
|
void DicomImageView::setVCRVisible(bool visible)
|
||||||
{
|
{
|
||||||
|
if (!_vcr_toolbar) return ;
|
||||||
_vcr_toolbar->setVisible(visible);
|
_vcr_toolbar->setVisible(visible);
|
||||||
}
|
}
|
||||||
void DicomImageView::cineModeOn()
|
void DicomImageView::cineModeOn()
|
||||||
{
|
{
|
||||||
|
if (!_vcr_toolbar) return;
|
||||||
//updateVCRToolbarPos();
|
//updateVCRToolbarPos();
|
||||||
int ax = (this->geometry().bottomLeft().x() + this->geometry().bottomRight().x()) / 2 + VCRHelper::getVCRXOffset();
|
int ax = (this->geometry().bottomLeft().x() + this->geometry().bottomRight().x()) / 2 + VCRHelper::getVCRXOffset();
|
||||||
int ay = (this->geometry().bottomLeft().y() + this->geometry().bottomRight().y()) / 2 + VCRHelper::getVCRYOffset();
|
int ay = (this->geometry().bottomLeft().y() + this->geometry().bottomRight().y()) / 2 + VCRHelper::getVCRYOffset();
|
||||||
|
|||||||
@@ -201,6 +201,11 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
void initCineModeThread();
|
void initCineModeThread();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a TitleBar for this widget
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
MyTitleBar* createMyTitleBar();
|
MyTitleBar* createMyTitleBar();
|
||||||
void orphanizeSeriesInstance();
|
void orphanizeSeriesInstance();
|
||||||
void ResetPanZoom();
|
void ResetPanZoom();
|
||||||
|
|||||||
Reference in New Issue
Block a user