HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GU_OSDTopology.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: GU_OSDTopology.h ( GU Library, C++)
7
*
8
* COMMENTS: Build OpenSubdiv TopologyRefiner directly from GU_Detail.
9
* Replaces GT-based topology path (GT_OSDTopology / GT_GEODetail).
10
*/
11
12
#pragma once
13
14
#include "
GU_API.h
"
15
16
#include <
UT/UT_FloatArray.h
>
17
#include <
UT/UT_IntArray.h
>
18
#include <
UT/UT_Span.h
>
19
#include <
UT/UT_UniquePtr.h
>
20
21
#include <opensubdiv/version.h>
22
namespace
OpenSubdiv {
namespace
OPENSUBDIV_VERSION {
namespace
Far {
23
class
TopologyRefiner;
24
} } }
25
26
class
GU_Detail
;
27
class
GU_OSDEval
;
28
29
/// Builds an OpenSubdiv TopologyRefiner directly from GU_Detail polygons.
30
/// All polygons are treated as Catmull-Clark subdivision faces (no creases).
31
class
GU_API
GU_OSDTopology
32
{
33
public
:
34
GU_OSDTopology
();
35
~
GU_OSDTopology
();
36
37
GU_OSDTopology
(
const
GU_OSDTopology
&) =
delete
;
38
GU_OSDTopology
&
operator=
(
const
GU_OSDTopology
&) =
delete
;
39
GU_OSDTopology
(
GU_OSDTopology
&&) noexcept;
40
GU_OSDTopology
&
operator=
(
GU_OSDTopology
&&) noexcept;
41
42
/// Build topology refiner from polygon mesh in GU_Detail.
43
/// Returns false if the detail has no polygons.
44
bool
createFromDetail(
const
GU_Detail
&gdp);
45
46
bool
hasRefiner
()
const
{
return
refiner() !=
nullptr
; }
47
48
/// Convert coarse face/u/v to patch coordinates.
49
/// coarseFace values are GA primitive indices; the internal face remap
50
/// is applied automatically.
51
bool
convertToPatch(
52
UT_Span<const int>
coarseFace,
53
UT_Span<const float>
coarseU,
54
UT_Span<const float>
coarseV,
55
UT_IntArray
&patchFace,
56
UT_FloatArray
&patchU,
57
UT_FloatArray
&patchV)
const
;
58
59
/// GA prim index -> topology face index.
60
const
UT_IntArray
&
faceRemap
()
const
{
return
myFaceRemap; }
61
62
friend
class
GU_OSDEval
;
63
64
private
:
65
/// Access the refiner (for GU_OSDEval::setTopology).
66
const
OpenSubdiv::Far::TopologyRefiner *refiner()
const
;
67
68
struct
State
;
69
UT_UniquePtr<State>
myState;
70
UT_IntArray
myFaceRemap;
71
};
TCB_SPAN_NAMESPACE_NAME::span
Definition:
UT_Span.h:175
UT_IntArray.h
UT_ValArray< int >
GU_OSDTopology
Definition:
GU_OSDTopology.h:31
UT_UniquePtr
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition:
UT_UniquePtr.h:39
UT_Span.h
GU_OSDEval
Definition:
GU_OSDEval.h:28
GU_API
#define GU_API
Definition:
GU_API.h:14
openvdb::OPENVDB_VERSION_NAME::points::index::State
State
Definition:
IndexIterator.h:40
UT_UniquePtr.h
GU_Detail
Definition:
GU_Detail.h:159
nanovdb::operator=
LeafData & operator=(const LeafData &)=delete
GU_OSDTopology::hasRefiner
bool hasRefiner() const
Definition:
GU_OSDTopology.h:46
UT_FloatArray.h
GU_API.h
GU_OSDTopology::faceRemap
const UT_IntArray & faceRemap() const
GA prim index -> topology face index.
Definition:
GU_OSDTopology.h:60
GU
GU_OSDTopology.h
Generated on Wed Jul 15 2026 02:17:02 for HDK by
1.8.6