PLY: add support for unsigned custom property length
This commit is contained in:
@@ -219,11 +219,11 @@ void _PLYReader_::readCreateCustomProperty(std::istream& _in, BaseImporter& _bi,
|
||||
}
|
||||
|
||||
//init vector
|
||||
int numberOfValues;
|
||||
read(_listType, _in, numberOfValues, OpenMesh::GenProg::Bool2Type<binary>());
|
||||
unsigned int numberOfValues;
|
||||
readInteger(_listType, _in, numberOfValues, OpenMesh::GenProg::Bool2Type<binary>());
|
||||
std::vector<T> vec(numberOfValues);
|
||||
//read and assign
|
||||
for (int i = 0; i < numberOfValues; ++i)
|
||||
for (unsigned int i = 0; i < numberOfValues; ++i)
|
||||
{
|
||||
read(_valueType, _in, vec[i], OpenMesh::GenProg::Bool2Type<binary>());
|
||||
}
|
||||
|
||||
@@ -212,6 +212,18 @@ private:
|
||||
_in >> _value;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void readInteger(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::TrueType /*_binary*/) const
|
||||
{
|
||||
readInteger(_type, _in, _value);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void readInteger(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::FalseType /*_binary*/) const
|
||||
{
|
||||
_in >> _value;
|
||||
}
|
||||
|
||||
//read and assign custom properties with the given type. Also creates property, if not exist
|
||||
template<bool binary, typename T, typename Handle>
|
||||
void readCreateCustomProperty(std::istream& _in, BaseImporter& _bi, Handle _h, const std::string& _propName, const ValueType _valueType, const ValueType _listType) const;
|
||||
|
||||
Reference in New Issue
Block a user