17 package com.generalrobotix.ui.view.tdview;
19 import javax.media.j3d.*;
20 import javax.vecmath.*;
38 FRONT_VIEW | BACK_VIEW | LEFT_VIEW | RIGHT_VIEW | TOP_VIEW |
BOTTOM_VIEW;
57 transform_ =
new Transform3D();
68 if ((mode_ & VIEW_MASK) == VIEW_MODE_FIXED)
return;
69 mode_ = (mode &
MODE_MASK) | (mode_ & VIEW_MASK);
70 if (listener_ !=
null) {
90 mode_ = (mode_ &
MODE_MASK) | (dir & VIEW_MASK);
91 Matrix3d rot =
new Matrix3d();
92 Vector3d pos =
new Vector3d();
93 switch (mode_ & VIEW_MASK) {
95 pos.set(
new double[]{
distance_, 0.0, 0.0});
105 pos.set(
new double[]{-
distance_, 0.0, 0.0});
115 pos.set(
new double[]{0.0,
distance_, 0.0});
125 pos.set(
new double[]{0.0, -
distance_, 0.0});
135 pos.set(
new double[]{0.0, 0.0, distance_});
145 pos.set(
new double[]{0.0, 0.0, -distance_});
155 transform_.setTranslation(pos);
156 transform_.setRotation(rot);
164 return (mode_ & MODE_MASK);
168 return (mode_ & VIEW_MASK);
180 transform_.set(transform);
static final int VIEW_MODE_PARALLEL
static final int VIEW_MODE_WALK
static final int VIEW_MODE_ROOM
static final int TOP_VIEW
#define null
our own NULL pointer
static final int LEFT_VIEW
static ViewModeChangeListener add(ViewModeChangeListener listener1, ViewModeChangeListener listener2)
void removeViewModeChangeListener(ViewModeChangeListener listener)
void setDistance(double dist)
static final int FRONT_VIEW
void setDirection(int dir)
static final int BOTTOM_VIEW
static final int VIEW_MASK
static ViewModeChangeListener remove(ViewModeChangeListener listener, ViewModeChangeListener old)
ViewInfo(int mode, double dist)
static final int RIGHT_VIEW
static final int VIEW_MODE_FIXED
void viewModeChanged(int mode)
static final int BACK_VIEW
void setTransform(Transform3D transform)
Transform3D getTransform()
void addViewModeChangeListener(ViewModeChangeListener listener)
static final int MODE_MASK
ViewModeChangeListener listener_
void setViewMode(int mode)