cz.cuni.jagrlib.iface
Interface Solid

All Superinterfaces:
IntersectionAttributes, Property
All Known Implementing Classes:
BrepSolid, Cone, Cube, Cylinder, DefaultSolid, Plane, Revolution, SolidSpecimen, Sphere

public interface Solid
extends Property, IntersectionAttributes

Elementary solid of 3D scene: it is able to compute ray-intersections (including normal vector, and 2D texture coordinate), manages bounding-volume and polyhedral representation.

Since:
0.11
See Also:
Solid.java, BoundingVolume, Brep, CSGLeaf, MicroFacet

Field Summary
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 int createPolyhedr(Brep b, double smoothness)
          Creates polyhedral representation of the solid (non-mandatory method).
 BoundingVolume getBoundingVolume(TrMatrix toWorld)
          Returns bounding volume of the solid (non-mandatory method).
 java.util.List<MicroFacet> intersection(double[] P0, double[] P1)
          Computes intersection of the solid with the given ray.
 boolean isInside(double[] point)
          Point vs. solid test ("inside-test").
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 
Methods inherited from interface cz.cuni.jagrlib.IntersectionAttributes
assertAttributes
 

Method Detail

createPolyhedr

int createPolyhedr(Brep b,
                   double smoothness)
Creates polyhedral representation of the solid (non-mandatory method).

Parameters:
b - Global B-rep data structure.
smoothness - Quality-factor of an approximation (0.0 for default approximation).
Returns:
Handle of the created solid (or NULL if the method is not implemented).
See Also:
Brep.NULL

intersection

java.util.List<MicroFacet> intersection(double[] P0,
                                        double[] P1)
Computes intersection of the solid with the given ray.

Parameters:
P0 - Ray origin (double[3] or double[4]).
P1 - Direction vector of the ray (double[3] or double[4]).
Returns:
List of intersection points (MicroFacets) sorted by t (parametric distance from P0). null is returned in case of bad arguments or if no intersection exists..
See Also:
MicroFacet, BoundingVolume

getBoundingVolume

BoundingVolume getBoundingVolume(TrMatrix toWorld)
Returns bounding volume of the solid (non-mandatory method).

Parameters:
toWorld - Transform from local (solid) coordinates to world coordinates (where bounding volume will live).
Returns:
Bounding volume of the solid or null if method is not implemented.
See Also:
intersection(double[], double[])

isInside

boolean isInside(double[] point)
Point vs. solid test ("inside-test").

Parameters:
point - Coordinates of the 3D point (double[3] or double[4]).
Returns:
true if the given point lies inside the solid.