Пример #1
0
Файл: Panner.C Проект: 0mk/non
Panner::Panner ( int X, int Y, int W, int H, const char *L ) :
    Fl_Group( X, Y, W, H, L )
{
    _bg_image = 0;
    _bg_image_scaled = 0;
    _bg_image_projection = 0;
//    _projection = POLAR;
    _points.push_back( Point( 1, 0 ) );
    
    static float ranges[] = { 1,3,5,10,15 };
    { Fl_Choice *o = _range_choice = new Fl_Choice(X + 40,Y + H - 18,75,18,"Range:");
        o->box(FL_UP_FRAME);
        o->down_box(FL_DOWN_FRAME);
        o->textsize(9);
        o->labelsize(9);
        o->align(FL_ALIGN_LEFT);
        o->add("1 Meter",0,0,&ranges[0]);
        o->add("3 Meters",0,0,&ranges[1]);
        o->add("5 Meters",0,0,&ranges[2]);
        o->add("10 Meters",0,0,&ranges[3]);
        o->add("15 Meters",0,0,&ranges[4]);
        o->value(_range_mode);
        o->callback( cb_mode, this );
    }

    { Fl_Choice *o = _projection_choice = new Fl_Choice(X + W - 75,Y + H - 18,75,18,"Projection:");
        o->box(FL_UP_FRAME);
        o->down_box(FL_DOWN_FRAME);
        o->textsize(9);
        o->labelsize(9);
        o->align(FL_ALIGN_LEFT);
        o->add("Spherical");
        o->add("Planar");
        o->value(_projection_mode);
        o->callback( cb_mode, this );
    }
                  
    end();
}
Пример #2
0
void DisplayFltkMenu::make_window() {
  size(235, 445);
  { 
    { Fl_Counter* o = nearclip = new Fl_Counter(105, 25, 110, 25, "Near Clip");
      o->align(FL_ALIGN_LEFT);
      o->range(0.01, 1000.0);
      o->step(0.05);
      o->lstep(0.5);
      o->precision(2);
      o->callback(nearclip_cb, app);
      VMDFLTKTOOLTIP(o, "Set near clipping plane (OpenGL display only)")
    }
    { Fl_Counter* o = farclip = new Fl_Counter(105, 50, 110, 25, "Far Clip");
      o->align(FL_ALIGN_LEFT);
      o->range(0.01, 1000.0);
      o->step(0.05);
      o->lstep(0.5);
      o->precision(2);
      o->callback(farclip_cb, app);
      VMDFLTKTOOLTIP(o, "Set far clipping plane (OpenGL display only)")
    }
    { Fl_Counter* o = eyesep = new Fl_Counter(105, 75, 110, 25, "Eye Sep");
      o->align(FL_ALIGN_LEFT);
      o->range(0.0, 100.0);
      o->step(0.01);
      o->lstep(0.1);
      o->precision(2);
      o->callback(eyesep_cb, app);
      VMDFLTKTOOLTIP(o, "Set stereo eye separation")
    }
    { Fl_Counter* o = focal = new Fl_Counter(105, 100, 110, 25, "Focal Length");
      o->align(FL_ALIGN_LEFT);
      o->range(0.01, 1000.0);
      o->step(0.05);
      o->lstep(0.5);
      o->precision(2);
      o->callback(focal_cb, app);
      VMDFLTKTOOLTIP(o, "Set stereo focal point")
    }
    { Fl_Counter* o = screenh = new Fl_Counter(105, 135, 110, 25, "Screen Hgt");
      o->align(FL_ALIGN_LEFT);
      o->range(0.0, 100000.0);
      o->step(0.1);
      o->lstep(1.0);
      o->precision(1);
      o->callback(screenh_cb, app);
      VMDFLTKTOOLTIP(o, "Set viewing frustum height")
    }
    { Fl_Counter* o = screend = new Fl_Counter(105, 160, 110, 25, "Screen Dist");
      o->align(FL_ALIGN_LEFT);
      o->range(-100000.0, 100000.0);
      o->step(0.1);
      o->lstep(1.0);
      o->precision(1);
      o->callback(screend_cb, app);
      VMDFLTKTOOLTIP(o, "Set viewing frustum distance")
    }

    { Fl_Choice* o = cuemode = new Fl_Choice(105, 195, 110, 25, "Cue Mode");
      o->color(VMDMENU_CHOOSER_BG);
      o->selection_color(VMDMENU_CHOOSER_SEL);
      o->box(FL_THIN_UP_BOX);
      o->align(FL_ALIGN_LEFT);
      o->callback(cuemode_cb, app);
      VMDFLTKTOOLTIP(o, "Set depth cueing mode")
      for (int m=0; m<app->display->num_cue_modes(); m++)
        cuemode->add(app->display->cue_mode_name(m));
    }
    { Fl_Counter* o = cuestart = new Fl_Counter(105, 220, 110, 25, "Cue Start");
      o->align(FL_ALIGN_LEFT);
      o->range(0.001, 1000.0);
      o->step(0.05);
      o->lstep(0.25);
      o->precision(2);
      o->callback(cuestart_cb, app);
      VMDFLTKTOOLTIP(o, "Set linear depth cueing starting distance")
    }
    { Fl_Counter* o = cueend = new Fl_Counter(105, 245, 110, 25, "Cue End");
      o->align(FL_ALIGN_LEFT);
      o->range(0.001, 1000.0);
      o->step(0.05);
      o->lstep(0.25);
      o->precision(2);
      o->callback(cueend_cb, app);
      VMDFLTKTOOLTIP(o, "Set linear depth cueing end distance")
    }
    { Fl_Counter* o = cuedensity = new Fl_Counter(105, 270, 110, 25, "Cue Density");
      o->align(FL_ALIGN_LEFT);
      o->range(0.001, 1000.0);
      o->step(0.05);
      o->lstep(0.1);
      o->precision(2);
      o->callback(cuedensity_cb, app);
      VMDFLTKTOOLTIP(o, "Set exponential depth cueing density")
    }

    new Fl_Box(35, 305, 170, 25, "External Renderer Options");
    { Fl_Choice* o = shadowmode = new Fl_Choice(105, 330, 110, 25, "Shadows");
      o->color(VMDMENU_CHOOSER_BG);
      o->selection_color(VMDMENU_CHOOSER_SEL);
      o->box(FL_THIN_UP_BOX);
      o->align(FL_ALIGN_LEFT);
      o->callback(shadowmode_cb, app);
      VMDFLTKTOOLTIP(o, "Enable shadows in external renderers")
      shadowmode->add("Off");
      shadowmode->add("On");
    }
    { Fl_Choice* o = aomode = new Fl_Choice(105, 355, 110, 25, "Amb. Occl.");
      o->color(VMDMENU_CHOOSER_BG);
      o->selection_color(VMDMENU_CHOOSER_SEL);
      o->box(FL_THIN_UP_BOX);
      o->align(FL_ALIGN_LEFT);
      o->callback(aomode_cb, app);
      VMDFLTKTOOLTIP(o, "Enable ambient occlusion lighting in external renderers")
      aomode->add("Off");
      aomode->add("On");
    }
    { Fl_Counter* o = aoambient = new Fl_Counter(105, 380, 110, 25, "AO Ambient");
      o->align(FL_ALIGN_LEFT);
      o->range(0.0, 1.0);
      o->step(0.01);
      o->lstep(0.10);
      o->precision(2);
      o->callback(aoambient_cb, app);
      VMDFLTKTOOLTIP(o, "Ambient occlusion lighting coefficient")
    }
    { Fl_Counter* o = aodirect = new Fl_Counter(105, 405, 110, 25, "AO Direct");
      o->align(FL_ALIGN_LEFT);
      o->range(0.0, 1.0);
      o->step(0.01);
      o->lstep(0.10);
      o->precision(2);
      o->callback(aodirect_cb, app);
      VMDFLTKTOOLTIP(o, "Direct lighting rescaling coefficient")
    }

    Fl_Box *box1 = new Fl_Box(10, 10, 215, 120);
    box1->box(FL_ENGRAVED_FRAME);
    Fl_Box *box2 = new Fl_Box(10, 130, 215, 65);
    box2->box(FL_ENGRAVED_FRAME);
    Fl_Box *box3 = new Fl_Box(10, 190, 215, 110);
    box3->box(FL_ENGRAVED_FRAME);
    Fl_Box *box4 = new Fl_Box(10, 300, 215, 135);
    box4->box(FL_ENGRAVED_FRAME);
    end();
    end();
  }
}
SaveTrajectoryFltkMenu::SaveTrajectoryFltkMenu(VMDApp *vmdapp)
: VMDFltkMenu("save", "Save Trajectory", vmdapp) {
  
  size(450, 250);
    { Fl_Choice* o = molchooser = new Fl_Choice(120, 10, 320, 25, "Save data from: ");
      o->box(FL_THIN_UP_BOX);
      o->down_box(FL_BORDER_BOX);
      o->color(VMDMENU_CHOOSER_BG);
      o->selection_color(VMDMENU_CHOOSER_SEL);
      o->callback(molchooser_cb, this);
    }
    { Fl_Input *o = selectinput = new Fl_Input(120, 45, 295, 25, "Selected atoms:");
      o->selection_color(VMDMENU_VALUE_SEL);
    }
    { Fl_Choice* o = repchooser = new Fl_Choice(415, 45, 25, 25);
      o->down_box(FL_BORDER_BOX);
      o->align(FL_ALIGN_TOP_LEFT);
      o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
      o->callback(repchooser_cb, this);
    }
    { Fl_Choice* o = filetypechooser = new Fl_Choice(20, 90, 115, 25, "File type:");
      o->down_box(FL_BORDER_BOX);
      o->align(FL_ALIGN_TOP_LEFT);
      o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
    }
    savebutton = new Fl_Return_Button(345, 90, 95, 25, "Save...");
    savebutton->callback(save_cb, this);
    { Fl_Group* o = timestepgroup = new Fl_Group(20, 145, 165, 95, "Frames: ");
      o->box(FL_ENGRAVED_FRAME);
      o->align(FL_ALIGN_TOP_LEFT);
      { Fl_Button* o = saveinbackgroundbutton = new Fl_Round_Button(30, 215, 150, 20, "Save in background");
        o->down_box(FL_ROUND_DOWN_BOX);
        o->type(FL_RADIO_BUTTON);
      }
      { Fl_Button* o = allatoncebutton = new Fl_Round_Button(30, 195, 150, 20, "Save all at once");
        o->down_box(FL_ROUND_DOWN_BOX);
        o->type(FL_RADIO_BUTTON);
      }
      { Fl_Input* o = firstinput = new Fl_Int_Input(25, 170, 45, 20, "First:");
        o->align(FL_ALIGN_TOP);
        o->selection_color(VMDMENU_VALUE_SEL);
      }
      { Fl_Input* o = lastinput = new Fl_Int_Input(80, 170, 45, 20, "Last:");
        o->align(FL_ALIGN_TOP);
        o->selection_color(VMDMENU_VALUE_SEL);
      }
      { Fl_Input* o = strideinput = new Fl_Int_Input(135, 170, 45, 20, "Stride:");
        o->align(FL_ALIGN_TOP);
        o->selection_color(VMDMENU_VALUE_SEL);
      }
      o->end();
      datasetbrowser = new Fl_Multi_Browser(195, 145, 240, 95, "Volumetric Datasets");
      datasetbrowser->align(5);
      datasetbrowser->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
    } 
    end();

  allatoncebutton->value(1);
  selected_molid = -1;
  datasetbrowser->deactivate();
  
  command_wanted(Command::PLUGIN_UPDATE);
  command_wanted(Command::MOL_NEW);
  command_wanted(Command::MOL_RENAME);
  command_wanted(Command::MOL_DEL);
  command_wanted(Command::MOL_ADDREP);
  command_wanted(Command::MOL_DELREP);
  command_wanted(Command::MOL_MODREP);
  command_wanted(Command::MOL_MODREPITEM);
  command_wanted(Command::ANIM_DELETE);
}