本帖最后由 robot 于 2013-2-17 20:12 编辑
类与函数关系:
基类FileWriter
PCDWriter的基类是FileWriter pcl\io\file_io.h 138行 定义了基类FileWriter class PCL_EXPORTS FileWriter
派生类PCDWriter
pcl\io\pcd_io.h 191行 定义了派生类PCDWriter class PCL_EXPORTS PCDWriter : public FileWriter
writeASCII()函数
pcl\io\pcd_io.h 280行 在派生类PCDWriter中,声明了writeASCII()函数。 pcl\io\impl\pcd_io.hpp 432行 writeASCII()函数的实现代码
具体代码:
基类FileWriter
pcl\io\file_io.h 155行 定义了纯虚函数write virtual int write () = 0; 纯虚函数的声明如下: virtual 函数原型=0; 声明了纯虚函数的类,称为抽象类。 使用纯虚函数与抽象类时应注意: (1)不能声明抽象类的对象,
writeASCII()函数的形参及说明:
int writeASCII (const std::string &file_name, const sensor_msgs: ointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen: uaternionf &orientation = Eigen: uaternionf::Identity (), const int precision = 8);
const Eigen::Vector4f 四元数
Eigen::Vector4f::Zero () 返回四元数 引用就是某一变量(目标)的一个别名,这样,对引用的操作就是对目标的操作。
引用的声明方法:类型标识符 &引用名=目标变量名;
const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (),
说明:(1)&在此不是求地址运算,而是起标识作用,标识在此声明的是一个引用名称。
用途: |