示例#1
0
/*
 * createButtonBox - Create a box to hold buttons.
 *
 * parameter animationDialog - GLMotif::RowColumn*&
 * return - GLMotif::RowColumn*
 */
GLMotif::RowColumn* AnimationDialog::createButtonBox(
  GLMotif::RowColumn*& animationDialog)
{
  GLMotif::RowColumn* buttonBox =
    new GLMotif::RowColumn("ButtonBox", animationDialog, false);
  buttonBox->setOrientation(GLMotif::RowColumn::HORIZONTAL);
  buttonBox->setPacking(GLMotif::RowColumn::PACK_GRID);
  GLMotif::Button* firstButton = new GLMotif::Button(
    "First", buttonBox, "First Frame");
  firstButton->getSelectCallbacks().add(this,
    &AnimationDialog::renderFrameCallback);
  GLMotif::Button* previousButton = new GLMotif::Button(
    "Previous", buttonBox, "Previous Frame");
  previousButton->getSelectCallbacks().add(this,
    &AnimationDialog::renderFrameCallback);
  playButton = new GLMotif::Button(
    "PlayPause", buttonBox, "Play");
  playButton->getSelectCallbacks().add(this,
    &AnimationDialog::playPauseCallback);
  GLMotif::Button* nextButton = new GLMotif::Button(
    "Next", buttonBox, "Next Frame");
  nextButton->getSelectCallbacks().add(this,
    &AnimationDialog::renderFrameCallback);
  GLMotif::Button* lastButton = new GLMotif::Button(
    "Last", buttonBox, "Last Frame");
  lastButton->getSelectCallbacks().add(this,
    &AnimationDialog::renderFrameCallback);
  return buttonBox;
}
示例#2
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
示例#3
0
/*
 * createButtonBox - Create a box to hold buttons.
 *
 * parameter colorMapDialog - GLMotif::RowColumn * &
 * return - GLMotif::RowColumn *
 */
GLMotif::RowColumn * Contours::createButtonBox(GLMotif::RowColumn * & colorMapDialog) {
    GLMotif::RowColumn * buttonBox = new GLMotif::RowColumn("ButtonBox", colorMapDialog, false);
    buttonBox->setOrientation(GLMotif::RowColumn::HORIZONTAL);
    GLMotif::ToggleButton * showContoursToggle = new GLMotif::ToggleButton(
      "ShowContoursToggle", buttonBox, "Show Contours");
    showContoursToggle->setToggle(true);
    showContoursToggle->getValueChangedCallbacks().add(this, &Contours::toggleSelectCallback);
    showContoursToggle->setToggleWidth(0.1f);
    GLMotif::Button * removeControlPointButton =
            new GLMotif::Button("RemoveControlPointButton", buttonBox, "Remove Control Point");
    removeControlPointButton->getSelectCallbacks().add(this, &Contours::removeControlPointCallback);
    return buttonBox;
}
/*
 * 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()
示例#5
0
/*
 * createTimeStepBox - Create a box to hold timestep buttons
 *
 * parameter animationDialog - GLMotif::RowColumn*&
 * return - GLMotif::RowColumn*
 */
GLMotif::RowColumn* AnimationDialog::createTimeStepBox(
  GLMotif::RowColumn*& animationDialog)
{
  GLMotif::RowColumn* buttonBox =
    new GLMotif::RowColumn("ButtonBox", animationDialog, false);
  buttonBox->setOrientation(GLMotif::RowColumn::HORIZONTAL);
  buttonBox->setPacking(GLMotif::RowColumn::PACK_GRID);
  GLMotif::ToggleButton* loopButton = new GLMotif::ToggleButton(
    "Loop", buttonBox, "Loop");
  loopButton->setToggle(false);
  loopButton->getValueChangedCallbacks().add(this,
    &AnimationDialog::loopPlayCallback);
  std::stringstream stimeStepRange;
  stimeStepRange << "Step (" << std::setprecision(4) <<
    0 << " - " << this->numberOfTimeSteps - 1 << "):";
  GLMotif::Label* timeStepLabel = new GLMotif::Label(
    "TimeStep", buttonBox, stimeStepRange.str().c_str());
  timeStepLabel->setHAlignment(GLFont::Center);
  this->stepField = new GLMotif::TextField(
    "TimeStepField", buttonBox, 6);
  this->stepField->setHAlignment(GLFont::Center);
  this->stepField->setEditable(false);
  this->stepField->setValue(0);
  std::stringstream stimeValueRange;
  stimeValueRange << "Time (" << std::setprecision(4) <<
    this->minTime << " - " << this->maxTime << "):";
  GLMotif::Label* timeValueLabel = new GLMotif::Label(
    "TimeValue", buttonBox, stimeValueRange.str().c_str());
  timeValueLabel->setHAlignment(GLFont::Center);
  this->timeField = new GLMotif::TextField(
    "TimeValueField", buttonBox, 6);
  this->timeField->setHAlignment(GLFont::Center);
  this->timeField->setEditable(false);
  this->timeField->setPrecision(4);
  this->timeField->setValue(0.0f);
  return buttonBox;
}