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,
39  bool *istimesampled,
40  const HUSD_TimeCode &timecode,
41  const UT_Matrix4D *transform = nullptr);
42 
43  static bool extractTransforms(HUSD_AutoAnyLock &readlock,
44  const UT_StringRef &primpath,
45  UT_Matrix4DArray &xforms,
46  bool *istimesampled,
47  const HUSD_TimeCode &timecode,
48  const UT_Matrix4D *transform = nullptr);
49 
50  static bool transformInstances(HUSD_AutoWriteLock &writelock,
51  const UT_StringRef &primpath,
52  const UT_IntArray &indices,
53  const UT_Array<UT_Matrix4D> &xforms,
54  const HUSD_TimeCode &timecode);
55 
56  static bool scatterArrayAttributes(
57  HUSD_AutoWriteLock &writelock,
58  const UT_StringRef &primpath,
59  const UT_ArrayStringSet &attribnames,
60  const HUSD_TimeCode &timecode,
61  const UT_StringArray &targetprimpaths,
62  const UT_Int64Array *srcdataindices = nullptr);
63 
64  static bool scatterSopArrayAttributes(
65  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(
73  HUSD_AutoWriteLock &writelock,
74  const GU_Detail *gdp,
75  const GA_PointGroup *group,
76  const UT_Array<const GA_Attribute*> &attribs,
77  const HUSD_TimeCode &timecode,
78  const UT_StringRef &targetprimpath);
79 
80 };
81 
82 #endif
GLsizei GLenum const void * indices
Definition: glcorearb.h:406
#define HUSD_API
Definition: HUSD_API.h:32
GA_API const UT_StringHolder transform
A map of string to various well defined value types.
Definition: UT_Options.h:84