Class Triangle
java.lang.Object
org.scilab.forge.scirenderer.implementation.g2d.motor.AbstractDrawable3DObject
org.scilab.forge.scirenderer.implementation.g2d.motor.ConvexObject
org.scilab.forge.scirenderer.implementation.g2d.motor.Triangle
- Author:
- Calixte DENIZET
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected static List
<ConvexObject> Get the broken triangles in following the intersection of the planes containing t1 and t2.Abstract method Break this ConvexObject against the ConvexObject oAbstract method Break this ConvexObject against a planeprotected static List
<ConvexObject> protected static List
<ConvexObject> breakTriangleOnLine
(Triangle t, Vector3d p, Vector3d n) Break a triangle according to its intersection with a line containing p in the plane of the triangle and orthogonal to n The triangle and the line are supposed to be coplanar.void
draw
(Graphics2D g2d) Draw this object on a Graphics2D objectprotected double
protected SpritedRectangle
int
Check if o is behind this.protected boolean
protected boolean
boolean
isIn2D()
protected boolean
protected boolean
isPointInside
(Vector3d v, boolean checkCoplanarity) protected boolean
protected boolean
protected boolean
boolean
void
void
replaceSegment
(Segment s, List<Segment> segs) protected void
setSprite
(SpritedRectangle sprite) toString()
Methods inherited from class org.scilab.forge.scirenderer.implementation.g2d.motor.ConvexObject
addArea, areCoplanar, check, check2DIntersection, check2DTrueIntersection, drawAreas
Methods inherited from class org.scilab.forge.scirenderer.implementation.g2d.motor.AbstractDrawable3DObject
getColorsBarycenter, getNormal, getPrecedence, getProjectedContour, getProjectedPolyLine, getProvidedNormal, is2D, isBehind, isBehind, isDegenerate, isEqual, isGreaterOrEqual, isLowerOrEqual, isMonochromatic, isNanOrInf, isNanOrInf, isNegativeOrNull, isNull, isPlanar, isPositiveOrNull, minmax2D, minmax3D, resetDefaultPrecedence, setNormal, setPrecedence
-
Field Details
-
segments
-
-
Constructor Details
-
Triangle
public Triangle(Vector3d[] vertices, Color[] colors, Vector3d normal) throws InvalidPolygonException - Throws:
InvalidPolygonException
-
Triangle
- Throws:
InvalidPolygonException
-
Triangle
public Triangle(Vector3d[] vertices, Vector3d[] textureCoords, BufferedImage image, Texture.Filter filter) throws InvalidPolygonException - Throws:
InvalidPolygonException
-
-
Method Details
-
isBehind
Description copied from class:ConvexObject
Check if o is behind this. Take care: the algorithms used are for convex objects (typically tri-tri, seg-seg or tri-seg)- Overrides:
isBehind
in classConvexObject
- Returns:
- true if o is behind this
-
isIn2D
public boolean isIn2D() -
addSegment
-
pointOnVertices
-
removeSegment
-
replaceSegment
-
breakObject
Description copied from class:ConvexObject
Abstract method Break this ConvexObject against the ConvexObject o- Specified by:
breakObject
in classConvexObject
- Parameters:
o
- a ConvexObject- Returns:
- a list of ConvexObject.
-
breakObject
-
breakObject
-
setSprite
-
getSprite
-
draw
Description copied from class:AbstractDrawable3DObject
Draw this object on a Graphics2D object- Specified by:
draw
in classAbstractDrawable3DObject
- Parameters:
g2d
- the Graphics2d object where to draw
-
breakObject
Description copied from class:ConvexObject
Abstract method Break this ConvexObject against a plane- Specified by:
breakObject
in classConvexObject
- Parameters:
v
- plane definition- Returns:
- a list of ConvexObject.
-
isPointInside
-
isPointInside
-
isCoplanar
-
isCoplanar
-
isSegmentAcross
-
isSegmentInside
-
isSegmentIntersects
-
getSegmentIntersection
-
breakSegmentOnTriangle
-
breakTriangleOnLine
Break a triangle according to its intersection with a line containing p in the plane of the triangle and orthogonal to n The triangle and the line are supposed to be coplanar.- Parameters:
t
- the triangle to breakp
- a point of the linen
- a vector- Returns:
- a list of triangles
-
breakIntersectingTriangles
Get the broken triangles in following the intersection of the planes containing t1 and t2. The planes containing t1 and t2 are supposed to be secant.- Parameters:
t1
- the first trianglet2
- the second triangle- Returns:
- an array of length 2 containing the resulting triangles for t1 and t2.
-
toString
-