MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / writeBinary

Method writeBinary

io/src/ply_io.cpp:1206–1238  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1204
1205////////////////////////////////////////////////////////////////////////////////////////
1206int
1207pcl::PLYWriter::writeBinary (const std::string& file_name,
1208 const pcl::PCLPointCloud2& cloud,
1209 const Eigen::Vector4f& origin,
1210 const Eigen::Quaternionf& orientation,
1211 bool use_camera)
1212{
1213 if (cloud.data.empty ())
1214 {
1215 PCL_ERROR ("[pcl::PLYWriter::writeBinary] Input point cloud has no data!\n");
1216 return (-1);
1217 }
1218
1219 std::ofstream fs;
1220 fs.open (file_name.c_str (),
1221 std::ios::out | std::ios::binary |
1222 std::ios::trunc); // Open file in binary mode and erase current contents
1223 // if any
1224 if (!fs)
1225 {
1226 PCL_ERROR ("[pcl::PLYWriter::writeBinary] Error during opening (%s)!\n",
1227 file_name.c_str ());
1228 return (-1);
1229 }
1230
1231 if (!(writeBinary (fs, cloud, origin, orientation, use_camera) == 0))
1232 {
1233 fs.close();
1234 return -1;
1235 }
1236 fs.close();
1237 return 0;
1238}
1239
1240int
1241pcl::PLYWriter::writeBinary (std::ostream& os,

Callers 5

mainFunction · 0.45
saveCloudFunction · 0.45
savePointCloudFunction · 0.45
TESTFunction · 0.45
write_sim_outputFunction · 0.45

Calls 7

getFieldIndexFunction · 0.50
emptyMethod · 0.45
openMethod · 0.45
closeMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45
findMethod · 0.45

Tested by 1

TESTFunction · 0.36