comparison Samples/Common/RtViewerApp.cpp @ 1409:07fac4fdbe07

Removed dead code (RtViewer is not supposed to demonstrate measuring tools in a simple example)
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 04 May 2020 13:18:06 +0200
parents 3e644f6fadd4
children cecedf0b1be6
comparison
equal deleted inserted replaced
1408:875c9a28236e 1409:07fac4fdbe07
58 #include <stdio.h> 58 #include <stdio.h>
59 59
60 60
61 namespace OrthancStone 61 namespace OrthancStone
62 { 62 {
63 const char* RtViewerGuiToolToString(size_t i)
64 {
65 static const char* descs[] = {
66 "RtViewerGuiTool_Rotate",
67 "RtViewerGuiTool_Pan",
68 "RtViewerGuiTool_Zoom",
69 "RtViewerGuiTool_LineMeasure",
70 "RtViewerGuiTool_CircleMeasure",
71 "RtViewerGuiTool_AngleMeasure",
72 "RtViewerGuiTool_EllipseMeasure",
73 "RtViewerGuiTool_LAST"
74 };
75 if (i >= RtViewerGuiTool_LAST)
76 {
77 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Wrong tool index");
78 }
79 return descs[i];
80 }
81
82 void RtViewerApp::SelectNextTool()
83 {
84 currentTool_ = static_cast<RtViewerGuiTool>(currentTool_ + 1);
85 if (currentTool_ == RtViewerGuiTool_LAST)
86 currentTool_ = static_cast<RtViewerGuiTool>(0);;
87 printf("Current tool is now: %s\n", RtViewerGuiToolToString(currentTool_));
88 }
89
90 void RtViewerApp::InvalidateAllViewports() 63 void RtViewerApp::InvalidateAllViewports()
91 { 64 {
92 for (size_t i = 0; i < views_.size(); ++i) 65 for (size_t i = 0; i < views_.size(); ++i)
93 { 66 {
94 views_[i]->Invalidate(); 67 views_[i]->Invalidate();
102 const VolumeImageGeometry& geometry = geometryProvider_->GetImageGeometry(); 75 const VolumeImageGeometry& geometry = geometryProvider_->GetImageGeometry();
103 return geometry; 76 return geometry;
104 } 77 }
105 78
106 RtViewerApp::RtViewerApp() 79 RtViewerApp::RtViewerApp()
107 : currentTool_(RtViewerGuiTool_Rotate) 80 : undoStack_(new UndoStack)
108 , undoStack_(new UndoStack)
109 { 81 {
110 // Create the volumes that will be filled later on 82 // Create the volumes that will be filled later on
111 ctVolume_ = boost::make_shared<DicomVolumeImage>(); 83 ctVolume_ = boost::make_shared<DicomVolumeImage>();
112 doseVolume_ = boost::make_shared<DicomVolumeImage>(); 84 doseVolume_ = boost::make_shared<DicomVolumeImage>();
113 } 85 }