Free Electron
SurfaceAccessibleXGen.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 __xgen_SurfaceAccessibleXGen_h__
8 #define __xgen_SurfaceAccessibleXGen_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief XGen Surface Binding
16 
17  @ingroup xgen
18 *//***************************************************************************/
19 class FE_DL_EXPORT SurfaceAccessibleXGen:
21  public ClassSafe<SurfaceAccessibleXGen>
22 {
23  public:
24 
25  class Procedural: public XGenRenderAPI::ProceduralCallbacks
26  {
27  public:
28  Procedural(void);
29  virtual ~Procedural(void);
30 
31  BWORD load(String a_filename,Real a_frame);
32 
33  virtual void flush(const char* a_geomName,
34  XGenRenderAPI::PrimitiveCache* a_cache);
35  virtual void log(const char* a_str);
36 
37  virtual bool get(EBoolAttribute a_attr) const;
38  virtual
39  const char* get(EStringAttribute a_attr) const;
40  virtual float get(EFloatAttribute a_attr) const;
41  virtual
42  const float* get(EFloatArrayAttribute a_attr) const;
43  virtual unsigned int getSize(EFloatArrayAttribute a_attr) const;
44 
45  virtual
46  const char* getOverride(const char* a_name) const;
47  virtual bool getArchiveBoundingBox(
48  const char* a_filename,
49  XGenRenderAPI::bbox& out_bbox) const;
50  virtual void getTransform(float a_time,
51  XGenRenderAPI::mat44& out_mat) const;
52 
53  void setSurfaceAccessible(
54  sp<SurfaceAccessibleXGen> a_spSurfaceAccessibleXGen)
55  { m_spSurfaceAccessibleXGen=a_spSurfaceAccessibleXGen; }
56  void setSkinContext(sp<SurfaceAccessibleI> a_spSkinContext)
57  { m_spSkinContext=a_spSkinContext; }
58  void setSkinSurface(sp<SurfaceI> a_spSurfaceI)
59  { m_spSkinSurface=a_spSurfaceI; }
60 
61  void setClearDescription(BWORD a_clearDescription)
62  { m_clearDescription=a_clearDescription; }
63  void setResolution(String a_resolution)
64  { m_resolution=a_resolution; }
65  void setDescription(String a_description)
66  { m_description=a_description; }
67 
68  private:
69 
70  sp<SurfaceAccessibleXGen> m_spSurfaceAccessibleXGen;
71  sp<SurfaceAccessibleI> m_spSkinContext;
72  sp<SurfaceI> m_spSkinSurface;
73  BWORD m_clearDescription;
74  String m_resolution;
75  String m_description;
76 
77  float m_zero;
78  float m_falloffArray[7];
79  };
80 
81  SurfaceAccessibleXGen(void) {}
82 virtual ~SurfaceAccessibleXGen(void) {}
83 
84  //* as SurfaceAccessibleI
85 
87 
88 virtual BWORD load(String a_filename,
89  sp<Catalog> a_spSettings);
90 
91  protected:
92 
93 virtual void reset(void);
94 
95  private:
96  BWORD probeOptions(String a_filename);
97  BWORD importBakedCurves(String a_filename);
98  BWORD importProcedural(String a_filename);
99 
100  std::map<String,String> m_optionMap;
101  std::map<String,String> m_patchMap;
102  Real m_frame;
103 
104  sp<Scope> m_spScope;
105  sp<Layout> m_spLayoutPoint;
106  sp<Layout> m_spLayoutPrimitive;
107  sp<SurfaceAccessibleI> m_spSkinContext;
108 
109  Accessor<SpatialVector> m_aPosition;
110  Array< Accessor<SpatialVector> > m_aMotionArray;
111  Accessor< Array<I32> > m_aVerts;
112  Accessor<Real> m_aRadius;
113  Accessor<Color> m_aColor;
114  Accessor<SpatialVector> m_aNormal;
115  Accessor<String> m_aName;
116  Accessor<String> m_aSurfaceName;
117  Accessor<String> m_aSurfacePart;
119  Accessor<SpatialVector> m_aSurfacePosition;
120  Accessor<SpatialVector> m_aRefSurfacePosition;
121  Accessor<SpatialVector> m_aSurfaceNormal;
122  Accessor<SpatialVector> m_aRefSurfaceNormal;
123 
124  Accessor<SpatialVector> m_aFaceUVW;
125  Accessor<I32> m_aProperties;
126  Accessor<I32> m_aFace;
127  Accessor<I32> m_aPrimitive;
128  Accessor<I32> m_aId;
129  Accessor<Real> m_aLength;
130  Accessor<Real> m_aWidth;
131  Accessor<Real> m_aTaper;
132  Accessor<Real> m_aTaperStart;
133 
134  sp<RecordGroup> m_spPointRG;
135  sp<RecordGroup> m_spPrimRG;
136 
137  I32 m_pointCount;
138 
139  BWORD m_shutter_populated;
140  BWORD m_normal_populated;
141  BWORD m_uv_populated;
142  BWORD m_surfaceP_populated;
143  BWORD m_refSurfaceP_populated;
144  BWORD m_surfaceN_populated;
145  BWORD m_refSurfaceN_populated;
146 };
147 
148 } /* namespace ext */
149 } /* namespace fe */
150 
151 #endif /* __xgen_SurfaceAccessibleXGen_h__ */
Class level locking for thread safety.
Definition: Safe.h:213
kernel
Definition: namespace.dox:3
The main data access class for the data system.
Definition: Accessor.h:128
Automatically reference-counted string container.
Definition: String.h:128
Wrapper for std::vector.
Definition: Array.h:21
Record Surface Binding.
Definition: SurfaceAccessibleRecord.h:20
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
virtual BWORD load(String a_filename, sp< Catalog > a_spSettings)
load model data with settings
Definition: SurfaceAccessibleRecord.cc:247
XGen Surface Binding.
Definition: SurfaceAccessibleXGen.h:19