Package mgui.interfaces.shapes.util
Class ShapeFunctions
java.lang.Object
mgui.interfaces.Utility
mgui.interfaces.shapes.util.ShapeFunctions
public class ShapeFunctions extends Utility
Utility class which provides functions related to
InterfaceShape
objects generally.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShapeFunctions.Point3fComparatorX
static class
ShapeFunctions.Point3fComparatorY
static class
ShapeFunctions.Point3fComparatorZ
-
Field Summary
Fields Modifier and Type Field Description static double
tolerance
-
Constructor Summary
Constructors Constructor Description ShapeFunctions()
-
Method Summary
Modifier and Type Method Description static BoolPolygon2DInt
getBoolCornerPoints(Polygon2DInt thePoly, double length_threshold, double angle_threshold)
static Mesh3D
getConvexHull(Shape3DInt shape)
Returns a new mesh which is the convex hull of the given mesh.static Mesh3D
getConvexHull(Shape3DInt shape, java.lang.String method)
static Mesh3D
getConvexHull(Shape3DInt shape, java.lang.String method, ProgressUpdater progress)
Returns a new mesh which is the convex hull of the given mesh.static Mesh3D
getConvexHull(Shape3DInt shape, ProgressUpdater progress)
protected static Mesh3D
getConvexHullBlocking(Shape3DInt shape, java.lang.String method, ProgressUpdater progress)
static org.jogamp.java3d.BranchGroup
getCylinderPolygon(Polygon3D polygon, float radius, int res, org.jogamp.java3d.Appearance app)
Returns a set of cylindrical segments which follow the path of the given polygon.static org.jogamp.java3d.BranchGroup
getCylinderPolygon(Polygon3D polygon, float radius, int res, org.jogamp.java3d.Appearance app, java.util.List<java.awt.Color> vertex_colours)
Returns a set of cylindrical segments which follow the path of the given polygon.static org.jogamp.java3d.BranchGroup
getCylinderSegment(org.jogamp.vecmath.Point3f p1, org.jogamp.vecmath.Point3f p2, float radius, int res, org.jogamp.java3d.Appearance app)
static java.util.ArrayList<MguiNumber>
getDataMaskedDoubleValues(java.util.ArrayList<MguiNumber> input, MeshDataMaskOptions options)
static java.util.ArrayList<MguiNumber>
getDataMaskedDoubleValues(java.util.ArrayList<MguiNumber> input, MeshDataMaskOptions options, VertexSelection selection)
static java.util.ArrayList<MguiNumber>
getDataMaskedIntegerValues(java.util.ArrayList<MguiNumber> input, MeshDataMaskOptions options)
static java.util.ArrayList<MguiNumber>
getDataMaskedIntegerValues(java.util.ArrayList<MguiNumber> input, MeshDataMaskOptions options, VertexSelection selection)
static AttributeList
getDefaultShapeAttributes2D()
static AttributeList
getDefaultShapeAttributes3D()
static Polygon2DInt
getGroomedPolygon(Polygon2DInt thisPoly, float minLen, boolean blnMin, float maxLen, boolean blnMax, float minAngle)
static IntPolygon2DInt
getIntCornerPoints(Polygon2DInt thePoly, double length_threshold, double angle_threshold)
static Graph2DInt
getIntersectedGraph(InterfaceAbstractGraph graph3d, java.util.HashMap<AbstractGraphNode,java.lang.Integer> node_map, Plane3D plane, float above_dist, float below_dist)
Returns a Graph2DInt object derived from the plane and 3D graph.static Graph2DInt
getIntersectedGraph(InterfaceAbstractGraph graph3d, java.util.HashMap<AbstractGraphNode,java.lang.Integer> node_map, Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)
Returns a Graph2DInt object derived from the plane and 3D graph.static Mesh2DInt
getIntersectionMesh(Mesh3D mesh, Plane3D plane)
Returns a Mesh2DInt object representing the intersection of the given 3D mesh with plane p.static Mesh2DInt
getIntersectionMesh(Mesh3D mesh, Plane3D plane, java.util.ArrayList<MguiNumber> data, ColourMap cmap)
Returns a Mesh2DInt object representing the intersection of the given 3D mesh with plane p.static PointSet2DInt
getIntersectionPointSet(PointSet3D point_set, Plane3D plane, float above_dist, float below_dist, java.util.HashMap<java.lang.String,java.util.ArrayList<MguiNumber>> data, ColourMap cmap)
Returns a PointSet2DInt object representing the points withinspacing
of the planeplane
.static Polygon2D
getIntersectionPolygon(Box3D box, Plane3D plane)
Returns a 2D polygon in section coordinates representing the intersection of a Box3D object with the plane.static Polygon2D
getIntersectionPolygon2(Box3D box, Plane3D plane)
Returns a 2D polygon in section coordinates representing the intersection of a Box3D object with the plane.static Vector2DInt
getIntersectionVector(Vector3DInt v_int, Plane3D plane, float above_dist, float below_dist)
Returns a Vector2DInt object which is the projection ofvector
ontoplane
, if and only if some part ofvector
is within the distance boundary specified byabove_dist
andbelow_dist
.static Vector2DInt
getIntersectionVector(Vector3DInt v_int, Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)
Returns a Vector2DInt object which is the projection ofvector
ontoplane
, if and only if some part ofvector
is within the distance boundary specified byabove_dist
andbelow_dist
.static java.util.ArrayList<MguiNumber>
getMaskNormalizedValues(InterfaceShape shape, java.lang.String source_column, java.lang.String normalize_column, java.lang.String mask_column)
Normalize values insource_column
by the mean of values innormalize_column
which lie in the maskmask_column
.static java.util.ArrayList<MguiNumber>
getMaskNormalizedValues(InterfaceShape shape, java.lang.String source_column, java.lang.String normalize_column, java.lang.String mask_column, java.lang.String statistic)
Normalize values insource_column
by thestatistic
of values innormalize_column
which lie in the maskmask_column
.static java.util.ArrayList<Polygon2D>
getMergedPolygons(java.util.ArrayList<Polygon2D> polygons)
static java.util.ArrayList<Polygon2D>
getMergedPolygonsbak(java.util.ArrayList<Polygon2D> polygons)
static org.jogamp.java3d.ModelClip
getModelClip(Plane3D plane, float up, float down, boolean invert)
Returns the up and down clipping planes for this planeprotected static java.util.ArrayList<java.lang.Integer>
getNearestNeighbour3DBlocking(Shape3DInt source, Shape3DInt target)
static java.util.ArrayList<java.lang.Integer>
getNearestNeighbours(InterfaceShape source, InterfaceShape target)
Returns a list of vertex indices fromsource
which are nearest neighbours of the corresponding vertices oftarget
.static java.util.ArrayList<MguiNumber>
getNormalizedValues(InterfaceShape shape, java.lang.String source_column, double source_min, double source_max, double target_min, double target_max)
Normalize values insource_column
to from the range[source_min, source_max]
to the range[target_min, target_max]
static Shape3DInt
getPickedShape(org.jogamp.java3d.utils.pickfast.PickCanvas pickNode, org.jogamp.java3d.utils.pickfast.PickCanvas pickGeom, java.awt.Point click_point, MguiInteger node)
Return the shape picked by a mouse click at the screen location defined byclick_point
.static java.util.List<java.lang.Float>
getPolygonAngles(Polygon3D polygon)
Returns a list of angles corresponding to the nodes ofpolygon
.static Polygon2DInt
getProjectedPolygon(Polygon3D polygon, Plane3D plane, float above_dist, float below_dist)
Returns a 2D polygon in section coordinates representing the projection ofpolygon
ontoplane
, within the specified clipping distances.static Polygon2DInt
getProjectedPolygon(Polygon3D polygon, Plane3D plane, float above_dist, float below_dist, VertexDataColumn v_column)
Returns a 2D polygon in section coordinates representing the projection ofpolygon
ontoplane
, within the specified clipping distances.static Polygon2DInt
getProjectedPolygon_bak(Polygon3D polygon, Plane3D plane, float above_dist, float below_dist, VertexDataColumn v_column)
Returns a 2D polygon in section coordinates representing the projection ofpolygon
ontoplane
, within the specified clipping distances.static Shape3DInt
getShape(org.jogamp.java3d.Shape3D shape)
static Shape3DInt
getShape3DIntFromSection(Plane3D refPlane, float dist, Shape2DInt shape2D)
static Shape3DInt
getShape3DIntFromSection(Plane3D refPlane, float dist, Shape2DInt shape2D, boolean set_parent)
static ShapeSet3DInt
getShapeSet3DFromSection(Plane3D refPlane, float dist, ShapeSet2DInt shapes, ShapeSelectionSet selSet)
static Shape3DInt
getShapeVertexObject(org.jogamp.java3d.Shape3D shape, MguiInteger index)
static org.jogamp.java3d.TransformGroup
getSphereAtPoint(float radius, org.jogamp.vecmath.Point3d point)
Returns aTransformGroup
with a sphere at the specified point, with the specified radius.static org.jogamp.java3d.TransformGroup
getSphereAtPoint(float radius, org.jogamp.vecmath.Point3d point, boolean pickable)
Returns aTransformGroup
with a sphere at the specified point, with the specified radius.static org.jogamp.java3d.TransformGroup
getSphereAtPoint(float radius, org.jogamp.vecmath.Point3d point, org.jogamp.java3d.Appearance app, boolean pickable)
Returns aTransformGroup
with a sphere at the specified point, with the specified radius andAppearance
.static org.jogamp.java3d.TransformGroup
getSphereAtPoint(float radius, org.jogamp.vecmath.Point3f point)
Returns aTransformGroup
with a sphere at the specified point, with the specified radius.static boolean
nodeHasChild(org.jogamp.java3d.BranchGroup parent, org.jogamp.java3d.Node child)
Determines whetherchild
is a child ofparent
in the Scene Graphstatic void
setAttributesFrom3DParent(Shape2DInt child, Shape3DInt parent, boolean inherit)
Sets a 2D child's attributes from its parent.static void
setMeshConstraints(Mesh3DInt mesh, java.util.ArrayList<org.jogamp.vecmath.Point3f> constraints)
static void
setModelClip(org.jogamp.java3d.ModelClip clip, Plane3D plane, float up, float down, boolean invert)
Setsclip
to match the specified plane and clipping distances.static Shape3D
transformWithMatrix(Shape3D shape_in, org.jogamp.vecmath.Matrix4d matrix, ProgressUpdater progress)
Transformshape_in
withmatrix
and returns the result.protected static Shape3D
transformWithMatrixBlocking(Shape3D shape_in, org.jogamp.vecmath.Matrix4d matrix, ProgressUpdater progress)
Transformshape_in
withmatrix
and returns the result.static void
unionMaskVolumeWithPlane(boolean[][][] mask, Volume3DInt volume, Plane3D plane, boolean is_above)
Returns a mask forvolume
which is above or belowplane
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
tolerance
public static final double tolerance- See Also:
- Constant Field Values
-
-
Constructor Details
-
ShapeFunctions
public ShapeFunctions()
-
-
Method Details
-
getShape
-
getShapeVertexObject
-
setAttributesFrom3DParent
Sets a 2D child's attributes from its parent. Ifinherit
istrue
, Sets all 2D attributes to the 3D attribute values.- Parameters:
child_attributes
-parent_attributes
-inherit
-
-
transformWithMatrix
public static Shape3D transformWithMatrix(Shape3D shape_in, org.jogamp.vecmath.Matrix4d matrix, ProgressUpdater progress)Transformshape_in
withmatrix
and returns the result. Does not altershape_in
. Ifprogress
is notnull
, this method starts a worker thread; otherwise, it blocks.- Parameters:
shape_in
- the shape to transformmatrix
- matrix specifying an affine transformationprogress
- option progress monitor- Returns:
- a shape which is the transformed copy of
shape_in
-
transformWithMatrixBlocking
protected static Shape3D transformWithMatrixBlocking(Shape3D shape_in, org.jogamp.vecmath.Matrix4d matrix, ProgressUpdater progress)Transformshape_in
withmatrix
and returns the result. Does not altershape_in
. This method blocks until complete; to run in a worker thread, calltransformWithMatrix(..)
- Parameters:
shape_in
- the shape to transformmatrix
- matrix specifying an affine transformationprogress
- option progress monitor- Returns:
- a shape which is the transformed copy of
shape_in
-
getConvexHull
Returns a new mesh which is the convex hull of the given mesh. Defaults to the "Giftwrap" algorithm, by Tim Lambert:http://www.cse.unsw.edu.au/~lambert/java/3d/implementation.html
- Parameters:
mesh
- Mesh for which to compute a convex hull.method
- The method to use
-
getConvexHull
-
getConvexHull
-
getConvexHull
public static Mesh3D getConvexHull(Shape3DInt shape, java.lang.String method, ProgressUpdater progress)Returns a new mesh which is the convex hull of the given mesh. Algorithms provided by Joseph O'Rourke et al:http://maven.smith.edu/~orourke/books/ftp.html
and Tim Lambert:
http://www.cse.unsw.edu.au/~lambert/java/3d/implementation.html
- Parameters:
mesh
- Mesh for which to compute a convex hullmethod
- The method to usebar
- Optional progress bar- Returns:
- the convex hull, or
null
if method failed or was cancelled.
-
getConvexHullBlocking
protected static Mesh3D getConvexHullBlocking(Shape3DInt shape, java.lang.String method, ProgressUpdater progress) -
getPickedShape
public static Shape3DInt getPickedShape(org.jogamp.java3d.utils.pickfast.PickCanvas pickNode, org.jogamp.java3d.utils.pickfast.PickCanvas pickGeom, java.awt.Point click_point, MguiInteger node)Return the shape picked by a mouse click at the screen location defined byclick_point
. Optionally sets the value ofnode
to the selected node index of the picked shape, ifnode
is not null.TODO: return a list of picked shapes, ordered from closest to farthest
- Parameters:
pickNode
-pickGeom
-click_point
-node
-- Returns:
-
getSphereAtPoint
public static org.jogamp.java3d.TransformGroup getSphereAtPoint(float radius, org.jogamp.vecmath.Point3f point)Returns aTransformGroup
with a sphere at the specified point, with the specified radius.- Parameters:
radius
-point
-- Returns:
-
getSphereAtPoint
public static org.jogamp.java3d.TransformGroup getSphereAtPoint(float radius, org.jogamp.vecmath.Point3d point)Returns aTransformGroup
with a sphere at the specified point, with the specified radius. Uses a defaultAppearance
with red colour.- Parameters:
radius
-point
-- Returns:
-
getSphereAtPoint
public static org.jogamp.java3d.TransformGroup getSphereAtPoint(float radius, org.jogamp.vecmath.Point3d point, boolean pickable)Returns aTransformGroup
with a sphere at the specified point, with the specified radius. Uses a defaultAppearance
with red colour.- Parameters:
radius
- Radius of the spherepoint
- Center point of the spherepickable
- Determines whether the sphere is pickable- Returns:
-
getSphereAtPoint
public static org.jogamp.java3d.TransformGroup getSphereAtPoint(float radius, org.jogamp.vecmath.Point3d point, org.jogamp.java3d.Appearance app, boolean pickable)Returns aTransformGroup
with a sphere at the specified point, with the specified radius andAppearance
.- Parameters:
radius
- Radius of the spherepoint
- Center point of the spherepickable
- Determines whether the sphere is pickable- Returns:
-
getBoolCornerPoints
public static BoolPolygon2DInt getBoolCornerPoints(Polygon2DInt thePoly, double length_threshold, double angle_threshold) -
getIntCornerPoints
public static IntPolygon2DInt getIntCornerPoints(Polygon2DInt thePoly, double length_threshold, double angle_threshold) -
nodeHasChild
public static boolean nodeHasChild(org.jogamp.java3d.BranchGroup parent, org.jogamp.java3d.Node child) throws org.jogamp.java3d.CapabilityNotSetExceptionDetermines whetherchild
is a child ofparent
in the Scene Graph- Parameters:
parent
-child
-- Returns:
- Throws:
org.jogamp.java3d.CapabilityNotSetException
-
getGroomedPolygon
public static Polygon2DInt getGroomedPolygon(Polygon2DInt thisPoly, float minLen, boolean blnMin, float maxLen, boolean blnMax, float minAngle) -
getShapeSet3DFromSection
public static ShapeSet3DInt getShapeSet3DFromSection(Plane3D refPlane, float dist, ShapeSet2DInt shapes, ShapeSelectionSet selSet) -
getShape3DIntFromSection
public static Shape3DInt getShape3DIntFromSection(Plane3D refPlane, float dist, Shape2DInt shape2D) -
getShape3DIntFromSection
public static Shape3DInt getShape3DIntFromSection(Plane3D refPlane, float dist, Shape2DInt shape2D, boolean set_parent) -
getIntersectionPolygon
Returns a 2D polygon in section coordinates representing the intersection of a Box3D object with the plane. Returnsnull
if the box does not intersect the plane.- Parameters:
box
-plane
-- Returns:
- Polygon2D object, in plane coordinates relative to its reference point
-
getIntersectionPolygon2
Returns a 2D polygon in section coordinates representing the intersection of a Box3D object with the plane. Returnsnull
if the box does not intersect the plane.- Parameters:
box
-plane
-- Returns:
- Polygon2D object, in plane coordinates relative to its reference point
-
getProjectedPolygon
public static Polygon2DInt getProjectedPolygon(Polygon3D polygon, Plane3D plane, float above_dist, float below_dist)Returns a 2D polygon in section coordinates representing the projection ofpolygon
ontoplane
, within the specified clipping distances.- Parameters:
box
-plane
-- Returns:
- Polygon2D object, in plane coordinates relative to its reference point
-
getProjectedPolygon
public static Polygon2DInt getProjectedPolygon(Polygon3D polygon, Plane3D plane, float above_dist, float below_dist, VertexDataColumn v_column)Returns a 2D polygon in section coordinates representing the projection ofpolygon
ontoplane
, within the specified clipping distances.- Parameters:
polygon
- The shape to projectplane
-above_dist
-below_dist
-v_column
- Vertex data column from which to derive vertex-wise values for the new polygon shape- Returns:
- Polygon2DInt object, in plane coordinates relative to its reference point
-
getProjectedPolygon_bak
public static Polygon2DInt getProjectedPolygon_bak(Polygon3D polygon, Plane3D plane, float above_dist, float below_dist, VertexDataColumn v_column)Returns a 2D polygon in section coordinates representing the projection ofpolygon
ontoplane
, within the specified clipping distances.- Parameters:
polygon
- The shape to projectplane
-above_dist
-below_dist
-v_column
- Vertex data column from which to derive vertex-wise values for the new polygon shape- Returns:
- Polygon2DInt object, in plane coordinates relative to its reference point
-
getIntersectionMesh
Returns a Mesh2DInt object representing the intersection of the given 3D mesh with plane p. Returns null if this mesh does not intersect the plane. TODO: add functionality to project mesh onto plane within a given spacing.- Parameters:
mesh
- mesh to intersectplane
- plane of intersection- Returns:
- Mesh2DInt object representing the intersection of the surface with the plane
-
getIntersectionMesh
public static Mesh2DInt getIntersectionMesh(Mesh3D mesh, Plane3D plane, java.util.ArrayList<MguiNumber> data, ColourMap cmap)Returns a Mesh2DInt object representing the intersection of the given 3D mesh with plane p. Returns null if this mesh does not intersect the plane. If data and cmap are not null, also assigns colours to the segments based upon their interpolated values. TODO: add functionality to project mesh onto plane within a given spacing.- Parameters:
mesh
- mesh to intersectplane
- plane of intersectiondata
- list of node data from which to colour the lines. If null, lines are coloured according to surface fill colour.cmap
- colour map from which to set the interpolated line colours- Returns:
- Mesh2DInt object representing the intersection of the surface with the plane,
or
null
if the plane doesn't intersect the mesh
-
getIntersectedGraph
public static Graph2DInt getIntersectedGraph(InterfaceAbstractGraph graph3d, java.util.HashMap<AbstractGraphNode,java.lang.Integer> node_map, Plane3D plane, float above_dist, float below_dist)Returns a Graph2DInt object derived from the plane and 3D graph.- Parameters:
graph3d
-plane
-above_dist
-below_dist
-- Returns:
-
getIntersectedGraph
public static Graph2DInt getIntersectedGraph(InterfaceAbstractGraph graph3d, java.util.HashMap<AbstractGraphNode,java.lang.Integer> node_map, Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)Returns a Graph2DInt object derived from the plane and 3D graph.- Parameters:
graph3d
-plane
-above_dist
-below_dist
-- Returns:
-
getIntersectionPointSet
public static PointSet2DInt getIntersectionPointSet(PointSet3D point_set, Plane3D plane, float above_dist, float below_dist, java.util.HashMap<java.lang.String,java.util.ArrayList<MguiNumber>> data, ColourMap cmap)Returns a PointSet2DInt object representing the points withinspacing
of the planeplane
. Returns null if this set does not intersect the plane. If data and cmap are not null, also sets these attributes.- Parameters:
point_set
- point set to intersectplane
- plane of intersectiondata
- list of node data from which to colour the lines. If null, lines are coloured according to surface fill colour.cmap
- colour map from which to set the interpolated line colours- Returns:
- Mesh2DInt object representing the intersection of the surface with the plane
-
getIntersectionVector
public static Vector2DInt getIntersectionVector(Vector3DInt v_int, Plane3D plane, float above_dist, float below_dist)Returns a Vector2DInt object which is the projection ofvector
ontoplane
, if and only if some part ofvector
is within the distance boundary specified byabove_dist
andbelow_dist
. Truncatesvector
at this boundary if it does not lie completely within it.- Parameters:
volume
-plane
-spacing
-- Returns:
- Image3DInt object, in plane coordinates relative to its reference point
-
getIntersectionVector
public static Vector2DInt getIntersectionVector(Vector3DInt v_int, Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)Returns a Vector2DInt object which is the projection ofvector
ontoplane
, if and only if some part ofvector
is within the distance boundary specified byabove_dist
andbelow_dist
. Truncatesvector
at this boundary if it does not lie completely within it.- Parameters:
volume
-plane
-spacing
-- Returns:
- Image3DInt object, in plane coordinates relative to its reference point
-
setMeshConstraints
public static void setMeshConstraints(Mesh3DInt mesh, java.util.ArrayList<org.jogamp.vecmath.Point3f> constraints) -
getMergedPolygons
-
getMergedPolygonsbak
-
getPolygonAngles
Returns a list of angles corresponding to the nodes ofpolygon
. End points will have the angle between the first and last segment.- Parameters:
polygon
-- Returns:
-
getCylinderPolygon
public static org.jogamp.java3d.BranchGroup getCylinderPolygon(Polygon3D polygon, float radius, int res, org.jogamp.java3d.Appearance app)Returns a set of cylindrical segments which follow the path of the given polygon. Parameters specify its appearance. TODO: fix junction artifacts- Parameters:
poly
-radius
-res
-closed
-app
-- Returns:
-
getCylinderPolygon
public static org.jogamp.java3d.BranchGroup getCylinderPolygon(Polygon3D polygon, float radius, int res, org.jogamp.java3d.Appearance app, java.util.List<java.awt.Color> vertex_colours)Returns a set of cylindrical segments which follow the path of the given polygon. Parameters specify its appearance. TODO: fix junction artifacts- Parameters:
poly
-radius
-res
-closed
-app
-vertex_colours
- Colors for each vertex- Returns:
-
getCylinderSegment
public static org.jogamp.java3d.BranchGroup getCylinderSegment(org.jogamp.vecmath.Point3f p1, org.jogamp.vecmath.Point3f p2, float radius, int res, org.jogamp.java3d.Appearance app) -
getDataMaskedDoubleValues
public static java.util.ArrayList<MguiNumber> getDataMaskedDoubleValues(java.util.ArrayList<MguiNumber> input, MeshDataMaskOptions options) -
getDataMaskedDoubleValues
public static java.util.ArrayList<MguiNumber> getDataMaskedDoubleValues(java.util.ArrayList<MguiNumber> input, MeshDataMaskOptions options, VertexSelection selection) -
getDataMaskedIntegerValues
public static java.util.ArrayList<MguiNumber> getDataMaskedIntegerValues(java.util.ArrayList<MguiNumber> input, MeshDataMaskOptions options) -
getDataMaskedIntegerValues
public static java.util.ArrayList<MguiNumber> getDataMaskedIntegerValues(java.util.ArrayList<MguiNumber> input, MeshDataMaskOptions options, VertexSelection selection) -
getNormalizedValues
public static java.util.ArrayList<MguiNumber> getNormalizedValues(InterfaceShape shape, java.lang.String source_column, double source_min, double source_max, double target_min, double target_max)Normalize values insource_column
to from the range[source_min, source_max]
to the range[target_min, target_max]
- Parameters:
volume
-source_column
-source_min
-source_max
-target_min
-target_max
-- Returns:
-
getMaskNormalizedValues
public static java.util.ArrayList<MguiNumber> getMaskNormalizedValues(InterfaceShape shape, java.lang.String source_column, java.lang.String normalize_column, java.lang.String mask_column)Normalize values insource_column
by the mean of values innormalize_column
which lie in the maskmask_column
.source_column
andnormalize_column
can be the same. Elements are considered to in the mask if their value inmask_column
is >= zero.Returned values are of the same type as
source_column
.- Parameters:
volume
-source_column
-normalize_column
-mask_column
-- Returns:
-
getMaskNormalizedValues
public static java.util.ArrayList<MguiNumber> getMaskNormalizedValues(InterfaceShape shape, java.lang.String source_column, java.lang.String normalize_column, java.lang.String mask_column, java.lang.String statistic)Normalize values insource_column
by thestatistic
of values innormalize_column
which lie in the maskmask_column
.source_column
andnormalize_column
can be the same. Elements are considered to in the mask if their value inmask_column
is >= zero.Returned values are of the same type as
source_column
.Valid values of
statistic
are:- mean
- max
- min
- sum
- Parameters:
volume
-source_column
-normalize_column
-mask_column
-statistic
-- Returns:
-
getModelClip
public static org.jogamp.java3d.ModelClip getModelClip(Plane3D plane, float up, float down, boolean invert)Returns the up and down clipping planes for this plane- Parameters:
plane
-- Returns:
-
setModelClip
public static void setModelClip(org.jogamp.java3d.ModelClip clip, Plane3D plane, float up, float down, boolean invert)Setsclip
to match the specified plane and clipping distances.- Parameters:
clip
-plane
-up
-down
-invert
-
-
unionMaskVolumeWithPlane
public static void unionMaskVolumeWithPlane(boolean[][][] mask, Volume3DInt volume, Plane3D plane, boolean is_above)Returns a mask forvolume
which is above or belowplane
.- Parameters:
volume
-plane
-is_above
-
-
getNearestNeighbours
public static java.util.ArrayList<java.lang.Integer> getNearestNeighbours(InterfaceShape source, InterfaceShape target)Returns a list of vertex indices fromsource
which are nearest neighbours of the corresponding vertices oftarget
.- Parameters:
source
-target
-search_max
- The maximum search radius; if no neighbours are found, the corresponding value is -1- Returns:
- a list of indices, of size
target.size()
corresponding to the nearest neighbours insource
.
-
getNearestNeighbour3DBlocking
protected static java.util.ArrayList<java.lang.Integer> getNearestNeighbour3DBlocking(Shape3DInt source, Shape3DInt target) -
getDefaultShapeAttributes2D
-
getDefaultShapeAttributes3D
-