1 #ifndef ZONE_PAINTER_PLUGIN_H
2 #define ZONE_PAINTER_PLUGIN_H
5 #include "../../extension_system/iplugin.h"
6 #include "../core/icontext.h"
7 #include "zone_painter_main_window.h"
10 #include <nel/misc/app_context.h>
11 #include <nel/misc/singleton.h>
12 #include <nel/3d/landscape.h>
13 #include <nel/3d/patch.h>
14 #include <nel/3d/zone.h>
15 #include <nel/3d/u_scene.h>
18 #include <QtCore/QObject>
19 #include <QtGui/QIcon>
23 class CLibraryContext
;
26 namespace ExtensionSystem
36 NLMISC_SAFE_SINGLETON_DECL(CZoneManager)
38 //m_painterLandscape = static_cast<NL3D::CLandscapeModel *>
41 NL3D::CLandscapeModel *m_painterLandscape;
42 NL3D::CZone *m_currentZone;
45 class ZonePainterPlugin
: public QObject
, public ExtensionSystem::IPlugin
48 Q_INTERFACES(ExtensionSystem::IPlugin
)
51 virtual ~ZonePainterPlugin();
53 bool initialize(ExtensionSystem::IPluginManager
*pluginManager
, QString
*errorString
);
54 void extensionsInitialized();
55 void setNelContext(NLMISC::INelContext
*nelContext
);
57 void addAutoReleasedObject(QObject
*obj
);
60 void clickLoadZoneAction();
61 void clickSaveZoneAction();
63 NLMISC::CLibraryContext
*m_LibContext
;
66 ExtensionSystem::IPluginManager
*m_plugMan
;
67 QList
<QObject
*> m_autoReleaseObjects
;
69 NL3D::CLandscapeModel
*m_Landscape
;
72 class CZonePainterContext
: public Core::IContext
76 CZonePainterContext(QObject
*parent
= 0): IContext(parent
)
78 m_zonePainterMainWindow
= new ZonePainterMainWindow();
80 virtual ~CZonePainterContext() {}
82 virtual QString
id() const
84 return QLatin1String("ZonePainterContext");
86 virtual QString
trName() const
88 return tr("Zone Painter");
90 virtual QIcon
icon() const
94 virtual QWidget
*widget()
96 return m_zonePainterMainWindow
;
99 virtual QUndoStack
*undoStack()
101 return m_zonePainterMainWindow
->getUndoStack();
108 ZonePainterMainWindow
*m_zonePainterMainWindow
;
111 } // namespace Plugin
113 #endif // ZONE_PAINTER_PLUGIN_H