ALBA
albaRefSys.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaRefSys
5 Authors: Marco Petrone, 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 __albaRefSys_h
18#define __albaRefSys_h
19
20#include "albaConfigure.h"
21#include "albaSmartPointer.h"
22#include "albaVME.h"
23#include "albaTransform.h"
24#include <iostream>
25
26//----------------------------------------------------------------------------
27// forward declarations
28//----------------------------------------------------------------------------
29
30class albaMatrix;
31class vtkMatrix4x4;
32class vtkRenderer;
33
34template class albaAutoPointer<albaVME>;
37
48class ALBA_EXPORT albaRefSys
49{
50public:
52 albaRefSys(int type);
54 albaRefSys(vtkMatrix4x4 *matrix);
55 albaRefSys(vtkRenderer *ren);
56 virtual ~albaRefSys();
57
59 void operator =(const albaRefSys &source);
60
61
62 //----------------------------------------------------------------------------
63 // Ref Sys Type:
64 //----------------------------------------------------------------------------
65 enum
66 {
67 CUSTOM = 0,
71 VIEW
72 };
73
74 /*
75 //----------------------------------------------------------------------------
76 // VIEW ref sys
77 //----------------------------------------------------------------------------
78
79 Y
80 ^
81 |
82 |
83 |
84 . ----> X
85 Z
86
87 X: View Right
88 Y: View Up
89 Z: View Look
90
91 */
92
98 void SetTypeToCustom(albaTransformBase *transform=NULL);
99
104 void SetTypeToCustom(vtkMatrix4x4 *matrix);
106
108 void SetTypeToLocal(albaVME *vme=NULL);
109
111 void SetTypeToView(vtkRenderer *renderer=NULL);
112
118
121
125 void SetType(int type) {m_Type=type;}
126
128 int GetType() {return m_Type;}
129
135
141
144
150 void SetMatrix(vtkMatrix4x4 *matrix);
151
157 void SetMatrix(albaMatrix *matrix);
158
162 void SetRenderer(vtkRenderer *renderer);
163
165 vtkRenderer *GetRenderer() {return m_Renderer;}
166
170 void SetVME(albaVME *vme);
171
173 albaVME *GetVME() {return m_VME;}
174
175
177 virtual void Print(std::ostream& os, const int tabs);
178
182 void DeepCopy(const albaRefSys *source);
183
185 void Reset();
186
187protected:
188
191
194 vtkRenderer* m_Renderer;
196 int m_Type;
197};
198
199#endif
Hold a reference to a T instance.
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
class representing reference system
Definition: albaRefSys.h:49
albaTransformBase * GetTransform()
return a transform representing this RefSys, this could be either the internally stored transform (CU...
vtkRenderer * GetRenderer()
return Renderer stored in this ref_sys
Definition: albaRefSys.h:165
void SetTypeToLocal(albaVME *vme=NULL)
Set the reference system to the VME's abs matrix.
void DeepCopy(const albaRefSys *source)
DeepCopy the source matrix into the target.
void Initialize()
internally used to set default values
albaMatrix * GetMatrix()
return the matrix of this ref_sys (
albaAutoPointer< albaTransformBase > m_Transform
the ref sys matrix
Definition: albaRefSys.h:193
int GetType()
Get the type of reference system, which can be CUSTOM, GLOBAL, LOCAL,PARENT or VIEW.
Definition: albaRefSys.h:128
albaRefSys(albaVME *vme)
virtual void Print(std::ostream &os, const int tabs)
Debug printing of internal data.
void SetTransform(albaTransformBase *transform)
Used to set the transform used for for the CUSTOM ref sys type.
albaVME * GetVME()
return the reference to the VME stored inside the RefSys
Definition: albaRefSys.h:173
@ LOCAL
the local ref sys of the VME
Definition: albaRefSys.h:70
albaRefSys(int type)
void SetTypeToView(vtkRenderer *renderer=NULL)
Set the reference system to VIEW.
void SetTypeToGlobal()
Set the reference system to identity.
void SetMatrix(albaMatrix *matrix)
Set the matrix relative to the ref_sys: albaTransform is created on the fly and stored in the Transfo...
void SetTypeToParent(albaVME *vme)
Set the reference system to the parent Abs matrix of a VME.
virtual ~albaRefSys()
void SetTypeToCustom(albaMatrix *matrix)
void SetMatrix(vtkMatrix4x4 *matrix)
Set the matrix relative to the ref_sys: albaTransform is created on the fly and stored in the Transfo...
vtkRenderer * m_Renderer
ref sys renderer
Definition: albaRefSys.h:194
albaRefSys(vtkMatrix4x4 *matrix)
albaAutoPointer< albaTransform > m_Identity
Definition: albaRefSys.h:192
void SetVME(albaVME *vme)
Set the reference to the VME.
void SetType(int type)
Set the type of reference system, which can be CUSTOM, GLOBAL, LOCAL, PARENT or VIEW.
Definition: albaRefSys.h:125
void SetTypeToCustom(vtkMatrix4x4 *matrix)
Set the reference system to CUSTOM.
albaAutoPointer< albaVME > m_VME
reference to VME
Definition: albaRefSys.h:195
void SetTypeToCustom(albaTransformBase *transform=NULL)
Set the reference system to CUSTOM.
int m_Type
type of ref sys (CUSTOM, GLOBAL, LOCAL, PARENT, VIEW)
Definition: albaRefSys.h:196
void Reset()
Reset the class to default value.
albaRefSys(vtkRenderer *ren)
void SetRenderer(vtkRenderer *renderer)
Set the internal Renderer variable.
Superclass for Homogeneous transformations.
albaVME -
Definition: albaVME.h:150