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 public:
33 
34  //virtual ~FWSimpleProxyBuilderTemplate();
35 
36  // ---------- const member functions ---------------------
37 
38  // ---------- static member functions --------------------
39 
40  // ---------- member functions ---------------------------
41 
42 protected:
43  const T& modelData(int index) { return *reinterpret_cast<const T*>(m_helper.offsetObject(item()->modelData(index))); }
44 
46  void build(const void* iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* context) override {
47  if (nullptr != iData) {
48  build(*reinterpret_cast<const T*>(iData), iIndex, oItemHolder, context);
49  }
50  }
51 
53  void buildViewType(const void* iData,
54  unsigned int iIndex,
55  TEveElement& oItemHolder,
56  FWViewType::EType viewType,
57  const FWViewContext* context) override {
58  if (nullptr != 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  throw std::runtime_error(
67  "virtual build(const T&, unsigned int, TEveElement&, const FWViewContext*) not implemented by inherited "
68  "class.");
69  }
70 
71  virtual void buildViewType(
72  const T& iData, unsigned int iIndex, TEveElement& oItemHolder, FWViewType::EType viewType, const FWViewContext*) {
73  throw std::runtime_error(
74  "virtual buildViewType(const T&, unsigned int, TEveElement&, FWViewType::EType, const FWViewContext*) not "
75  "implemented by inherited class");
76  };
77 
78 private:
79  FWSimpleProxyBuilderTemplate(const FWSimpleProxyBuilderTemplate&) = delete; // stop default
80 
81  const FWSimpleProxyBuilderTemplate& operator=(const FWSimpleProxyBuilderTemplate&) = delete; // stop default
82 
83  // ---------- member data --------------------------------
84 };
85 
86 #endif
FWSimpleProxyBuilder::buildViewType
void buildViewType(const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
Definition: FWSimpleProxyBuilder.cc:95
FWViewType::EType
EType
Definition: FWViewType.h:31
FWSimpleProxyBuilderTemplate::modelData
const T & modelData(int index)
Definition: FWSimpleProxyBuilderTemplate.h:43
FWSimpleProxyBuilderTemplate::build
virtual void build(const T &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
Definition: FWSimpleProxyBuilderTemplate.h:65
FWSimpleProxyBuilderTemplate::buildViewType
virtual void buildViewType(const T &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
Definition: FWSimpleProxyBuilderTemplate.h:71
FWSimpleProxyBuilderTemplate::buildViewType
void buildViewType(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
Definition: FWSimpleProxyBuilderTemplate.h:53
FWSimpleProxyBuilder::m_helper
FWSimpleProxyHelper m_helper
Definition: FWSimpleProxyBuilder.h:59
FWSimpleProxyBuilderTemplate::operator=
const FWSimpleProxyBuilderTemplate & operator=(const FWSimpleProxyBuilderTemplate &)=delete
FWSimpleProxyBuilder.h
FWSimpleProxyHelper::offsetObject
const void * offsetObject(const void *iObj) const
Definition: FWSimpleProxyHelper.h:36
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWEventItem.h
FWViewContext
Definition: FWViewContext.h:32
FWSimpleProxyBuilder
Definition: FWSimpleProxyBuilder.h:30
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
T
long double T
Definition: Basic3DVectorLD.h:48
FWSimpleProxyBuilderTemplate::FWSimpleProxyBuilderTemplate
FWSimpleProxyBuilderTemplate()
Definition: FWSimpleProxyBuilderTemplate.h:32
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30
FWSimpleProxyBuilderTemplate::build
void build(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
Definition: FWSimpleProxyBuilderTemplate.h:46