Free Electron
SurfaceAccessibleHoudini.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 #ifndef __houdini_SurfaceAccessibleHoudini_h__
8 #define __houdini_SurfaceAccessibleHoudini_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Houdini Surface Binding
17 
18  @ingroup houdini
19 *//***************************************************************************/
20 class FE_DL_EXPORT SurfaceAccessibleHoudini:
21  public SurfaceAccessibleBase,
22  public CastableAs<SurfaceAccessibleHoudini>
23 {
24  public:
26 virtual ~SurfaceAccessibleHoudini(void);
27 
28  //* as SurfaceAccessibleI
29 
31 
32 virtual void bind(Instance a_instance)
33  { setGdp(a_instance.cast<GU_Detail*>()); }
34 
35 virtual BWORD isBound(void) { return m_pGdp!=NULL; }
36 
37 virtual void groupNames(Array<String>& a_rNameArray,
38  SurfaceAccessibleI::Element
39  a_element) const;
40 
41  using SurfaceAccessibleBase::attributeSpecs;
42 
43 virtual void attributeSpecs(
45  a_rSpecs,
46  String a_node,
47  SurfaceAccessibleI::Element
48  a_element) const;
49 
50 //virtual void copy(sp<SurfaceAccessibleI>
51 // a_spSurfaceAccessible);
52 
54 
55 virtual sp<SurfaceAccessorI> accessor(String a_node,
56  SurfaceAccessibleI::Element a_element,
57  String a_name,
58  SurfaceAccessibleI::Creation a_create,
59  SurfaceAccessibleI::Writable
60  a_writable);
61 virtual sp<SurfaceAccessorI> accessor(String a_node,
62  SurfaceAccessibleI::Element a_element,
63  SurfaceAccessibleI::Attribute
64  a_attribute,
65  SurfaceAccessibleI::Creation a_create,
66  SurfaceAccessibleI::Writable
67  a_writable);
68 
69  using SurfaceAccessibleBase::discard;
70 
71 virtual BWORD discard(SurfaceAccessibleI::Element a_element,
72  String a_name);
73 
74 #ifdef FE_HOUDINI_USE_GA
75 virtual sp<SpannedRange> atomize(AtomicChange a_atomicChange,
76  String a_group,U32 a_desiredCount);
77 
78 virtual void preparePaging(AtomicChange a_atomicChange,
79  String a_group);
80 virtual I32 pointPage(U32 a_pointIndex) const;
81 virtual I32 primitivePage(U32 a_primitiveIndex) const;
82 #endif
83 
85 
86 virtual sp<SurfaceI> surface(String a_group,
87  SurfaceI::Restrictions a_restrictions);
88 
89  using SurfaceAccessibleBase::subSurface;
90 
91 virtual sp<SurfaceI> subSurface(U32 a_subIndex,String a_group,
92  SurfaceI::Restrictions a_restrictions);
93 
94  using SurfaceAccessibleBase::append;
95 
96 virtual void append(sp<SurfaceAccessibleI>
97  a_spSurfaceAccessibleI,
98  const SpatialTransform* a_pTransform);
99 
100 virtual void instance(sp<SurfaceAccessibleI>
101  a_spSurfaceAccessibleI,
103  a_rTransformArray);
104 
105 virtual sp<MultiGroup> generateGroup(
106  SurfaceAccessibleI::Element a_element,
107  String a_groupString);
108 
109  class MultiGroupHoudini:
110  public MultiGroup,
111  public CastableAs<MultiGroupHoudini>
112  {
113  public:
114  MultiGroupHoudini(void):
115  m_pSolitaryGroup(NULL) {}
116  virtual ~MultiGroupHoudini(void) {}
117 
118  virtual void add(I32 a_index);
119  virtual void remove(I32 a_index);
120 
121  void setSolitaryGroup(GA_ElementGroup* a_pSolitaryGroup)
122  { m_pSolitaryGroup=a_pSolitaryGroup; }
123 
124  private:
125  GA_ElementGroup* m_pSolitaryGroup;
126  };
127  //* Houdini specific
128  void setGdp(const GU_Detail* a_pGdp);
129  void setGdpChangeable(GU_Detail* a_pGdp);
130 const GU_Detail* gdp(void) { return m_pGdp; }
131  GU_Detail* gdpChangeable(void) { return m_pGdpChangeable; }
132 
133  protected:
134 
135 virtual void reset(void);
136 
137 #ifdef FE_HOUDINI_USE_GA
138 static GA_AttributeOwner attributeOwner(
139  SurfaceAccessibleI::Element a_element);
140 #else
141 #endif
142 
143  private:
144 // sp<SpannedRange> atomizeCrossover(AtomicChange a_atomicChange,
145 // String a_group);
146 
147  void harden(sp<SurfaceAccessorHoudini>& rspAccessor);
148 
149  sp<SurfaceAccessorHoudini> accessor(void);
150  sp<SurfaceAccessorI> accessorOf(sp<SurfaceAccessorI> a_spAccessor);
151 
152  void initPrimitiveMap(void);
153  I32 lookupPrimitive(I32 a_surfaceIndex) const;
154 
155 const GU_Detail* m_pGdp;
156  GU_Detail* m_pGdpChangeable;
157  BWORD m_selfGdp;
158 
159  sp<SurfaceI> m_spSurfaceI;
160  std::map<I32,I32> m_primitiveMap;
161  BWORD m_hasDiscretePolygons;
162  Array<I32> m_pageOfPoint;
163  Array<I32> m_pageOfPrimitive;
164 
165 #if FE_HOUDINI_HARDENING
166  public:
168  private:
169  std::map<String, hp<SurfaceAccessorHoudini::Hardening> > m_hardeningMap;
170 #endif
171 };
172 
173 } /* namespace ext */
174 } /* namespace fe */
175 
176 #endif /* __houdini_SurfaceAccessibleHoudini_h__ */
Common Functionality for Accessible Surface.
Definition: SurfaceAccessibleBase.h:20
virtual sp< SurfaceI > surface(void)
Return current underlying SurfaceI.
Definition: SurfaceAccessibleBase.h:143
Smart pointer used with types represented by BaseType.
Definition: Instance.h:28
kernel
Definition: namespace.dox:3
virtual void bind(Instance a_instance)
associate with model data
Definition: SurfaceAccessibleHoudini.h:32
Houdini Surface Binding.
Definition: SurfaceAccessibleHoudini.h:20
virtual void bind(Instance a_instance)
associate with model data
Definition: SurfaceAccessibleBase.h:31
Automatically reference-counted string container.
Definition: String.h:128
Wrapper for std::vector.
Definition: Array.h:21
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
virtual BWORD isBound(void)
Return true if surface is available.
Definition: SurfaceAccessibleHoudini.h:35
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192
virtual sp< SurfaceAccessorI > accessor(String a_node, Element a_element, String a_name, Creation a_create, Writable a_writable)
Return access to an attribute.
Definition: SurfaceAccessibleBase.h:87