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  static bool isAttribRational(const GA_Attribute *attr, bool forceisp)
56  {
57  if (!attr)
58  return false;
59  if (attr->getTypeInfo() == GA_TYPE_HPOINT)
60  return true;
61  if ((attr == attr->getDetail().getP() || forceisp)
62  && attr->getDetail().getPwAttribute())
63  return true;
64  return false;
65  }
66 }
67 
68 /// Read-only generic handle.
69 ///
70 /// The handle provides read-only access to attributedata.
71 /// The @c T template parameter can be specialized with
72 /// - float
73 /// - UT_Vector2
74 /// - UT_Vector3
75 /// - UT_Vector4 (see specializations below)
76 /// - UT_Matrix3
77 /// - UT_Matrix4
78 /// - GA_Offset (see specializations below)
79 /// The @c T_OWNER parameter can be specialized with
80 /// - GA_ATTRIB_POINT @n
81 /// Point offsets will be passeed to math.getValue(). Only point
82 /// attributes will be modified for GA_Offset specializations.
83 /// - GA_ATTRIB_VERTEX
84 /// Vertex offsets must be passed to math.getValue(). Both point and
85 /// vertex attributes will be modified with the GA_Offset specialization.
86 ///
87 /// The offsets passed to @c getValue() must match the @c T_OWNER template
88 /// parameter.
89 template <typename T, GA_AttributeOwner T_OWNER>
91 {
92 public:
93  GA_ROGenericHandle(const GA_Attribute *attr, int component=0, bool forceisp=false)
94  : myHandle(SYSconst_cast(attr))
95  , myComponent(component)
96  , myConst(true)
97  , myIsRational(GA_Homogenize::isAttribRational(attr, forceisp))
98  , myIsForcedP(forceisp)
99  {}
100 
101  const GA_Attribute *getAttribute() const
102  { return myHandle.getAttribute(); }
103  bool isRational() const
104  { return myIsRational; }
105 
106  T getValue(GA_Offset off) const
107  {
109  const GA_Attribute *attr = myHandle.getAttribute();
110  T val;
111  if (T_OWNER == GA_ATTRIB_POINT)
112  {
113  UT_ASSERT_P(attr->getOwner() == GA_ATTRIB_POINT);
114  val = myHandle.get(off, myComponent);
115  }
116  else if (attr->getOwner() == GA_ATTRIB_POINT)
117  {
118  val = myHandle.get(attr->getDetail().vertexPoint(off),
119  myComponent);
120  }
121  else
122  {
123  val = myHandle.get(off, myComponent);
124  }
125  return val;
126  }
128  {
129  // Only specialization for UT_Vector4 needs homogenization.
130  return getValue(off);
131  }
132  bool isForcedP() const
133  { return myIsForcedP; }
134 
135 protected:
138  bool myConst;
141 };
142 
143 /// Specialization of GA_ROGenericHandle for GA_ATTRIB_POINT offsets
144 template <typename T>
146  : public GA_ROGenericHandle<T, GA_ATTRIB_POINT>
147 {
148 public:
149  GA_ROGenericHandlePoint(const GA_Attribute *attr, int component=0)
150  : GA_ROGenericHandle<T, GA_ATTRIB_POINT>(attr, component)
151  {
152  }
153 };
154 
155 /// Specialization of GA_ROGenericHandle for GA_ATTRIB_VERTEX offsets
156 template <typename T>
158  : public GA_ROGenericHandle<T, GA_ATTRIB_VERTEX>
159 {
160 public:
161  GA_ROGenericHandleVertex(const GA_Attribute *attr, int component=0)
162  : GA_ROGenericHandle<T, GA_ATTRIB_VERTEX>(attr, component)
163  {
164  }
165  GA_ROGenericHandleVertex(const GA_Attribute *attr, bool forceisp)
166  : GA_ROGenericHandle<T, GA_ATTRIB_VERTEX>(attr, 0, forceisp)
167  {
168  }
169 };
170 
171 /// Read-Write access to generic attribute data
172 ///
173 /// Like GA_ROGenericHandle, but also provides a method to write to the
174 /// attribute. The offsets passed to set value must match the @c T_OWNER
175 /// template parameter.
176 template <typename T, GA_AttributeOwner T_OWNER>
178  : public GA_ROGenericHandle<T, T_OWNER>
179 {
180 public:
182 
183  GA_RWGenericHandle(GA_Attribute *attr, int component=0)
184  : GA_ROGenericHandle<T, T_OWNER>(attr, component)
185  {
186  Base::myConst = false;
187  }
188 
189  void setValue(GA_Offset off, const T &val) const
190  {
192  const GA_Attribute *attr = Base::myHandle.getAttribute();
193  if (T_OWNER == GA_ATTRIB_POINT)
194  {
197  }
198  else if (attr->getOwner() == GA_ATTRIB_POINT)
199  {
200  GA_Offset ptoff = attr->getDetail().vertexPoint(off);
201  Base::myHandle.set(ptoff, Base::myComponent, val);
202  }
203  else
204  {
206  }
207  }
208 };
209 
210 /// Specialization of GA_RWGenericHandle for GA_ATTRIB_POINT offsets
211 template <typename T>
213  : public GA_RWGenericHandle<T, GA_ATTRIB_POINT>
214 {
215 public:
216  GA_RWGenericHandlePoint(GA_Attribute *attr, int component=0)
217  : GA_RWGenericHandle<T, GA_ATTRIB_POINT>(attr, component)
218  {
219  }
220 };
221 
222 /// Specialization of GA_RWGenericHandle for GA_ATTRIB_VERTEX offsets
223 template <typename T>
225  : public GA_RWGenericHandle<T, GA_ATTRIB_VERTEX>
226 {
227 public:
228  GA_RWGenericHandleVertex(GA_Attribute *attr, int component=0)
229  : GA_RWGenericHandle<T, GA_ATTRIB_VERTEX>(attr, component)
230  {
231  }
232 };
233 
234 /// Template math for operating on generic handles
235 ///
236 /// This template is specialized to work on @c float, @c UT_Vector3, @c
237 /// UT_Vector4, and other POD data types.
238 ///
239 /// The offsets passed in to methods must match the @c T_OWNER template
240 /// parameter.
241 template <typename T, GA_AttributeOwner T_OWNER>
243 {
244 public:
246  : myHandle(h) {}
247 
248  bool setElement(T &val)
249  { myDest = &val; return true; }
250 
251  // Source/destination operations
252  void copy(GA_Offset source_index) const
253  { *myDest = myHandle.getValue(source_index); }
254  void add(GA_WeightedSum &sum,
255  GA_Offset source_index,
256  fpreal w) const
257  {
258  sum.advance(w);
259  *myDest += myHandle.getValue(source_index)*w;
260  }
261  void addH(GA_WeightedSum &sum,
262  GA_Offset source_index,
263  fpreal w) const
264  {
265  sum.advance(w);
266  *myDest += myHandle.getHomogeneous(source_index)*w;
267  }
268 
269  // Weighted sum
270  void startSum(const GA_WeightedSum &sum) const
271  { *myDest = 0; }
272  void startHSum(const GA_WeightedSum &sum) const
273  { *myDest = 0; }
274  void finishSum(const GA_WeightedSum &sum,
275  fpreal normalization=1) const
276  {
277  *myDest *= normalization;
278  }
279  void finishHSum(const GA_WeightedSum &sum,
280  fpreal normalization=1) const
281  {
282  *myDest *= normalization;
283  }
284 
285  // Comparsion
286  bool isEqual(const T &val) const
287  { return *myDest == val; }
288  bool isAlmostEqual(const T &val) const
289  { return *myDest == val; }
290 
291  // Destination operations
292  void zero() const { *myDest = 0; }
293 
294  void multiply(fpreal scale) const
295  { *myDest *= scale; }
296 
297  void copyDest(T val) const { *myDest = val; }
298  void addDest(T val) const { *myDest += val; }
299 
300  void subDest(T val) const { *myDest -= val; }
301  void lerpDest(T s0, T s1, fpreal t) const
302  { *myDest = s0 + (s1-s0)*t; }
303 
304  void addDest(GA_WeightedSum &sum, T val, fpreal w) const
305  {
306  sum.advance(w);
307  *myDest += val*w;
308  }
309  void addHDest(GA_WeightedSum &sum, T val, fpreal w) const
310  {
311  sum.advance(w);
312  *myDest += GA_Homogenize::homogenize(val)*w;
313  }
315  {
316  if (myHandle.isRational())
317  {
318  for (int i = 0; i < size; i++)
319  GA_Homogenize::dehomogenize(data[i]);
320  }
321  }
322 
323 private:
324  const GA_ROGenericHandle<T, T_OWNER> &myHandle;
325  T *myDest;
326 };
327 
328 /// Specialization of GA_GenericMath for GA_ATTRIB_POINT offsets
329 template <typename T>
331  : public GA_GenericMath<T, GA_ATTRIB_POINT>
332 {
333 public:
336  {
337  }
338 };
339 
340 /// Specialization of GA_GenericMath for GA_ATTRIB_VERTEX offsets
341 template <typename T>
343  : public GA_GenericMath<T, GA_ATTRIB_VERTEX>
344 {
345 public:
348  {
349  }
350 };
351 
352 /// Template class to construct temporary objects
353 ///
354 /// The default does no initialization on objects and is suitable for POD data.
355 template <typename T, GA_AttributeOwner T_OWNER>
357 {
358 public:
360  void appendVertices(T *, int) {}
361  void clear() {}
362 };
363 
364 /// Specialization of GA_GenericTemp for GA_ATTRIB_POINT types
365 template <typename T>
367  : public GA_GenericTemp<T, GA_ATTRIB_POINT>
368 {
369 public:
372  {}
373 };
374 
375 /// Specialization of GA_GenericTemp for GA_ATTRIB_POINT types
376 template <typename T>
378  : public GA_GenericTemp<T, GA_ATTRIB_VERTEX>
379 {
380 public:
383  {}
384 };
385 
386 // ----------------------------------------------------------
387 // Specializations for GA_Offset
388 // ----------------------------------------------------------
389 
390 /// Specialization of GA_ROGenericHandle for GA_Offset
391 template <GA_AttributeOwner T_OWNER>
393 {
394 public:
396  : myMap(map)
397  {
398  UT_ASSERT(component == 0 &&
399  "component operations not supported on GA_Offset handles");
400  }
401 
402  void setValue(GA_Offset, const GA_Offset &) const;
403  const GA_Attribute *getAttribute() const { return 0; }
404  bool isRational() const { return false; }
405  bool isForcedP() const { return false; }
406  GA_AttributeRefMap &getMap() const { return myMap; }
407 
408 private:
409  GA_AttributeRefMap &myMap;
410 };
411 
412 /// Specialization of GA_ROGenericHandlePoint for GA_Offset
413 template <>
415  : public GA_ROGenericHandle<GA_Offset, GA_ATTRIB_POINT>
416 {
417 public:
419  : GA_ROGenericHandle<GA_Offset, GA_ATTRIB_POINT>(map, component)
420  { }
421 };
422 
423 /// Specialization of GA_ROGenericHandleVertex for GA_Offset
424 template <>
426  : public GA_ROGenericHandle<GA_Offset, GA_ATTRIB_VERTEX>
427 {
428 public:
430  : GA_ROGenericHandle<GA_Offset, GA_ATTRIB_VERTEX>(map, component)
431  { }
432 };
433 
434 /// Specialization of GA_RWGenericHandle for GA_Offset
435 template <GA_AttributeOwner T_OWNER>
437  : public GA_ROGenericHandle<GA_Offset, T_OWNER>
438 {
439 public:
441 
442  GA_RWGenericHandle(GA_AttributeRefMap &map, int component=0)
443  : GA_ROGenericHandle<GA_Offset, T_OWNER>(map, component)
444  {
445  }
446 
447  void setValue(GA_Offset dest, const GA_Offset &src) const
448  {
449  if (T_OWNER == GA_ATTRIB_POINT)
450  {
451  Base::getMap().copyValue(GA_ATTRIB_POINT, dest,
452  GA_ATTRIB_POINT, src);
453  }
454  else
455  {
456  Base::getMap().copyValue(GA_ATTRIB_VERTEX, dest,
457  GA_ATTRIB_VERTEX, src);
458  }
459  }
460 private:
461 };
462 
463 /// Specialization of GA_GenericMath for GA_Offset
464 template <GA_AttributeOwner T_OWNER>
465 class GA_GenericMath<GA_Offset, T_OWNER>
466  : public GA_AttributeRefMapDestHandle<T_OWNER>
467 {
468 public:
470 
472  : GA_AttributeRefMapDestHandle<T_OWNER>(h.getMap()) {}
473 
475  {
476  for (int i = 0; i < size; i++)
477  {
478  Base::setElement(data[i]);
479  Base::dehomogenize();
480  }
481  }
482 };
483 
484 /// Specialization of GA_GenericMathPoint for GA_Offset
485 template <>
487  : public GA_GenericMath<GA_Offset, GA_ATTRIB_POINT>
488 {
489 public:
492  {
493  }
494 };
495 
496 /// Specialization of GA_GenericMathVertex for GA_Offset
497 template <>
499  : public GA_GenericMath<GA_Offset, GA_ATTRIB_VERTEX>
500 {
501 public:
504  {
505  }
506 };
507 
508 
509 /// Specialization of GA_GenericTemp for GA_Offset
510 template <GA_AttributeOwner T_OWNER>
511 class GA_GenericTemp<GA_Offset, T_OWNER>
512 {
513 public:
515  : myBuffer(gah.getMap().getVertexPool()) {}
516 
518  {
519  if (T_OWNER == GA_ATTRIB_POINT)
520  myBuffer.appendPoints(data, size);
521  else
522  myBuffer.appendVertices(data, size);
523  }
524  void clear()
525  { myBuffer.clear(); }
526 
527 private:
528  GA_WorkVertexBuffer myBuffer;
529 };
530 
531 /// Specialization of GA_GenericTempPoint for GA_Offset
532 template <>
534  : public GA_GenericTemp<GA_Offset, GA_ATTRIB_POINT>
535 {
536 public:
539  {}
540 };
541 
542 /// Specialization of GA_GenericTempVertex for GA_Offset
543 template <>
545  : public GA_GenericTemp<GA_Offset, GA_ATTRIB_VERTEX>
546 {
547 public:
550  {}
551 };
552 
553 /// Specialization for UT_Vector4, so that (P,Pw) attribute pair will work.
554 template <GA_AttributeOwner T_OWNER>
556 {
557 public:
558  GA_ROGenericHandle(const GA_Attribute *attr, int component=0, bool forceisp=false)
559  : myHandle(SYSconst_cast(attr))
560  , myConst(true)
561  , myIsRational(GA_Homogenize::isAttribRational(attr, forceisp))
562  , myIsForcedP(forceisp)
563  {
564  UT_ASSERT_P(component == 0);
565  if (!myHandle.isValid() && attr && (attr == attr->getDetail().getP() || forceisp))
566  myPwHandle = GA_PwHandleRW(SYSconst_cast(attr), SYSconst_cast(attr->getDetail().getPwAttribute()));
567  }
568 
569  const GA_Attribute *getAttribute() const
570  { return myHandle.isValid() ? myHandle.getAttribute() : myPwHandle.getAttribute(); }
571  bool isRational() const
572  { return myIsRational; }
573  bool isValid() const
574  { return getAttribute() != NULL; }
575 
577  {
578  UT_ASSERT_P(myHandle.isValid() != myPwHandle.isValid());
579  const GA_Attribute *attr = getAttribute();
580  UT_Vector4 val;
581  if (T_OWNER == GA_ATTRIB_POINT)
582  {
583  UT_ASSERT_P(attr->getOwner() == GA_ATTRIB_POINT);
584  val = myHandle.isValid() ? myHandle.get(off)
585  : myPwHandle.get(off);
586  }
587  else if (attr->getOwner() == GA_ATTRIB_POINT)
588  {
589  GA_Offset ptoff = attr->getDetail().vertexPoint(off);
590  val = myHandle.isValid()
591  ? myHandle.get(ptoff)
592  : myPwHandle.get(ptoff);
593  }
594  else
595  {
596  val = myHandle.isValid() ? myHandle.get(off)
597  : myPwHandle.get(off);
598  }
599  return val;
600  }
602  {
603  UT_Vector4 val = getValue(off);
604  if (isRational())
605  val.homogenize();
606  return val;
607  }
608  bool isForcedP() const
609  { return myIsForcedP; }
610 protected:
612  bool myConst;
616 };
617 
618 template <GA_AttributeOwner T_OWNER>
620  : public GA_ROGenericHandle<UT_Vector4, T_OWNER>
621 {
622 public:
624 protected:
625  using Base::myHandle;
626  using Base::myPwHandle;
627 public:
628 
629  GA_RWGenericHandle(GA_Attribute *attr, int component=0)
630  : Base(attr, component)
631  {
632  Base::myConst = false;
633  }
634 
635  void setValue(GA_Offset off, const UT_Vector4 &val) const
636  {
637  UT_ASSERT_P(myHandle.isValid() != myPwHandle.isValid());
639  const GA_Attribute *attr = Base::getAttribute();
640  if (T_OWNER == GA_ATTRIB_POINT)
641  {
643  if (myHandle.isValid())
644  myHandle.set(off, val);
645  else
646  myPwHandle.set(off, val);
647  }
648  else if (attr->getOwner() == GA_ATTRIB_POINT)
649  {
650  GA_Offset ptoff = attr->getDetail().vertexPoint(off);
651  if (myHandle.isValid())
652  myHandle.set(ptoff, val);
653  else
654  myPwHandle.set(ptoff, val);
655  }
656  else
657  {
658  if (myHandle.isValid())
659  myHandle.set(off, val);
660  else
661  myPwHandle.set(off, val);
662  }
663  }
664 };
665 
666 #endif
GA_ROGenericHandle< UT_Vector4, T_OWNER > Base
SYS_FORCE_INLINE const GA_Detail & getDetail() const
Definition: GA_Attribute.h:208
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
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
Specialization of GA_RWGenericHandle for GA_ATTRIB_POINT offsets.
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
void homogenize()
Express the point in homogeneous coordinates or vice-versa.
Definition: UT_Vector4.h:539
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
Definition: SYS_Types.h:136
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:164
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.
const GA_Attribute * getAttribute() const
Specialization of GA_ROGenericHandle for GA_Offset.
GA_ATINumeric * getAttribute() const
Definition: GA_Handle.h:339
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:641
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:155
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:203
SYS_FORCE_INLINE GA_Offset vertexPoint(GA_Offset vertex) const
Given a vertex, return the point it references.
Definition: GA_Detail.h:529
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)
GLdouble t
Definition: glad.h:2397
GA_GenericTempPoint(const GA_ROGenericHandlePoint< GA_Offset > &h)
SYS_FORCE_INLINE bool isValid() const
Definition: GA_Handle.h:187
GA_RWGenericHandleVertex(GA_Attribute *attr, int component=0)
void zero() const
void addDest(T val) const
GLsizeiptr size
Definition: glcorearb.h:664
const GA_Attribute * getAttribute() const
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
Specialization of GA_ROGenericHandle for GA_ATTRIB_POINT offsets.
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 GA_TypeInfo getTypeInfo() const
Definition: GA_Attribute.h:252
SYS_FORCE_INLINE void set(GA_Offset off, const T &val) const
Definition: GA_Handle.h:354
Specialization of GA_GenericMath for GA_ATTRIB_VERTEX offsets.
fpreal64 fpreal
Definition: SYS_Types.h:277
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:1608
A handle to simplify manipulation of multiple attributes.
GA_GenericTempVertex(const GA_ROGenericHandleVertex< GA_Offset > &h)
GA_GenericMathVertex(const GA_ROGenericHandleVertex< T > &h)
const GA_Attribute * getPwAttribute() const
Definition: GA_Detail.h:281
GA_GenericTempVertex(const GA_ROGenericHandleVertex< T > &h)
Specialization of GA_GenericTemp for GA_ATTRIB_POINT types.
SYS_FORCE_INLINE GA_AttributeOwner getOwner() const
Definition: GA_Attribute.h:210
void setValue(GA_Offset dest, const GA_Offset &src) const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
Definition: format.h:895
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:1793