ALBA
albaPics.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaPics
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 __albaPics_H__
17#define __albaPics_H__
18//----------------------------------------------------------------------------
19// Include:
20//----------------------------------------------------------------------------
21#include "albaGUICheckTree.h" // friend class
22#include <wx/bitmap.h>
23#include <wx/image.h>
24#include <wx/icon.h>
25#include <vector>
26
27#ifdef ALBA_USE_VTK
28 #include "vtkImageData.h"
29#endif
30//----------------------------------------------------------------------------
31// Forward refs:
32//----------------------------------------------------------------------------
33struct albaPictureFactory_Pimpl;
34//----------------------------------------------------------------------------
35// albaPictureFactory
36//----------------------------------------------------------------------------
66class ALBA_EXPORT albaPictureFactory
67{
68public:
72 void Initialize();
73
75 void Add(wxString id,char** xpm);
76
78 wxBitmap GetBmp(wxString id);
79
81 wxImage GetImg(wxString id);
82
84 wxIcon GetIcon(wxString id);
85
86#ifdef ALBA_USE_VTK
88 vtkImageData* GetVTKImg(wxString id);
89#endif
90
92 void GetPicIds(std::vector<wxString>& v);
93
98 void AddVmePic(wxString id,char** xpm);
99
101 wxBitmap GetVmePic(wxString id);
102
104 void GetVmeNames( std::vector<wxString>& v );
105
107
108 static bool GetPicsInitialized();
109
110
111protected:
112 albaPictureFactory_Pimpl *m_PictureMaps;
113};
114//----------------------------------------------------------------------------
115// macro
116//----------------------------------------------------------------------------
117/* shotcut to add a picture to the factory */
118#define albaADDPIC(X) albaPictureFactory::GetPictureFactory()->Add( #X , X##_xpm )
119
120/* shotcut to add a vmepicture to the factory */
121#define albaADDVMEPIC(X) albaPictureFactory::GetPictureFactory()->AddVmePic( #X , X##_xpm )
122
123//----------------------------------------------------------------------------
124// the albaPics and albaVmePics singleton
125//----------------------------------------------------------------------------
126// extern "C" __declspec(dllexport) albaPictureFactory albaPics;
127// extern bool albaPics_Initialized;
128#endif // __albaPics_H__
This class is normally instantiated as the "albaPics" singleton.
Definition: albaPics.h:67
wxBitmap GetVmePic(wxString id)
retrieve a vme-picture from the Factory as a wxBitmap.
static bool GetPicsInitialized()
void Add(wxString id, char **xpm)
add a picture to the factory – if id already exist it is overwritten
albaPictureFactory_Pimpl * m_PictureMaps
Definition: albaPics.h:112
wxBitmap GetBmp(wxString id)
retrieve a picture from the Factory as a wxBitmap
void GetVmeNames(std::vector< wxString > &v)
retrieve the names of the registered vme-pics
wxImage GetImg(wxString id)
retrieve a picture from the Factory as a wxImage
static albaPictureFactory * GetPictureFactory()
albaPictureFactory()
initialize the factory with the standard icons
void GetPicIds(std::vector< wxString > &v)
Fills the given vectors with the available Pic Id's.
void AddVmePic(wxString id, char **xpm)
add a vme-picture to the factory.
wxIcon GetIcon(wxString id)
retrieve a picture from the Factory as a wxIcon