Add annotations and referenceLine hide or show functions.
This commit is contained in:
@@ -200,13 +200,13 @@ public:
|
||||
EventsCenter::TriggerEvent(AnonymizeStateChanged);
|
||||
}
|
||||
|
||||
static bool IsAnno()
|
||||
static bool GetVisibility()
|
||||
{
|
||||
return annotOn;
|
||||
}
|
||||
static void toggleAnno()
|
||||
static void setVisibility(bool v)
|
||||
{
|
||||
annotOn = !annotOn;
|
||||
annotOn = v;
|
||||
EventsCenter::TriggerEvent(AnnotationStateChanged);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ void ActorDraggableInteractorStyle::OnChar() {
|
||||
|
||||
void ActorDraggableInteractorStyle::NoneStatePick() {
|
||||
|
||||
if (AnnoHelper::IsAnno()) {
|
||||
if (AnnoHelper::GetVisibility()) {
|
||||
int *pos = this->Interactor->GetEventPosition();
|
||||
this->FindPokedRenderer(pos[0], pos[1]);
|
||||
int result = picker->PickProp(pos[0], pos[1], this->CurrentRenderer);
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <vtkProperty2D.h>
|
||||
#include <vtkPolyLineSource.h>
|
||||
|
||||
bool ReferenceLineLegendActor::TypeVisibility = true;
|
||||
|
||||
vtkStandardNewMacro(ReferenceLineLegendActor)
|
||||
|
||||
ReferenceLineLegendActor::ReferenceLineLegendActor() {
|
||||
@@ -53,7 +55,7 @@ int ReferenceLineLegendActor::RenderOverlay(vtkViewport *viewport) {
|
||||
auto renderer = vtkRenderer::SafeDownCast(viewport);
|
||||
if (!renderer) return 0;
|
||||
BuildShape(renderer);
|
||||
if (Visibility){
|
||||
if (Visibility && ReferenceLineLegendActor::TypeVisibility){
|
||||
shadow2D->RenderOverlay(viewport);
|
||||
return actor2D->RenderOverlay(viewport);
|
||||
}
|
||||
|
||||
@@ -58,6 +58,14 @@ public:
|
||||
Modified();
|
||||
}
|
||||
|
||||
static bool GetTypeVisibility(){
|
||||
return TypeVisibility;
|
||||
};
|
||||
|
||||
static void SetTypeVisibility(bool v){
|
||||
TypeVisibility = v;
|
||||
}
|
||||
|
||||
protected:
|
||||
ReferenceLineLegendActor();
|
||||
|
||||
@@ -73,6 +81,7 @@ private:
|
||||
|
||||
void operator=(const ReferenceLineLegendActor &) = delete;
|
||||
vtkTimeStamp mModifyTime;
|
||||
static bool TypeVisibility;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1129,7 +1129,7 @@ void infinitiViewer::InitTopLeftCornerInfo(const std::string &lbl_ser_num, const
|
||||
}
|
||||
|
||||
void infinitiViewer::UpdateCornerInfo(int index) {
|
||||
if (AnnoHelper::IsAnno()) {
|
||||
if (AnnoHelper::GetVisibility()) {
|
||||
|
||||
if (index == TOP_LEFT) {
|
||||
int maxSlice = this->GetSliceMax();
|
||||
@@ -1167,7 +1167,7 @@ void infinitiViewer::UpdateCornerInfo(int index) {
|
||||
}
|
||||
|
||||
void infinitiViewer::UpdateCornerInfoAll() {
|
||||
if (AnnoHelper::IsAnno()) {
|
||||
if (AnnoHelper::GetVisibility()) {
|
||||
UpdateCornerInfo(TOP_LEFT);
|
||||
UpdateCornerInfo(BOTTOM_RIGHT);
|
||||
UpdateCornerInfo(TOP_RIGHT);
|
||||
@@ -1184,7 +1184,7 @@ void infinitiViewer::UpdateCornerInfoAll() {
|
||||
}
|
||||
|
||||
void infinitiViewer::UpdateTopLeftCornerInfo() {
|
||||
if (AnnoHelper::IsAnno()) {
|
||||
if (AnnoHelper::GetVisibility()) {
|
||||
int maxSlice = this->GetSliceMax();
|
||||
int currentSlice = this->GetSlice();
|
||||
std::string msg_const = m_cornerInfo.ConstAnno[TOP_LEFT];
|
||||
@@ -1334,7 +1334,7 @@ void infinitiViewer::UnActiveReferenceLine() {
|
||||
}
|
||||
|
||||
void infinitiViewer::RenderLegend() {
|
||||
if (AnnoHelper::IsAnno()) {
|
||||
if (AnnoHelper::GetVisibility()) {
|
||||
if (Renderer) {
|
||||
if (rulerActive)ruler->RenderOverlay(Renderer);
|
||||
referenceLine->RenderOverlay(Renderer);
|
||||
|
||||
@@ -514,3 +514,8 @@ void ImageViewManager::reloadCurrentView(DicomImageView * view){
|
||||
emit currentViewReloaded(view);
|
||||
}
|
||||
|
||||
void ImageViewManager::switchReferenceLineVisibility(bool v) {
|
||||
ReferenceLineLegendActor::SetTypeVisibility(v);
|
||||
renderAll();
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@ public:
|
||||
|
||||
void switchSliceOrientation();
|
||||
|
||||
void switchReferenceLineVisibility(bool v);
|
||||
|
||||
void updateCornerInfoAll();
|
||||
|
||||
void updateCornerInfoPrivacy();
|
||||
|
||||
@@ -280,6 +280,16 @@ void DefaultToolBar::initAnonymizeButton() {
|
||||
mBtnAnonymize->setCheckable(true);
|
||||
QMenu *m;
|
||||
m = new QMenu(this);
|
||||
//显隐 Annotations
|
||||
mActionHideAnnotations = m->addAction(tr("Annotations"), this, [=](bool value) {
|
||||
AnnoHelper::setVisibility(value);
|
||||
});
|
||||
mActionHideAnnotations->setCheckable(true);
|
||||
mActionHideAnnotations->setChecked(true);
|
||||
//显隐 reference line
|
||||
mActionHideReferenceLine = m->addAction(tr("Cross Reference Line"), this, &DefaultToolBar::referenceLineStateChange);
|
||||
mActionHideReferenceLine->setCheckable(true);
|
||||
mActionHideReferenceLine->setChecked(true);
|
||||
//视窗操作,显隐测量
|
||||
mActionHideMeasure = m->addAction(tr("Hide all measurements"), this, [=](bool value) {
|
||||
Measure::SetHidden(mActionHideMeasure->isChecked());
|
||||
|
||||
@@ -39,6 +39,7 @@ signals:
|
||||
void parentWindowClose();
|
||||
void transform(TransFormType type);
|
||||
void showMeta();
|
||||
void referenceLineStateChange(bool isShow);
|
||||
private:
|
||||
QAction *addButton(QToolButton *button, const char *objectName);
|
||||
|
||||
@@ -90,6 +91,8 @@ private:
|
||||
QAction *mActionClose;
|
||||
QAction *mActionFullScreen;
|
||||
QAction *mActionSyncState;
|
||||
QAction *mActionHideAnnotations;
|
||||
QAction *mActionHideReferenceLine;
|
||||
QAction *mActionHideMeasure;
|
||||
QAction *mActionHidePatData;
|
||||
QAction* mSyncActions[3]={nullptr,nullptr,nullptr};
|
||||
|
||||
@@ -116,9 +116,10 @@ void QDicomViewer::createVCRToolbar(DicomImageView *v) {
|
||||
|
||||
//视窗操作,wwwl
|
||||
void QDicomViewer::initViewOperation() {
|
||||
// operation mode change
|
||||
// operation reference line hide and show
|
||||
connect(ui->toolBar, &DefaultToolBar::referenceLineStateChange,
|
||||
ui->viewContainer->getViewManager(), &ImageViewManager::switchReferenceLineVisibility); // operation mode change
|
||||
connect(ui->toolBar, &DefaultToolBar::modeChanged, [=](int mode) {
|
||||
printf("mode:%d\r\n",mode);
|
||||
ui->viewContainer->getViewManager()->setInteractionMode(mode);
|
||||
});
|
||||
// custom window level
|
||||
|
||||
Reference in New Issue
Block a user