Loading...
Searching...
No Matches
topologyLevel.h
Go to the documentation of this file.
//
// Copyright 2015 DreamWorks Animation LLC.
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef OPENSUBDIV3_FAR_TOPOLOGY_LEVEL_H
#define OPENSUBDIV3_FAR_TOPOLOGY_LEVEL_H
#include "../version.h"
#include "../vtr/level.h"
#include "../vtr/refinement.h"
#include "../far/types.h"
#include <vector>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
namespace Far {
class TopologyLevel {
public:
int GetNumVertices() const { return _level->getNumVertices(); }
int GetNumFaces() const { return _level->getNumFaces(); }
int GetNumEdges() const { return _level->getNumEdges(); }
int GetNumFaceVertices() const { return _level->getNumFaceVerticesTotal(); }
//
ConstIndexArray GetFaceVertices(Index f) const { return _level->getFaceVertices(f); }
ConstIndexArray GetFaceEdges(Index f) const { return _level->getFaceEdges(f); }
ConstIndexArray GetEdgeVertices(Index e) const { return _level->getEdgeVertices(e); }
ConstIndexArray GetEdgeFaces(Index e) const { return _level->getEdgeFaces(e); }
ConstIndexArray GetVertexFaces(Index v) const { return _level->getVertexFaces(v); }
ConstIndexArray GetVertexEdges(Index v) const { return _level->getVertexEdges(v); }
ConstLocalIndexArray GetVertexFaceLocalIndices(Index v) const { return _level->getVertexFaceLocalIndices(v); }
ConstLocalIndexArray GetVertexEdgeLocalIndices(Index v) const { return _level->getVertexEdgeLocalIndices(v); }
ConstLocalIndexArray GetEdgeFaceLocalIndices(Index e) const { return _level->getEdgeFaceLocalIndices(e); }
Index FindEdge(Index v0, Index v1) const { return _level->findEdge(v0, v1); }
bool IsEdgeNonManifold(Index e) const { return _level->isEdgeNonManifold(e); }
bool IsVertexNonManifold(Index v) const { return _level->isVertexNonManifold(v); }
bool IsEdgeBoundary(Index e) const { return _level->getEdgeTag(e)._boundary; }
bool IsVertexBoundary(Index v) const { return _level->getVertexTag(v)._boundary; }
float GetEdgeSharpness(Index e) const { return _level->getEdgeSharpness(e); }
float GetVertexSharpness(Index v) const { return _level->getVertexSharpness(v); }
bool IsFaceHole(Index f) const { return _level->isFaceHole(f); }
Sdc::Crease::Rule GetVertexRule(Index v) const { return _level->getVertexRule(v); }
int GetNumFVarChannels() const { return _level->getNumFVarChannels(); }
int GetNumFVarValues(int channel = 0) const { return _level->getNumFVarValues(channel); }
ConstIndexArray GetFaceFVarValues(Index f, int channel = 0) const {
return _level->getFaceFVarValues(f, channel);
}
bool DoesVertexFVarTopologyMatch(Index v, int channel = 0) const {
return _level->doesVertexFVarTopologyMatch(v, channel);
}
bool DoesEdgeFVarTopologyMatch(Index e, int channel = 0) const {
return _level->doesEdgeFVarTopologyMatch(e, channel);
}
bool DoesFaceFVarTopologyMatch(Index f, int channel = 0) const {
return _level->doesFaceFVarTopologyMatch(f, channel);
}
ConstIndexArray GetFaceChildFaces(Index f) const { return _refToChild->getFaceChildFaces(f); }
ConstIndexArray GetFaceChildEdges(Index f) const { return _refToChild->getFaceChildEdges(f); }
ConstIndexArray GetEdgeChildEdges(Index e) const { return _refToChild->getEdgeChildEdges(e); }
Index GetFaceChildVertex( Index f) const { return _refToChild->getFaceChildVertex(f); }
Index GetEdgeChildVertex( Index e) const { return _refToChild->getEdgeChildVertex(e); }
Index GetVertexChildVertex(Index v) const { return _refToChild->getVertexChildVertex(v); }
Index GetFaceParentFace(Index f) const { return _refToParent->getChildFaceParentFace(f); }
bool ValidateTopology() const { return _level->validateTopology(); }
void PrintTopology(bool children = true) const { _level->print((children && _refToChild) ? _refToChild : 0); }
private:
friend class TopologyRefiner;
Vtr::internal::Level const * _level;
Vtr::internal::Refinement const * _refToParent;
Vtr::internal::Refinement const * _refToChild;
public:
// Not intended for public use, but required by std::vector, etc...
TopologyLevel() { }
~TopologyLevel() { }
};
} // end namespace Far
} // end namespace OPENSUBDIV_VERSION
using namespace OPENSUBDIV_VERSION;
} // end namespace OpenSubdiv
#endif /* OPENSUBDIV3_FAR_TOPOLOGY_LEVEL_H */
refinement.h
level.h
OpenSubdiv
Definition error.h:30
OpenSubdiv::OPENSUBDIV_VERSION::Far::Index
Vtr::Index Index
Definition types.h:41
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel
An interface for accessing data in a specific level of a refined topology hierarchy.
Definition topologyLevel.h:49
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetFaceParentFace
Index GetFaceParentFace(Index f) const
Return the parent face (in the previous level) of a given face.
Definition topologyLevel.h:243
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::TopologyLevel
TopologyLevel()
Definition topologyLevel.h:263
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetEdgeSharpness
float GetEdgeSharpness(Index e) const
Return the sharpness assigned a given edge.
Definition topologyLevel.h:148
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::DoesFaceFVarTopologyMatch
bool DoesFaceFVarTopologyMatch(Index f, int channel=0) const
Return if face-varying topology around a face matches.
Definition topologyLevel.h:215
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetVertexRule
Sdc::Crease::Rule GetVertexRule(Index v) const
Return the subdivision rule assigned a given vertex specific to this level.
Definition topologyLevel.h:157
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetVertexChildVertex
Index GetVertexChildVertex(Index v) const
Return the child vertex (in the next level) of a given vertex.
Definition topologyLevel.h:240
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetEdgeFaceLocalIndices
ConstLocalIndexArray GetEdgeFaceLocalIndices(Index e) const
Access the local indices of an edge with respect to its incident faces.
Definition topologyLevel.h:117
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetFaceChildEdges
ConstIndexArray GetFaceChildEdges(Index f) const
Access the child edges (in the next level) of a given face.
Definition topologyLevel.h:228
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::DoesEdgeFVarTopologyMatch
bool DoesEdgeFVarTopologyMatch(Index e, int channel=0) const
Return if face-varying topology across the edge only matches.
Definition topologyLevel.h:210
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::PrintTopology
void PrintTopology(bool children=true) const
Definition topologyLevel.h:250
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetFaceVertices
ConstIndexArray GetFaceVertices(Index f) const
Access the vertices incident a given face.
Definition topologyLevel.h:93
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetFaceChildFaces
ConstIndexArray GetFaceChildFaces(Index f) const
Access the child faces (in the next level) of a given face.
Definition topologyLevel.h:225
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetNumEdges
int GetNumEdges() const
Return the number of edges in this level.
Definition topologyLevel.h:68
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::ValidateTopology
bool ValidateTopology() const
Definition topologyLevel.h:249
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::IsEdgeNonManifold
bool IsEdgeNonManifold(Index e) const
Return if the edge is non-manifold.
Definition topologyLevel.h:128
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::IsFaceHole
bool IsFaceHole(Index f) const
Return if a given face has been tagged as a hole.
Definition topologyLevel.h:154
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetVertexEdges
ConstIndexArray GetVertexEdges(Index v) const
Access the edges incident a given vertex.
Definition topologyLevel.h:108
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetFaceChildVertex
Index GetFaceChildVertex(Index f) const
Return the child vertex (in the next level) of a given face.
Definition topologyLevel.h:234
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::DoesVertexFVarTopologyMatch
bool DoesVertexFVarTopologyMatch(Index v, int channel=0) const
Return if face-varying topology around a vertex matches.
Definition topologyLevel.h:205
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetEdgeChildEdges
ConstIndexArray GetEdgeChildEdges(Index e) const
Access the child edges (in the next level) of a given edge.
Definition topologyLevel.h:231
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetVertexFaces
ConstIndexArray GetVertexFaces(Index v) const
Access the faces incident a given vertex.
Definition topologyLevel.h:105
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::FindEdge
Index FindEdge(Index v0, Index v1) const
Identify the edge matching the given vertex pair.
Definition topologyLevel.h:120
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetVertexEdgeLocalIndices
ConstLocalIndexArray GetVertexEdgeLocalIndices(Index v) const
Access the local indices of a vertex with respect to its incident edges.
Definition topologyLevel.h:114
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetFaceEdges
ConstIndexArray GetFaceEdges(Index f) const
Access the edges incident a given face.
Definition topologyLevel.h:96
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetNumFaces
int GetNumFaces() const
Return the number of faces in this level.
Definition topologyLevel.h:65
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::IsVertexBoundary
bool IsVertexBoundary(Index v) const
Return if the vertex is a boundary.
Definition topologyLevel.h:137
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetNumFVarChannels
int GetNumFVarChannels() const
Return the number of face-varying channels (should be same for all levels)
Definition topologyLevel.h:193
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetNumVertices
int GetNumVertices() const
Return the number of vertices in this level.
Definition topologyLevel.h:62
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetEdgeFaces
ConstIndexArray GetEdgeFaces(Index e) const
Access the faces incident a given edge.
Definition topologyLevel.h:102
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetFaceFVarValues
ConstIndexArray GetFaceFVarValues(Index f, int channel=0) const
Access the face-varying values associated with a particular face.
Definition topologyLevel.h:200
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetEdgeVertices
ConstIndexArray GetEdgeVertices(Index e) const
Access the vertices incident a given edge.
Definition topologyLevel.h:99
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::~TopologyLevel
~TopologyLevel()
Definition topologyLevel.h:264
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetVertexSharpness
float GetVertexSharpness(Index v) const
Return the sharpness assigned a given vertex.
Definition topologyLevel.h:151
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetEdgeChildVertex
Index GetEdgeChildVertex(Index e) const
Return the child vertex (in the next level) of a given edge.
Definition topologyLevel.h:237
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetNumFaceVertices
int GetNumFaceVertices() const
Return the total number of face-vertices, i.e. the sum of all vertices for all faces.
Definition topologyLevel.h:71
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::IsVertexNonManifold
bool IsVertexNonManifold(Index v) const
Return if the vertex is non-manifold.
Definition topologyLevel.h:131
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::IsEdgeBoundary
bool IsEdgeBoundary(Index e) const
Return if the edge is a boundary.
Definition topologyLevel.h:134
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetNumFVarValues
int GetNumFVarValues(int channel=0) const
Return the total number of face-varying values in a particular channel (the upper bound of a face-var...
Definition topologyLevel.h:197
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetVertexFaceLocalIndices
ConstLocalIndexArray GetVertexFaceLocalIndices(Index v) const
Access the local indices of a vertex with respect to its incident faces.
Definition topologyLevel.h:111
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner
Stores topology data for a specified set of refinement options.
Definition topologyRefiner.h:51
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Rule
Rule
Definition crease.h:82
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstArray< Index >
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level
Definition level.h:83
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::doesFaceFVarTopologyMatch
bool doesFaceFVarTopologyMatch(Index fIndex, int fvarChannel) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getNumFaces
int getNumFaces() const
Definition level.h:215
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getVertexEdges
ConstIndexArray getVertexEdges(Index vertIndex) const
Definition level.h:641
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getEdgeFaceLocalIndices
ConstLocalIndexArray getEdgeFaceLocalIndices(Index edgeIndex) const
Definition level.h:710
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::isFaceHole
bool isFaceHole(Index faceIndex) const
Definition level.h:770
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getNumFVarValues
int getNumFVarValues(int channel) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getEdgeVertices
ConstIndexArray getEdgeVertices(Index edgeIndex) const
Definition level.h:685
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::validateTopology
bool validateTopology(ValidationCallback callback=0, void const *clientData=0) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getFaceEdges
ConstIndexArray getFaceEdges(Index faceIndex) const
Definition level.h:590
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getEdgeSharpness
float getEdgeSharpness(Index edgeIndex) const
Definition level.h:740
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getEdgeTag
ETag const & getEdgeTag(Index edgeIndex) const
Definition level.h:280
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getFaceFVarValues
ConstIndexArray getFaceFVarValues(Index faceIndex, int channel) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::print
void print(const Refinement *parentRefinement=0) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getVertexFaces
ConstIndexArray getVertexFaces(Index vertIndex) const
Definition level.h:604
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getNumFaceVerticesTotal
int getNumFaceVerticesTotal() const
Definition level.h:219
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getVertexEdgeLocalIndices
ConstLocalIndexArray getVertexEdgeLocalIndices(Index vertIndex) const
Definition level.h:652
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getVertexRule
Sdc::Crease::Rule getVertexRule(Index vertIndex) const
Definition level.h:758
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::doesVertexFVarTopologyMatch
bool doesVertexFVarTopologyMatch(Index vIndex, int fvarChannel) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getNumVertices
int getNumVertices() const
Definition level.h:214
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::findEdge
Index findEdge(Index v0Index, Index v1Index) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::isVertexNonManifold
bool isVertexNonManifold(Index vertIndex) const
Definition level.h:791
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getNumFVarChannels
int getNumFVarChannels() const
Definition level.h:264
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getVertexFaceLocalIndices
ConstLocalIndexArray getVertexFaceLocalIndices(Index vertIndex) const
Definition level.h:615
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getVertexSharpness
float getVertexSharpness(Index vertIndex) const
Definition level.h:749
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getEdgeFaces
ConstIndexArray getEdgeFaces(Index edgeIndex) const
Definition level.h:697
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::isEdgeNonManifold
bool isEdgeNonManifold(Index edgeIndex) const
Definition level.h:782
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getNumEdges
int getNumEdges() const
Definition level.h:216
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::doesEdgeFVarTopologyMatch
bool doesEdgeFVarTopologyMatch(Index eIndex, int fvarChannel) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getVertexTag
VTag const & getVertexTag(Index vertIndex) const
Definition level.h:279
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::getFaceVertices
ConstIndexArray getFaceVertices(Index faceIndex) const
Definition level.h:560
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::VTag::_boundary
VTagSize _boundary
Definition level.h:109
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::ETag::_boundary
ETagSize _boundary
Definition level.h:149
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement
Definition refinement.h:69
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getVertexChildVertex
Index getVertexChildVertex(Index v) const
Definition refinement.h:146
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFaceChildEdges
ConstIndexArray getFaceChildEdges(Index parentFace) const
Definition refinement.h:425
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getEdgeChildEdges
ConstIndexArray getEdgeChildEdges(Index parentEdge) const
Definition refinement.h:438
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFaceChildFaces
ConstIndexArray getFaceChildFaces(Index parentFace) const
Definition refinement.h:411
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildFaceParentFace
Index getChildFaceParentFace(Index f) const
Definition refinement.h:155
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFaceChildVertex
Index getFaceChildVertex(Index f) const
Definition refinement.h:144
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getEdgeChildVertex
Index getEdgeChildVertex(Index e) const
Definition refinement.h:145
types.h