Beispiel #1
0
void Scene::clear_internal_data()
{
    m_facet_tree.clear();
    m_edge_tree.clear();

    clear_points();
    clear_segments();
    clear_cutting_plane();
}
Beispiel #2
0
/**
 * @brief set segmenter sequence index
 * @param context segmenter context
 * @param sequence new sequence value
 * @param del whether to delete out sequence segments from disk
 */
int segmenter_set_sequence(SegmenterContext *context, unsigned int sequence, int del) {
    double duration = 0;
    
    int i;
    
    if (sequence <= context->segment_sequence || sequence >= context->segment_index) {
        return 0;
    }
    
    for (i=sequence; i < context->segment_index; i++) {
        duration += segment_duration(context, i);
    }
    
    i = sequence;
    
    while (duration < context->target_duration * 3 && i > context->segment_sequence) {
        duration += segment_duration(context, --i);
    }
        
    sequence = i;
    
    context->max_duration = 0;
    
    for (i = sequence; i < context->segment_index; i++) {
        context->durations[i - sequence] = context->durations[i - context->segment_sequence];
        context->max_duration = max(context->max_duration, context->durations[i - sequence]);
    }
    
    context->segment_sequence = sequence;
    
    if (del) {
        clear_segments(context);
    }
    
    return 0;
}