HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_AIFStdInterp.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GA_AIFStdInterp.h ( GA Library, C++)
7  *
8  * COMMENTS: Attribute Interface for Interpolation
9  */
10 
11 #ifndef __GA_AIFStdInterp__
12 #define __GA_AIFStdInterp__
13 
14 #include "GA_API.h"
15 #include "GA_AIFInterp.h"
16 #include "GA_Range.h"
17 #include "GA_Types.h"
18 
19 #include <SYS/SYS_Types.h>
20 
21 class GA_Attribute;
22 class GA_WeightedSum;
23 
24 
25 /// @brief Generic implementation of the GA_AIFInterp interface using AIFTuple
26 ///
27 /// The GA_AIFInterp class provides a pure virtual implementation requiring
28 /// developers to implement all specializations of the methods. This class
29 /// provides these specializations using the AIFTuple methods to get/set
30 /// data.
31 ///
32 /// As a developer, you may want to provide the GA_AIFInterp interface, but
33 /// may not want to have to provide all the specialized methods. You can
34 /// subclass from this interface (rather than GA_AIFInterp directly).
35 ///
36 /// However, <b>be warned</b> that if the GA_AIFInterp iterface changes,
37 /// you may end up missing opportunities for specialization.
38 /// @see GA_AIFMath, GA_AIFStdMath
39 ///
40 class GA_API GA_AIFStdInterp : public GA_AIFInterp
41 {
42 public:
44  virtual ~GA_AIFStdInterp();
45 
46  /// Note: Weighted sums can only be performed on a single element, and thus
47  /// don't have a generic GA_AttributeOperand method.
48  /// These methods @b must be implemented for an interpolation interface.
49  virtual bool startSum(GA_Attribute &d, GA_Offset di,
50  const GA_WeightedSum &sum) const = 0;
51  virtual bool addSum(GA_Attribute &d, GA_Offset di,
52  const GA_WeightedSum &sum,
53  const GA_Attribute &a, GA_Offset ai) const = 0;
54  virtual bool endSum(GA_Attribute &d, GA_Offset di,
55  const GA_WeightedSum &sum,
56  fpreal scale_factor = 1) const = 0;
57 
58  // Specializations of some of the common methods
59  virtual bool lerp(GA_Attribute &d, GA_Offset di,
60  const GA_Attribute &a, GA_Offset ai,
61  const GA_Attribute &b, GA_Offset bi,
62  fpreal t) const;
63  virtual bool lerp(GA_Attribute &d, const GA_Range &di,
64  const GA_Attribute &a, const GA_Range &ai,
65  const GA_Attribute &b, const GA_Range &bi,
66  fpreal t) const;
67  virtual bool lerp(GA_Attribute &d, const GA_Range &di,
68  const GA_Attribute &a, const GA_Range &ai,
69  const GA_Attribute &b, const GA_Range &bi,
70  const GA_Attribute &t, const GA_Range &ti)const;
71 
72  virtual bool smooth(GA_Attribute &d, GA_Offset di,
74  const GA_Attribute &a, GA_Offset ai) const = 0;
75  virtual bool smooth(GA_Attribute &d, const GA_Range &di,
77  const GA_Attribute &a, const GA_Range &ai)const;
78 
79  virtual bool fit(GA_Attribute &d, GA_Offset di,
80  const GA_Attribute &a, GA_Offset ai,
81  fpreal omin, fpreal omax,
82  fpreal nmin, fpreal nmax) const = 0;
83  virtual bool fit(GA_Attribute &d, const GA_Range &di,
84  const GA_Attribute &a, const GA_Range &ai,
85  fpreal omin, fpreal omax,
86  fpreal nmin, fpreal nmax) const = 0;
87 
88  /// @{
89  /// Methods implemented in GA_AIFInterp
90  GA_AIFINTERP_OPERAND_METHODS(GA_AIFInterp)
91  /// @}
92 };
93 
94 #endif
Definition of a geometry attribute.
Definition: GA_Attribute.h:190
virtual bool lerp(GA_AttributeOperand &d, GA_AttributeOperand &a, GA_AttributeOperand &b, GA_AttributeOperand &t) const
d = SYSlerp(a, b, t);
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
Context to keep track of weighted sums.
#define GA_API
Definition: GA_API.h:12
virtual bool fit(GA_AttributeOperand &d, GA_AttributeOperand &a, GA_AttributeOperand &omin, GA_AttributeOperand &omax, GA_AttributeOperand &nmin, GA_AttributeOperand &nmax) const
d = SYSfit(a, omin, omax, nmin, nmax);
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_Size GA_Offset
Definition: GA_Types.h:617
const std::enable_if<!VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:133
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
double fpreal
Definition: SYS_Types.h:270
virtual bool smooth(GA_AttributeOperand &d, GA_AttributeOperand &min, GA_AttributeOperand &max, GA_AttributeOperand &t) const
d = SYSsmooth(min, max, t);
#define GA_AIFINTERP_OPERAND_METHODS(BASECLASS)
Definition: GA_AIFInterp.h:253
virtual bool endSum(GA_Attribute &d, GA_Offset di, const GA_WeightedSum &sum, fpreal scale_factor=1) const =0
Attribute Interface class to perform interpolation operations on attributes.
const std::enable_if<!VecTraits< T >::IsVec, T >::type & min(const T &a, const T &b)
Definition: Composite.h:129
Generic implementation of the GA_AIFInterp interface using AIFTuple.