25 #ifndef HBRHIERARCHICALEDIT_H
26 #define HBRHIERARCHICALEDIT_H
28 #include "../version.h"
30 namespace OpenSubdiv {
31 namespace OPENSUBDIV_VERSION {
33 template <
class T>
class HbrHierarchicalEdit;
34 template <
class T>
class HbrFace;
35 template <
class T>
class HbrVertex;
38 class HbrHierarchicalEdit {
51 subfaces =
new unsigned char[_nsubfaces];
59 subfaces =
new unsigned char[_nsubfaces];
61 subfaces[i] =
static_cast<unsigned char>(_subfaces[i]);
71 if (
faceid < p.faceid)
return true;
72 if (
faceid > p.faceid)
return false;
74 if (minlength > p.nsubfaces) minlength = p.nsubfaces;
75 for (
int i = 0; i < minlength; ++i) {
76 if (
subfaces[i] < p.subfaces[i])
return true;
77 if (
subfaces[i] > p.subfaces[i])
return false;
104 virtual void ApplyToBound(
struct bbox& , RtMatrix * )
const {}
122 return (*path1 < *path2);
127 using namespace OPENSUBDIV_VERSION;
131 #include "../hbr/face.h"
134 namespace OpenSubdiv {
135 namespace OPENSUBDIV_VERSION {
149 if (!p)
return false;
151 if (
this == p)
return true;
153 if (faceid != p->faceid)
return false;
158 if (nsubfaces < face->GetDepth())
return false;
160 if (memcmp(subfaces, p->subfaces, face->
GetDepth() *
sizeof(
unsigned char)) != 0) {
167 using namespace OPENSUBDIV_VERSION;
virtual void ApplyEditToFace(HbrFace< T > *)
HbrHierarchicalEdit(int _faceid, int _nsubfaces, int *_subfaces)
bool IsRelevantToFace(HbrFace< T > *face) const
virtual void ApplyEditToVertex(HbrFace< T > *, HbrVertex< T > *)
virtual ~HbrHierarchicalEdit()
bool operator<(const HbrHierarchicalEdit &p) const
unsigned char GetSubface(int index) const
HbrHierarchicalEdit< T > ** GetHierarchicalEdits() const
HbrHierarchicalEdit(int _faceid, int _nsubfaces, unsigned char *_subfaces)
bool operator()(const HbrHierarchicalEdit< T > *path1, const HbrHierarchicalEdit< T > *path2) const