Example #1
0
// compare one selection from two different files
void CompareDraw(TFile *f1, TFile *f2, const char *varexp, const char *hisrange, const char *selection)
{
  CompareDraw(f1,f2,varexp,hisrange,selection,selection);
}
Example #2
0
// compare two selections from one file
void CompareDraw(TFile *f1, const char *varexp, const char *hisrange, const char *selection, const char *selection2)
{
  CompareDraw(f1,f1,varexp,hisrange,selection,selection2);
}
Example #3
0
void GUIController::draw_gui_recursive (PlaceableObject *root, const std::shared_ptr<CameraObject> &camera, const Color4f &parent_color, DTint stencil)
{
    GUIObject *gui = checked_cast<GUIObject*>(root);
    Rectangle gui_rect(0.0F,1.0F,0.0F,1.0F);
    DTboolean use_stencil = false;

    std::list<PlaceableObject*> c = root->children();

    if (gui) {

        // Check for transparent
        Color4f color = parent_color * gui->color();
        if (color.a <= 0.0F)
            return;

        // Check for no scale
        if (gui->scale() == Vector3(0.0F,0.0F,0.0F))
            return;

        // Get Rectangle
        gui_rect = gui->screen_rectangle();

        // Check if we need to stencil
        use_stencil = c.size() > 0;

        if (use_stencil) {
            ++stencil;
            gui->draw_gui_mask(camera);
        }

        System::renderer()->set_stencil_ref(stencil);
        gui->draw_gui(camera, parent_color);
    }


    c.sort(CompareDraw());
    
    for (auto &i : c) {
        GUIObject *gui_child = checked_cast<GUIObject*>(i);

        if (gui_child) {
        
            // Get Rectangle
            Rectangle gui_child_rect = gui_child->screen_rectangle();

            if (!gui_rect.is_touching(gui_child_rect))
                continue;

            draw_gui_recursive(gui_child, camera, parent_color * gui_child->color(), stencil );
        } else {
            draw_gui_recursive(i, camera, parent_color, stencil);
        }
    }

    if (gui) {
        System::renderer()->set_stencil_ref(stencil);
        gui->post_draw_gui(camera, parent_color);

        if (use_stencil) {
            gui->draw_gui_unmask(camera);
        }
        
    }
}