#include "OgUtil.h"
Go to the source code of this file.
◆ ogGroupTypeToString()
Definition at line 15 of file OgUtil.cpp.
21 case F3DAttributeType:
◆ readString()
bool readString |
( |
Alembic::Ogawa::IGroupPtr |
group, |
|
|
const size_t |
idx, |
|
|
std::string & |
s |
|
) |
| |
Definition at line 32 of file OgUtil.cpp.
36 Alembic::Ogawa::IDataPtr data = group->getData(idx, OGAWA_THREAD);
39 std::cout <<
"OgUtil::readString() got null data for index "
41 std::cout <<
" numChildren(): " << group->getNumChildren() << std::endl;
45 const size_t length = data->getSize();
46 if (length %
sizeof(std::string::value_type) != 0) {
50 const size_t stringLength = length /
sizeof(std::string::value_type);
52 std::vector<std::string::value_type> temp(stringLength + 1);
54 temp[stringLength] = 0;
56 data->read(length, &temp[0], 0, OGAWA_THREAD);
58 s = std::string(&temp[0]);
Referenced by getGroupName().
◆ readDataType()
OgDataType readDataType |
( |
Alembic::Ogawa::IGroupPtr |
group, |
|
|
const size_t |
idx |
|
) |
| |
Definition at line 65 of file OgUtil.cpp.
70 Alembic::Ogawa::IDataPtr data = group->getData(idx, OGAWA_THREAD);
73 const size_t length = data->getSize();
74 if (length != sizeLength) {
75 std::cout <<
"readDataType() " << sizeLength <<
" != " << length << std::endl;
79 data->read(length, &dataType, 0, OGAWA_THREAD);
References F3DInvalidDataType.
◆ writeString()
bool writeString |
( |
Alembic::Ogawa::OGroupPtr |
group, |
|
|
const std::string & |
s |
|
) |
| |
Definition at line 86 of file OgUtil.cpp.
89 Alembic::Ogawa::ODataPtr data =
90 group->addData(s.size() *
sizeof(std::string::value_type), s.c_str());
◆ getGroupName()
bool getGroupName |
( |
Alembic::Ogawa::IGroupPtr |
group, |
|
|
std::string & |
name |
|
) |
| |