CMS 3D CMS Logo

FWSimpleProxyBuilderTemplate.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWSimpleProxyBuilderTemplate_h
2 #define Fireworks_Core_FWSimpleProxyBuilderTemplate_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWSimpleProxyBuilderTemplate
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Tue Dec 2 11:20:00 EST 2008
19 //
20 
21 // system include files
22 
23 // user include files
26 
27 // forward declarations
28 
29 template <typename T>
31 
32 public:
34  FWSimpleProxyBuilder(typeid(T)) {
35  }
36 
37  //virtual ~FWSimpleProxyBuilderTemplate();
38 
39  // ---------- const member functions ---------------------
40 
41  // ---------- static member functions --------------------
42 
43  // ---------- member functions ---------------------------
44 
45 protected:
46  const T& modelData(int index) { return *reinterpret_cast<const T*>(m_helper.offsetObject(item()->modelData(index))); }
47 
49  void build(const void*iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* context) override
50  {
51  if(nullptr!=iData) {
52  build(*reinterpret_cast<const T*> (iData), iIndex, oItemHolder, context);
53  }
54  }
55 
57  void buildViewType(const void*iData, unsigned int iIndex, TEveElement& oItemHolder, FWViewType::EType viewType, const FWViewContext* context) override
58  {
59  if(nullptr!=iData) {
60  buildViewType(*reinterpret_cast<const T*> (iData), iIndex, oItemHolder, viewType, context);
61  }
62  }
66  virtual void build(const T& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*)
67  {
68  throw std::runtime_error("virtual build(const T&, unsigned int, TEveElement&, const FWViewContext*) not implemented by inherited class.");
69  }
70 
71  virtual void buildViewType(const T& iData, unsigned int iIndex,TEveElement& oItemHolder, FWViewType::EType viewType, const FWViewContext*)
72  {
73  throw std::runtime_error("virtual buildViewType(const T&, unsigned int, TEveElement&, FWViewType::EType, const FWViewContext*) not implemented by inherited class");
74  };
75 private:
76  FWSimpleProxyBuilderTemplate(const FWSimpleProxyBuilderTemplate&) = delete; // stop default
77 
78  const FWSimpleProxyBuilderTemplate& operator=(const FWSimpleProxyBuilderTemplate&) = delete; // stop default
79 
80 
81 
82  // ---------- member data --------------------------------
83 
84 };
85 
86 
87 #endif
const fireworks::Context & context() const
void buildViewType(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
virtual void buildViewType(const T &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
virtual void build(const T &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
const void * offsetObject(const void *iObj) const
const FWSimpleProxyBuilderTemplate & operator=(const FWSimpleProxyBuilderTemplate &)=delete
const FWEventItem * item() const
FWSimpleProxyHelper m_helper
void buildViewType(const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
void build(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
long double T