ALBA
albaGUIMaterialChooser.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIMaterialChooser
5 Authors: Paolo Quadrani
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 __albaGUIMaterialChooser_H__
18#define __albaGUIMaterialChooser_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaObserver.h"
25#include "albaStorable.h"
26#include "albaServiceClient.h"
27#include "albaAbsLogicManager.h"
28#include <vector>
29
30//----------------------------------------------------------------------------
31// forward declarations :
32//----------------------------------------------------------------------------
34class mmaMaterial;
35class vtkProperty;
36class vtkSphereSource;
37class vtkPolyDataMapper;
38class vtkProperty;
39class albaRWI;
40class albaGUI;
41class albaGUIButton;
42class vtkWindowToImageFilter;
43class albaGUIBitmaps;
44class vtkImageData;
45class mmaMaterial;
46class vtkActor;
47class albaVME;
48
49//----------------------------------------------------------------------------
50// albaGUIMaterialChooser :
51//----------------------------------------------------------------------------
54class ALBA_EXPORT albaGUIMaterialChooser : public albaObserver, public albaServiceClient
55{
56
57public:
58 albaGUIMaterialChooser(wxString dialog_title = "Material Chooser"); // reads materials from file
59 ~albaGUIMaterialChooser(); // store materials to file
60
62 bool ShowChooserDialog(albaVME *vme, bool remember_last_material = false);
63
65
66 void OnEvent(albaEventBase *alba_event);
67
70
71protected:
73 void CreateGUI();
74
76 void CreatePipe();
77
79 void ClearList();
80
83
86
89
92
94 void SelectMaterial(long matPos);
95
97
98 wxDialog *m_Dialog;
102
103 std::vector<mmaMaterial *> m_List;
108 vtkSphereSource *m_Sphere;
109 vtkProperty *m_Property;
110 vtkPolyDataMapper *m_Mapper;
111 vtkActor *m_Actor;
115
124 double m_Opacity;
126
128};
129//------------------------------------------------------------------------------
130class ALBA_EXPORT albaStorableMaterialLibrary: public albaObject, public albaStorable
131//------------------------------------------------------------------------------
132{
133public:
136 albaStorableMaterialLibrary(std::vector<mmaMaterial *> *mat_list);
140 std::vector<mmaMaterial *> *m_MaterialList;
141};
142#endif // _albaGUIMaterialChooser_H_
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUIButton inherit from wxButton.
Definition: albaGUIButton.h:35
albaGUIListCtrlBitmap allows a simplified use of a wxWindows ListCtrl widget.
albaMaterialChooser let the user Choose one of the predefined materials, but also edit material setti...
void CreatePipe()
Create the pipeline showing the colored spheres.
albaGUIListCtrlBitmap * m_ListCtrlMaterial
void CreateGUI()
Create the dialog that show the interface for materials.
std::vector< mmaMaterial * > m_List
mmaMaterial * GetMaterial(int id)
void AddMaterial()
Store the current settings as a new material.
bool ShowChooserDialog(albaVME *vme, bool remember_last_material=false)
Show in modal configuration the material editor.
void SelectMaterial(long matPos)
Copy choosed material on vme properties.
void LoadLibraryFromFile()
Load material library from file.
void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
void CreateDefaultLibrary()
Create the default material library.
void ClearList()
Delete the material list.
void RemoveMaterial()
remove choosed material from the list.
vtkPolyDataMapper * m_Mapper
albaGUIMaterialChooser(wxString dialog_title="Material Chooser")
void SetFromMat(mmaMaterial *mat)
void StoreLibraryToFile()
Store material library to file.
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
int InternalRestore(albaStorageElement *node)
This is called by Restore() and must be reimplemented by subclasses The element from which the object...
albaStorableMaterialLibrary(std::vector< mmaMaterial * > *mat_list)
albaTypeMacro(albaStorableMaterialLibrary, albaObject)
int InternalStore(albaStorageElement *parent)
This is called by Store() and must be reimplemented by subclasses.
std::vector< mmaMaterial * > * m_MaterialList
albaStorable is an interface for serializable objects.
Definition: albaStorable.h:41
Abstract class representing the interface for the unit of information stored in the storage.
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:150