HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GDT_Transform.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: A GDT_Transform contains a list of matrices that describe
9  * the changes to the gdp's primitive transforms.
10  *
11  */
12 #ifndef __GDT_Transform_h__
13 #define __GDT_Transform_h__
14 
15 #include "GDT_API.h"
16 #include <UT/UT_BitArray.h>
17 #include <UT/UT_ValArray.h>
18 #include <UT/UT_Matrix3.h>
19 
20 #include "GDT_Token.h"
21 
22 class GA_PrimitiveGroup;
23 class GDT_TokenList;
24 
26 {
27 public:
28  GDT_Transform(unsigned int size) : myUsedEntries(size) {}
29  GDT_Transform(const GDT_Transform &other);
30 
31  virtual ~GDT_Transform();
32 
33  virtual int64 getMemoryUsage(bool inclusive=false) const;
34 
35  virtual void applyDeltas(const GDT_TokenList &list,
36  GEO_Detail &gdp,
37  const GA_AIFEditDeltaMap &map,
38  bool inverse=false) const;
39 
40  void mergeTransformDeltas(
41  const GDT_Transform &other,
42  bool inverse = false);
43 
44  // Zero all the deltas non-destructively
45  virtual void zeroDeltas();
46 
47  // Begin/end a change to a point position
48  void beginPrimitiveTransformChange(
49  const UT_Matrix3 &mat);
50  void endPrimitiveTransformChange(
51  const UT_Matrix3 &endmat,
52  unsigned int index);
53 
54  virtual void resize(unsigned int size);
55 
56  virtual unsigned int changed() const
57  { return myUsedEntries.numBitsSet(); }
58  virtual unsigned int entries() const
59  { return myUsedEntries.size(); }
60 
61  // I/O Methods
62  virtual bool legacyLoad(UT_IStream &is,
63  unsigned int numtotal);
64 
65  virtual bool save(UT_JSONWriter &w,
66  const GDT_JSON &json) const;
67  virtual bool load(UT_JSONParser &p,
68  const GDT_JSON &json);
69 
70 private:
71  UT_Matrix3 mySavedMat;
72 
74  UT_BitArray myUsedEntries;
75 };
76 
77 #endif
#define GDT_API
Definition: GDT_API.h:10
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
virtual unsigned int entries() const
Definition: GDT_Transform.h:58
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
GLsizeiptr size
Definition: glcorearb.h:663
virtual bool legacyLoad(UT_IStream &is, unsigned int numtotal)=0
long long int64
Definition: SYS_Types.h:100
virtual void applyDeltas(const GDT_TokenList &list, GEO_Detail &gdp, const GA_AIFEditDeltaMap &map, bool inverse=false) const =0
GLuint index
Definition: glcorearb.h:785
GDT_Transform(unsigned int size)
Definition: GDT_Transform.h:28
virtual bool load(UT_JSONParser &p, const GDT_JSON &json)=0
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
virtual bool save(UT_JSONWriter &w, const GDT_JSON &json) const =0
virtual unsigned int changed() const
Definition: GDT_Transform.h:56
virtual int64 getMemoryUsage(bool inclusive=false) const =0
Class for mapping between an index and an attribute data offset.
Definition: GA_AIFEdit.h:48