public class HomeController3D extends java.lang.Object implements Controller
Modifier and Type | Class and Description |
---|---|
protected static class |
HomeController3D.CameraControllerState
Controller state classes super class.
|
protected class |
HomeController3D.EditingCameraState
Controller state handling mouse events to edit home items.
|
Constructor and Description |
---|
HomeController3D(Home home,
PlanController planController,
UserPreferences preferences,
ViewFactory viewFactory,
ContentManager contentManager,
javax.swing.undo.UndoableEditSupport undoSupport)
Creates the controller of home 3D view.
|
HomeController3D(Home home,
UserPreferences preferences,
ViewFactory viewFactory,
ContentManager contentManager,
javax.swing.undo.UndoableEditSupport undoSupport)
Creates the controller of home 3D view.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteCameras(java.util.List<Camera> cameras)
Deletes the given list of cameras from the ones stored in home.
|
void |
displayAllLevels()
Makes all levels visible.
|
void |
displaySelectedLevel()
Makes the selected level and below visible.
|
void |
elevateCamera(float delta)
Elevates home camera of
delta . |
void |
escape()
Escapes of current editing action.
|
protected HomeController3D.CameraControllerState |
getObserverCameraState()
Returns the observer camera state.
|
protected HomeController3D.CameraControllerState |
getTopCameraState()
Returns the top camera state.
|
View |
getView()
Returns the view associated with this controller.
|
void |
goToCamera(Camera camera)
Switches to observer or top camera and move camera to the values as the current camera.
|
boolean |
isEditingState()
Returns
true if this controller is moving items. |
void |
modifyAttributes()
Controls the edition of 3D attributes.
|
void |
modifyFieldOfView(float delta)
Modifies home camera field of view of
delta . |
void |
moveCamera(float delta)
Moves home camera of
delta . |
void |
moveCameraSideways(float delta)
Moves home camera sideways of
delta . |
void |
moveMouse(float x,
float y)
Processes a mouse button moved event.
|
void |
pressMouse(float x,
float y,
int clickCount,
boolean shiftDown,
boolean alignmentActivated,
boolean duplicationActivated,
boolean magnetismToggled,
View.PointerType pointerType)
Processes a mouse button pressed event.
|
void |
releaseMouse(float x,
float y)
Processes a mouse button released event.
|
void |
rotateCameraPitch(float delta)
Rotates home camera pitch angle of
delta radians. |
void |
rotateCameraYaw(float delta)
Rotates home camera yaw angle of
delta radians. |
void |
setAlignmentActivated(boolean alignmentActivated)
Activates or deactivates alignment feature during editing action.
|
protected void |
setCameraState(HomeController3D.CameraControllerState state)
Changes current state of controller.
|
void |
setDuplicationActivated(boolean duplicationActivated)
Activates or deactivates duplication feature during editing action.
|
void |
storeCamera(java.lang.String name)
Stores a clone of the current camera in home under the given
name . |
void |
toggleMagnetism(boolean magnetismToggled)
Toggles temporary magnetism feature of user preferences during editing action.
|
void |
viewFromObserver()
Changes home camera for
observer camera . |
void |
viewFromTop()
Changes home camera for
top camera . |
public HomeController3D(Home home, UserPreferences preferences, ViewFactory viewFactory, ContentManager contentManager, javax.swing.undo.UndoableEditSupport undoSupport)
home
- the home edited by this controller and its viewpublic HomeController3D(Home home, PlanController planController, UserPreferences preferences, ViewFactory viewFactory, ContentManager contentManager, javax.swing.undo.UndoableEditSupport undoSupport)
home
- the home edited by this controller and its viewpublic View getView()
getView
in interface Controller
public void viewFromTop()
top camera
.public void viewFromObserver()
observer camera
.public void storeCamera(java.lang.String name)
name
.public void goToCamera(Camera camera)
public void deleteCameras(java.util.List<Camera> cameras)
public void displayAllLevels()
public void displaySelectedLevel()
public void modifyAttributes()
protected void setCameraState(HomeController3D.CameraControllerState state)
public void moveCamera(float delta)
delta
.delta
- the value in cm that the camera should move forward
(with a negative delta) or backward (with a positive delta)public void moveCameraSideways(float delta)
delta
.delta
- the value in cm that the camera should move left
(with a negative delta) or right (with a positive delta)public void elevateCamera(float delta)
delta
.delta
- the value in cm that the camera should move down
(with a negative delta) or up (with a positive delta)public void rotateCameraYaw(float delta)
delta
radians.delta
- the value in rad that the camera should turn around yaw axispublic void rotateCameraPitch(float delta)
delta
radians.delta
- the value in rad that the camera should turn around pitch axispublic void modifyFieldOfView(float delta)
delta
.delta
- the value in rad that should be added the field of view
to get a narrower view (with a negative delta) or a wider view (with a positive delta)public void pressMouse(float x, float y, int clickCount, boolean shiftDown, boolean alignmentActivated, boolean duplicationActivated, boolean magnetismToggled, View.PointerType pointerType)
public void releaseMouse(float x, float y)
public void moveMouse(float x, float y)
public boolean isEditingState()
true
if this controller is moving items.public void escape()
public void toggleMagnetism(boolean magnetismToggled)
magnetismToggled
- if true
then magnetism feature is toggled.public void setAlignmentActivated(boolean alignmentActivated)
alignmentActivated
- if true
then alignment is active.public void setDuplicationActivated(boolean duplicationActivated)
duplicationActivated
- if true
then duplication is active.protected HomeController3D.CameraControllerState getObserverCameraState()
protected HomeController3D.CameraControllerState getTopCameraState()
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License