HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_GenericHandle.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_GenericHandle.h ( GA Library, C++)
7  *
8  * COMMENTS: A set of classes for writing generic algorithms that operate
9  * either on all attributes (using GA_Offset and
10  * GA_AttributeRefMap) or on a floating point tuple (using
11  * float, UT_Vector3, UT_Vector4, UT_Matrix3, UT_Matrix4).
12  * Algorithms must be written using the set of arithmetic
13  * operations defined in GA_GenericMath, which must also match
14  * those in GA_AttributeRefMapDestHandle.
15  *
16  * The classes are:
17  * - GA_GenericHandle
18  * - GA_GenericMath
19  * - GA_GenericTemp
20  */
21 
22 #ifndef __GA_GenericHandle__
23 #define __GA_GenericHandle__
24 
25 #include "GA_API.h"
26 #include "GA_Attribute.h"
28 #include "GA_Detail.h"
29 #include "GA_Handle.h"
30 #include "GA_PwHandle.h"
31 #include "GA_Types.h"
32 #include "GA_WeightedSum.h"
33 #include "GA_WorkVertexBuffer.h"
34 
35 #include <UT/UT_Assert.h>
36 #include <UT/UT_Vector4.h>
37 
38 #include <SYS/SYS_Types.h>
39 
40 
41 class GA_AttributeRefMap;
42 
43 
44 /// Homogenize/dehomogenize that only operate on UT_Vector4
45 namespace GA_Homogenize
46 {
47  template <typename T> static inline void homogenize(T &val) {}
48  template <> inline void homogenize<UT_Vector4>(UT_Vector4 &val)
49  { val.homogenize(); }
50 
51  template <typename T> static inline void dehomogenize(T &val) {}
52  template <> inline void dehomogenize<UT_Vector4>(UT_Vector4 &val)
53  { val.dehomogenize(); }
54 }
55 
56 /// Read-only generic handle.
57 ///
58 /// The handle provides read-only access to attributedata.
59 /// The @c T template parameter can be specialized with
60 /// - float
61 /// - UT_Vector2
62 /// - UT_Vector3
63 /// - UT_Vector4 (see specializations below)
64 /// - UT_Matrix3
65 /// - UT_Matrix4
66 /// - GA_Offset (see specializations below)
67 /// The @c T_OWNER parameter can be specialized with
68 /// - GA_ATTRIB_POINT @n
69 /// Point offsets will be passeed to math.getValue(). Only point
70 /// attributes will be modified for GA_Offset specializations.
71 /// - GA_ATTRIB_VERTEX
72 /// Vertex offsets must be passed to math.getValue(). Both point and
73 /// vertex attributes will be modified with the GA_Offset specialization.
74 ///
75 /// The offsets passed to @c getValue() must match the @c T_OWNER template
76 /// parameter.
77 template <typename T, GA_AttributeOwner T_OWNER>
79 {
80 public:
81  GA_ROGenericHandle(const GA_Attribute *attr, int component=0, bool forceisp=false)
82  : myHandle(SYSconst_cast(attr))
83  , myComponent(component)
84  , myConst(true)
85  , myIsRational(attr->getTypeInfo() == GA_TYPE_HPOINT ||
86  ((attr == attr->getDetail().getP() || forceisp)
87  && attr->getDetail().getPwAttribute()))
88  , myIsForcedP(forceisp)
89  {}
90 
91  const GA_Attribute *getAttribute() const
92  { return myHandle.getAttribute(); }
93  bool isRational() const
94  { return myIsRational; }
95 
96  T getValue(GA_Offset off) const
97  {
99  const GA_Attribute *attr = myHandle.getAttribute();
100  T val;
101  if (T_OWNER == GA_ATTRIB_POINT)
102  {
103  UT_ASSERT_P(attr->getOwner() == GA_ATTRIB_POINT);
104  val = myHandle.get(off, myComponent);
105  }
106  else if (attr->getOwner() == GA_ATTRIB_POINT)
107  {
108  val = myHandle.get(attr->getDetail().vertexPoint(off),
109  myComponent);
110  }
111  else
112  {
113  val = myHandle.get(off, myComponent);
114  }
115  return val;
116  }
118  {
119  // Only specialization for UT_Vector4 needs homogenization.
120  return getValue(off);
121  }
122  bool isForcedP() const
123  { return myIsForcedP; }
124 
125 protected:
128  bool myConst;
131 };
132 
133 /// Specialization of GA_ROGenericHandle for GA_ATTRIB_POINT offsets
134 template <typename T>
136  : public GA_ROGenericHandle<T, GA_ATTRIB_POINT>
137 {
138 public:
139  GA_ROGenericHandlePoint(const GA_Attribute *attr, int component=0)
140  : GA_ROGenericHandle<T, GA_ATTRIB_POINT>(attr, component)
141  {
142  }
143 };
144 
145 /// Specialization of GA_ROGenericHandle for GA_ATTRIB_VERTEX offsets
146 template <typename T>
148  : public GA_ROGenericHandle<T, GA_ATTRIB_VERTEX>
149 {
150 public:
151  GA_ROGenericHandleVertex(const GA_Attribute *attr, int component=0)
152  : GA_ROGenericHandle<T, GA_ATTRIB_VERTEX>(attr, component)
153  {
154  }
155  GA_ROGenericHandleVertex(const GA_Attribute *attr, bool forceisp)
156  : GA_ROGenericHandle<T, GA_ATTRIB_VERTEX>(attr, 0, forceisp)
157  {
158  }
159 };
160 
161 /// Read-Write access to generic attribute data
162 ///
163 /// Like GA_ROGenericHandle, but also provides a method to write to the
164 /// attribute. The offsets passed to set value must match the @c T_OWNER
165 /// template parameter.
166 template <typename T, GA_AttributeOwner T_OWNER>
168  : public GA_ROGenericHandle<T, T_OWNER>
169 {
170 public:
172 
173  GA_RWGenericHandle(GA_Attribute *attr, int component=0)
174  : GA_ROGenericHandle<T, T_OWNER>(attr, component)
175  {
176  Base::myConst = false;
177  }
178 
179  void setValue(GA_Offset off, const T &val) const
180  {
182  const GA_Attribute *attr = Base::myHandle.getAttribute();
183  if (T_OWNER == GA_ATTRIB_POINT)
184  {
187  }
188  else if (attr->getOwner() == GA_ATTRIB_POINT)
189  {
190  GA_Offset ptoff = attr->getDetail().vertexPoint(off);
191  Base::myHandle.set(ptoff, Base::myComponent, val);
192  }
193  else
194  {
196  }
197  }
198 };
199 
200 /// Specialization of GA_RWGenericHandle for GA_ATTRIB_POINT offsets
201 template <typename T>
203  : public GA_RWGenericHandle<T, GA_ATTRIB_POINT>
204 {
205 public:
206  GA_RWGenericHandlePoint(GA_Attribute *attr, int component=0)
207  : GA_RWGenericHandle<T, GA_ATTRIB_POINT>(attr, component)
208  {
209  }
210 };
211 
212 /// Specialization of GA_RWGenericHandle for GA_ATTRIB_VERTEX offsets
213 template <typename T>
215  : public GA_RWGenericHandle<T, GA_ATTRIB_VERTEX>
216 {
217 public:
218  GA_RWGenericHandleVertex(GA_Attribute *attr, int component=0)
219  : GA_RWGenericHandle<T, GA_ATTRIB_VERTEX>(attr, component)
220  {
221  }
222 };
223 
224 /// Template math for operating on generic handles
225 ///
226 /// This template is specialized to work on @c float, @c UT_Vector3, @c
227 /// UT_Vector4, and other POD data types.
228 ///
229 /// The offsets passed in to methods must match the @c T_OWNER template
230 /// parameter.
231 template <typename T, GA_AttributeOwner T_OWNER>
233 {
234 public:
236  : myHandle(h) {}
237 
238  bool setElement(T &val)
239  { myDest = &val; return true; }
240 
241  // Source/destination operations
242  void copy(GA_Offset source_index) const
243  { *myDest = myHandle.getValue(source_index); }
244  void add(GA_WeightedSum &sum,
245  GA_Offset source_index,
246  fpreal w) const
247  {
248  sum.advance(w);
249  *myDest += myHandle.getValue(source_index)*w;
250  }
251  void addH(GA_WeightedSum &sum,
252  GA_Offset source_index,
253  fpreal w) const
254  {
255  sum.advance(w);
256  *myDest += myHandle.getHomogeneous(source_index)*w;
257  }
258 
259  // Weighted sum
260  void startSum(const GA_WeightedSum &sum) const
261  { *myDest = 0; }
262  void startHSum(const GA_WeightedSum &sum) const
263  { *myDest = 0; }
264  void finishSum(const GA_WeightedSum &sum,
265  fpreal normalization=1) const
266  {
267  *myDest *= normalization;
268  }
269  void finishHSum(const GA_WeightedSum &sum,
270  fpreal normalization=1) const
271  {
272  *myDest *= normalization;
273  }
274 
275  // Comparsion
276  bool isEqual(const T &val) const
277  { return *myDest == val; }
278  bool isAlmostEqual(const T &val) const
279  { return *myDest == val; }
280 
281  // Destination operations
282  void zero() const { *myDest = 0; }
283 
284  void multiply(fpreal scale) const
285  { *myDest *= scale; }
286 
287  void copyDest(T val) const { *myDest = val; }
288  void addDest(T val) const { *myDest += val; }
289 
290  void subDest(T val) const { *myDest -= val; }
291  void lerpDest(T s0, T s1, fpreal t) const
292  { *myDest = s0 + (s1-s0)*t; }
293 
294  void addDest(GA_WeightedSum &sum, T val, fpreal w) const
295  {
296  sum.advance(w);
297  *myDest += val*w;
298  }
299  void addHDest(GA_WeightedSum &sum, T val, fpreal w) const
300  {
301  sum.advance(w);
302  *myDest += GA_Homogenize::homogenize(val)*w;
303  }
305  {
306  if (myHandle.isRational())
307  {
308  for (int i = 0; i < size; i++)
309  GA_Homogenize::dehomogenize(data[i]);
310  }
311  }
312 
313 private:
314  const GA_ROGenericHandle<T, T_OWNER> &myHandle;
315  T *myDest;
316 };
317 
318 /// Specialization of GA_GenericMath for GA_ATTRIB_POINT offsets
319 template <typename T>
321  : public GA_GenericMath<T, GA_ATTRIB_POINT>
322 {
323 public:
326  {
327  }
328 };
329 
330 /// Specialization of GA_GenericMath for GA_ATTRIB_VERTEX offsets
331 template <typename T>
333  : public GA_GenericMath<T, GA_ATTRIB_VERTEX>
334 {
335 public:
338  {
339  }
340 };
341 
342 /// Template class to construct temporary objects
343 ///
344 /// The default does no initialization on objects and is suitable for POD data.
345 template <typename T, GA_AttributeOwner T_OWNER>
347 {
348 public:
350  void appendVertices(T *, int) {}
351  void clear() {}
352 };
353 
354 /// Specialization of GA_GenericTemp for GA_ATTRIB_POINT types
355 template <typename T>
357  : public GA_GenericTemp<T, GA_ATTRIB_POINT>
358 {
359 public:
362  {}
363 };
364 
365 /// Specialization of GA_GenericTemp for GA_ATTRIB_POINT types
366 template <typename T>
368  : public GA_GenericTemp<T, GA_ATTRIB_VERTEX>
369 {
370 public:
373  {}
374 };
375 
376 // ----------------------------------------------------------
377 // Specializations for GA_Offset
378 // ----------------------------------------------------------
379 
380 /// Specialization of GA_ROGenericHandle for GA_Offset
381 template <GA_AttributeOwner T_OWNER>
383 {
384 public:
386  : myMap(map)
387  {
388  UT_ASSERT(component == 0 &&
389  "component operations not supported on GA_Offset handles");
390  }
391 
392  void setValue(GA_Offset, const GA_Offset &) const;
393  const GA_Attribute *getAttribute() const { return 0; }
394  bool isRational() const { return false; }
395  bool isForcedP() const { return false; }
396  GA_AttributeRefMap &getMap() const { return myMap; }
397 
398 private:
399  GA_AttributeRefMap &myMap;
400 };
401 
402 /// Specialization of GA_ROGenericHandlePoint for GA_Offset
403 template <>
405  : public GA_ROGenericHandle<GA_Offset, GA_ATTRIB_POINT>
406 {
407 public:
409  : GA_ROGenericHandle<GA_Offset, GA_ATTRIB_POINT>(map, component)
410  { }
411 };
412 
413 /// Specialization of GA_ROGenericHandleVertex for GA_Offset
414 template <>
416  : public GA_ROGenericHandle<GA_Offset, GA_ATTRIB_VERTEX>
417 {
418 public:
420  : GA_ROGenericHandle<GA_Offset, GA_ATTRIB_VERTEX>(map, component)
421  { }
422 };
423 
424 /// Specialization of GA_RWGenericHandle for GA_Offset
425 template <GA_AttributeOwner T_OWNER>
427  : public GA_ROGenericHandle<GA_Offset, T_OWNER>
428 {
429 public:
431 
432  GA_RWGenericHandle(GA_AttributeRefMap &map, int component=0)
433  : GA_ROGenericHandle<GA_Offset, T_OWNER>(map, component)
434  {
435  }
436 
437  void setValue(GA_Offset dest, const GA_Offset &src) const
438  {
439  if (T_OWNER == GA_ATTRIB_POINT)
440  {
441  Base::getMap().copyValue(GA_ATTRIB_POINT, dest,
442  GA_ATTRIB_POINT, src);
443  }
444  else
445  {
446  Base::getMap().copyValue(GA_ATTRIB_VERTEX, dest,
447  GA_ATTRIB_VERTEX, src);
448  }
449  }
450 private:
451 };
452 
453 /// Specialization of GA_GenericMath for GA_Offset
454 template <GA_AttributeOwner T_OWNER>
455 class GA_GenericMath<GA_Offset, T_OWNER>
456  : public GA_AttributeRefMapDestHandle<T_OWNER>
457 {
458 public:
460 
462  : GA_AttributeRefMapDestHandle<T_OWNER>(h.getMap()) {}
463 
465  {
466  for (int i = 0; i < size; i++)
467  {
468  Base::setElement(data[i]);
469  Base::dehomogenize();
470  }
471  }
472 };
473 
474 /// Specialization of GA_GenericMathPoint for GA_Offset
475 template <>
477  : public GA_GenericMath<GA_Offset, GA_ATTRIB_POINT>
478 {
479 public:
482  {
483  }
484 };
485 
486 /// Specialization of GA_GenericMathVertex for GA_Offset
487 template <>
489  : public GA_GenericMath<GA_Offset, GA_ATTRIB_VERTEX>
490 {
491 public:
494  {
495  }
496 };
497 
498 
499 /// Specialization of GA_GenericTemp for GA_Offset
500 template <GA_AttributeOwner T_OWNER>
501 class GA_GenericTemp<GA_Offset, T_OWNER>
502 {
503 public:
505  : myBuffer(gah.getMap().getVertexPool()) {}
506 
508  {
509  if (T_OWNER == GA_ATTRIB_POINT)
510  myBuffer.appendPoints(data, size);
511  else
512  myBuffer.appendVertices(data, size);
513  }
514  void clear()
515  { myBuffer.clear(); }
516 
517 private:
518  GA_WorkVertexBuffer myBuffer;
519 };
520 
521 /// Specialization of GA_GenericTempPoint for GA_Offset
522 template <>
524  : public GA_GenericTemp<GA_Offset, GA_ATTRIB_POINT>
525 {
526 public:
529  {}
530 };
531 
532 /// Specialization of GA_GenericTempVertex for GA_Offset
533 template <>
535  : public GA_GenericTemp<GA_Offset, GA_ATTRIB_VERTEX>
536 {
537 public:
540  {}
541 };
542 
543 /// Specialization for UT_Vector4, so that (P,Pw) attribute pair will work.
544 template <GA_AttributeOwner T_OWNER>
546 {
547 public:
548  GA_ROGenericHandle(const GA_Attribute *attr, int component=0, bool forceisp=false)
549  : myHandle(SYSconst_cast(attr))
550  , myConst(true)
551  , myIsRational(attr->getTypeInfo() == GA_TYPE_HPOINT ||
552  ((attr == attr->getDetail().getP() || forceisp)
553  && attr->getDetail().getPwAttribute()))
554  , myIsForcedP(forceisp)
555  {
556  UT_ASSERT_P(component == 0);
557  if (!myHandle.isValid() && attr && (attr == attr->getDetail().getP() || forceisp))
558  myPwHandle = GA_PwHandleRW(SYSconst_cast(attr), SYSconst_cast(attr->getDetail().getPwAttribute()));
559  }
560 
561  const GA_Attribute *getAttribute() const
562  { return myHandle.isValid() ? myHandle.getAttribute() : myPwHandle.getAttribute(); }
563  bool isRational() const
564  { return myIsRational; }
565  bool isValid() const
566  { return getAttribute() != NULL; }
567 
569  {
570  UT_ASSERT_P(myHandle.isValid() != myPwHandle.isValid());
571  const GA_Attribute *attr = getAttribute();
572  UT_Vector4 val;
573  if (T_OWNER == GA_ATTRIB_POINT)
574  {
575  UT_ASSERT_P(attr->getOwner() == GA_ATTRIB_POINT);
576  val = myHandle.isValid() ? myHandle.get(off)
577  : myPwHandle.get(off);
578  }
579  else if (attr->getOwner() == GA_ATTRIB_POINT)
580  {
581  GA_Offset ptoff = attr->getDetail().vertexPoint(off);
582  val = myHandle.isValid()
583  ? myHandle.get(ptoff)
584  : myPwHandle.get(ptoff);
585  }
586  else
587  {
588  val = myHandle.isValid() ? myHandle.get(off)
589  : myPwHandle.get(off);
590  }
591  return val;
592  }
594  {
595  UT_Vector4 val = getValue(off);
596  if (isRational())
597  val.homogenize();
598  return val;
599  }
600  bool isForcedP() const
601  { return myIsForcedP; }
602 protected:
604  bool myConst;
608 };
609 
610 template <GA_AttributeOwner T_OWNER>
612  : public GA_ROGenericHandle<UT_Vector4, T_OWNER>
613 {
614 public:
616 protected:
617  using Base::myHandle;
618  using Base::myPwHandle;
619 public:
620 
621  GA_RWGenericHandle(GA_Attribute *attr, int component=0)
622  : Base(attr, component)
623  {
624  Base::myConst = false;
625  }
626 
627  void setValue(GA_Offset off, const UT_Vector4 &val) const
628  {
629  UT_ASSERT_P(myHandle.isValid() != myPwHandle.isValid());
631  const GA_Attribute *attr = Base::getAttribute();
632  if (T_OWNER == GA_ATTRIB_POINT)
633  {
635  if (myHandle.isValid())
636  myHandle.set(off, val);
637  else
638  myPwHandle.set(off, val);
639  }
640  else if (attr->getOwner() == GA_ATTRIB_POINT)
641  {
642  GA_Offset ptoff = attr->getDetail().vertexPoint(off);
643  if (myHandle.isValid())
644  myHandle.set(ptoff, val);
645  else
646  myPwHandle.set(ptoff, val);
647  }
648  else
649  {
650  if (myHandle.isValid())
651  myHandle.set(off, val);
652  else
653  myPwHandle.set(off, val);
654  }
655  }
656 };
657 
658 #endif
GA_ROGenericHandle< UT_Vector4, T_OWNER > Base
Definition of a geometry attribute.
Definition: GA_Attribute.h:190
void finishSum(const GA_WeightedSum &sum, fpreal normalization=1) const
GA_RWGenericHandle< GA_Offset, T_OWNER > Base
bool setElement(T &val)
void startSum(const GA_WeightedSum &sum) const
GA_GenericMath(const GA_ROGenericHandle< GA_Offset, T_OWNER > &h)
bool isRational() const
png_voidp s1
Definition: png.h:2193
Specialization of GA_RWGenericHandle for GA_ATTRIB_POINT offsets.
const GA_Detail & getDetail() const
Specialization of GA_GenericMath for GA_ATTRIB_POINT offsets.
GA_ROGenericHandleVertex(GA_AttributeRefMap &map, int component=0)
void dehomogenizeData(GA_Offset *data, int size)
bool isAlmostEqual(const T &val) const
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
Definition: SYS_Types.h:127
Specialization of GA_ROGenericHandleVertex for GA_Offset.
void add(GA_WeightedSum &sum, GA_Offset source_index, fpreal w) const
GA_RWGenericHandle(GA_AttributeRefMap &map, int component=0)
GA_Attribute * getP()
Convenience method to access the P attribute.
Definition: GA_Detail.h:163
Specialization of GA_RWGenericHandle for GA_ATTRIB_VERTEX offsets.
GA_ROGenericHandleVertex(const GA_Attribute *attr, int component=0)
GA_RWGenericHandle(GA_Attribute *attr, int component=0)
Context to keep track of weighted sums.
GA_ROGenericHandle(const GA_Attribute *attr, int component=0, bool forceisp=false)
Specialization of GA_RWGenericHandle for GA_Offset.
png_uint_32 i
Definition: png.h:2877
const GA_Attribute * getAttribute() const
Specialization of GA_ROGenericHandle for GA_Offset.
GA_ATINumeric * getAttribute() const
Definition: GA_Handle.h:305
GLsizeiptr size
Definition: glcorearb.h:663
void startHSum(const GA_WeightedSum &sum) const
void copyDest(T val) const
void lerpDest(T s0, T s1, fpreal t) const
GA_Size GA_Offset
Definition: GA_Types.h:617
void appendVertices(GA_Offset *data, int size)
GA_GenericTemp(const GA_ROGenericHandle< T, T_OWNER > &)
GA_API const UT_StringHolder scale
void homogenize< UT_Vector4 >(UT_Vector4 &val)
void appendVertices(T *, int)
GA_GenericTempPoint(const GA_ROGenericHandlePoint< T > &h)
GA_AttributeRefMap & getMap() const
void setValue(GA_Offset off, const UT_Vector4 &val) const
GA_ROGenericHandle(GA_AttributeRefMap &map, int component)
GA_GenericTemp(const GA_ROGenericHandle< GA_Offset, T_OWNER > &gah)
void addDest(GA_WeightedSum &sum, T val, fpreal w) const
void addH(GA_WeightedSum &sum, GA_Offset source_index, fpreal w) const
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:125
void setValue(GA_Offset off, const T &val) const
GA_ROGenericHandle< T, T_OWNER > Base
void copy(GA_Offset source_index) const
A handle to simplify manipulation of multiple attributes.
Specialization of GA_GenericTemp for GA_ATTRIB_POINT types.
SYS_FORCE_INLINE T get(GA_Offset off, int comp=0) const
Definition: GA_Handle.h:191
SYS_FORCE_INLINE GA_Offset vertexPoint(GA_Offset vertex) const
Given a vertex, return the point it references.
Definition: GA_Detail.h:473
GLboolean * data
Definition: glcorearb.h:130
void multiply(fpreal scale) const
GA_ROGenericHandlePoint(const GA_Attribute *attr, int component=0)
void dehomogenize< UT_Vector4 >(UT_Vector4 &val)
T getHomogeneous(GA_Offset off) const
GA_RWGenericHandle(GA_Attribute *attr, int component=0)
GA_GenericTempPoint(const GA_ROGenericHandlePoint< GA_Offset > &h)
SYS_FORCE_INLINE bool isValid() const
Definition: GA_Handle.h:182
GA_RWGenericHandleVertex(GA_Attribute *attr, int component=0)
void zero() const
GA_AttributeOwner getOwner() const
void addDest(T val) const
const GA_Attribute * getAttribute() const
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
Specialization of GA_ROGenericHandle for GA_ATTRIB_POINT offsets.
double fpreal
Definition: SYS_Types.h:270
GA_RWHandleT< T > myHandle
GA_GenericMath(const GA_ROGenericHandle< T, T_OWNER > &h)
bool isForcedP() const
GA_ROGenericHandleVertex(const GA_Attribute *attr, bool forceisp)
SYS_FORCE_INLINE void set(GA_Offset off, const T &val) const
Definition: GA_Handle.h:320
Specialization of GA_GenericMath for GA_ATTRIB_VERTEX offsets.
GA_GenericMathPoint(const GA_ROGenericHandlePoint< T > &h)
Specialization for UT_Vector4, so that (P,Pw) attribute pair will work.
void advance(fpreal weight)
UT_Vector4 getValue(GA_Offset off) const
GA_RWGenericHandlePoint(GA_Attribute *attr, int component=0)
GLuint GLfloat * val
Definition: glcorearb.h:1607
A handle to simplify manipulation of multiple attributes.
GA_GenericTempVertex(const GA_ROGenericHandleVertex< GA_Offset > &h)
void homogenize(void)
Express the point in homogeneous coordinates or vice-versa.
Definition: UT_Vector4.h:417
GA_GenericMathVertex(const GA_ROGenericHandleVertex< T > &h)
GA_GenericTempVertex(const GA_ROGenericHandleVertex< T > &h)
Specialization of GA_GenericTemp for GA_ATTRIB_POINT types.
void setValue(GA_Offset dest, const GA_Offset &src) const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:126
Specialization of GA_ROGenericHandle for GA_ATTRIB_VERTEX offsets.
UT_Vector4 getHomogeneous(GA_Offset off) const
const GA_Attribute * getAttribute() const
GA_GenericMathPoint(const GA_ROGenericHandlePoint< GA_Offset > &h)
void dehomogenizeData(T *data, int size)
Specialization of GA_ROGenericHandlePoint for GA_Offset.
bool isEqual(const T &val) const
void finishHSum(const GA_WeightedSum &sum, fpreal normalization=1) const
GA_ROGenericHandlePoint(GA_AttributeRefMap &map, int component=0)
void addHDest(GA_WeightedSum &sum, T val, fpreal w) const
T getValue(GA_Offset off) const
void subDest(T val) const
GA_AttributeRefMapDestHandle< T_OWNER > Base
GA_ROGenericHandle(const GA_Attribute *attr, int component=0, bool forceisp=false)
GA_GenericMathVertex(const GA_ROGenericHandleVertex< GA_Offset > &h)
GLenum src
Definition: glcorearb.h:1792