Package gov.nih.mipav.model.algorithms
Class ContourPlot.Triangles
- java.lang.Object
- 
- gov.nih.mipav.model.algorithms.ContourPlot.Triangles
 
- 
- All Implemented Interfaces:
- ContourPlot.Renderable
 - Enclosing class:
- ContourPlot
 
 public class ContourPlot.Triangles extends java.lang.Object implements ContourPlot.Renderable The Triangles class is a collection of 2D triangles. A single triangle consists of three 2D points where each of these points can be colored differently which leads to the triangle area being colored by interpolating using barycentric coordinates. Also a triangle can have a single picking color, which is the color with which the triangle is rendered into the (invisible) picking color attachment of anFBO. This color may serve as an identifier of the object that can be queried from a location of the rendering canvas. It may take on a value in range of 0xff000001 to 0xffffffff (16.777.214 possible values) or 0.There is also a global alpha multiplier parameter which scales every triangle's color alpha value, which can be used to introduce transparency for all triangles of this collection. This may come in handy to let other rendered content under a triangle 'shine through'. - Author:
- hageldave
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.function.DoubleSupplierglobalAlphaMultiplierprotected java.util.function.DoubleSupplierglobalSaturationMultiplierprotected booleanhiddenprotected booleanisDirtyprotected java.util.ArrayList<ContourPlot.TriangleDetails>trianglesprotected booleanuseAAinFallbackprotected booleanuseCrispEdgesForSVG
 - 
Constructor SummaryConstructors Constructor Description Triangles()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetGlobalAlphaMultiplier()floatgetGlobalSaturationMultiplier()java.util.List<ContourPlot.TriangleDetails>getIntersectingTriangles(java.awt.geom.Rectangle2D rect)Returns the triangles that intersect or contain the specified rectangle.java.util.ArrayList<ContourPlot.TriangleDetails>getTriangleDetails()booleanintersects(java.awt.geom.Rectangle2D rect)tests if thisContourPlot.Renderableintersects or contains the specified rectangle.booleanisAAinFallbackEnabled()Return true when anti-aliasing is enabled for fallback (AWT) rendering (default=false).booleanisDirty()if true, indicates that a call to#updateGL(boolean)is necessary to sync this objects GL resources to its current state.booleanisHidden()Indicates whether this Renderable is hidden i.e. will not be drawn.intnumTriangles()ContourPlot.TrianglesremoveAllTriangles()Removes all TriangleDetails from this collection.ContourPlot.TrianglessetDirty()Sets theisDirty()state of thisContourPlot.Trianglesobject to true.ContourPlot.TrianglessetGlobalAlphaMultiplier(double globalAlphaMultiplier)Sets the global alpha multiplier parameter of thisContourPlot.Trianglesobject.ContourPlot.TrianglessetGlobalAlphaMultiplier(java.util.function.DoubleSupplier globalAlphaMultiplier)Sets the global alpha multiplier parameter of thisContourPlot.Trianglesobject.
 
- 
- 
- 
Field Detail- 
isDirtyprotected boolean isDirty 
 - 
globalAlphaMultiplierprotected java.util.function.DoubleSupplier globalAlphaMultiplier 
 - 
globalSaturationMultiplierprotected java.util.function.DoubleSupplier globalSaturationMultiplier 
 - 
trianglesprotected java.util.ArrayList<ContourPlot.TriangleDetails> triangles 
 - 
useCrispEdgesForSVGprotected boolean useCrispEdgesForSVG 
 - 
useAAinFallbackprotected boolean useAAinFallback 
 - 
hiddenprotected boolean hidden 
 
- 
 - 
Method Detail- 
numTrianglespublic int numTriangles() - Returns:
- the number of triangles in this collection.
 
 - 
intersectspublic boolean intersects(java.awt.geom.Rectangle2D rect) Description copied from interface:ContourPlot.Renderabletests if thisContourPlot.Renderableintersects or contains the specified rectangle.- Specified by:
- intersectsin interface- ContourPlot.Renderable
- Parameters:
- rect- rectangle to test
- Returns:
- true when intersecting
 
 - 
isHiddenpublic boolean isHidden() Description copied from interface:ContourPlot.RenderableIndicates whether this Renderable is hidden i.e. will not be drawn.- Specified by:
- isHiddenin interface- ContourPlot.Renderable
- Returns:
- true when hidden
 
 - 
getTriangleDetailspublic java.util.ArrayList<ContourPlot.TriangleDetails> getTriangleDetails() - Returns:
- the list of triangle details.
 Make sure to callsetDirty()when manipulating.
 
 - 
setGlobalAlphaMultiplierpublic ContourPlot.Triangles setGlobalAlphaMultiplier(double globalAlphaMultiplier) Sets the global alpha multiplier parameter of thisContourPlot.Trianglesobject. The value will be multiplied with each vertex' alpha color value when rendering. The triangle will then be rendered with the opacityalpha = globalAlphaMultiplier * point.alpha.- Parameters:
- globalAlphaMultiplier- of the triangles in this collection
- Returns:
- this for chaining
 
 - 
getGlobalSaturationMultiplierpublic float getGlobalSaturationMultiplier() - Returns:
- the saturation multiplier of this renderable
 
 - 
setGlobalAlphaMultiplierpublic ContourPlot.Triangles setGlobalAlphaMultiplier(java.util.function.DoubleSupplier globalAlphaMultiplier) Sets the global alpha multiplier parameter of thisContourPlot.Trianglesobject. The value will be multiplied with each vertex' alpha color value when rendering. The triangle will then be rendered with the opacityalpha = globalAlphaMultiplier * point.alpha.- Parameters:
- globalAlphaMultiplier- of the triangles in this collection
- Returns:
- this for chaining
 
 - 
getGlobalAlphaMultiplierpublic float getGlobalAlphaMultiplier() - Returns:
- the global alpha multiplier of the triangles in this collection
 
 - 
isDirtypublic boolean isDirty() Description copied from interface:ContourPlot.Renderableif true, indicates that a call to#updateGL(boolean)is necessary to sync this objects GL resources to its current state.- Specified by:
- isDirtyin interface- ContourPlot.Renderable
- Returns:
- true if dirty
 
 - 
isAAinFallbackEnabledpublic boolean isAAinFallbackEnabled() Return true when anti-aliasing is enabled for fallback (AWT) rendering (default=false).Especially for triangle grids/meshes this option should be disabled to avoid visible triangle edges inside the grid/mesh. When triangles are not connected, this option can be enabled to get anti-aliased edges. - Returns:
- true when enabled
 
 - 
getIntersectingTrianglespublic java.util.List<ContourPlot.TriangleDetails> getIntersectingTriangles(java.awt.geom.Rectangle2D rect) Returns the triangles that intersect or contain the specified rectangle.- Parameters:
- rect- rectangle to test intersection
- Returns:
- list of intersecting triangles
 
 - 
removeAllTrianglespublic ContourPlot.Triangles removeAllTriangles() Removes all TriangleDetails from this collection. Sets theisDirty()state to true.- Returns:
- this for chaining
 
 - 
setDirtypublic ContourPlot.Triangles setDirty() Sets theisDirty()state of thisContourPlot.Trianglesobject to true.- Returns:
- this for chaining
 
 
- 
 
-