HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GDT_Position.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_Position contains a full list of vectors that describe
9  * the changes to the gdp's point positions.
10  *
11  */
12 #ifndef __GDT_Position_h__
13 #define __GDT_Position_h__
14 
15 #include "GDT_API.h"
16 #include <UT/UT_BitArray.h>
17 #include <UT/UT_Vector4Array.h>
18 #include <GA/GA_Types.h>
19 
20 #include "GDT_Token.h"
21 
22 #include "GDT_CoordinateFrames.h"
23 #include "GDT_SymmetryTransform.h"
24 
25 class GA_PointGroup;
26 class GA_AIFEditDelta;
27 class GA_AIFEditSnapshot;
28 class GDT_TokenList;
29 
31 {
32 public:
33  GDT_Position();
34  GDT_Position(const GDT_Position &other);
35  ~GDT_Position() override;
36 
38  bool inclusive = false) const override;
39 
40  void applyDeltas(const GDT_TokenList &list,
41  GEO_Detail &gdp,
42  const GA_AIFEditDeltaMap &map,
43  bool inverse=false) const override;
44  virtual void applyScaledDelta(GEO_Detail &gdp, GA_Offset pt,
46  const GA_AIFEditDeltaMap &map) const;
47  virtual void applyScaledDeltas(GEO_Detail &gdp,
48  fpreal64 scale,
49  const GA_PointGroup *ptgroup,
50  const GA_AIFEditDeltaMap &map) const;
51 
52  void mergePositionDeltas(const GDT_Position &other,
53  bool inverse = false);
54 
55  // Reset elements with deltas to the values from the source detail.
56  void resetElementsFromSource(GEO_Detail &gdp,
57  const GA_AIFEditDeltaMap &map,
58  const GEO_Detail &src_gdp,
59  const GA_AIFEditDeltaMap &src_map) const;
60 
61  // Apply stored deltas for elements also recordered in other to the
62  // given gdp.
63  void applyIntersectionDeltas(
64  const GDT_TokenList &token_list,
65  GEO_Detail &gdp,
66  const GA_AIFEditDeltaMap &map,
67  const GDT_Position &other) const;
68 
69  // Zero all the deltas non-destructively
70  virtual void zeroDeltas();
71 
72  // Begin/end a change to a point position
73  void beginPointPositionChange(const GA_Attribute *P,
74  GA_Offset element);
75  void beginPointPositionChange(const GA_Attribute *P,
76  const GA_Range &range);
77  void endPointPositionChange(
78  const GA_AIFEditDeltaMap &map);
79 
80  virtual unsigned int changed() const;
81 
82  // I/O Methods
83  bool legacyLoad(UT_IStream &is,
84  unsigned int numtotal) override;
85 
86  bool save(UT_JSONWriter &w,
87  const GDT_JSON &json) const override;
88  bool load(UT_JSONParser &p,
89  const GDT_JSON &json) override;
90 
91  void setCoordinateFrames(const GDT_CoordinateFrames *coords);
92 
93  void createSymmetryDeltas(const GDT_Position &input,
95  const GA_AIFEditDeltaMap &map);
96 
97 private:
98  GA_AIFEditDelta *myDelta;
99  GA_AIFEditSnapshot *mySnapshot;
100 
101  const GDT_CoordinateFrames *myCoordinateFrames;
102 };
103 
104 #endif
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
#define GDT_API
Definition: GDT_API.h:10
GLenum GLint * range
Definition: glcorearb.h:1925
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
virtual bool legacyLoad(UT_IStream &is, unsigned int numtotal)=0
A range of elements in an index-map.
Definition: GA_Range.h:42
double fpreal64
Definition: SYS_Types.h:201
GA_Size GA_Offset
Definition: GA_Types.h:646
GA_API const UT_StringHolder scale
GLuint coords
Definition: glad.h:4091
long long int64
Definition: SYS_Types.h:116
Base class for storing snapshots during an edit operation.
Definition: GA_AIFEdit.h:112
GA_API const UT_StringHolder transform
virtual void applyDeltas(const GDT_TokenList &list, GEO_Detail &gdp, const GA_AIFEditDeltaMap &map, bool inverse=false) const =0
Base class to store recorder data.
Definition: GA_AIFEdit.h:217
virtual bool load(UT_JSONParser &p, const GDT_JSON &json)=0
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
virtual bool save(UT_JSONWriter &w, const GDT_JSON &json) const =0
virtual int64 getMemoryUsage(bool inclusive=false) const =0
Class for mapping between an index and an attribute data offset.
Definition: GA_AIFEdit.h:48