|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.presentation.Shape
com.xj.anylogic.engine.presentation.Shape3DObject
public class Shape3DObject
Persistent 3D object shape loaded from X3D file. Also visible on 2D animation.
3D Object element enables AnyLogic users to import ready-to-use
3D objects created in some third-party 3D graphics packets into their models.
3D Object supports import of 3D objects stored in X3D and VRML files.
X3D format is the XML-based file format
for representing 3D computer graphics, the successor to the
Virtual Reality Modeling Language (VRML).
| Field Summary | |
|---|---|
static int |
XYZ_AXIS_ORDER
|
static int |
YZX_AXIS_ORDER
|
static int |
ZXY_AXIS_ORDER
|
| Fields inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
UNKNOWN_NAME |
| Constructor Summary | |
|---|---|
Shape3DObject(Presentable presentable,
boolean ispublic,
double x,
double y,
double z,
double rotation,
double scale,
java.lang.String packagePrefix,
java.lang.String fileName,
int axisOrder,
boolean applyShading,
double topLeftX,
double topLeftY,
double width,
double height)
Constructs a 3D shape with specific attributes. |
|
| Method Summary | |
|---|---|
Shape3DObject |
clone()
Creates and returns a copy of this shape (i.e. new shape instance). |
boolean |
contains(double px,
double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y) |
void |
dispose()
Releases resources allocated by this object, should be called on active object destroy. |
void |
draw(Panel panel,
java.awt.Graphics2D g,
java.awt.geom.AffineTransform xform,
boolean publicOnly)
Draws the object in a given context. |
Element3D_xjal |
get3DElement_xjal()
This method is internal and shouldn't be accessed by user. |
java.lang.String |
getFilename()
Returns the name of X3D file |
java.lang.String |
getFilePath_xjal()
This method is not intended to be called by user and may be removed in the next releases |
Presentable |
getPresentable()
Returns the Presentable object (ActiveObject or Experiment) where this shape belongs to, or null. |
double |
getScaleZ()
Returns the scale of the shape along z axis |
double |
getZ()
Returns the z coordinate of the shape. |
double |
getZOffset()
Returns the offset from z coordinate of the location base. |
boolean |
onClickAt(double px,
double py,
boolean publicOnly)
Tests if the object contains the point with the given coordinates and, if yes, executes the shape's reaction on click at that point. |
void |
restoreOwner(java.lang.Object owner)
This method normally should not be called by user This method restores owner of this object The method is used in snapshot saving/loading |
void |
set3DElement_xjal(Element3D_xjal element3D)
This method is internal and shouldn't be accessed by user. |
void |
setContextReference_xjal(Presentable contextReference)
This method is internal and shouldn't be accessed by user. |
void |
setPos(double x,
double y)
Sets (x, y) coordinates of the shape. |
void |
setPos(double x,
double y,
double z)
Sets coordinates of the shape |
void |
setRotation(double rotation)
Sets the rotation of the shape. |
void |
setScale(double scale)
Sets the scale of the object along all the axes |
void |
setScale(double sx,
double sy)
Sets the scales of the shape along both axes |
void |
setScaleX(double sx)
Sets the scale of the shape along x axis |
void |
setScaleY(double sy)
Sets the scale of the shape along y axis |
void |
setScaleZ(double sz)
Sets the scale of the shape along z axis |
void |
setVisible(boolean visible)
Sets the visibility of the shape. |
void |
setX(double x)
Sets the x coordinate of the shape |
void |
setY(double y)
Sets the y coordinate of the shape |
void |
setZ(double z)
Sets the z coordinate of the object |
| Methods inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
canHandleClick, getGroup, getName, getRotation, getScaleX, getScaleY, getX, getY, isVisible, onClick |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.xj.anylogic.engine.Locatable2D |
|---|
getX, getY |
| Field Detail |
|---|
public static final int XYZ_AXIS_ORDER
public static final int YZX_AXIS_ORDER
public static final int ZXY_AXIS_ORDER
| Constructor Detail |
|---|
public Shape3DObject(Presentable presentable,
boolean ispublic,
double x,
double y,
double z,
double rotation,
double scale,
java.lang.String packagePrefix,
java.lang.String fileName,
int axisOrder,
boolean applyShading,
double topLeftX,
double topLeftY,
double width,
double height)
presentable - the presentable object owning this objectispublic - if true, the shape is visible on container's presentationx - the x coordinate of the objecty - the y coordinate of the objectz - the z coordinate of the objectrotation - the rotation of the object in radiansscale - the scale of the objectpackagePrefix - the package name of original active object where
this object is defined, formatted using '/' characters; with '/'
character at the beginning and at the endfileName - the name of X3D fileaxisOrder - axis order of this figure, may be used for orientation correction
for objects obtained from different 3D editorsapplyShading - if true, AnyLogic light shaders will be added to this object
to provide nicer lighting effects. If you experience problems with specific
X3D file, set this parameter to falsetopLeftX - the x coordinate of the top-left corner of XY-projection of object in local object coordinatestopLeftY - the y coordinate of the top-left corner of XY-projection of object in local object coordinateswidth - the width of the XY-projection of object in local object coordinatesheight - the height of the XY-projection of object in local object coordinates| Method Detail |
|---|
public java.lang.String getFilename()
public java.lang.String getFilePath_xjal()
public boolean onClickAt(double px,
double py,
boolean publicOnly)
onClickAt in class Shapepx - the x coordinate of the clickpy - the y coordinate of the clickpublicOnly - if true, not public shape returns false
public boolean contains(double px,
double py)
Shape
contains in class Shapepx - the x coordinate relative to this shape's containerpy - the y coordinate relative to this shape's container
public void draw(Panel panel,
java.awt.Graphics2D g,
java.awt.geom.AffineTransform xform,
boolean publicOnly)
draw in class Shapepanel - the panel where the drawing is doneg - the graphics where the drawing takes placexform - the "original" transform that must be restored before drawingpublicOnly - if true, the shape is only drawn if it is publicpublic Presentable getPresentable()
Shape
getPresentable in interface com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjalgetPresentable in class Shapepublic void restoreOwner(java.lang.Object owner)
Shape
restoreOwner in interface com.xj.anylogic.engine.internal.ChildrestoreOwner in class Shapeowner - owner of this object, usually ActiveObject,
Experiment or
ShapeGrouppublic final Shape3DObject clone()
Shape
clone in class Shapepublic void setX(double x)
Shape
setX in class Shapex - the new value of x coordinatepublic void setY(double y)
Shape
setY in class Shapey - the new value of y coordinatepublic void setZ(double z)
z - the new value of z coordinatepublic double getZ()
getZ in interface Locatable3D
public void setPos(double x,
double y)
setPos in class Shapex - the new value of x coordinatey - the new value of y coordinate
public void setPos(double x,
double y,
double z)
x - the new value of x coordinatey - the new value of y coordinatez - the new value of z coordinatepublic void setScale(double scale)
setScale in class Shapescale - the new value of scale
public void setScale(double sx,
double sy)
Shape
setScale in class Shapesx - the new value of scale along x axis, 1 = keep original sizesy - the new value of scale along y axis, 1 = keep original sizepublic void setScaleX(double sx)
Shape
setScaleX in class Shapesx - the new value of scale along x axis, 1 = keep original sizepublic void setScaleY(double sy)
Shape
setScaleY in class Shapesy - the new value of scale along y axis, 1 = keep original sizepublic void setScaleZ(double sz)
sz - the new value of scale along z axis, 1 = keep original sizepublic double getScaleZ()
public double getZOffset()
Locatable3DgetZHeight() for
some 3D shapes
getZOffset in interface Locatable3Dpublic void setRotation(double rotation)
Shape
setRotation in class Shaperotation - the new value of rotation in radianspublic void setVisible(boolean visible)
Shape
setVisible in class Shapevisible - visibility: true - visible, false - notpublic Element3D_xjal get3DElement_xjal()
com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
get3DElement_xjal in interface com.xj.anylogic.engine.internal.presentation.Accessor3D_xjalpublic void set3DElement_xjal(Element3D_xjal element3D)
com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
set3DElement_xjal in interface com.xj.anylogic.engine.internal.presentation.Accessor3D_xjalpublic void setContextReference_xjal(Presentable contextReference)
com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjal
setContextReference_xjal in interface com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjalpublic void dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||