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
25 
26 // forward declarations
27 
28 template <typename T>
30 
31 public:
33  FWSimpleProxyBuilder(typeid(T)) {
34  }
35 
36  //virtual ~FWSimpleProxyBuilderTemplate();
37 
38  // ---------- const member functions ---------------------
39 
40  // ---------- static member functions --------------------
41 
42  // ---------- member functions ---------------------------
43 
44 protected:
45  const T& modelData(int index) { return *reinterpret_cast<const T*>(m_helper.offsetObject(item()->modelData(index))); }
46 
48  virtual void build(const void*iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* context)
49  {
50  if(0!=iData) {
51  build(*reinterpret_cast<const T*> (iData), iIndex, oItemHolder, context);
52  }
53  }
54 
56  virtual void buildViewType(const void*iData, unsigned int iIndex, TEveElement& oItemHolder, FWViewType::EType viewType, const FWViewContext* context)
57  {
58  if(0!=iData) {
59  buildViewType(*reinterpret_cast<const T*> (iData), iIndex, oItemHolder, viewType, context);
60  }
61  }
65  virtual void build(const T& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*)
66  {
67  throw std::runtime_error("virtual build(const T&, unsigned int, TEveElement&, const FWViewContext*) not implemented by inherited class.");
68  }
69 
70  virtual void buildViewType(const T& iData, unsigned int iIndex,TEveElement& oItemHolder, FWViewType::EType viewType, const FWViewContext*)
71  {
72  throw std::runtime_error("virtual buildViewType(const T&, unsigned int, TEveElement&, FWViewType::EType, const FWViewContext*) not implemented by inherited class");
73  };
74 private:
76 
78 
79 
80 
81  // ---------- member data --------------------------------
82 
83 };
84 
85 
86 #endif
const fireworks::Context & context() const
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 FWEventItem * item() const
const FWSimpleProxyBuilderTemplate & operator=(const FWSimpleProxyBuilderTemplate &)
FWSimpleProxyHelper m_helper
virtual void build(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context)
long double T
virtual void buildViewType(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context)
virtual void buildViewType(const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *)