Exemple #1
0
// Documented in superclass.
void
SoWinExaminerViewer::setCamera(SoCamera * newCamera)
{
  // This method overridden from parent class to toggle the camera
  // type selection button pixmap and string of the zoom/dolly
  // thumbwheel.

  inherited::setCamera(newCamera);

  if (! newCamera)
    return;

  SoType camtype = newCamera->getTypeId();
  SbBool orthogonal =
    camtype.isDerivedFrom(SoOrthographicCamera::getClassTypeId());

  const char * oldLabel = this->getRightWheelString();
  if (oldLabel) {
    if (orthogonal) {
      if (strcmp("Dolly",oldLabel) == 0)
        this->setRightWheelString("Zoom");
    }
    else if (strcmp("Zoom",oldLabel) == 0)
      this->setRightWheelString("Dolly");
  }
  SoWinBitmapButton * wbtn = PRIVATE(this)->camerabutton;
  // If viewer was made without decorations, button will not have been
  // made yet.
  if (wbtn) { wbtn->setBitmap(orthogonal ? 1 : 0); }
}
Exemple #2
0
// Documented in superclass.
void
SoWinExaminerViewer::createViewerButtons(HWND parent, SbPList * buttonlist)
{
  inherited::createViewerButtons(parent, buttonlist);

  SoWinBitmapButton * b = PRIVATE(this)->camerabutton =
    new SoWinBitmapButton(parent, 24, "perspective", NULL);
  b->addBitmap(perspective_xpm);
  b->addBitmap(ortho_xpm);
  b->setBitmap(0);
  b->registerClickedProc(SoWinExaminerViewerP::cameraButtonProc, this);
  buttonlist->append(b);
}
Exemple #3
0
HWND
SoWinFullViewer::buildViewerButtons(HWND parent)
{
  this->createViewerButtons(parent, & PRIVATE(this)->righttrimbuttons);

  // Now position the buttons.

  RECT rect;
  Win32::GetClientRect(parent, &rect);
  const int x = rect.right - DECORATION_SIZE;

  for (int i=0; i < PRIVATE(this)->righttrimbuttons.getLength(); i++) {
    SoWinBitmapButton * b = (SoWinBitmapButton *)
      PRIVATE(this)->righttrimbuttons[i];
    b->move(x, i * DECORATION_SIZE, DECORATION_SIZE, DECORATION_SIZE);
  }

  return parent;
}
Exemple #4
0
void
SoWinFullViewer::createViewerButtons(HWND parent, SbPList * buttonlist)
{
  SoWinBitmapButton * button = new SoWinBitmapButton(parent, 24, "pick", NULL);
  button->addBitmap(pick_xpm);
  button->setBitmap(0); // use first (and only) bitmap
  button->registerClickedProc(SoWinFullViewerP::interactbuttonProc, PRIVATE(this));
  buttonlist->append(button);
  button->setPressedState(this->isViewing() ? FALSE : TRUE);

  button = new SoWinBitmapButton(parent, 24, "view", NULL);
  button->addBitmap(view_xpm);
  button->setBitmap(0); // use first (and only) bitmap
  button->registerClickedProc(SoWinFullViewerP::examinebuttonProc, PRIVATE(this));
  buttonlist->append(button);
  button->setPressedState(this->isViewing());

  button = new SoWinBitmapButton(parent, 24, "home", NULL);
  button->addBitmap(home_xpm);
  button->setBitmap(0); // use first (and only) bitmap
  button->registerClickedProc(SoWinFullViewerP::homebuttonProc, PRIVATE(this));
  buttonlist->append(button);

  button = new SoWinBitmapButton(parent, 24, "set_home", NULL);
  button->addBitmap(set_home_xpm);
  button->setBitmap(0);
  button->registerClickedProc(SoWinFullViewerP::sethomebuttonProc, PRIVATE(this));
  buttonlist->append(button);

  button = new SoWinBitmapButton(parent, 24, "view_all", NULL);
  button->addBitmap(view_all_xpm);
  button->setBitmap(0); // use first (and only) bitmap
  button->registerClickedProc(SoWinFullViewerP::viewallbuttonProc, PRIVATE(this));
  buttonlist->append(button);

  button = new SoWinBitmapButton(parent, 24, "seek", NULL);
  button->addBitmap(seek_xpm);
  button->setBitmap(0); // use first (and only) bitmap
  button->registerClickedProc(SoWinFullViewerP::seekbuttonProc, PRIVATE(this));
  buttonlist->append(button);
}