HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_PointPrim.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __HUSD_PointPrim_h__
19 #define __HUSD_PointPrim_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include <UT/UT_Array.h>
24 #include <UT/UT_ArrayStringSet.h>
25 #include <GA/GA_Attribute.h>
26 #include <GU/GU_Detail.h>
27 
28 class HUSD_TimeCode;
29 class UT_Options;
30 
32 {
33 public:
34  static bool extractTransforms(HUSD_AutoAnyLock &readlock,
35  const UT_StringRef &primpath,
36  UT_Vector3FArray &positions,
37  UT_Array<UT_QuaternionF> *orients,
38  UT_Vector3FArray *scales,
40  bool *istimesampled,
41  const HUSD_TimeCode &timecode,
42  const UT_Matrix4D *transform = nullptr);
43 
44  static bool extractTransforms(HUSD_AutoAnyLock &readlock,
45  const UT_StringRef &primpath,
46  UT_Matrix4DArray &xforms,
47  UT_Int64Array *ids,
48  bool *istimesampled,
49  const HUSD_TimeCode &timecode,
50  const UT_Matrix4D *transform = nullptr);
51 
52  static bool transformInstances(HUSD_AutoWriteLock &writelock,
53  const UT_StringRef &primpath,
54  const UT_Array<int64> &ids,
55  const UT_Array<UT_Matrix4D> &xforms,
56  const HUSD_TimeCode &timecode);
57 
58  static bool scatterArrayAttributes(HUSD_AutoWriteLock &writelock,
59  const UT_StringRef &primpath,
60  const UT_ArrayStringSet &attribnames,
61  const HUSD_TimeCode &timecode,
62  const UT_StringArray &targetprimpaths,
63  const UT_Int64Array *srcdataindices = nullptr);
64 
65  static bool scatterSopArrayAttributes(HUSD_AutoWriteLock &writelock,
66  const GU_Detail *gdp,
67  const GA_PointGroup *group,
68  const UT_Array<const GA_Attribute*> &attribs,
69  const HUSD_TimeCode &timecode,
70  const UT_StringArray &targetprimpaths);
71 
72  static bool copySopArrayAttributes(HUSD_AutoWriteLock &writelock,
73  const GU_Detail *gdp,
74  const GA_PointGroup *group,
75  const UT_Array<const GA_Attribute*> &attribs,
76  const HUSD_TimeCode &timecode,
77  const UT_StringRef &targetprimpath);
78 
79 };
80 
81 #endif
#define HUSD_API
Definition: HUSD_API.h:31
GA_API const UT_StringHolder transform
A map of string to various well defined value types.
Definition: UT_Options.h:87
GLuint * ids
Definition: glcorearb.h:652