Esempio n. 1
0
/*
 * createAnimationDialog - Create animation dialog.
 *
 * parameter styleSheet - const GLMotif::StyleSheet&
 */
void AnimationDialog::createAnimationDialog(const GLMotif::StyleSheet& styleSheet)
{
  GLMotif::RowColumn* animationDialog =
    new GLMotif::RowColumn("AnimationDialog", this, false);
  GLMotif::RowColumn* buttonBox = createButtonBox(animationDialog);
  buttonBox->manageChild();
  GLMotif::RowColumn* timeStepBox = createTimeStepBox(animationDialog);
  timeStepBox->manageChild();
  animationDialog->manageChild();
}
Esempio n. 2
0
/*
 * createContoursDialog - Create color map dialog.
 *
 * parameter styleSheet - const GLMotif::StyleSheet&
 */
void Contours::createContoursDialog(const GLMotif::StyleSheet& styleSheet) {
    GLMotif::RowColumn* contoursDialog =
      new GLMotif::RowColumn("ContoursDialog", this, false);
    GLMotif::Label * contourLabel = new GLMotif::Label(
      "ContourLabel", contoursDialog, "Contours");
    contourLabel->setString("Contour");
    createAlphaComponent(styleSheet, contoursDialog);
    GLMotif::RowColumn* buttonBox = createButtonBox(contoursDialog);
    buttonBox->manageChild();
    GLMotif::Label * sliceContourLabel = new GLMotif::Label(
      "SliceContourLabel", contoursDialog, "SliceContours");
    sliceContourLabel->setString("Slice Contours");
    createXYZContours(styleSheet, contoursDialog);
    contoursDialog->manageChild();
}
/*
 * initialize - Initialize the GUI for the DownSampling class.
 */
void DownSampling::initialize(void) {
    const GLMotif::StyleSheet& styleSheet = *Vrui::getWidgetManager()->getStyleSheet();
    GLMotif::RowColumn* downSamplingDialog = new GLMotif::RowColumn("DownSamplingDialog", this, false);
    createSlicingScaleSlider(styleSheet, downSamplingDialog);
    createXStepSlider(styleSheet, downSamplingDialog);
    createYStepSlider(styleSheet, downSamplingDialog);
    createZStepSlider(styleSheet, downSamplingDialog);
    downSamplingDialog->manageChild();
}
Esempio n. 4
0
/*
 * createXYZContours - Create x, y and z slice widgets.
 *
 * parameter styleSheet - const GLMotif::StyleSheet&
 * parameter colorMapDialog - GLMotif::RowColumn*&
 */
