1
#ifndef CSG_IndexProp_H
2
#define CSG_IndexProp_H
6
// Face and vertex props that are contained in a seperate array
7
// (PropArray) and indexed through a VProp compliant thing.
9
typedef int (*CSG_InterpFunc)(const void *d1, const void * d2, void *dnew, float epsilon);
17
unsigned char *m_data;
18
mutable CSG_InterpFunc m_interpFunc;
22
IndexProp(const int& vIndex)
32
const MT_Scalar& epsilon
37
SetInterpFunc(p1.m_interpFunc);
39
m_interpFunc(p1.m_data,p2.m_data,m_data,(float)epsilon);
42
IndexProp(const IndexProp& other)
43
: m_vIndex(other.m_vIndex),
45
m_interpFunc(other.m_interpFunc)
47
SetInterpFunc(other.m_interpFunc);
48
SetSize(other.m_size);
49
memcpy(m_data,other.m_data,m_size);
58
// Support conversion to an integer
59
///////////////////////////////////
65
// and assignment from an integer.
66
//////////////////////////////////
77
const IndexProp& other
79
m_vIndex = other.m_vIndex;
81
SetSize(other.m_size);
82
SetInterpFunc(other.m_interpFunc);
83
memcpy(m_data,other.m_data,m_size);
87
// Our local functions
88
//////////////////////
90
void SetInterpFunc(CSG_InterpFunc interpFunc)
92
m_interpFunc = interpFunc;
95
void SetSize(int size)
98
m_data = new unsigned char[size];
106
void CopyData(const void * userData)
108
memcpy(m_data,userData,m_size);
111
void Create(int size, const void * userData, CSG_InterpFunc interpFunc)
113
SetInterpFunc(interpFunc);
118
const unsigned char * GetData() const { return m_data;}
b'\\ No newline at end of file'