本文整理汇总了C++中MatrixIr::data方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixIr::data方法的具体用法?C++ MatrixIr::data怎么用?C++ MatrixIr::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatrixIr
的用法示例。
在下文中一共展示了MatrixIr::data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save_mesh
void InflatorEngine::save_mesh(const std::string& filename,
const MatrixFr& vertices, const MatrixIr& faces, VectorF debug) {
VectorF flattened_vertices(vertices.rows() * vertices.cols());
std::copy(vertices.data(), vertices.data() + vertices.rows() *
vertices.cols(), flattened_vertices.data());
VectorI flattened_faces(faces.rows() * faces.cols());
std::copy(faces.data(), faces.data() + faces.rows() * faces.cols(),
flattened_faces.data());
VectorI voxels = VectorI::Zero(0);
Mesh::Ptr mesh = MeshFactory().load_data(
flattened_vertices, flattened_faces, voxels,
vertices.cols(), faces.cols(), 0).create_shared();
mesh->add_attribute("debug");
mesh->set_attribute("debug", debug);
MeshWriter::Ptr writer = MeshWriter::create(filename);
writer->with_attribute("debug");
writer->write_mesh(*mesh);
}
示例2: extract_surface_boundary_raw
Boundary::Ptr Boundary::extract_surface_boundary_raw(
MatrixFr& vertices, MatrixIr& faces) {
VectorF flattened_vertices = Eigen::Map<VectorF>(vertices.data(),
vertices.rows() * vertices.cols());
VectorI flattened_faces = Eigen::Map<VectorI>(faces.data(),
faces.rows() * faces.cols());
VectorI voxels = VectorI::Zero(0);
MeshFactory factory;
Mesh::Ptr mesh = factory.load_data(flattened_vertices, flattened_faces,
voxels, vertices.cols(), faces.cols(), 0).create();
return extract_surface_boundary(*mesh);
}
示例3: extract_volume_boundary_raw
Boundary::Ptr Boundary::extract_volume_boundary_raw(
MatrixFr& vertices, MatrixIr& voxels) {
VectorF flattened_vertices = Eigen::Map<VectorF>(vertices.data(),
vertices.rows() * vertices.cols());
VectorI faces = VectorI::Zero(0);
VectorI flattened_voxels = Eigen::Map<VectorI>(voxels.data(),
voxels.rows() * voxels.cols());
size_t vertex_per_voxel = voxels.cols();
size_t vertex_per_face=0;
if (vertex_per_voxel == 4) vertex_per_face = 3;
else if (vertex_per_voxel == 8) vertex_per_face = 4;
else {
throw RuntimeError("Unknown voxel type.");
}
MeshFactory factory;
Mesh::Ptr mesh = factory.load_data(flattened_vertices, faces,
flattened_voxels, vertices.cols(), vertex_per_face,
vertex_per_voxel).create();
return extract_volume_boundary(*mesh);
}