MeVisLab Toolbox Reference
SoView2DRigidRegistrationEditor.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2016, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 // editor for setting a rigid registration with external undo handling
14 
15 #pragma once
16 
18 
19 #include "XVEnterScope.h"
20 #include <SoSFMLBase.h>
21 #include "XVLeaveScope.h"
22 
23 #include <mlUndoContext.h>
24 #include <mlUndoStep.h>
25 
27 
28 
31 {
33  SO_NODE_HEADER(SoView2DRigidRegistrationEditor);
34 
35 public:
38 
40  static void initClass();
41 
44 
45 
46 protected:
48  virtual void inUndoContextChanged(SoField* field);
49 
51  void pushOldState(const RegistrationState& state) override;
52 
54  ml::UndoContextPtr _undoContext;
55 
56  class UndoStep : public ml::UndoOnlyStep
57  {
58  public:
60 
61  std::string description() const override;
62  void undo() override;
63 
64  private:
65  SoView2DRigidRegistrationEditor* module() const { return static_cast<SoView2DRigidRegistrationEditor*>(owner()); }
66 
67  RegistrationState _state;
68  };
69 };
70 
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
The SoSFMLBase field is the interface used by Inventor Nodes to output ML Base objects to the outside...
Definition: SoSFMLBase.h:45
interactive editor to accumulate a transformation matrix
UndoStep(SoView2DRigidRegistrationEditor *owner, const RegistrationState &state)
std::string description() const override
gui grabber to accumulate a transformation matrix
ml::UndoContextPtr _undoContext
Reference to the current undo context.
SoSFMLBase inUndoContext
input for undo context for undo/redo handling
void pushOldState(const RegistrationState &state) override
inherited to implement undo handling
virtual void inUndoContextChanged(SoField *field)
called when inUndoContext field is touched:
static void initClass()
Initializes this class (called on dll initialization).
SoView2DRigidRegistrationEditor()
Constructor.