예제 #1
0
void Scene::cut_segment_plane()
{
    // Build tree (if build fail, exit)
    build_facet_tree();
    if ( m_facet_tree.empty() ) {
        return;
    }

    Plane plane = frame_plane();

    // Compute intersections
    typedef std::vector<Facet_tree::Object_and_primitive_id> Intersections;
    Intersections intersections;
    m_facet_tree.all_intersections(plane, std::back_inserter(intersections));

    // Fill data structure
    m_cut_segments.clear();
    for ( Intersections::iterator it = intersections.begin(),
            end = intersections.end() ; it != end ; ++it )
    {
        const Segment* inter_seg = CGAL::object_cast<Segment>(&(it->first));

        if ( NULL != inter_seg )
        {
            m_cut_segments.push_back(*inter_seg);
        }
    }

    m_cut_plane = CUT_SEGMENTS;
}
예제 #2
0
파일: Scene.cpp 프로젝트: weaselp/cgal
void Scene::unsigned_distance_function()
{
    // Build tree (if build fail, exit)
    build_facet_tree();
    if ( m_facet_tree.empty() ) { return; }

    compute_distance_function(m_facet_tree);

    m_cut_plane = UNSIGNED_FACETS;
    changed();
}