本文整理汇总了C++中DimTypeList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ DimTypeList::push_back方法的具体用法?C++ DimTypeList::push_back怎么用?C++ DimTypeList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DimTypeList
的用法示例。
在下文中一共展示了DimTypeList::push_back方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dbDimTypes
/// Get a dimension type list for the storage schema.
/// \return Storage dimension types.
DimTypeList DbWriter::dbDimTypes() const
{
using namespace Dimension;
DimTypeList dimTypes;
for (auto di = m_dimTypes.begin(); di != m_dimTypes.end(); ++di)
dimTypes.push_back(DimType(di->m_id, di->m_type, XForm()));
if (!m_locationScaling)
return dimTypes;
//ONLY for location scaling...
for (auto di = dimTypes.begin(); di != dimTypes.end(); ++di)
{
if (di->m_id == Id::X)
{
di->m_xform = m_xXform;
di->m_type = Type::Signed32;
}
if (di->m_id == Id::Y)
{
di->m_xform = m_yXform;
di->m_type = Type::Signed32;
}
if (di->m_id == Id::Z)
{
di->m_xform = m_zXform;
di->m_type = Type::Signed32;
}
}
return dimTypes;
}
示例2: dimTypes
DimTypeList XMLSchema::dimTypes() const
{
DimTypeList dimTypes;
for (auto di = m_dims.begin(); di != m_dims.end(); ++di)
dimTypes.push_back(di->m_dimType);
return dimTypes;
}
示例3: dbDimTypes
DimTypeList DbReader::dbDimTypes() const
{
DimTypeList dimTypes;
for (auto di = m_dims.begin(); di != m_dims.end(); ++di)
dimTypes.push_back(di->m_dimType);
return dimTypes;
}
示例4: dimTypes
DimTypeList PointLayout::dimTypes() const
{
DimTypeList dimTypes;
const Dimension::IdList& ids = dims();
for (auto ii = ids.begin(); ii != ids.end(); ++ii)
dimTypes.push_back(DimType(*ii, dimType(*ii)));
return dimTypes;
}
示例5: b
TEST(Compression, types)
{
using namespace Dimension;
Type types[] = {
Type::Unsigned8, Type::Unsigned16, Type::Unsigned32, Type::Unsigned64,
Type::Signed8, Type::Signed16, Type::Signed32, Type::Signed64,
Type::Float, Type::Double
};
// Size is 42.
std::default_random_engine generator;
std::uniform_int_distribution<int> dist(std::numeric_limits<int>::min());
char pts[3][42];
// Fill three "points" with some random data.
char *c = &pts[0][0];
for (size_t i = 0; i < 3 * 42; ++i)
{
int v = dist(generator);
memcpy(c++, &v, sizeof(char));
}
DimTypeList dimTypes;
for (auto ti = std::begin(types); ti != std::end(types); ++ti)
dimTypes.push_back(DimType(Dimension::Id::Unknown, *ti));
std::vector<unsigned char> rawBuf;
LazPerfBuf b(rawBuf);
LazPerfCompressor<LazPerfBuf> compressor(b, dimTypes);
for (size_t i = 0; i < 50; i++)
{
compressor.compress(pts[0], 42);
compressor.compress(pts[1], 42);
compressor.compress(pts[2], 42);
}
compressor.done();
LazPerfBuf b2(rawBuf);
LazPerfDecompressor<LazPerfBuf> decompressor(b2, dimTypes);
char oPts[3][42];
for (size_t i = 0; i < 50; ++i)
{
decompressor.decompress(oPts[0], 42);
decompressor.decompress(oPts[1], 42);
decompressor.decompress(oPts[2], 42);
EXPECT_EQ(memcmp(pts[0], oPts[0], 42), 0);
EXPECT_EQ(memcmp(pts[1], oPts[1], 42), 0);
EXPECT_EQ(memcmp(pts[2], oPts[2], 42), 0);
memset(oPts[0], 0, 42);
memset(oPts[1], 0, 42);
memset(oPts[2], 0, 42);
}
}
示例6: dimTypes
DimTypeList DbWriter::dimTypes(PointTableRef table)
{
using namespace Dimension;
PointLayoutPtr layout = table.layout();
if (m_outputDims.empty())
return layout->dimTypes();
DimTypeList dims;
for (std::string& s : m_outputDims)
{
DimType dt = layout->findDimType(s);
if (dt.m_id == Id::Unknown)
{
std::ostringstream oss;
oss << "Invalid dimension '" << s << "' specified for "
"'output_dims' option.";
throw pdal_error(oss.str());
}
dims.push_back(dt);
}
return dims;
}
示例7: compressor
TEST(Compression, types)
{
using namespace Dimension;
Type types[] = {
Type::Unsigned8, Type::Unsigned16, Type::Unsigned32, Type::Unsigned64,
Type::Signed8, Type::Signed16, Type::Signed32, Type::Signed64,
Type::Float, Type::Double
};
// Size is 42.
std::default_random_engine generator;
std::uniform_int_distribution<int> dist((std::numeric_limits<int>::min)());
char pts[3][42];
// Fill three "points" with some random data.
char *c = &pts[0][0];
for (size_t i = 0; i < 3 * 42; ++i)
{
int v = dist(generator);
memcpy(c++, &v, sizeof(char));
}
DimTypeList dimTypes;
for (auto ti = std::begin(types); ti != std::end(types); ++ti)
dimTypes.push_back(DimType(Dimension::Id::Unknown, *ti));
std::vector<unsigned char> rawBuf;
auto cb = [&rawBuf](char *buf, size_t bufsize)
{
unsigned char *ubuf = reinterpret_cast<unsigned char *>(buf);
rawBuf.insert(rawBuf.begin(), ubuf, ubuf + bufsize);
};
LazPerfCompressor compressor(cb, dimTypes);
for (size_t i = 0; i < 50; i++)
{
compressor.compress(pts[0], 42);
compressor.compress(pts[1], 42);
compressor.compress(pts[2], 42);
}
compressor.done();
char oPts[3][42];
PointId id = 0;
auto cb2 = [&pts, &oPts, &id](char *buf, size_t bufsize)
{
memcpy(oPts[id++], buf, bufsize);
if (id == 3)
{
EXPECT_EQ(memcmp(pts[0], oPts[0], 42), 0);
EXPECT_EQ(memcmp(pts[0], oPts[0], 42), 0);
EXPECT_EQ(memcmp(pts[2], oPts[2], 42), 0);
memset(oPts[0], 0, 42);
memset(oPts[1], 0, 42);
memset(oPts[2], 0, 42);
id = 0;
}
};
LazPerfDecompressor(cb2, dimTypes, 50 * 3).
decompress(reinterpret_cast<const char *>(rawBuf.data()),
rawBuf.size());
}