public class OBJMesh
extends java.lang.Object
Viewer3D
, with access points to its OBJFile
and
DrawableVBO
Constructor and Description |
---|
OBJMesh(java.lang.String filePath)
Instantiates a new wavefront OBJ mesh from a file path/URL.
|
OBJMesh(java.net.URL url) |
Modifier and Type | Method and Description |
---|---|
SNTPoint |
getCentroid(java.lang.String hemihalf)
Returns the spatial centroid of the specified (hemi)mesh.
|
org.jzy3d.plot3d.primitives.vbo.drawable.DrawableVBO |
getDrawable()
Returns the
DrawableVBO associated with this mesh |
org.jzy3d.io.obj.OBJFile |
getObj()
Returns the
OBJFile associated with this mesh |
java.util.Collection<? extends SNTPoint> |
getVertices()
Returns the mesh vertices.
|
java.util.Collection<? extends SNTPoint> |
getVertices(java.lang.String hemihalf)
Returns the mesh vertices.
|
void |
setBoundingBoxColor(org.scijava.util.ColorRGB boundingBoxColor)
Determines whether the mesh bounding box should be displayed.
|
void |
setColor(org.scijava.util.ColorRGB color,
double transparencyPercent)
Assigns a color to the mesh.
|
void |
setColor(java.lang.String color,
double transparencyPercent)
Script friendly method to assign a color to the mesh.
|
void |
setLabel(java.lang.String label) |
void |
translate(SNTPoint offset)
Translates the vertices of this mesh by the specified offset.
|
public OBJMesh(java.lang.String filePath)
filePath
- the absolute path to the .OBJ file to be imported. URL
representations acceptedjava.lang.IllegalArgumentException
- if filePath is invalid or file does not
contain a compilable meshpublic OBJMesh(java.net.URL url)
public void translate(SNTPoint offset)
offset
- the translation offsetpublic void setColor(java.lang.String color, double transparencyPercent)
color
- the color to render the imported file, either a 1)
HTML color codes starting with hash (#
), a
color preset ("red", "blue", etc.), or integer
triples of the form r,g,b
and range
[0, 255]
transparencyPercent
- the color transparency (in percentage)public void setColor(org.scijava.util.ColorRGB color, double transparencyPercent)
color
- the color to render the imported filetransparencyPercent
- the color transparency (in percentage)public void setBoundingBoxColor(org.scijava.util.ColorRGB boundingBoxColor)
boundingBoxColor
- the color of the mesh bounding box. If null, no
bounding box is displayedpublic void setLabel(java.lang.String label)
public java.util.Collection<? extends SNTPoint> getVertices()
SNTPoint
spublic java.util.Collection<? extends SNTPoint> getVertices(java.lang.String hemihalf)
hemihalf
- either "left", "l", "right", "r" otherwise centroid is
retrieved for both hemi-halves, i.e., the full meshSNTPoint
spublic SNTPoint getCentroid(java.lang.String hemihalf)
hemihalf
- either "left", "l", "right", "r", otherwise centroid is
retrieved for both hemi-halves, i.e., the full meshpublic org.jzy3d.io.obj.OBJFile getObj()
OBJFile
associated with this meshpublic org.jzy3d.plot3d.primitives.vbo.drawable.DrawableVBO getDrawable()
DrawableVBO
associated with this mesh