typedef osg::ref_ptr<CullCallback> CullCallbackPtr;
Canvas(SGPropertyNode* node);
+ virtual ~Canvas();
virtual void onDestroy();
- void setSystemAdapter(const SystemAdapterPtr& system_adapter);
- SystemAdapterPtr getSystemAdapter() const;
-
void setCanvasMgr(CanvasMgr* canvas_mgr);
CanvasMgr* getCanvasMgr() const;
void update(double delta_time_sec);
- naRef addEventListener(const nasal::CallContext& ctx);
+ bool addEventListener(const std::string& type, const EventListener& cb);
void setSizeX(int sx);
void setSizeY(int sy);
void reloadPlacements( const std::string& type = std::string() );
static void addPlacementFactory( const std::string& type,
PlacementFactory factory );
+ static void removePlacementFactory(const std::string& type);
+
+ /**
+ * Set global SystemAdapter for all Canvas/ODGauge instances.
+ *
+ * The SystemAdapter is responsible for application specific operations
+ * like loading images/fonts and adding/removing cameras to the scene
+ * graph.
+ */
+ static void setSystemAdapter(const SystemAdapterPtr& system_adapter);
+ static SystemAdapterPtr getSystemAdapter();
protected:
- SystemAdapterPtr _system_adapter;
CanvasMgr *_canvas_mgr;
boost::scoped_ptr<EventManager> _event_manager;
private:
+ static SystemAdapterPtr _system_adapter;
+
Canvas(const Canvas&); // = delete;
Canvas& operator=(const Canvas&); // = delete;
};