28 #include "../hbr/hierarchicalEdit.h"
29 #include "../hbr/vertexEdit.h"
31 #include "../version.h"
33 namespace OpenSubdiv {
34 namespace OPENSUBDIV_VERSION {
36 template <
class T>
class HbrFVarEdit;
39 std::ostream& operator<<(std::ostream& out, const HbrFVarEdit<T>& path) {
40 out <<
"vertex path = (" << path.faceid <<
' ';
41 for (
int i = 0; i < path.nsubfaces; ++i) {
42 out << static_cast<int>(path.subfaces[i]) <<
' ';
44 return out << static_cast<int>(path.vertexid) <<
"), edit = (" << path.edit[0] <<
',' << path.edit[1] <<
',' << path.edit[2] <<
')';
53 :
HbrHierarchicalEdit<T>(_faceid, _nsubfaces, _subfaces), vertexid(_vertexid), index(_index), width(_width), offset(_offset), op(_op) {
54 edit =
new float[width];
55 memcpy(edit, _edit, width *
sizeof(
float));
59 :
HbrHierarchicalEdit<T>(_faceid, _nsubfaces, _subfaces), vertexid(_vertexid), index(_index), width(_width), offset(_offset), op(_op) {
60 edit =
new float[width];
61 memcpy(edit, _edit, width *
sizeof(
float));
71 friend std::ostream& operator<< <T> (std::ostream& out,
const HbrFVarEdit<T>& path);
83 const float*
GetEdit()
const {
return edit; }
107 const unsigned char vertexid;
117 using namespace OPENSUBDIV_VERSION;
void ApplyFVarEdit(const HbrFVarEdit< T > &edit)
HbrFVarEdit(int _faceid, int _nsubfaces, int *_subfaces, int _vertexid, int _index, int _width, int _offset, typename HbrHierarchicalEdit< T >::Operation _op, float *_edit)
const float * GetEdit() const
HbrFVarEdit(int _faceid, int _nsubfaces, unsigned char *_subfaces, unsigned char _vertexid, int _index, int _width, int _offset, typename HbrHierarchicalEdit< T >::Operation _op, float *_edit)
float * GetData(int item)
HbrMesh< T > * GetMesh() const
virtual void ApplyEditToFace(HbrFace< T > *face)
HbrHierarchicalEdit< T >::Operation GetOperation() const
HbrVertex< T > * GetVertex(int index) const
void SetAllData(int width, const float *values)
unsigned char GetVertexID() const