Esempio n. 1
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. 2
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();
}
Esempio n. 3
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. 4
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();
}