void Contours::createXYZContours(const GLMotif::StyleSheet& styleSheet, GLMotif::RowColumn*& colorMapDialog) {
    GLMotif::RowColumn * xyzContoursRowColumn = new GLMotif::RowColumn("XYZContoursRowColumn", colorMapDialog, false);
    xyzContoursRowColumn->setOrientation(GLMotif::RowColumn::VERTICAL);
    xyzContoursRowColumn->setNumMinorWidgets(GLsizei(3));
    createXContours(xyzContoursRowColumn, styleSheet);
    createYContours(xyzContoursRowColumn, styleSheet);
    createZContours(xyzContoursRowColumn, styleSheet);

    xyzContoursRowColumn->manageChild();
} // end createXYZContours()createXYZContours
Esempio n. 5
0
ArfWindow::ArfWindow(Mycelia* application)
    : Window(application), layout(application->getDynamicLayout())
{
    window = new GLMotif::PopupWindow("AttributeWindow", Vrui::getWidgetManager(), "Layout Parameters");
    
    GLMotif::RowColumn* dialog = new GLMotif::RowColumn("ArfDialog", window, false);
    dialog->setNumMinorWidgets(3);
    
    // damping
    ParamPair p = VruiHelp::createParameter("Damping", -10, -1, layout->dampingConstant, dialog);
    dampingField = p.first;
    dampingSlider = p.second;
    dampingSlider->getValueChangedCallbacks().add(this, &ArfWindow::sliderCallback);
    
    // step size
    p = VruiHelp::createParameter("Step Size", 0.001, 0.05, layout->deltaTime, dialog);
    stepsizeField = p.first;
    stepsizeSlider = p.second;
    stepsizeSlider->getValueChangedCallbacks().add(this, &ArfWindow::sliderCallback);
    
    // beta
    p = VruiHelp::createParameter("Repulsion Falloff", -0.6, -0.1, layout->beta, dialog);
    betaField = p.first;
    betaSlider = p.second;
    betaSlider->getValueChangedCallbacks().add(this, &ArfWindow::sliderCallback);
    
    // strongly connected constant slider
    p = VruiHelp::createParameter("Strongly Connected Const", -5, -1, layout->stronglyConnectedSpringConstant, dialog);
    stronglyConnectedConstantField = p.first;
    stronglyConnectedConstantSlider = p.second;
    stronglyConnectedConstantSlider->getValueChangedCallbacks().add(this, &ArfWindow::sliderCallback);
    
    // connected constant slider
    p = VruiHelp::createParameter("Connected Const", -5, -1, layout->connectedSpringConstant, dialog);
    connectedConstantField = p.first;
    connectedConstantSlider = p.second;
    connectedConstantSlider->getValueChangedCallbacks().add(this, &ArfWindow::sliderCallback);
    
    // unconnected constant slider
    p = VruiHelp::createParameter("Unconnected Const", -5, -1, layout->unconnectedSpringConstant, dialog);
    unconnectedConstantField = p.first;
    unconnectedConstantSlider = p.second;
    unconnectedConstantSlider->getValueChangedCallbacks().add(this, &ArfWindow::sliderCallback);
    
    GLMotif::Button* navButton = new GLMotif::Button("NavButton", dialog, "Center Graph");
    navButton->getSelectCallbacks().add(application, &Mycelia::resetNavigationCallback);
    
    dialog->manageChild();
}
/*
 * createYStepSlider
 *
 * parameter styleSheet - const GLMotif::StyleSheet&
 * parameter downSamplingDialog - GLMotif::RowColumn*&
 */
