ALBA
albaPipe.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaPipe
5 Authors: Silvano Imboden
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#ifndef __albaPipe_H__
17#define __albaPipe_H__
18
19//----------------------------------------------------------------------------
20// Include:
21//----------------------------------------------------------------------------
22#include "albaDecl.h" // for MINID
23#include "albaObject.h"
24#include "albaObserver.h"
25#include "albaEvent.h"
26#include "albaServiceClient.h"
27#include "albaAbsLogicManager.h"
28
29//----------------------------------------------------------------------------
30// forward references :
31//----------------------------------------------------------------------------
32class albaVME;
33class albaVME;
34class albaSceneNode;
35class albaSceneGraph;
36class vtkALBAAssembly;
37class vtkRenderer;
38class albaGUI;
39
40//----------------------------------------------------------------------------
41// albaPipe :
42//----------------------------------------------------------------------------
43/*
44 albaPipe is the base class for all visual pipes; each pipe represents how a vme can be
45 visualized inside the view, so logically a pipe has as input a vme and in output
46 creates actors that will be rendered in a render view.
47 It can handle a GUI, which events can be catched by OnEvent.
48*/
49class ALBA_EXPORT albaPipe : public albaObject, public albaObserver, public albaServiceClient
50{
51public:
53
55 virtual ~albaPipe();
56
58 virtual void OnEvent(albaEventBase *alba_event) {};
59
61 virtual void Create(albaSceneNode *n);
62
63 void SetListener(albaObserver *listener) {m_Listener = listener;};
64
66 virtual void Select(bool select) {};
67
69 virtual void UpdateProperty(bool fromTag = false) {};
70
72 virtual vtkALBAAssembly *GetAssemblyFront(){return m_AssemblyFront;};
73 virtual vtkALBAAssembly *GetAssemblyBack(){return m_AssemblyBack;};
74
77 {
78 ID_FIRST = MINID,
79 ID_LAST
80 };
81
84 { \
85 if (m_Gui==NULL) CreateGui(); \
86 assert(m_Gui); \
87 return m_Gui; \
88 }
89
91 void DeleteGui();
92
93 /* Return Listener */
94 albaObserver *GetListener(){return m_Listener;};
95
103 vtkRenderer *m_RenFront;
104 vtkRenderer *m_RenBack;
106
107protected:
115 virtual albaGUI *CreateGui();
116
118};
119#endif
MINID
Definition: albaDecl.h:420
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Abstract superclass for all ALBA classes implementing RTTI APIs.
Definition: albaObject.h:38
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaTypeMacro(albaPipe, albaObject)
vtkRenderer * m_AlwaysVisibleRenderer
Definition: albaPipe.h:105
virtual vtkALBAAssembly * GetAssemblyFront()
Get assembly front/back.
Definition: albaPipe.h:72
VISUAL_PIPE_WIDGET_ID
IDs for the GUI.
Definition: albaPipe.h:77
virtual vtkALBAAssembly * GetAssemblyBack()
Definition: albaPipe.h:73
virtual void Select(bool select)
Change the visibility of the bounding box actor representing the selection for the vme.
Definition: albaPipe.h:66
albaObserver * m_Listener
Definition: albaPipe.h:117
void DeleteGui()
destroy the Gui
albaGUI * GetGui()
create and return the GUI for changing the node parameters
Definition: albaPipe.h:83
void SetListener(albaObserver *listener)
Definition: albaPipe.h:63
albaVME * m_Vme
VME used as input for the visual pipe.
Definition: albaPipe.h:97
virtual void OnEvent(albaEventBase *alba_event)
process events coming from gui
Definition: albaPipe.h:58
virtual void UpdateProperty(bool fromTag=false)
Update the properties.
Definition: albaPipe.h:69
virtual ~albaPipe()
virtual albaGUI * CreateGui()
< Renderer used to superimpose utility stuff to main render window
albaGUI * m_Gui
User Interface.
Definition: albaPipe.h:96
albaSceneGraph * m_Sg
Pointer to the SceneGraph.
Definition: albaPipe.h:101
vtkRenderer * m_RenBack
Renderer associated to the background layer.
Definition: albaPipe.h:104
vtkALBAAssembly * m_AssemblyFront
Assembly used to contain the actor in the front layer.
Definition: albaPipe.h:98
virtual void Create(albaSceneNode *n)
The real setup must be performed here - not in the ctor.
vtkALBAAssembly * m_AlwaysVisibleAssembly
Definition: albaPipe.h:100
vtkALBAAssembly * m_AssemblyBack
Assembly used to contain the actor in the background layer.
Definition: albaPipe.h:99
vtkRenderer * m_RenFront
Renderer associated to the front layer.
Definition: albaPipe.h:103
albaObserver * GetListener()
Definition: albaPipe.h:94
bool m_Selected
Flag used to say if the rendered VME is selected.
Definition: albaPipe.h:102
albaSceneNode is a node of albaScenegraph.
Definition: albaSceneNode.h:32
albaVME -
Definition: albaVME.h:150
create hierarchies of vtkProp3Ds (transformable props) vtkALBAAssembly same as vtkAssembly,...