tFloat32 x_max = *std::max_element(Cluster_x.begin(), Cluster_x.end());
tFloat32 x_min = *std::min_element(Cluster_x.begin(), Cluster_x.end());
tFloat32 y_max = *std::max_element(Cluster_y.begin(), Cluster_y.end());
tFloat32 y_min = *std::min_element(Cluster_y.begin(), Cluster_y.end());
tFloat32 z_max = *std::max_element(Cluster_z.begin(), Cluster_z.end());
tFloat32 z_min = *std::min_element(Cluster_z.begin(), Cluster_z.end());
//Center//
tFloat32 c_x = (x_max - x_min) / 2;
tFloat32 c_y = (y_max - y_min) / 2;
tFloat32 c_z = (z_max - z_min) / 2;
cetuc::BoundingBox NewBox(cetuc::Point3D(c_x,c_y,c_z), cetuc::Point3D(8, 8, 10), cetuc::Point3D(0, 0, 0));
答案 0 :(得分:0)
要使std::max_element
正常工作,您必须为元素类型operator<
或谓词提供tFloat32
重载以进行比较。在您的情况下,最好使用std::minmax_element