HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GDT_PrimitiveList.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: GDT Library. (Geo Delta)
7  *
8  * COMMENTS: GDT_PrimitiveList contains tokens for primitive attributes.
9  * All these tokens are not sparse.
10  *
11  */
12 #ifndef __GDT_PrimitiveList_h__
13 #define __GDT_PrimitiveList_h__
14 
15 #include "GDT_API.h"
16 #include "GDT_TokenList.h"
17 
18 #include <GEO/GEO_Detail.h>
19 #include "GDT_Transform.h"
20 
21 class GA_PrimitiveGroup;
22 
23 
25 {
26 public:
27  GDT_PrimitiveList() : myTransform(0) {}
29  virtual ~GDT_PrimitiveList();
30 
31  // Implement the pure virtual applyDeltas() from GDT_TokenList.
32  virtual void applyDeltas(GEO_Detail &gdp, bool inverse=false) const;
33 
34  // Merge the primitive deltas from another GDT_PrimitiveList
35  void mergePrimitiveDeltas(const GDT_PrimitiveList &other,
36  bool inverse = false);
37 
38  // Overload hiding base class method which requires a GA_AIFEditDeltaMap.
39  void endAttributeChange(const GEO_Detail &gdp);
40 
41  // Begin and end a transform change to the primitive specified by index.
42  // The delta matrix is computed and stored.
43  void beginPrimitiveTransformChange(const UT_Matrix3 &mat);
44  void endPrimitiveTransformChange(const UT_Matrix3 &mat,
45  unsigned int index);
46 
48  const GEO_Detail &gdp) const
49  { return gdp.primitiveAttribs(); }
50 
51  virtual bool hasChange() const;
52  virtual bool haveAttributesChanged() const
53  { return GDT_TokenList::hasChange(); }
54  bool hasTransformChanged() const
55  {
56  return (myTransform &&
57  myTransform->changed() > 0);
58  }
59 
60  virtual bool legacyLoadTrans(UT_IStream &is, uint numtotal);
61 
62  bool saveTrans(UT_JSONWriter &w,
63  const GDT_JSON &json) const;
64  bool loadTrans(UT_JSONParser &p,
65  const GDT_JSON &json);
66 
67  // Zero the primitive deltas
68  virtual void zeroDeltas();
69  // Destroy the primitive deltas, but not the attribute lists
70  virtual void clearDeltas();
71  // Destroy the primitive deltas
72  virtual void destroy();
73 
74 private:
75  // As with the position token, the transform token for primitives
76  // is kept apart from the token list.
77  GDT_Transform *myTransform;
78 };
79 #endif
virtual bool haveAttributesChanged() const
#define GDT_API
Definition: GDT_API.h:10
virtual void zeroDeltas()
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
A string map of attributes to ease backward compatibility In the GB/GEO/GU library code would often p...
unsigned int uint
Definition: SYS_Types.h:39
virtual void applyDeltas(GEO_Detail &gdp, bool inverse=0) const =0
SYS_FORCE_INLINE const GA_AttributeDict & primitiveAttribs() const
Definition: GEO_Detail.h:1825
GLuint index
Definition: glcorearb.h:785
bool hasTransformChanged() const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
void endAttributeChange(const GA_AIFEditDeltaMap &map)
virtual bool hasChange() const
virtual void clearDeltas()
virtual void destroy()
virtual const GA_AttributeDict & getAttributeDict(const GEO_Detail &gdp) const