示例#1
0
/*
 * createZContours - Create x slice widgets.
 *
 * parameter xyzContoursRowColumn - GLMotif::RowColumn * &
 * parameter styleSheet - const GLMotif::StyleSheet&
 */
void Contours::createZContours(GLMotif::RowColumn * & xyzContoursRowColumn, const GLMotif::StyleSheet & styleSheet) {
    //create z slice button and slider+textfield
    GLMotif::ToggleButton * showZSliceToggle = new GLMotif::ToggleButton("ShowZSliceToggle", xyzContoursRowColumn, "Z");
    showZSliceToggle->setToggle(false);
    showZSliceToggle->getValueChangedCallbacks().add(this, &Contours::toggleSelectCallback);
    zSliceValue = new GLMotif::TextField("ZSliceValue", xyzContoursRowColumn, 7);
    zSliceValue->setPrecision(3);
    zSliceValue->setValue(0.0);
    GLMotif::Slider * zSliceSlider = new GLMotif::Slider("ZSliceSlider", xyzContoursRowColumn, GLMotif::Slider::HORIZONTAL, styleSheet.fontHeight * 10.0f);
    zSliceSlider->setValueRange(0.0, float(exampleVTKReader->getHeight() - 1), 1.0);
    zSliceSlider->setValue(0.0);
    zSliceSlider->getValueChangedCallbacks().add(this, &Contours::sliderCallback);
} // end createZContours()
示例#2
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();
}
示例#3
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();
}