public Geometry createLineGeometry() { final Point3f origin = new Point3f(); final Point3f onX = new Point3f(length < 1 ? 1f : length, 0, 0); final Point3f[] coords = { origin, onX }; final int N = coords.length; final Color3f colors[] = new Color3f[N]; for (int i = 0; i < N; i++) { colors[i] = color; } final LineArray ta = new LineArray(N, GeometryArray.COORDINATES | GeometryArray.COLOR_3); ta.setCoordinates(0, coords); ta.setColors(0, colors); return ta; } }
public void setTrackDisplayMode( final int mode ) { this.displayMode = mode; if ( displayMode == TrackMateModelView.TRACK_DISPLAY_MODE_WHOLE ) { final Color4f color = new Color4f(); for ( final Integer trackID : lines.keySet() ) { final LineArray line = lines.get( trackID ); for ( int i = 0; i < line.getVertexCount(); i++ ) { line.getColor( i, color ); color.w = 1f; line.setColor( i, color ); } } } }
/** * Sets the color of the given edge mesh. */ public void setColor( final DefaultWeightedEdge edge, final Color color ) { // First, find to what track it belongs to final int trackID = model.getTrackModel().trackIDOf( edge ); if ( null == edgeIndices.get( trackID ) || null == edgeIndices.get( trackID ).get( edge ) ) return; // Set color of corresponding line primitive final Color4f color4 = new Color4f(); final int index = edgeIndices.get( trackID ).get( edge ); final LineArray line = lines.get( trackID ); if ( null == line ) { return; } line.getColor( index, color4 ); final float[] val = color.getRGBColorComponents( null ); color4.x = val[ 0 ]; color4.y = val[ 1 ]; color4.z = val[ 2 ]; line.setColor( index, color4 ); line.setColor( index + 1, color4 ); }
final LineArray line = new LineArray( 2 * track.size(), GeometryArray.COORDINATES | GeometryArray.COLOR_4 ); line.setCapability( GeometryArray.ALLOW_COLOR_WRITE ); line.setCoordinate( edgeIndex, coordinates ); line.setColor( edgeIndex, color ); edgeIndex++; coordinates = new double[ 3 ]; TMUtils.localize( target, coordinates ); line.setCoordinate( edgeIndex, coordinates ); line.setColor( edgeIndex, color ); edgeIndex++;
int numberOfPoints = 2 * numberOfEdges; LineArray la = new LineArray(numberOfPoints, LineArray.COORDINATES); la.setCoordinate(0, point2point3f(v1.getPoints().get(0))); for (int edgePoint = 0; edgePoint < edge.getSlabs().size();edgePoint++) { Point point = edge.getSlabs().get(edgePoint); la.setCoordinate((2*edgePoint)+1, point2point3f(point)); la.setCoordinate((2*edgePoint)+2, point2point3f(point)); la.setCoordinate(numberOfPoints-1, point2point3f(v2.getPoints().get(0))); la.setCapability(LineArray.ALLOW_COLOR_READ); la.setCapability(LineArray.ALLOW_COLOR_WRITE);
@Override protected org.scijava.java3d.SceneGraphObject createNode() { return new LineArray( vertexCount, vertexFormat, texCoordSetCount, texCoordSetMap ); }
/** * @deprecated replaced with cloneNodeComponent(boolean forceDuplicate) */ @Override public NodeComponent cloneNodeComponent() { LineArrayRetained rt = (LineArrayRetained) retained; int texSetCount = rt.getTexCoordSetCount(); int[] texMap = null; int vertexAttrCount = rt.getVertexAttrCount(); int[] vertexAttrSizes = null; if (texSetCount > 0) { texMap = new int[rt.getTexCoordSetMapLength()]; rt.getTexCoordSetMap(texMap); } if (vertexAttrCount > 0) { vertexAttrSizes = new int[vertexAttrCount]; rt.getVertexAttrSizes(vertexAttrSizes); } LineArray l = new LineArray(rt.getVertexCount(), rt.getVertexFormat(), texSetCount, texMap, vertexAttrCount, vertexAttrSizes); l.duplicateNodeComponent(this); return l; }
appearance.setColoringAttributes(ca); LineArray segments = (LineArray) shape.getGeometry(); int nSegs = segments.getVertexCount(); for (int i = 0; i < nSegs; i++) { UserData ud = (UserData) (shape.getUserData());
/** * Returns the color of the specified edge mesh. */ public Color getColor( final DefaultWeightedEdge edge ) { // First, find to what track it belongs to final int trackID = model.getTrackModel().trackIDOf( edge ); // Retrieve color from index final Color4f color = new Color4f(); final int index = edgeIndices.get( trackID ).get( edge ); final LineArray line = lines.get( trackID ); if ( null == line ) { return null; } line.getColor( index, color ); return color.get(); }
final LineArray line = new LineArray( 2 * track.size(), GeometryArray.COORDINATES | GeometryArray.COLOR_4 ); line.setCapability( GeometryArray.ALLOW_COLOR_WRITE ); line.setCoordinate( edgeIndex, coordinates ); line.setColor( edgeIndex, color ); edgeIndex++; coordinates = new double[ 3 ]; TMUtils.localize( target, coordinates ); line.setCoordinate( edgeIndex, coordinates ); line.setColor( edgeIndex, color ); edgeIndex++;
if (mode == PAIRWISE) { ta = new LineArray(nAll, GeometryArray.COORDINATES | GeometryArray.COLOR_3); ta.setValidVertexCount(nValid);
/** * Sets the color of the given edge mesh. */ public void setColor( final DefaultWeightedEdge edge, final Color color ) { // First, find to what track it belongs to final int trackID = model.getTrackModel().trackIDOf( edge ); if ( null == edgeIndices.get( trackID ) || null == edgeIndices.get( trackID ).get( edge ) ) return; // Set color of corresponding line primitive final Color4f color4 = new Color4f(); final int index = edgeIndices.get( trackID ).get( edge ); final LineArray line = lines.get( trackID ); if ( null == line ) { return; } line.getColor( index, color4 ); final float[] val = color.getRGBColorComponents( null ); color4.x = val[ 0 ]; color4.y = val[ 1 ]; color4.z = val[ 2 ]; line.setColor( index, color4 ); line.setColor( index + 1, color4 ); }
/** * Returns the color of the specified edge mesh. */ public Color getColor( final DefaultWeightedEdge edge ) { // First, find to what track it belongs to final int trackID = model.getTrackModel().trackIDOf( edge ); // Retrieve color from index final Color4f color = new Color4f(); final int index = edgeIndices.get( trackID ).get( edge ); final LineArray line = lines.get( trackID ); if ( null == line ) { return null; } line.getColor( index, color ); return color.get(); }
public Geometry createGeometry() { final Point3f origin = new Point3f(); final Point3f onX = new Point3f(length, 0, 0); final Point3f onY = new Point3f(0, length, 0); final Point3f onZ = new Point3f(0, 0, length); final Point3f[] coords = { origin, onX, origin, onY, origin, onZ }; final int N = coords.length; final Color3f colors[] = new Color3f[N]; for (int i = 0; i < N; i++) { colors[i] = color; } final LineArray ta = new LineArray(N, GeometryArray.COORDINATES | GeometryArray.COLOR_3); ta.setCoordinates(0, coords); ta.setColors(0, colors); // initialize the geometry info here return ta; } }
object = new org.scijava.java3d.LineArray(vertexCount, vertexFormat); object.setCoordinates(0, shape.coordsArray);
public void setTrackDisplayMode( final int mode ) { this.displayMode = mode; if ( displayMode == TrackMateModelView.TRACK_DISPLAY_MODE_WHOLE ) { final Color4f color = new Color4f(); for ( final Integer trackID : lines.keySet() ) { final LineArray line = lines.get( trackID ); for ( int i = 0; i < line.getVertexCount(); i++ ) { line.getColor( i, color ); color.w = 1f; line.setColor( i, color ); } } } }
line.getColor( index, color ); color.w = 0; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color );
new LineArray(coords.length, GeometryArray.COORDINATES | GeometryArray.COLOR_3); ga.setCoordinates(0, coords); final Color3f[] col = new Color3f[coords.length]; for (i = 0; i < col.length; i++) col[i] = color; ga.setColors(0, col); return ga;
case GeometryRetained.GEO_TYPE_LINE_SET: this.morphedGeometryArray = new LineArray(geometryArrays[0].validVertexCount, vFormat, texCoordSetCount, texCoordSetMap); break;
line.getColor( index, color ); color.w = 0; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color ); line.getColor( index, color ); color.w = tp; line.setColor( index, color ); line.setColor( index + 1, color );