ALBA
albaGizmoSlice.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoSlice
5 Authors: Paolo Quadrani, Stefano Perticoni
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaGizmoSlice_h
18#define __albaGizmoSlice_h
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaDefines.h"
24#include "albaGizmoInterface.h"
25#include "albaMatrix.h"
26
27//---------------------------------------------------------------------------
28// forward refs:
29//---------------------------------------------------------------------------
32class albaVME;
33class albaVMEGizmo;
34class vtkPoints;
35class vtkDoubleArray;
36
41class ALBA_EXPORT albaGizmoSlice : public albaGizmoInterface
42{
43public:
44
45 albaGizmoSlice(albaVME* inputVme, albaObserver *Listener = NULL, const char *name = "GizmoSlice", bool inverseHandle = false, double centralClipfactor = 0);
46
47 virtual ~albaGizmoSlice();
48
51 void Show(bool show);
52
54 void SetInput(albaVME *vme);
55
57 void SetColor(double col[3]);
58
60 void SetCentralClipFactor(double factor){m_CentralClipFactor = factor;};
61
64
66 void UpdateGizmoSliceInLocalPositionOnAxis(int gizmoSliceId, int axis, double positionOnAxis, bool visibleCubeHandler = true);
67
69 {
70 GIZMO_SLICE_X = 0,
72 GIZMO_SLICE_Z
73 };
74
78 int GetGizmoMovingModality() {return this->m_MovingModality;};
79
80 void SetGizmoEnableMoving(bool enable);
81
83 void OnEvent(albaEventBase *alba_event);
84
85 void GetPosition(double * slicePlaneOrigin);
86
87
89 void SetModalityToGlobal() {albaLogMessage("Global modality is currently not supported for this item");};
90
91 void SetPosition(albaMatrix *matrix);
92 albaMatrix *GetPosition(){return m_GizmoHandleCenterMatrix;};
93
96
97 void SetEnableCustomizedSnapArray(bool enable){m_CustomizedSnapArrayFlag = enable;};
98 void SetCustomizedSnapArrayStep(double step){m_CustomizedArrayStep = step;};
99
100 double *GetBounds() { return m_Bounds; }
101 void SetBounds(double *val);
102protected:
103
104 void CreateGizmoSlice(albaVME *imputVme, albaObserver *listener, const char *name, bool inverseHandle, double centralClipfactor);
105
107
109
111 void InitSnapArray(albaVME *vol, int axis);
112
113 /*Set Gizmo On correct slices when activate snap array modality*/
114 void SetOnSnapArray(int axis);
115
117 long m_Id;
118 albaVMEGizmo *m_VmeGizmo;
120 vtkDoubleArray *m_SnapArray;
121 double m_Bounds[6];
122
124 vtkPoints *m_Point;
125
128
131
136
138 {
139 BOUND = 0,
142 };
144
146
148};
149#endif
ALBA_EXPORT void albaLogMessage(const char *format,...)
write a message in the log area
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Base class for operations and views gizmos.
Gizmo typically used to move volume slices.
double GetBorderCube()
int m_MovingModality
Register the gizmo behavior: BOUND means gizmo movement is free in an interval while SNAP snaps on a ...
void InitSnapArray(albaVME *vol, int axis)
Initialize snap array.
void UpdateGizmoSliceInLocalPositionOnAxis(int gizmoSliceId, int axis, double positionOnAxis, bool visibleCubeHandler=true)
Create the gizmo slice with its id on choosed position on choosed axis.
void CreateGizmoSlice(albaVME *imputVme, albaObserver *listener, const char *name, bool inverseHandle, double centralClipfactor)
void SetInput(albaVME *vme)
This method is used to change the input vme.
void GetPosition(double *slicePlaneOrigin)
void SetGizmoMovingModalityToSnap()
void DestroyGizmoSlice()
void SetGizmoMovingModalityToBound()
Set/Get the gizmo moving modality, default is Snap.
void SetCentralClipFactor(double factor)
Set the central clip length in order to create a less invasive gizmo.
vtkPoints * m_Point
void SetGizmoEnableMoving(bool enable)
double m_CustomizedArrayStep
albaMatrix * m_GizmoHandleCenterMatrix
void SetHandleCenterMatrix(albaMatrix *m)
Set matrix of the handle.
vtkDoubleArray * m_SnapArray
void OnEvent(albaEventBase *alba_event)
Events handling method.
int GetGizmoMovingModality()
void SetModalityToGlobal()
Gizmo is reparented under the vme tree root, this modality is currently not supported.
albaGizmoSlice(albaVME *inputVme, albaObserver *Listener=NULL, const char *name="GizmoSlice", bool inverseHandle=false, double centralClipfactor=0)
albaString m_Name
albaInteractorGenericMouse * m_MouseBH
albaVME * GetOutput()
return the gizmo slice object
void SetColor(double col[3])
Set the gizmo color.
albaInteractorCompositorMouse * m_GizmoBehavior
double m_CentralClipFactor
double * GetBounds()
void SetBounds(double *val)
virtual ~albaGizmoSlice()
void Show(bool show)
Show/Hide the gizmos using actor visibility instead of pipe creation/destruction: this is used for fa...
albaVMEGizmo * m_VmeGizmo
bool m_CustomizedSnapArrayFlag
void SetCustomizedSnapArrayStep(double step)
albaMatrix * GetPosition()
void SetOnSnapArray(int axis)
void SetEnableCustomizedSnapArray(bool enable)
void SetPosition(albaMatrix *matrix)
int m_Axis
Register the gizmo axis, default is z.
Associates instances of albaInteractorGenericMouse to mouse buttons and ctrl/shift keys combinations.
Constrained interaction with mouse device.
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:150