Package org.graphstream.ui.view.camera
Interface ConnectorSkeleton
public interface ConnectorSkeleton
Class used by DefaultCamera, implementation in gs-ui-... Skeleton for edges.
Data stored on the edge to retrieve the edge basic geometry and various
shared data between parts of the renderer.
XXX TODO This part needs much work. The skeleton geometry of an edge can be
various things: - An automatically computed shape (for multi-graphs and loop
edges). - An user specified shape: - A polyline (points are in absolute
coordinates). - A polycurve (in absolute coordinates). - A vector
representation (points are relative to an origin and the whole may be
rotated).
-
Method Summary
Modifier and Type Method Description Point3apply(int i)The i-th point of the edge shape.Point3from()The first point of the edge shape.booleanisCurve()If true the edge shape is a loop defined by four points.booleanisLoop()This is only set when the edge is a curve, if true the starting and ending nodes of the edge are the same node.booleanisMulti()booleanisPoly()If true the edge shape is a polyline made of size points.StringkindString()doublelength()Total length of the polyline defined by the points.intmulti()If larger than one there are several edges between the two nodes of this edge.Point3pointOnShape(double percent)Compute a point at the given percent on the shape and return it.Point3pointOnShape(double percent, Point3 target)Compute a point at a given percent on the shape and store it in the target, also returning it.Point3pointOnShapeAndPerpendicular(double percent, double perpendicular)Compute a point at a given percent on the shape and push it from the shape perpendicular to it at a given distance in GU.Point3pointOnShapeAndPerpendicular(double percent, double perpendicular, Point3 target)Compute a point at a given percent on the shape and push it from the shape perpendicular to it at a given distance in GU.doublesegmentLength(int i)Length of the i-th segment.double[]segmentsLengths()Compute the length of each segment between the points making up this edge.voidsetCurve(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)voidsetLine(double x0, double y0, double z0, double x1, double y1, double z1)voidsetLoop(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2)voidsetMulti(int aMulti)voidsetPoly(Object aSetOfPoints)voidsetPoly(Point3[] aSetOfPoints)intsize()The number of points in the edge shape.Point3to()The last point of the edge shape.voidupdate(int i, Point3 p)Change the i-th point in the set of points making up the shape of this edge.
-
Method Details
-
kindString
String kindString() -
isPoly
boolean isPoly()If true the edge shape is a polyline made of size points. -
isCurve
boolean isCurve()If true the edge shape is a loop defined by four points. -
multi
int multi()If larger than one there are several edges between the two nodes of this edge. -
isLoop
boolean isLoop()This is only set when the edge is a curve, if true the starting and ending nodes of the edge are the same node. -
setPoly
-
setPoly
-
setCurve
void setCurve(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) -
setLine
void setLine(double x0, double y0, double z0, double x1, double y1, double z1) -
setMulti
void setMulti(int aMulti) -
isMulti
boolean isMulti() -
setLoop
void setLoop(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2) -
size
int size()The number of points in the edge shape. -
apply
The i-th point of the edge shape. -
update
Change the i-th point in the set of points making up the shape of this edge. -
to
Point3 to()The last point of the edge shape. -
from
Point3 from()The first point of the edge shape. -
length
double length()Total length of the polyline defined by the points. -
segmentsLengths
double[] segmentsLengths()Compute the length of each segment between the points making up this edge. This is mostly only useful for polylines. The results of this method is cached. It is only recomputed when a points changes in the shape. There are size-1 segments if the are size points. The segment 0 is between points 0 and 1. -
segmentLength
double segmentLength(int i)Length of the i-th segment. There are size-1 segments if there are size points. The segment 0 is between points 0 and 1. -
pointOnShape
Compute a point at the given percent on the shape and return it. The percent must be a number between 0 and 1. -
pointOnShape
Compute a point at a given percent on the shape and store it in the target, also returning it. The percent must be a number between 0 and 1. -
pointOnShapeAndPerpendicular
Compute a point at a given percent on the shape and push it from the shape perpendicular to it at a given distance in GU. The percent must be a number between 0 and 1. The resulting points is returned. -
pointOnShapeAndPerpendicular
Compute a point at a given percent on the shape and push it from the shape perpendicular to it at a given distance in GU. The percent must be a number between 0 and 1. The result is stored in target and also returned.
-