Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Compiler errors CGAL曲面网格覆盖示例_Compiler Errors_Cgal_Aabb - Fatal编程技术网

Compiler errors CGAL曲面网格覆盖示例

Compiler errors CGAL曲面网格覆盖示例,compiler-errors,cgal,aabb,Compiler Errors,Cgal,Aabb,在CGAL网页上,您会看到以下简短示例: CGAL::AABB_tree tree(faces(surface_mesh)); 在所有的surface_mesh和AABBTree文档示例中,都没有使用这一行,因此我想知道如何配置AABB特性以使该示例成为可能。我自己的方法无法编译: #include <CGAL/AABB_face_graph_triangle_primitive.h> #include <CGAL/AABB_traits.h>

在CGAL网页上,您会看到以下简短示例:

 CGAL::AABB_tree tree(faces(surface_mesh));
在所有的surface_mesh和AABBTree文档示例中,都没有使用这一行,因此我想知道如何配置AABB特性以使该示例成为可能。我自己的方法无法编译:

    #include <CGAL/AABB_face_graph_triangle_primitive.h>
    #include <CGAL/AABB_traits.h>
    #include <CGAL/AABB_tree.h>
    #include <CGAL/AABB_triangle_primitive.h>
    #include <CGAL/Simple_cartesian.h>
    #include <CGAL/Surface_mesh.h>
    #include <fstream>
    #include <iostream>
    #include <list>

    typedef CGAL::Simple_cartesian<double> Kernel;
    typedef Kernel::FT FT;
    typedef Kernel::Ray_3 Ray;
    typedef Kernel::Line_3 Line;
    typedef Kernel::Point_3 Point;

    typedef CGAL::Surface_mesh<Point> SMesh;
    typedef CGAL::AABB_face_graph_triangle_primitive<SMesh> Primitive;
    typedef CGAL::AABB_traits<Kernel, Primitive> AABB_Mesh_Traits;
    typedef CGAL::AABB_tree<AABB_Mesh_Traits> AABBTree;

    int main( const int argc, const char* argv[] )
    {
        const char* filename = ( argc > 1 ) ? argv[1] : "model.obj";
        std::ifstream input( filename );
        SMesh mesh;
        input >> mesh;
        AABBTree tree( faces( mesh ) );

        Point a( 1.0, 0.0, 0.0 );
        Point b( 0.0, 1.0, 0.0 );
        Ray ray_query( a, b );
        std::cout << tree.number_of_intersected_primitives( ray_query )
           << " intersections(s) with ray query" << std::endl;

        return EXIT_SUCCESS;
    }
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
简单笛卡尔核;
typedef内核::FT;
typedef内核::Ray_3 Ray;
typedef内核::Line_3 Line;
typedef内核::Point_3 Point;
typedef CGAL::表面网格SMesh;
typedef CGAL::AABB_face_graph_triangle_primitive;
类型定义CGAL::AABB_特征AABB_网格特征;
typedef CGAL::AABB_树AABBTree;
int main(常量int argc,常量char*argv[])
{
常量字符*文件名=(argc>1)?argv[1]:“model.obj”;
std::ifstream输入(文件名);
斯梅什网;
输入>>网格;
AABBTree树(面(网格));
a点(1.0,0.0,0.0);
b点(0.0,1.0,0.0);
射线查询(a,b);
std::cout它应该是
树(面(网格)。首先是面(网格)。其次是网格)

请注意,在中,您可以找到一个使用 完整语法 目录
examples/AABB_tree

应该是
树(面(网格)。首先是面(网格)。其次是网格)

请注意,在中,您可以找到一个使用 完整语法
网站所在的目录
examples/AABB_tree

过于简化,应该是
tree(faces(mesh)。第一,faces(mesh)。第二,mesh)
。事实上,这一次更改使它得以编译。谢谢!你能@slorio将其添加为解决方案吗?然后我可以将其标记为已解决。网站在撒谎:)它过于简化,应该是树(面(网格)。首先是面(网格)。其次是网格)
。事实上,这一个更改使它得以编译。谢谢!您能@slorio将其添加为解决方案吗?然后我可以将其标记为已解决。
 no matching constructor for initialization of 'AABBTree' 
 (aka 'AABB_tree<AABB_traits<Simple_cartesian<double>, 
   AABB_face_graph_triangle_primitive<
    Surface_mesh<Point_3<CGAL::Simple_cartesian<double> > > > > >')