MeVisLab Toolbox Reference
CSOProcessor.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, 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 #ifndef CSOPROCESSOR_H
14 #define CSOPROCESSOR_H
15 
16 
20 
21 #include "SoCSODefines.h"
22 #include "SoCSOSystem.h"
23 
25 #include <CSOBase/CSOScopeEvents.h>
26 
27 #include "CSOProcessorData.h"
28 
29 // Used in processors for setting mouse cursor shapes.
30 #include <SoViewerElement.h>
31 
32 
33 ML_START_NAMESPACE
34 
35 
37 
42 {
43 
44 public:
45 
47  CSOProcessor(std::string type="CSOProcessor", int numInImg=0, int numOutImg=0);
48 
51  virtual bool process(CSOEvalEventView2DInfos view2DInfos, CSOEvalEventCSOInfos csoInfos);
52 
54  virtual void draw(CSODrawView2DInfos view2DInfos, CSODrawCSOInfos csoInfos);
55 
58  virtual bool needsMemoryImage();
59 
61  virtual void setMemoryImage(float* imageData, int sizex, int sizey, int voxelPosZ,
62  const Matrix4& voxelToWorldMatrix, const Matrix4& worldToVoxelMatrix,
63  View2DSliceList* slicelist);
64 
66  virtual bool isCurrentlyGenerating();
68  virtual bool isCurrentlyEditing();
70  virtual bool couldCloseCSO();
71 
73  inline CSOProcessorMode getProcessorMode() { return _processorMode; }
75  inline CSOProcessorPickingMode getPickingMode() { return _pickingMode; }
77  virtual void resetInteractionState();
79  virtual void triggerSetMouseCursor(SoView2D* view2d, bool shouldSetMouseCursor);
80 
81 protected:
82 
83  /* FIELDS */
84 
87 
88 
89  /* MEMBER VARIABLES */
90 
95  // The mode of picking.
97 
98 
99  /* METHODS */
100 
102  ~CSOProcessor() override;
103 
104 private:
105 
107 
108 };
109 
111 
112 
113 ML_END_NAMESPACE
114 
115 
116 #endif // __CSOInteraction_H
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition: SoCSOSystem.h:21
SoView2D is a 2D viewer for image data.
Definition: SoView2D.h:62
a list that holds all View2DSlice objects (lazily created) of a SoView2D
Field to encapsulate a pointer to an ML base object.
Definition: mlFields.h:1187
The CSOGenerator is the base class for all modules that generate CSOs, be it automatically or interac...
Definition: CSOGenerator.h:29
The CSOProcesorData provides the network data interchange object for processing interaction events an...
Base class for processor modules; those provide mechanisms for an interactive generation of seed poin...
Definition: CSOProcessor.h:42
virtual void resetInteractionState()
Sets back internal interaction state.
virtual bool process(CSOEvalEventView2DInfos view2DInfos, CSOEvalEventCSOInfos csoInfos)
Processes the interaction events and interpolates the contours accordingly.
virtual void setMemoryImage(float *imageData, int sizex, int sizey, int voxelPosZ, const Matrix4 &voxelToWorldMatrix, const Matrix4 &worldToVoxelMatrix, View2DSliceList *slicelist)
Sets an image which can be used with an image based interpolation algorithm.
virtual void draw(CSODrawView2DInfos view2DInfos, CSODrawCSOInfos csoInfos)
Draws processor-specific geometry.
virtual bool needsMemoryImage()
Returns whether the processor need the current memory image for interpolation.
CSOProcessorPickingMode _pickingMode
Definition: CSOProcessor.h:96
CSOProcessor(std::string type="CSOProcessor", int numInImg=0, int numOutImg=0)
Constructor.
virtual void triggerSetMouseCursor(SoView2D *view2d, bool shouldSetMouseCursor)
Triggers the setting of the processor's default mouse cursor.
CSOProcessorData _processorData
The processor data for data exchange.
Definition: CSOProcessor.h:92
CSOProcessorMode getProcessorMode()
Returns the mode of this processor.
Definition: CSOProcessor.h:73
~CSOProcessor() override
Destructor.
virtual bool isCurrentlyGenerating()
Returns whether the processor is currently generating a new contour.
virtual bool isCurrentlyEditing()
Returns whether the processor is currently editing an existing contour.
CSOProcessorMode _processorMode
The mode of the processor.
Definition: CSOProcessor.h:94
virtual bool couldCloseCSO()
Returns whether the processor could close an open CSO by the processor's rules.
CSOProcessorPickingMode getPickingMode()
Returns the picking mode of this processor.
Definition: CSOProcessor.h:75
BaseField * _outProcessDataFld
Field for connecting this processor to an editor.
Definition: CSOProcessor.h:86
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
CSOProcessorMode
Enumeration of Processor modes.
Definition: CSODefines.h:147
CSOProcessorPickingMode
Enumeration of processor picking mode.
Definition: CSODefines.h:157