Interface Prism3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Prism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
-
- Type Parameters:
ST
- is the type of the general implementation.IT
- is the type of the implementation of this shape.IE
- is the type of the path elements.P
- is the type of the points.V
- is the type of the vectors.B
- is the type of the bounding boxes.
- All Superinterfaces:
Cloneable
,JsonableObject
,Serializable
,Shape3afp<ST,IT,IE,P,V,B>
,Shape3D<ST,IT,PathIterator3afp<IE>,P,V,B>
- All Known Subinterfaces:
RectangularPrism3afp<ST,IT,IE,P,V,B>
,Sphere3afp<ST,IT,IE,P,V,B>
- All Known Implementing Classes:
RectangularPrism3d
,RectangularPrism3dfx
,Sphere3d
,Sphere3dfx
public interface Prism3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Prism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>> extends Shape3afp<ST,IT,IE,P,V,B>
Base class for Prisms. Only rectangular prism are considered here.- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Thomas PIOTROWSKI, Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
clear()
Reset this shape to be equivalent to an just-created instance of this shape type.default P
getCenter()
Replies the center.default double
getCenterX()
Replies the center x.default double
getCenterY()
Replies the center y.default double
getCenterZ()
Replies the center z.default double
getDepth()
Replies the depth.default double
getHeight()
Replies the height.double
getMaxX()
Replies the max x.double
getMaxY()
Replies the max y.double
getMaxZ()
Replies the max z.double
getMinX()
Replies the min X.double
getMinY()
Replies the min y.double
getMinZ()
Replies the min z.default double
getWidth()
Replies the width.default void
inflate(double minXBorder, double minYBorder, double minZBorder, double maxXBorder, double maxYBorder, double maxZBorder)
Inflate this rectangular prism with the given amounts.default boolean
isEmpty()
Replies if this shape is empty.default void
set(double x, double y, double z, double width, double height, double depth)
Change the frame of the prism.default void
set(IT shape)
Set this shape with the attributes of the given shape.default void
set(Point3D<?,?> min, Point3D<?,?> max)
Change the frame of the prism.default void
setCenter(double cx, double cy, double cz)
Set the center.default void
setCenter(Point3D<?,?> center)
Set the center.default void
setCenterX(double cx)
Set the center's x.default void
setCenterY(double cy)
Set the center's y.default void
setCenterZ(double cz)
Set the center's z.default void
setDepth(double depth)
Change the depth of the prism, not the min corner.default void
setFromCenter(double centerX, double centerY, double centerZ, double cornerX, double cornerY, double cornerZ)
Sets the framing rectangular prism of thisShape
based on the specified center point coordinates and corner point coordinates.default void
setFromCenter(Point3D<?,?> center, Point3D<?,?> corner)
Sets the framing rectangular prism of thisShape
based on the specified center point coordinates and corner point coordinates.void
setFromCorners(double x1, double y1, double z1, double x2, double y2, double z2)
Change the frame of the rectangular prism conserving previous min and max if needed.default void
setFromCorners(Point3D<?,?> p1, Point3D<?,?> p2)
Change the frame of the rectangular prism conserving previous min and max if needed.default void
setHeight(double height)
Change the height of the prism, not the min corner.void
setMaxX(double x)
Set the max X conserving previous max if needed.void
setMaxY(double y)
Set the max Y conserving previous max if needed.void
setMaxZ(double z)
Set the max Z conserving previous max if needed.void
setMinX(double x)
Set the min X conserving previous min if needed.void
setMinY(double y)
Set the min Y conserving previous min if needed.void
setMinZ(double z)
Set the min Z conserving previous min if needed.default void
setWidth(double width)
Change the width of the prism, not the min corner.default void
toBoundingBox(B box)
Replies the bounds of the shape.default void
translate(double dx, double dy, double dz)
Translate the shape.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.afp.Shape3afp
contains, contains, contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, intersects, intersects, intersects, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.Shape3D
clone, equalsToPathIterator, equalsToShape, getClosestPointTo, getDistance, getDistance, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getPathIterator, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Method Detail
-
toBoundingBox
default void toBoundingBox(B box)
Description copied from interface:Shape3D
Replies the bounds of the shape.- Specified by:
toBoundingBox
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Prism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
box
- is set with the bounds of the shape.
-
clear
default void clear()
Description copied from interface:Shape3D
Reset this shape to be equivalent to an just-created instance of this shape type.
-
set
default void set(double x, double y, double z, double width, double height, double depth)
Change the frame of the prism.- Parameters:
x
- x coordinate of the lower front corner of the prism.y
- y coordinate of the lower front corner of the prism.z
- z coordinate of the lower front corner of the prism.width
- width of the prism.height
- height of the prism.depth
- depth of the prism.
-
set
default void set(Point3D<?,?> min, Point3D<?,?> max)
Change the frame of the prism.- Parameters:
min
- is the min corner of the rectangular prism.max
- is the max corner of the rectangular prism.
-
set
default void set(IT shape)
Description copied from interface:Shape3D
Set this shape with the attributes of the given shape.- Specified by:
set
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Prism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
shape
- the shape.
-
setWidth
default void setWidth(double width)
Change the width of the prism, not the min corner.- Parameters:
width
- the width of the prism.
-
setHeight
default void setHeight(double height)
Change the height of the prism, not the min corner.- Parameters:
height
- the heigth of the prism.
-
setDepth
default void setDepth(double depth)
Change the depth of the prism, not the min corner.- Parameters:
depth
- the depth of the prism
-
setFromCorners
void setFromCorners(double x1, double y1, double z1, double x2, double y2, double z2)
Change the frame of the rectangular prism conserving previous min and max if needed.- Parameters:
x1
- is the coordinate of the first corner.y1
- is the coordinate of the first corner.z1
- is the coordinate of the first corner.x2
- is the coordinate of the second corner.y2
- is the coordinate of the second corner.z2
- is the coordinate of the second corner.
-
setFromCorners
default void setFromCorners(Point3D<?,?> p1, Point3D<?,?> p2)
Change the frame of the rectangular prism conserving previous min and max if needed.- Parameters:
p1
- the first corner.p2
- the second corner.
-
setFromCenter
default void setFromCenter(double centerX, double centerY, double centerZ, double cornerX, double cornerY, double cornerZ)
Sets the framing rectangular prism of thisShape
based on the specified center point coordinates and corner point coordinates. The framing rectangular prism is used by the subclasses ofRectangularShape
to define their geometry.- Parameters:
centerX
- the X coordinate of the specified center pointcenterY
- the Y coordinate of the specified center pointcenterZ
- the Z coordinate of the specified center pointcornerX
- the X coordinate of the specified corner pointcornerY
- the Y coordinate of the specified corner pointcornerZ
- the Z coordinate of the specified corner point
-
setFromCenter
default void setFromCenter(Point3D<?,?> center, Point3D<?,?> corner)
Sets the framing rectangular prism of thisShape
based on the specified center point coordinates and corner point coordinates. The framing rectangular prism is used by the subclasses ofRectangularShape
to define their geometry.- Parameters:
center
- the specified center pointcorner
- the specified corner point
-
getMinX
@Pure double getMinX()
Replies the min X.- Returns:
- the min x.
-
setMinX
void setMinX(double x)
Set the min X conserving previous min if needed.- Parameters:
x
- the min x.
-
getCenterX
@Pure default double getCenterX()
Replies the center x.- Returns:
- the center x.
-
getMaxX
@Pure double getMaxX()
Replies the max x.- Returns:
- the max x.
-
setMaxX
void setMaxX(double x)
Set the max X conserving previous max if needed.- Parameters:
x
- the max x.
-
getMinY
@Pure double getMinY()
Replies the min y.- Returns:
- the min y.
-
setMinY
void setMinY(double y)
Set the min Y conserving previous min if needed.- Parameters:
y
- the min y.
-
getCenterY
@Pure default double getCenterY()
Replies the center y.- Returns:
- the center y.
-
getMaxY
@Pure double getMaxY()
Replies the max y.- Returns:
- the max y.
-
setMaxY
void setMaxY(double y)
Set the max Y conserving previous max if needed.- Parameters:
y
- the max y.
-
getMinZ
@Pure double getMinZ()
Replies the min z.- Returns:
- the min z.
-
setMinZ
void setMinZ(double z)
Set the min Z conserving previous min if needed.- Parameters:
z
- the min z.
-
getCenterZ
@Pure default double getCenterZ()
Replies the center z.- Returns:
- the center z.
-
getMaxZ
@Pure double getMaxZ()
Replies the max z.- Returns:
- the max z.
-
setMaxZ
void setMaxZ(double z)
Set the max Z conserving previous max if needed.- Parameters:
z
- the max z.
-
getCenter
default P getCenter()
Replies the center.- Returns:
- the center.
-
setCenter
default void setCenter(double cx, double cy, double cz)
Set the center.- Parameters:
cx
- the center x.cy
- the center y.cz
- the center z.
-
setCenter
default void setCenter(Point3D<?,?> center)
Set the center.- Parameters:
center
- the center point.
-
setCenterX
default void setCenterX(double cx)
Set the center's x.- Parameters:
cx
- the center x.
-
setCenterY
default void setCenterY(double cy)
Set the center's y.- Parameters:
cy
- the center y.
-
setCenterZ
default void setCenterZ(double cz)
Set the center's z.- Parameters:
cz
- the center z.
-
getWidth
@Pure default double getWidth()
Replies the width.- Returns:
- the width.
-
getHeight
@Pure default double getHeight()
Replies the height.- Returns:
- the height.
-
getDepth
@Pure default double getDepth()
Replies the depth.- Returns:
- the depth.
-
translate
default void translate(double dx, double dy, double dz)
Description copied from interface:Shape3afp
Translate the shape.- Specified by:
translate
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Prism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
dx
- x translation.dy
- y translation.dz
- z translation.
-
isEmpty
@Pure default boolean isEmpty()
Description copied from interface:Shape3D
Replies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.- Specified by:
isEmpty
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Prism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Returns:
true
if the shape is empty;false
otherwise.
-
inflate
default void inflate(double minXBorder, double minYBorder, double minZBorder, double maxXBorder, double maxYBorder, double maxZBorder)
Inflate this rectangular prism with the given amounts.All borders may be inflated. If the value associated to a border is positive, the border is moved outside the current prism. If the value is negative, the border is moved inside the prism.
- Parameters:
minXBorder
- the value to substract to the minimum x.minYBorder
- the value to substract to the minimum y.minZBorder
- the value to substract to the minimum z.maxXBorder
- the value to add to the maximum x.maxYBorder
- the value to add to the maximum y.maxZBorder
- the value to add to the maximum z.
-
-