Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/ViewportController.cpp @ 906:52b1c6ff10c5
Disabled OpenGL in GuiAdapter to allow for Cairo-only workflows (THIS IS A TEMP CHANGE!!!) + disabled outlined text by default (build macro)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 17 Jul 2019 17:17:34 +0200 |
parents | 0c5201499af8 |
children | a911f5bb48da |
comparison
equal
deleted
inserted
replaced
905:88bf49aebc13 | 906:52b1c6ff10c5 |
---|---|
49 return undoStackW_.lock(); | 49 return undoStackW_.lock(); |
50 } | 50 } |
51 | 51 |
52 void ViewportController::PushCommand(boost::shared_ptr<TrackerCommand> command) | 52 void ViewportController::PushCommand(boost::shared_ptr<TrackerCommand> command) |
53 { | 53 { |
54 GetUndoStack()->PushCommand(command); | 54 boost::shared_ptr<UndoStack> undoStack = undoStackW_.lock(); |
55 if(undoStack.get() != NULL) | |
56 undoStack->PushCommand(command); | |
57 else | |
58 { | |
59 LOG(ERROR) << "Internal error: no undo stack in the viewport controller!"; | |
60 } | |
55 } | 61 } |
56 | 62 |
57 void ViewportController::Undo() | 63 void ViewportController::Undo() |
58 { | 64 { |
59 GetUndoStack()->Undo(); | 65 boost::shared_ptr<UndoStack> undoStack = undoStackW_.lock(); |
66 if (undoStack.get() != NULL) | |
67 undoStack->Undo(); | |
68 else | |
69 { | |
70 LOG(ERROR) << "Internal error: no undo stack in the viewport controller!"; | |
71 } | |
60 } | 72 } |
61 | 73 |
62 void ViewportController::Redo() | 74 void ViewportController::Redo() |
63 { | 75 { |
64 GetUndoStack()->Redo(); | 76 boost::shared_ptr<UndoStack> undoStack = undoStackW_.lock(); |
77 if (undoStack.get() != NULL) | |
78 undoStack->Redo(); | |
79 else | |
80 { | |
81 LOG(ERROR) << "Internal error: no undo stack in the viewport controller!"; | |
82 } | |
65 } | 83 } |
66 | 84 |
67 bool ViewportController::CanUndo() const | 85 bool ViewportController::CanUndo() const |
68 { | 86 { |
69 return GetUndoStack()->CanUndo(); | 87 boost::shared_ptr<UndoStack> undoStack = undoStackW_.lock(); |
88 if (undoStack.get() != NULL) | |
89 return undoStack->CanUndo(); | |
90 else | |
91 { | |
92 LOG(ERROR) << "Internal error: no undo stack in the viewport controller!"; | |
93 return false; | |
94 } | |
70 } | 95 } |
71 | 96 |
72 bool ViewportController::CanRedo() const | 97 bool ViewportController::CanRedo() const |
73 { | 98 { |
74 return GetUndoStack()->CanRedo(); | 99 boost::shared_ptr<UndoStack> undoStack = undoStackW_.lock(); |
100 if (undoStack.get() != NULL) | |
101 return undoStack->CanRedo(); | |
102 else | |
103 { | |
104 LOG(ERROR) << "Internal error: no undo stack in the viewport controller!"; | |
105 return false; | |
106 } | |
75 } | 107 } |
76 | 108 |
77 bool ViewportController::HandlePointerEvent(PointerEvent e) | 109 bool ViewportController::HandlePointerEvent(PointerEvent e) |
78 { | 110 { |
79 throw StoneException(ErrorCode_NotImplemented); | 111 throw StoneException(ErrorCode_NotImplemented); |