| OpenSubdiv

Loading...
Searching...
No Matches
topologyDescriptor.h
Go to the documentation of this file.
1//
2// Copyright 2014 DreamWorks Animation LLC.
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://opensubdiv.org/license.
6//
7#ifndef OPENSUBDIV3_FAR_TOPOLOGY_DESCRIPTOR_H
8#define OPENSUBDIV3_FAR_TOPOLOGY_DESCRIPTOR_H
9
10#include "../version.h"
11
12#include "../far/topologyRefiner.h"
13#include "../far/topologyRefinerFactory.h"
14#include "../far/error.h"
15
16#include <cassert>
17
18 namespace OpenSubdiv {
19 namespace OPENSUBDIV_VERSION {
20
21 namespace Far {
22
32 struct TopologyDescriptor {
33
34 int numVertices,
35 numFaces;
36
37 int const * numVertsPerFace;
38 Index const * vertIndicesPerFace;
39
40 int numCreases;
41 Index const * creaseVertexIndexPairs;
42 float const * creaseWeights;
43
44 int numCorners;
45 Index const * cornerVertexIndices;
46 float const * cornerWeights;
47
48 int numHoles;
49 Index const * holeIndices;
50
51 bool isLeftHanded;
52
53 // Face-varying data channel -- value indices correspond to vertex indices,
54 // i.e. one for every vertex of every face:
55 //
56 struct FVarChannel {
57
58 int numValues;
59 Index const * valueIndices;
60
61 FVarChannel() : numValues(0), valueIndices(0) { }
62 };
63
64 int numFVarChannels;
65 FVarChannel const * fvarChannels;
66
67 TopologyDescriptor();
68};
69
70
71//
72// Forward declarations of required TopologyRefinerFactory<TopologyDescriptor>
73// specializations (defined internally):
74//
75// @cond EXCLUDE_DOXYGEN
76
77 template <>
78 bool
79 TopologyRefinerFactory<TopologyDescriptor>::resizeComponentTopology(
80 TopologyRefiner & refiner, TopologyDescriptor const & desc);
81
82 template <>
83 bool
84 TopologyRefinerFactory<TopologyDescriptor>::assignComponentTopology(
85 TopologyRefiner & refiner, TopologyDescriptor const & desc);
86
87 template <>
88 bool
89 TopologyRefinerFactory<TopologyDescriptor>::assignComponentTags(
90 TopologyRefiner & refiner, TopologyDescriptor const & desc);
91
92 template <>
93 bool
94 TopologyRefinerFactory<TopologyDescriptor>::assignFaceVaryingTopology(
95 TopologyRefiner & refiner, TopologyDescriptor const & desc);
96
97 template <>
98 void
99 TopologyRefinerFactory<TopologyDescriptor>::reportInvalidTopology(
100 TopologyError errCode, char const * msg, TopologyDescriptor const & desc);
101
102// @endcond
103
104} // end namespace Far
105
106} // end namespace OPENSUBDIV_VERSION
107 using namespace OPENSUBDIV_VERSION;
108} // end namespace OpenSubdiv
109
110#endif /* OPENSUBDIV3_FAR_TOPOLOGY_DESCRIPTOR_H */
topologyRefinerFactory.h
topologyRefiner.h
error.h
OpenSubdiv
Definition limits.h:15
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:16
OpenSubdiv::OPENSUBDIV_VERSION::Far
Definition refinerSurfaceFactory.h:19
OpenSubdiv::OPENSUBDIV_VERSION::Far::Index
Vtr::Index Index
Definition types.h:24
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor
A simple reference to raw topology data for use with TopologyRefinerFactory.
Definition topologyDescriptor.h:32
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::fvarChannels
FVarChannel const * fvarChannels
Definition topologyDescriptor.h:65
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::numVertices
int numVertices
Definition topologyDescriptor.h:34
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::cornerVertexIndices
Index const * cornerVertexIndices
Definition topologyDescriptor.h:45
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::vertIndicesPerFace
Index const * vertIndicesPerFace
Definition topologyDescriptor.h:38
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::creaseVertexIndexPairs
Index const * creaseVertexIndexPairs
Definition topologyDescriptor.h:41
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::holeIndices
Index const * holeIndices
Definition topologyDescriptor.h:49
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::numFaces
int numFaces
Definition topologyDescriptor.h:35
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::numCorners
int numCorners
Definition topologyDescriptor.h:44
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::cornerWeights
float const * cornerWeights
Definition topologyDescriptor.h:46
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::isLeftHanded
bool isLeftHanded
Definition topologyDescriptor.h:51
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::numVertsPerFace
int const * numVertsPerFace
Definition topologyDescriptor.h:37
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::TopologyDescriptor
TopologyDescriptor()
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::creaseWeights
float const * creaseWeights
Definition topologyDescriptor.h:42
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::numCreases
int numCreases
Definition topologyDescriptor.h:40
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::numHoles
int numHoles
Definition topologyDescriptor.h:48
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::numFVarChannels
int numFVarChannels
Definition topologyDescriptor.h:64
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::FVarChannel
Definition topologyDescriptor.h:56
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::FVarChannel::FVarChannel
FVarChannel()
Definition topologyDescriptor.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::FVarChannel::valueIndices
Index const * valueIndices
Definition topologyDescriptor.h:59
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyDescriptor::FVarChannel::numValues
int numValues
Definition topologyDescriptor.h:58
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::assignComponentTopology
static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the relationships between vertices, faces, etc. ie the face-vertices, vertex-faces,...
Definition topologyRefinerFactory.h:604
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::reportInvalidTopology
static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH const &mesh)
(Optional) Control run-time topology validation and error reporting
Definition topologyRefinerFactory.h:690
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::assignComponentTags
static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify edge or vertex sharpness or face holes
Definition topologyRefinerFactory.h:673
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::resizeComponentTopology
static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the number of vertices, faces, face-vertices, etc.
Definition topologyRefinerFactory.h:563
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::assignFaceVaryingTopology
static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify face-varying data per face
Definition topologyRefinerFactory.h:657
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner
Stores topology data for a specified set of refinement options.
Definition topologyRefiner.h:34