Free Electron
HoudiniRamp.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_HoudiniRamp_h__
8 #define __houdini_HoudiniRamp_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Ramp in Houdini
17 
18  @ingroup houdini
19 *//***************************************************************************/
20 class FE_DL_EXPORT HoudiniRamp:
21  public MetaRamp,
22  public CastableAs<HoudiniRamp>
23 {
24  public:
25  HoudiniRamp(void) {}
26 virtual ~HoudiniRamp(void) {}
27 
28  //* as RampI
29 virtual U32 entryCount(void) const
30  { return m_ramp.getNodeCount(); }
31 
32 virtual Vector2 entry(U32 a_index) const
33  {
34  const UT_ColorNode* pColorNode=m_ramp.getNode(a_index);
35  return Vector2(pColorNode->t,pColorNode->rgba.r);
36  }
37 
38 virtual Real eval(Real a_u) const
39  {
40  float values[4];
41  m_ramp.rampLookup(a_u,values);
42  return values[0];
43  }
44 
45  UT_Ramp& nativeRamp(void) { return m_ramp; }
46 
47  private:
48 
49  UT_Ramp m_ramp;
50 };
51 
52 } /* namespace ext */
53 } /* namespace fe */
54 
55 #endif /* __houdini_HoudiniRamp_h__ */
Common ramp interface for Houdini, Maya, etc.
Definition: MetaRamp.h:20
kernel
Definition: namespace.dox:3
Ramp in Houdini.
Definition: HoudiniRamp.h:20
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192