Katana Plug-in APIs 0.1

ExampleViewerDelegate.h

00001 // Copyright (c) 2016 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef EXAMPLEVIEWERDELEGATE_H_
00004 #define EXAMPLEVIEWERDELEGATE_H_
00005 
00006 #include <FnAttribute/FnGroupBuilder.h>
00007 #include <FnViewer/plugin/FnViewerDelegate.h>
00008 #include <FnViewer/plugin/FnViewerLocationEvent.h>
00009 #include <FnAttribute/FnAttribute.h>
00010 
00011 #include "SceneNode.h"
00012 
00013 using Foundry::Katana::ViewerAPI::OptionIdGenerator;
00014 
00026 class ExampleViewerDelegate : public Foundry::Katana::ViewerAPI::ViewerDelegate
00027 {
00028 public:
00029     ExampleViewerDelegate();
00030     ~ExampleViewerDelegate();
00031 
00033     static Foundry::Katana::ViewerAPI::ViewerDelegate* create();
00034 
00036     static void flush();
00037 
00039     void setup();
00040 
00042     void cleanup();
00043 
00045     void setOption(OptionIdGenerator::value_type optionId,
00046         FnAttribute::Attribute attr);
00047 
00049     FnAttribute::Attribute getOption(
00050         OptionIdGenerator::value_type optionId);
00051 
00052     void locationEvent(
00053             const Foundry::Katana::ViewerAPI::ViewerLocationEvent& event,
00054             bool locationHandled) override;
00055 
00056     void sourceLocationEvent(
00057             const Foundry::Katana::ViewerAPI::ViewerLocationEvent& event)
00058                     override;
00059 
00061     void locationsSelected(const std::vector<std::string>& locations);
00062 
00064     void freeze();
00065 
00067     void thaw();
00068 
00070     SceneNode* getSceneRoot() { return &m_sceneRoot; }
00071 
00072 private:
00074     void dirtyAllViewports();
00075 
00077     void reactivateManipulators();
00078 
00079     typedef std::map<OptionIdGenerator::value_type,
00080         FnAttribute::Attribute> AttrMap;
00081 
00083     AttrMap m_options;
00084 
00086     SceneNode m_sceneRoot;
00087 };
00088 
00089 #endif  // EXAMPLEVIEWERDELEGATE_H_
 All Classes Functions Variables Typedefs Enumerations Enumerator