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//---------------------------------------------------------------------------
31class albaVME;
32class albaVMEGizmo;
33class vtkPoints;
34class vtkDoubleArray;
35
40class ALBA_EXPORT albaGizmoSlice : public albaGizmoInterface
41{
42public:
43
44 albaGizmoSlice(albaVME* inputVme, albaObserver *Listener = NULL, const char *name = "GizmoSlice", bool inverseHandle = false, double centralClipfactor = 0);
45
46 virtual ~albaGizmoSlice();
47
50 void Show(bool show);
51
53 void SetInput(albaVME *vme);
54
56 void SetColor(double col[3]);
57
59 void SetCentralClipFactor(double factor){m_CentralClipFactor = factor;};
60
63
65 void UpdateGizmoSliceInLocalPositionOnAxis(int gizmoSliceId, int axis, double positionOnAxis, bool visibleCubeHandler = true);
66
68 {
69 GIZMO_SLICE_X = 0,
71 GIZMO_SLICE_Z
72 };
73
77 int GetGizmoMovingModality() {return this->m_MovingModality;};
78
79 void SetGizmoEnableMoving(bool enable);
80
82 void OnEvent(albaEventBase *alba_event);
83
84 void GetPosition(double * slicePlaneOrigin);
85
86
88 void SetModalityToGlobal() {albaLogMessage("Global modality is currently not supported for this item");};
89
90 void SetPosition(albaMatrix *matrix);
91 albaMatrix *GetPosition(){return m_GizmoHandleCenterMatrix;};
92
95
96 void SetEnableCustomizedSnapArray(bool enable){m_CustomizedSnapArrayFlag = enable;};
97 void SetCustomizedSnapArrayStep(double step){m_CustomizedArrayStep = step;};
98
99 double *GetBounds() { return m_Bounds; }
100 void SetBounds(double *val);
101protected:
102
103 void CreateGizmoSlice(albaVME *imputVme, albaObserver *listener, const char *name, bool inverseHandle, double centralClipfactor);
104
106
108
110 void InitSnapArray(albaVME *vol, int axis);
111
112 /*Set Gizmo On correct slices when activate snap array modality*/
113 void SetOnSnapArray(int axis);
114
116 long m_Id;
117 albaVMEGizmo *m_VmeGizmo;
118 vtkDoubleArray *m_SnapArray;
119 double m_Bounds[6];
120
122 vtkPoints *m_Point;
123
126
129
134
136 {
137 BOUND = 0,
140 };
142
144
146};
147#endif
ALBA_EXPORT void albaLogMessage(const char *format,...)
write a message in the log area
Constrained interaction with mouse device: the left button moves the VME (see OnLeftButtonDown).
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
albaVME * GetOutput()
return the gizmo slice object
void SetColor(double col[3])
Set the gizmo color.
double m_CentralClipFactor
albaBehaviorTransform * m_MouseBH
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.
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:45
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