Free Electron
HoudiniRenderComponent.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 //* derived from Houndini sample: PrimSurface_Surface
8 
9 #ifndef __houdini_HoudiniRenderComponent_h__
10 #define __houdini_HoudiniRenderComponent_h__
11 
12 namespace fe
13 {
14 namespace ext
15 {
16 
17 class HoudiniRenderHookComponent: public GUI_PrimitiveHook
18 {
19  public:
20 
21  HoudiniRenderHookComponent(void);
22 virtual ~HoudiniRenderHookComponent(void);
23 
24 virtual GR_Primitive* createPrimitive(const GT_PrimitiveHandle& gt_prim,
25  const GEO_Primitive* geo_prim,
26  const GR_RenderInfo* info,
27  const char* cache_name,
28  GR_PrimAcceptResult& processed);
29 
30 static sp<DrawI> ms_spDraw;
31 };
32 
33 /**************************************************************************//**
34  @brief Houdini render handler for general Component
35 
36  @ingroup houdini
37 *//***************************************************************************/
38 class HoudiniRenderComponent: public GR_Primitive
39 {
40  public:
41 
42  HoudiniRenderComponent(const GR_RenderInfo *info,
43  const char *cache_name,
44  const GEO_Primitive *prim);
45 virtual ~HoudiniRenderComponent(void);
46 
47 virtual
48 const char* className(void) const
49  { return "HoudiniRenderComponent"; }
50 
51 virtual GR_PrimAcceptResult acceptPrimitive(GT_PrimitiveType t,
52  int geo_type,
53  const GT_PrimitiveHandle& ph,
54  const GEO_Primitive* prim);
55 
56 virtual void update(RE_Render* a_pRender,
57  const GT_PrimitiveHandle& primh,
58  const GR_UpdateParms& p);
59 
60 #if FE_HOUDINI_16_PLUS
61 virtual void render(RE_Render* a_pRender,
62  GR_RenderMode render_mode,
63  GR_RenderFlags flags,
64  GR_DrawParms dp);
65 #else
66 virtual void render(RE_Render* a_pRender,
67  GR_RenderMode render_mode,
68  GR_RenderFlags flags,
69  const GR_DisplayOption *opt,
70  const RE_MaterialList* materials);
71 
72 virtual void renderInstances(RE_Render *a_pRender,
73  GR_RenderMode render_mode,
74  GR_RenderFlags flags,
75  const GR_DisplayOption *opt,
76  const RE_MaterialList *materials,
77  int render_instance) {}
78 #endif
79 
80 virtual int renderPick(RE_Render* a_pRender,
81  const GR_DisplayOption* opt,
82  unsigned int pick_type,
83  GR_PickStyle pick_style,
84  bool has_pick_map)
85  { return 0; }
86 
87  private:
88  int m_typeID;
89  sp<Component> m_spPayload;
90 
91  class RenderBrush: public MetaBrush
92  {
93  public:
94  RenderBrush(void);
95  virtual ~RenderBrush(void);
96 
97  void render(RE_Render* a_pRender,
98  sp<Component> a_spPayload);
99 
100  virtual void drawPost(void);
101 
102  private:
103 
104  RE_Render* m_pRender;
105  sp<Component> m_spPayload;
106  sp<DrawableI> m_spDrawable;
107  sp<DrawBufferI> m_spDrawBuffer;
108  };
109 
110  RenderBrush* m_pRenderBrush;
111 };
112 
113 } /* namespace ext */
114 } /* namespace fe */
115 
116 #endif /* __houdini_HoudiniRenderComponent_h__ */
kernel
Definition: namespace.dox:3
Common functionality of meta brushes for Houdini, Maya, etc.
Definition: MetaBrush.h:20
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Houdini render handler for general Component.
Definition: HoudiniRenderComponent.h:38