HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_GeoSubset.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 
19 #ifndef __HUSD_GeoSubset__
20 #define __HUSD_GeoSubset__
21 
22 #include "HUSD_API.h"
23 #include "HUSD_DataHandle.h"
24 class HUSD_TimeCode;
25 
26 
28 {
29 public:
30  /// Standard constructor.
32 
33  /// Creates geometry subset in a given primitive.
34  bool createGeoSubset( const UT_StringRef &prim_path,
35  const UT_ExintArray &face_indices,
36  const UT_StringRef &subset_name ) const;
37 
38 
39  /// @{ Get and set the geometry subset family name.
40  /// The subsets that have the same family name are logically tied
41  /// together, and can be validated for overlaps, partitioning, etc.
43  { myFamilyName = name; }
45  { return myFamilyName; }
46  /// @}
47 
48  /// Enumerates the possible values for geo subset family type
49  enum class FamilyType
50  {
51  UNRESTRICTED, // each face can belong to zero or more subsets
52  NONOVERLAPPING, // each face belongs to at most one subset
53  PARTITION, // each face belongs to exactly one subset
54  };
56  { myFamilyType = type; }
58  { return myFamilyType; }
59 
60 
61  /// Returns true if the @p subset_prim_path refers to a geometry subset,
62  /// and if so also returns the geometry parent path and face idices.
63  /// Otherwise, returns false.
64  bool getGeoPrimitiveAndFaceIndices(
65  UT_StringHolder &geo_prim_path,
66  UT_ExintArray &face_indices,
67  const UT_StringRef &subset_prim_path,
68  const HUSD_TimeCode &time_code ) const;
69 
70 private:
71  HUSD_AutoWriteLock & myWriteLock;
72  UT_StringHolder myFamilyName;
73  FamilyType myFamilyType;
74 };
75 
76 #endif
77 
#define HUSD_API
Definition: HUSD_API.h:32
void setFamilyName(const UT_StringRef &name)
GLuint const GLchar * name
Definition: glcorearb.h:786
FamilyType getFamilyType() const
void setFamilyType(FamilyType type)
const UT_StringHolder & getFamilyName() const
type
Definition: core.h:1059
FamilyType
Enumerates the possible values for geo subset family type.