Package com.reportmill.shape
Class RMScene3D
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.shape.RMShape
com.reportmill.shape.RMScene3D
- All Implemented Interfaces:
RMArchiver.Archiving
,Cloneable
- Direct Known Subclasses:
RMGraphBarView3D
,RMGraphContent
,RMGraphPieView3D
This class manages a list of children and transforms them to 3D representations for display based on X and Y axis
rotations.
ReportMill 3D conventions:
Coordinate system: Right handed (not left handed) Polygon front: Right hand rule (counter-clockwise defined polygons face forward) Transforms: Row major notation (as opposed to column major, points are assumed row vectors)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
RMPolygon subclass that encapsulates a Path3D. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
final int
final int
Fields inherited from class com.reportmill.shape.RMShape
WRAP_TYPE_BOTH, WRAP_TYPE_NONE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Viewer method.protected RMScene3D.RMShape3D
addChild3D
(RMShape aShape, float z1, float z2) Adds a given shape in 3D.protected RMScene3D.RMShape3D
addChild3D
(RMShape aShape, float z1, float z2, boolean fixupEdges, boolean axisAlign) Adds a given shape in 3D.void
Adds a shape to the end of the shape list.void
Adds a shape to the shape list at the given index.boolean
Editor method - declares that this shape can't be ungrouped.void
Copies the attributes from the given object.boolean
Standard equals implementation.fromXML
(RXArchiver anArchiver, RXElement anElement) XML unarchival.Overrides shape implementation to reflect that transformed children may extend outside bounds.Returns the bounds of the shape in parect coords when super selected (same as getBoundsMarked by default).Returns the camera as a vector.Editor method - declares that no child of this shape can be selected.float
getDepth()
Returns the depth of the scene.float
Returns the field of view of the camera (derived from focalLength).float
Returns the focal length of the camera (derived from the field of view and with view size).getLight()
Returns the scene light as a vector.float
Returns the Z offset of the scene (for zooming).Returns the scene's origin.float
getPitch()
Returns the rotation about the X axis in degrees.float
Returns the skew angle for X by Z.float
Returns the skew angle for Y by Z.getShape
(int anIndex) Returns the specific shape at the given index from the shape list.int
Returns the number of shapes in the shape list.Returns the transform 3d for the scene's camera.float
getYaw()
Returns the rotation about the Y axis in degrees.float
getZRoll()
Returns the rotation about the Z axis in degrees.boolean
Returns whether scene is rendered in pseudo 3d.void
mouseDragged
(RMViewer aViewer, MouseEvent anEvent) Viewer method.void
mousePressed
(RMViewer aViewer, MouseEvent anEvent) Viewer method.void
mouseReleased
(RMViewer aViewer, MouseEvent anEvent) Viewer method.void
rebuild()
Rebuilds 3D representation of shapes from shapes list.void
removeShape
(int anIndex) Removes the shape at the given index from the shape list.void
resort()
Resorts child shapes from back to front.void
setColor
(RMScene3D.RMShape3D aShape3D, RMColor aColor) Sets the color for a 3d shape from a base color.void
setDepth
(float aDepth) Sets the depth of the scene.void
setFieldOfView
(float aValue) Sets the field of view of the camera.void
setFillAndStroke
(RMScene3D.RMShape3D aShape3D, RMShape aShape) Sets the fill and stroke of a 3D shape from a 2D shape.void
setFocalLength
(float aValue) Sets the focal length of the camera.void
setOffsetZ
(float aValue) Sets the Z offset of the scene (for zooming).void
setPitch
(float aValue) Sets the rotation about the X axis in degrees.void
setPseudo3D
(boolean aFlag) Sets whether scene is rendered in pseudo 3d.void
setPseudoSkewX
(float anAngle) Sets the skew angle for X by Z.void
setPseudoSkewY
(float anAngle) Sets the skew angle for Y by Z.void
setYaw
(float aValue) Sets the rotation about the Y axis in degrees.void
setZRoll
(float aValue) Sets the rotation about the Z axis in degrees.boolean
Editor method - indicates that scene 3d is super selectable.toXML
(RXArchiver anArchiver) XML archival.Methods inherited from class com.reportmill.shape.RMShape
acceptsChildren, acceptsDragKeys, acceptsFormat, addChild, addChild, addChildBelowLastChild, bounds, boundsChanged, boundsChanged, bringShapesToFront, childrenSuperSelectImmediately, clone, cloneDeep, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, delete, didChange, divideShapeFromEdge, divideShapeFromTop, dragExit, dragKeyAtPoint, dropKeyAtPoint, fromXMLDeep, get, getActionScript, getAnim, getAnim, getAnimator, getAnimator, getAutosizeHeight, getAutosizing, getBounds, getBoundsInside, getBoundsOfChildren, getBoundsOfChildren, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildAnimator, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWhoCauseWrap, getChildrenWhoDraw, getChildSortedByX, getChildWithClass, getChildWithName, getColor, getCommonAncestor, getDocument, getFill, getFill, getFill, getFillCount, getFills, getFont, getFormat, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getGroupShape, getHeight, getHeightToFit, getImageFill, getLineWidth, getListKey, getListKeyDeep, getListKeyShape, getMaxX, getMaxY, getName, getOpacity, getOpacityDeep, getOutline, getPageCount, getPageShape, getParent, getParentCount, getParents, getPath, getPathInBounds, getPropertyKey, getPropertyKeyCount, getPropertyKeyName, getRoll, getRootShape, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSizeP, getSkewX, getSkewY, getStroke, getStrokeColor, getTextColor, getToolClassName, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getWidth, getWidthToFit, getX, getXY, getXYP, getY, groupShapes, hasPageBreaks, height, indexOf, indexOf, initWithArchiver, intersects, isAncestor, isDescendant, isLocked, isRoot, isUnderlined, mouseEntered, mouseExited, mouseMoved, notRSS, offsetChildrenXY, offsetXY, page, pageBreakMax, pageBreakPageMax, pageMax, put, putPropertyKey, reclaimChildren, removeChild, removeChild, removeChildren, removeChildren, removeFromParent, resolvePageReferences, rpgClone, rpgCloneBase, rpgCloneChildren, rpgCloneConclude, rpgCloneNotification, rpgClonePrepare, rpgClonePreprocess, rpgCloneUrl, sendShapesToBack, setActionScript, setAnim, setAutosizeHeight, setAutosizing, setBounds, setBounds, setCausesWrapType, setChildren, setColor, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightDeep, setHeightDeep, setHeightToFit, setLineWidth, setListKey, setLocked, setName, setNeedsRepaint, setNeedsRepaint, setOpacity, setOutline, setParent, setRoll, setScaleX, setScaleXY, setScaleY, setSize, setSize, setSizeDeep, setSizeP, setSizeToFit, setSizeToFit, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setTextColor, setTime, setUnderlined, setUrl, setWidth, setWidthDeep, setWidthDeep, setWidthToFit, setX, setXY, setXY, setXYP, setY, sizesToFitChildren, toString, undoClone, undoCopy, undoEquals, undoerAddDirtyObject, undoerDisable, undoerEnable, undoerSetUndoTitle, width, willChange, willChange, x, y
Methods inherited from class com.reportmill.base.RMObject
didUndo, getAnimAttribute, getClassNameShort
-
Field Details
-
CONSTRAIN_NONE
public final int CONSTRAIN_NONE- See Also:
-
CONSTRAIN_PITCH
public final int CONSTRAIN_PITCH- See Also:
-
CONSTRAIN_YAW
public final int CONSTRAIN_YAW- See Also:
-
-
Constructor Details
-
RMScene3D
public RMScene3D()Creates a new Scene3d.
-
-
Method Details
-
getDepth
public float getDepth()Returns the depth of the scene. -
setDepth
public void setDepth(float aDepth) Sets the depth of the scene. -
getOrigin
Returns the scene's origin. -
getYaw
public float getYaw()Returns the rotation about the Y axis in degrees. -
setYaw
public void setYaw(float aValue) Sets the rotation about the Y axis in degrees. -
getPitch
public float getPitch()Returns the rotation about the X axis in degrees. -
setPitch
public void setPitch(float aValue) Sets the rotation about the X axis in degrees. -
getZRoll
public float getZRoll()Returns the rotation about the Z axis in degrees. -
setZRoll
public void setZRoll(float aValue) Sets the rotation about the Z axis in degrees. -
getFocalLength
public float getFocalLength()Returns the focal length of the camera (derived from the field of view and with view size). -
setFocalLength
public void setFocalLength(float aValue) Sets the focal length of the camera. Two feet is normal (1728 points). -
getOffsetZ
public float getOffsetZ()Returns the Z offset of the scene (for zooming). -
setOffsetZ
public void setOffsetZ(float aValue) Sets the Z offset of the scene (for zooming). -
isPseudo3D
public boolean isPseudo3D()Returns whether scene is rendered in pseudo 3d. -
setPseudo3D
public void setPseudo3D(boolean aFlag) Sets whether scene is rendered in pseudo 3d. -
getPseudoSkewX
public float getPseudoSkewX()Returns the skew angle for X by Z. -
setPseudoSkewX
public void setPseudoSkewX(float anAngle) Sets the skew angle for X by Z. -
getPseudoSkewY
public float getPseudoSkewY()Returns the skew angle for Y by Z. -
setPseudoSkewY
public void setPseudoSkewY(float anAngle) Sets the skew angle for Y by Z. -
getFieldOfView
public float getFieldOfView()Returns the field of view of the camera (derived from focalLength). -
setFieldOfView
public void setFieldOfView(float aValue) Sets the field of view of the camera. -
getCamera
Returns the camera as a vector. -
getLight
Returns the scene light as a vector. -
getShape
Returns the specific shape at the given index from the shape list. -
getShapeCount
public int getShapeCount()Returns the number of shapes in the shape list. -
addShape
Adds a shape to the end of the shape list. -
addShape
Adds a shape to the shape list at the given index. -
removeShape
public void removeShape(int anIndex) Removes the shape at the given index from the shape list. -
getTransform3D
Returns the transform 3d for the scene's camera. -
rebuild
public void rebuild()Rebuilds 3D representation of shapes from shapes list. -
addChild3D
Adds a given shape in 3D. -
addChild3D
protected RMScene3D.RMShape3D addChild3D(RMShape aShape, float z1, float z2, boolean fixupEdges, boolean axisAlign) Adds a given shape in 3D. fixupEdges flag indicates wheter or not to stroke the polygons created during extrusion, to try to make them mesh better. The axisAlign flag can be set to true to make sure the shape's coordinate system is aligned with the screen. -
setFillAndStroke
Sets the fill and stroke of a 3D shape from a 2D shape. -
setColor
Sets the color for a 3d shape from a base color. -
resort
public void resort()Resorts child shapes from back to front. -
getBoundsSuperSelected
Returns the bounds of the shape in parect coords when super selected (same as getBoundsMarked by default).- Overrides:
getBoundsSuperSelected
in classRMShape
-
getBoundsMarked
Overrides shape implementation to reflect that transformed children may extend outside bounds.- Overrides:
getBoundsMarked
in classRMShape
-
canBeUngrouped
public boolean canBeUngrouped()Editor method - declares that this shape can't be ungrouped.- Overrides:
canBeUngrouped
in classRMShape
-
superSelectable
public boolean superSelectable()Editor method - indicates that scene 3d is super selectable.- Overrides:
superSelectable
in classRMShape
-
acceptsMouse
public boolean acceptsMouse()Viewer method.- Overrides:
acceptsMouse
in classRMShape
-
mousePressed
Viewer method.- Overrides:
mousePressed
in classRMShape
-
mouseDragged
Viewer method.- Overrides:
mouseDragged
in classRMShape
-
mouseReleased
Viewer method.- Overrides:
mouseReleased
in classRMShape
-
getChildrenWhoHitTest
Editor method - declares that no child of this shape can be selected.- Overrides:
getChildrenWhoHitTest
in classRMShape
-
equals
Standard equals implementation. -
copy
Copies the attributes from the given object. -
toXML
XML archival. -
fromXML
XML unarchival.
-