HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_ObjectImport.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_ObjectImport_h__
19 #define __HUSD_ObjectImport_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_CreatePrims.h"
23 #include "HUSD_DataHandle.h"
24 #include "HUSD_SetRelationships.h"
25 #include <OBJ/OBJ_Node.h>
26 
27 class HUSD_FindPrims;
28 class HUSD_TimeCode;
29 
31 {
32 public:
35 
36  // Returns the appropriate primtype for an object.
37  // Returns an empty string for unsupported object types.
38  static UT_StringHolder getPrimTypeForObject(const OP_Node *node,
39  UT_Set<int> *parmindices = nullptr);
40  static UT_StringHolder getPrimKindForObject(const OP_Node *node);
41 
42  bool importPrim(
43  const OBJ_Node *object,
44  const UT_StringHolder &primpath,
45  const UT_StringHolder &primtype,
46  const UT_StringHolder &primkind) const;
47 
48  void importParameters(
49  const UT_StringHolder &primpath,
50  const OP_Node *object,
51  const HUSD_TimeCode &timecode,
52  const fpreal time,
53  bool firsttime,
54  UT_Set<int> *parmindices = nullptr) const;
55 
56  void importSOP(
57  SOP_Node *sop,
58  OP_Context &context,
59  const UT_StringRef &refprimpath,
60  const UT_StringRef &pathattr,
61  const UT_StringRef &primpath,
62  const UT_StringRef &pathprefix,
63  bool polygonsassubd,
64  const UT_StringRef &subdgroup) const;
65 
66  bool importMaterial(
67  VOP_Node *object,
68  const UT_StringHolder &primpath) const;
69 
70  bool setLightGeometry(
71  const UT_StringHolder &lightprimpath,
72  const UT_StringHolder &geoprimpath) const;
73 
74  bool setLightPortal(
75  const UT_StringHolder &lightprimpath,
76  const UT_StringHolder &geoprimpath) const;
77 
78 private:
79  HUSD_AutoWriteLock &myWriteLock;
80 };
81 
82 #endif
83 
GT_API const UT_StringHolder time
#define HUSD_API
Definition: HUSD_API.h:32
fpreal64 fpreal
Definition: SYS_Types.h:277