void DownSampling::createYStepSlider(const GLMotif::StyleSheet& styleSheet, GLMotif::RowColumn*& downSamplingDialog) {
    GLMotif::RowColumn* yStepSliderRowColumn = new GLMotif::RowColumn("YStepSliderRowColumn", downSamplingDialog, false);
    yStepSliderRowColumn->setOrientation(GLMotif::RowColumn::HORIZONTAL);
    yStepSliderRowColumn->setPacking(GLMotif::RowColumn::PACK_TIGHT);
    GLMotif::Label * yStepLabel = new GLMotif::Label("YStepLabel", yStepSliderRowColumn, "Y");
    yStepLabel->setLabel("Y");
    yStepTextField = new GLMotif::TextField("YStepTextField", yStepSliderRowColumn, 6);
    yStepTextField->setFieldWidth(4);
    yStepTextField->setPrecision(3);
    yStepTextField->setValue(yStep);
    yStepSlider = new GLMotif::Slider("YStepSlider", yStepSliderRowColumn, GLMotif::Slider::HORIZONTAL, styleSheet.fontHeight
            * 5.0f);
    yStepSlider->setSliderColor(GLMotif::Color(0.5f, 0.5f, 0.5f));
    yStepSlider->setValueRange(1, stepMaximum, 1);
    yStepSlider->setValue(yStep);
    yStepSlider->getValueChangedCallbacks().add(this, &DownSampling::yStepSliderCallback);
    yStepSliderRowColumn->manageChild();
} // end createYStepSlider()
Esempio n. 7
0
void VerticalScaleDialog::init()
{
  Dialog::init();

  const GLMotif::StyleSheet* style = Vrui::getWidgetManager()->getStyleSheet();

  GLMotif::RowColumn* root = new GLMotif::RowColumn("ScaleRoot", dialog, false);

  GLMotif::Slider* slider = new GLMotif::Slider(
    "ScaleSlider", root, GLMotif::Slider::HORIZONTAL,
    10.0 * style->fontHeight);
  slider->setValue(0.0);
  slider->setValueRange(-0.5, 2.5, 0.00001);
  slider->getValueChangedCallbacks().add(
    this,
    &VerticalScaleDialog::changeScaleCallback);

  scaleLabel = new GLMotif::Label("ScaleLabel", root, "1.0x");

  root->setNumMinorWidgets(2);
  root->manageChild();
}
Esempio n. 8
0
void OpacityDialog::init()
{
  Dialog::init();

  const GLMotif::StyleSheet* style = Vrui::getWidgetManager()->getStyleSheet();

  GLMotif::RowColumn* root = new GLMotif::RowColumn("OpacityRoot", dialog, false);

  GLMotif::Slider* slider = new GLMotif::Slider(
    "OpacitySlider",
    root,
    GLMotif::Slider::HORIZONTAL,
    10.0 * style->fontHeight);
  slider->setValue(1.0);
  slider->setValueRange(0.0, 1.0, 0.01);
  slider->getValueChangedCallbacks().add(
    this,
    &OpacityDialog::changeOpacityCallback);

  opacityLabel = new GLMotif::Label("OpacityLabel", root, "1.0");

  root->setNumMinorWidgets(2);
  root->manageChild();
}
void TerrainColorSettingsDialog::init()
{
  Dialog::init();

  const GLMotif::StyleSheet* style = Vrui::getWidgetManager()->getStyleSheet();

  colorPicker.setCloseButton(true);
  colorPicker.getColorPicker()->getColorChangedCallbacks().add(this, &TerrainColorSettingsDialog::colorChangedCallback);

  GLMotif::RowColumn* root = new GLMotif::RowColumn("TCSRoot", dialog, false);
  root->setNumMinorWidgets(2);

  GLMotif::Button* button = NULL;

//- Emissive Color
  new GLMotif::Label("TCSEmissive", root, "Emissive:");
  button = new GLMotif::Button("TSCEmissiveButton", root, "");
  button->setBackgroundColor(SETTINGS->terrainEmissiveColor);
  button->getSelectCallbacks().add(this, &TerrainColorSettingsDialog::colorButtonCallback);

//- Ambient Color
  new GLMotif::Label("TCSAmbient", root, "Ambient:");
  button = new GLMotif::Button("TSCAmbientButton", root, "");
  button->setBackgroundColor(SETTINGS->terrainAmbientColor);
  button->getSelectCallbacks().add(this, &TerrainColorSettingsDialog::colorButtonCallback);

//- Diffuse Color
  new GLMotif::Label("TCSDiffuse", root, "Diffuse:");
  button = new GLMotif::Button("TSCDiffuseButton", root, "");
  button->setBackgroundColor(SETTINGS->terrainDiffuseColor);
  button->getSelectCallbacks().add(this, &TerrainColorSettingsDialog::colorButtonCallback);

//- Specular Color
  new GLMotif::Label("TCSSpecular", root, "Specular:");
  button = new GLMotif::Button("TSCSpecularButton", root, "");
  button->setBackgroundColor(SETTINGS->terrainSpecularColor);
  button->getSelectCallbacks().add(this, &TerrainColorSettingsDialog::colorButtonCallback);

//- Specular Shininess
  new GLMotif::Label("TCSShininess", root, "Shininess:");
  GLMotif::RowColumn* shininessRoot = new GLMotif::RowColumn("TCSShininessRoot", root, false);
  shininessRoot->setNumMinorWidgets(2);

  GLMotif::Slider* slider = new GLMotif::Slider(
    "TCSShininessSlider",
    shininessRoot,
    GLMotif::Slider::HORIZONTAL,
    5.0 * style->fontHeight);
  slider->setValue(SETTINGS->terrainShininess);
  slider->setValueRange(0.0f, 128.0f, 1.0f);
  slider->getValueChangedCallbacks().add(this, &TerrainColorSettingsDialog::shininessChangedCallback);
  shininessField = new GLMotif::TextField(
    "SSShininessField",
    shininessRoot,
    3);
  shininessField->setPrecision(3);
  shininessField->setValue(SETTINGS->terrainShininess);

  shininessRoot->manageChild();

  root->manageChild();
}