Ejemplo n.º 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); }
}
Ejemplo n.º 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);
}
Ejemplo n.º 3
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);
}