Пример #1
0
ostream& VrmlNodeNavigationInfo::printFields(ostream& os, int indent)
{
  if (d_avatarSize.size() != 3 ||
      ! FPEQUAL(d_avatarSize[0], 0.25) ||
      ! FPEQUAL(d_avatarSize[1], 1.6) ||
      ! FPEQUAL(d_avatarSize[2], 0.75) )
    PRINT_FIELD(avatarSize);
  if (! d_headlight.get()) PRINT_FIELD(headlight);
  if (! FPEQUAL(d_speed.get(), 1.0)) PRINT_FIELD(speed);
  if (d_type.size() != 2 ||
      strcmp(d_type[0], "WALK") != 0 ||
      strcmp(d_type[1], "ANY") != 0 )
    PRINT_FIELD(type);
  if (! FPZERO(d_visibilityLimit.get())) PRINT_FIELD(visibilityLimit);

  return os;
}
Пример #2
0
ostream &VrmlNodeMultiTouchSensor::printFields(ostream &os, int indent)
{
    if (!d_trackObjects.get())
        PRINT_FIELD(trackObjects);
    if (!d_freeze.get())
        PRINT_FIELD(freeze);
    if (!d_enabled.get())
        PRINT_FIELD(enabled);
    if (!d_currentCamera.get())
        PRINT_FIELD(currentCamera);
    if (!FPEQUAL(d_size.x(), -1.0) || !FPEQUAL(d_size.y(), -1.0))
        PRINT_FIELD(size);
    if (!FPEQUAL(d_minPosition.x(), -1.0) || !FPEQUAL(d_minPosition.y(), -1.0))
        PRINT_FIELD(minPosition);

    return os;
}
ostream& VrmlNodeTextureTransform::printFields(ostream& os, int indent)
{
  if (! FPZERO(d_center.x()) ||
      ! FPZERO(d_center.y()))
    PRINT_FIELD(center);

  if (! FPZERO(d_rotation.get()))
    PRINT_FIELD(rotation);

  if (! FPEQUAL(d_scale.x(), 1.0) ||
      ! FPEQUAL(d_scale.y(), 1.0))
    PRINT_FIELD(scale);
  if (! FPZERO(d_translation.x()) ||
      ! FPZERO(d_translation.y()))
    PRINT_FIELD(translation);
      
  return os;
}
Пример #4
0
ostream& VrmlNodePlaneSensor::printFields(ostream& os, int indent)
{
  if (! d_autoOffset.get()) PRINT_FIELD(autoOffset);
  if (! d_enabled.get())    PRINT_FIELD(enabled);
  if (! FPEQUAL(d_maxPosition.x(), -1.0) ||
      ! FPEQUAL(d_maxPosition.y(), -1.0))
    PRINT_FIELD(maxPosition);
  if (! FPEQUAL(d_minPosition.x(), -1.0) ||
      ! FPEQUAL(d_minPosition.y(), -1.0))
    PRINT_FIELD(minPosition);

  if (! FPZERO(d_offset.x()) ||
      ! FPZERO(d_offset.y()) ||
      ! FPZERO(d_offset.z()) )
    PRINT_FIELD(offset);

  return os;
}
Пример #5
0
ostream& VrmlNodeViewpoint::printFields(ostream& os, int indent)
{
  if (! FPEQUAL( d_fieldOfView.get(), DEFAULT_FIELD_OF_VIEW))
    PRINT_FIELD(fieldOfView);
  if (! d_jump.get()) PRINT_FIELD(jump);
  if (! FPZERO(d_orientation.x()) ||
      ! FPZERO(d_orientation.y()) ||
      ! FPEQUAL(d_orientation.z(), 1.0) ||
      ! FPZERO(d_orientation.r()) )
    PRINT_FIELD(orientation);
  if (! FPZERO(d_position.x()) ||
      ! FPZERO(d_position.y()) ||
      ! FPEQUAL(d_position.z(), 10.0) )
    PRINT_FIELD(position);
  if (d_description.get()) PRINT_FIELD(description);

  return os;
}
Пример #6
0
ostream& VrmlNodeMovieTexture::printFields(ostream& os, int indent)
{
  if (d_loop.get()) PRINT_FIELD(loop);
  if (!FPEQUAL(d_speed.get(), 1.0)) PRINT_FIELD(speed);
  if (!FPZERO(d_startTime.get())) PRINT_FIELD(startTime);
  if (!FPZERO(d_stopTime.get())) PRINT_FIELD(stopTime);
  if (d_url.get()) PRINT_FIELD(url);
  if (! d_repeatS.get()) PRINT_FIELD(repeatS);
  if (! d_repeatT.get()) PRINT_FIELD(repeatT);
  return os;
}
Пример #7
0
void do_SetRegion(struct work_item *p) {
  double new_xstep;
  double new_ystep;
  new_x_left   = p->u.set_region.new_x_left;
  new_y_top    = p->u.set_region.new_y_top;
  new_x_right  = p->u.set_region.new_x_right;
  new_y_bottom = p->u.set_region.new_y_bottom;

  new_xstep = (new_x_right - new_x_left) / canvas_width;
  new_ystep = (new_y_bottom - new_y_top) / canvas_width;

  if (new_x_left == x_left && new_x_right == x_right) {
    if (new_y_top == y_top && new_y_bottom == y_bottom) {
      /* No change */
    } else if (new_ystep == ystep) {
      /* Vertical pan */
      /* Note that ystep is negative */
      MoveUD(-(new_y_top - y_top) / ystep);
      y_top = new_y_top;
      y_bottom = new_y_bottom;
    } else {
      /* Vertical zoom (and possibly pan) */
      y_top = new_y_top;
      y_bottom = new_y_bottom;
      ystep = new_ystep;
      Compute(0, canvas_width, x_left,
              0, canvas_width, y_top,
              (int) canvas_width, pixmap);
    }
  } else if (new_y_top == y_top && new_y_bottom == y_bottom) {
    if (new_x_left == x_left && new_x_right == x_right) {
      /* No change */
    } else if (new_xstep == xstep) {
      /* Horizontal pan */
      MoveLR((new_x_right - x_right) / xstep);
      x_left = new_x_left;
      x_right = new_x_right;
    } else {
      /* Horizontal zoom (and possibly pan) */
      x_left = new_x_left;
      x_right = new_x_right;
      xstep = new_xstep;
      Compute(0, canvas_width, x_left,
              0, canvas_width, y_top,
              (int) canvas_width, pixmap);
    }
  } else if (FPEQUAL((x_right - x_left) / (y_top - y_bottom),
                     (new_x_right - new_x_left) / (new_y_top - new_y_bottom)) &&
             ((x_right - x_left) / (y_top - y_bottom) >=
              (new_x_right - new_x_left) / (new_y_top - new_y_bottom))) {
    /* Uniform zoom. */
    BuildMask(canvas_width, pixmap, mask);
    x_left = new_x_left;
    y_top = new_y_top;
    x_right = new_x_right;
    y_bottom = new_y_bottom;
    xstep = new_xstep;
    ystep = new_ystep;
    Compute(0, canvas_width, x_left,
            0, canvas_width, y_top,
            (int) canvas_width, pixmap);
  } else {
    /* General move. */
    x_left = new_x_left;
    y_top = new_y_top;
    x_right = new_x_right;
    y_bottom = new_y_bottom;
    xstep = new_xstep;
    ystep = new_ystep;
    Compute(0, canvas_width, x_left,
            0, canvas_width, y_top,
            (int) canvas_width, pixmap);
  }
}