Package com.inductiveautomation.rm.shape
Class RMScene3D
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.shape.RMShape
com.inductiveautomation.rm.shape.RMParentShape
com.inductiveautomation.rm.shape.RMScene3D
- All Implemented Interfaces:
Archivable
,DeepChangeListener
,RMPropertyChanger
,RMTypes
,PropertyChangeListener
,Cloneable
,EventListener
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.Nested classes/interfaces inherited from interface com.inductiveautomation.rm.base.RMTypes
RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
Fields inherited from class com.inductiveautomation.rm.shape.RMShape
BINDING_PROP_NAME, STROKE_BORDER, STROKE_DOUBLE, STROKE_HIDDEN, STROKE_SHAPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Viewer method.protected RMScene3D.RMShape3D
addChild3D
(RMShape aShape, double z1, double z2, boolean fixEdges) 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.void
Copy 3D attributes only.protected void
fromXMLShape
(RXArchiver anArchiver, RXElement anElement) XML unarchival.Returns the camera as a vector.double
getDepth()
Returns the depth of the scene.double
Returns the field of view of the camera (derived from focalLength).double
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.double
Returns the Z offset of the scene (for zooming).Returns the scene's origin.double
getPitch()
Returns the rotation about the X axis in degrees.double
Returns the skew angle for X by Z.double
Returns the skew angle for Y by Z.double
Returns the rotation about the Z axis in degrees.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.boolean
Returns whether scene3d is being re-oriented.double
getYaw()
Returns the rotation about the Y axis in degrees.boolean
isHittable
(RMShape aChild) Override to indicate that scene children are unhittable.boolean
Returns whether scene is rendered in pseudo 3d.protected boolean
Override to make all 3D children show.protected void
Rebuilds 3D representation of shapes from shapes list.void
mouseDragged
(RMShapeMouseEvent anEvent) Viewer method.void
mousePressed
(RMShapeMouseEvent anEvent) Viewer method.void
mouseReleased
(RMShapeMouseEvent anEvent) Viewer method.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
Sets some reasonable default view settings.void
setDepth
(double aValue) Sets the depth of the scene.void
setFieldOfView
(double aValue) Sets the field of view of the camera.void
setFillAndStroke
(RMScene3D.RMShape3D aShape3D, RMFill aFill, RMStroke aStroke, RMEffect anEffect) Sets the fill and stroke of a 3D shape from a 2D shape.void
setFocalLength
(double aValue) Sets the focal length of the camera.void
setOffsetZ
(double aValue) Sets the Z offset of the scene (for zooming).void
setPitch
(double aValue) Sets the rotation about the X axis in degrees.void
setPseudo3D
(boolean aFlag) Sets whether scene is rendered in pseudo 3d.void
setPseudoSkewX
(double anAngle) Sets the skew angle for X by Z.void
setPseudoSkewY
(double anAngle) Sets the skew angle for Y by Z.void
setRoll3D
(double aValue) Sets the rotation about the Z axis in degrees.void
setYaw
(double aValue) Sets the rotation about the Y axis in degrees.protected void
toXMLChildren
(RXArchiver anArchiver, RXElement anElement) XML archival of children - overrides shape implementation to suppress archival of generated 3D shapes.protected RXElement
toXMLShape
(RXArchiver anArchiver) XML archival.Methods inherited from class com.inductiveautomation.rm.shape.RMParentShape
addChild, addChild, addChild, addChild, addLayoutChild, bringShapesToFront, clone, cloneDeep, computePrefHeight, computePrefWidth, divideShapeFromTop, fromXML, fromXMLChildren, getBoundsOfChildren, getChild, getChildArray, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWithClass, getChildrenWithClass, getChildWithClass, getChildWithName, getLayout, getNeedsLayout, getSourceURL, indexOfChild, isSourceURLSet, layout, relayout, removeChild, removeChild, removeChildren, removeLayoutChild, rpgAll, rpgChildren, sendShapesToBack, setHeight, setLayout, setNeedsLayout, setSourceURL, setWidth, toXML
Methods inherited from class com.inductiveautomation.rm.shape.RMShape
acceptsChildren, addBinding, addBinding, addDeepChangeListener, addMouseListener, animUpdate, bounds, childrenSuperSelectImmediately, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, createDivideShapeRemainder, deepChange, divideShapeFromEdge, get, get, getAlignment, getAlignmentX, getAlignmentY, getAncestor, getAncestorCount, getAncestorInCommon, getAnimator, getAnimator, getAutosizing, getAutosizingDefault, getBestHeight, getBestHeight, getBestWidth, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBounds, getBoundsInside, getBoundsMarked, getBoundsMarkedDeep, getChildAnimator, getChildAnimator, getChildClipShape, getClipShape, getColor, getDashArrayString, getDashPhase, getDatasetEntity, getDatasetKey, getDisplayedFill, getDisplayedStroke, getDocument, getEffect, getEventAdapter, getFill, getFont, getFormat, getFrame, getFrameHeight, getFrameMaxX, getFrameMaxY, getFrameWidth, getFrameX, getFrameXY, getFrameY, getHeight, getHover, getLayoutInfo, getMaskPath, getMaxX, getMaxY, getMinHeight, getMinHeight, getMinWidth, getMinWidth, getName, getOpacity, getOpacityDeep, getOutline, getPageBreak, getPageBreakMax, getPageBreakPage, getPageBreakPageMax, getPageShape, getParent, getParent, getPath, getPathInBounds, getPrefHeight, getPrefHeight, getPrefWidth, getPrefWidth, getPropertyNameMapped, getPropertyNames, getPropertyNames, getRoll, getRootShape, getRSS, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSkewX, getSkewY, getStroke, getStrokeColor, getStrokeOnTop, getStrokeStyle, getStrokeWidth, getTextColor, getTimeline, getTimeline, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getURL, getVisbileBounds, getVisibleBounds, getVisibleBounds, getVisibleBounds, getWidth, getX, getXY, getXYP, getY, height, indexOf, intersects, isAncestor, isAnimProperty, isDeletable, isDescendant, isEditing, isEnabled, isFontSet, isHittable, isLocked, isMinHeightSet, isMinWidthSet, isPrefHeightSet, isPrefWidthSet, isRoot, isRSS, isShowing, isUnderlined, isUseFill, isUseStroke, isViewing, isVisible, mouseClicked, mouseEntered, mouseExited, mouseMoved, offsetXY, page, pageMax, paint, paintShape, paintShapeAll, paintShapeChildren, paintShapeOver, propertyChange, put, removeBinding, removeBinding, removeDeepChangeListener, removeFromParent, removeMouseListener, repaint, repaint, resolvePageReferences, rpgBindings, rpgShape, setAlignment, setAlignmentX, setAlignmentY, setAutosizing, setBestHeight, setBestSize, setBounds, setBounds, setColor, setDashArrayString, setDashPhase, setEffect, setEnabled, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHover, setLayoutInfo, setLocked, setMinHeight, setMinSize, setMinWidth, setName, setOpacity, setOutline, setParent, setPrefHeight, setPrefWidth, setRoll, setScaleX, setScaleXY, setScaleY, setShowing, setSize, setSize, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setStrokeStyle, setStrokeWidth, setTextColor, setTime, setTimeline, setUnderlined, setURL, setUseFill, setUseStroke, setVisible, setX, setXY, setXY, setXYP, setY, shapeHidden, shapeShown, superSelectable, toString, undoerDisable, undoerEnable, undoerSetUndoTitle, width, x, y
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
Field Details
-
CONSTRAIN_NONE
public static final int CONSTRAIN_NONE- See Also:
-
CONSTRAIN_PITCH
public static final int CONSTRAIN_PITCH- See Also:
-
CONSTRAIN_YAW
public static final int CONSTRAIN_YAW- See Also:
-
-
Constructor Details
-
RMScene3D
public RMScene3D()
-
-
Method Details
-
getDepth
public double getDepth()Returns the depth of the scene. -
setDepth
public void setDepth(double aValue) Sets the depth of the scene. -
getOrigin
Returns the scene's origin. -
getYaw
public double getYaw()Returns the rotation about the Y axis in degrees. -
setYaw
public void setYaw(double aValue) Sets the rotation about the Y axis in degrees. -
getPitch
public double getPitch()Returns the rotation about the X axis in degrees. -
setPitch
public void setPitch(double aValue) Sets the rotation about the X axis in degrees. -
getRoll3D
public double getRoll3D()Returns the rotation about the Z axis in degrees. -
setRoll3D
public void setRoll3D(double aValue) Sets the rotation about the Z axis in degrees. -
getFocalLength
public double getFocalLength()Returns the focal length of the camera (derived from the field of view and with view size). -
setFocalLength
public void setFocalLength(double aValue) Sets the focal length of the camera. Two feet is normal (1728 points). -
getOffsetZ
public double getOffsetZ()Returns the Z offset of the scene (for zooming). -
setOffsetZ
public void setOffsetZ(double 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 double getPseudoSkewX()Returns the skew angle for X by Z. -
setPseudoSkewX
public void setPseudoSkewX(double anAngle) Sets the skew angle for X by Z. -
getPseudoSkewY
public double getPseudoSkewY()Returns the skew angle for Y by Z. -
setPseudoSkewY
public void setPseudoSkewY(double anAngle) Sets the skew angle for Y by Z. -
getFieldOfView
public double getFieldOfView()Returns the field of view of the camera (derived from focalLength). -
setFieldOfView
public void setFieldOfView(double aValue) Sets the field of view of the camera. -
setDefaultViewSettings
public void setDefaultViewSettings()Sets some reasonable default view settings. -
getCamera
Returns the camera as a vector. -
getLight
Returns the scene light as a vector. -
getShapeCount
public int getShapeCount()Returns the number of shapes in the shape list. -
getShape
Returns the specific shape at the given index from 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. -
layoutChildren
protected void layoutChildren()Rebuilds 3D representation of shapes from shapes list.- Overrides:
layoutChildren
in classRMParentShape
-
addChild3D
Adds a given shape in 3D. FixEdges flag indicates wheter to stroke 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
public void setFillAndStroke(RMScene3D.RMShape3D aShape3D, RMFill aFill, RMStroke aStroke, RMEffect anEffect) 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. -
isShowing
Override to make all 3D children show.- Overrides:
isShowing
in classRMParentShape
-
isHittable
Override to indicate that scene children are unhittable.- Overrides:
isHittable
in classRMParentShape
-
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
-
getValueIsAdjusting
public boolean getValueIsAdjusting()Returns whether scene3d is being re-oriented. -
copy3D
Copy 3D attributes only. -
toXMLShape
XML archival.- Overrides:
toXMLShape
in classRMParentShape
-
toXMLChildren
XML archival of children - overrides shape implementation to suppress archival of generated 3D shapes.- Overrides:
toXMLChildren
in classRMParentShape
-
fromXMLShape
XML unarchival.- Overrides:
fromXMLShape
in classRMParentShape
-