Package armyc2.c5isr.JavaLineArray
Class lineutility
java.lang.Object
armyc2.c5isr.JavaLineArray.lineutility
A class to provide the utility functions required for calculating the line
points.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
adjustCATKBYFIREControlPoint
(int linetype, ArrayList<POINT2> pLinePoints, double dist) shift the control point to match the shift that occurs in Channels.GetAXADDouble for CATKBYFIRE.protected static POINT2[]
ArcArrayDouble
(POINT2[] pResultLinePoints, int vblCounter, double dRadius, int linetype, IPointConversion converter) Computes an arc.static POINT2[]
BoundOneSegment
(POINT2 pt0, POINT2 pt1, POINT2 ul, POINT2 lr) side 1 ----- | | side 0 | | side 2 | | ------ side 3 bounds one segment for autoshapes that need it: bydif, fordif, fix, mnfldfix if null is returned the client should conect the original line points (i.e.protected static POINT2
CalcCenterPointDouble
(POINT2[] pLinePoints, int vblCounter) Calculates the center point of an area using the first vblCounter points in the array.static POINT2
CalcCenterPointDouble2
(Object[] pLinePoints, int vblCounter) Called by renderer Modifier2 class after ArrayList.ToArray was called, which produces an array of objects.protected static void
CalcCircleDouble
(POINT2 Center, double radius, int numpts, POINT2[] CirclePoints, int styl) Computes the points for a circle.protected static void
CalcCircleDouble2
(POINT2 Center, POINT2 pt1, int numpts, POINT2[] CirclePoints, IPointConversion converter) Gets geodesic circle using the converterprotected static Shape2
CalcCircleShape
(POINT2 Center, double radius, int numpts, POINT2[] CirclePoints, int styl) protected static double
CalcClockwiseCenterDouble
(POINT2[] ptsSeize) Returns center point for a clockwise arc to connect pts 1 and 2.protected static int
CalcDirectionFromLine
(POINT2 pt0, POINT2 pt1, POINT2 pt2) Deprecated.protected static double
CalcDistance2
(long x1, long y1, long x2, long y2) Returns the distance in pixels from x1,y1 to x2,y2static double
CalcDistanceDouble
(Point2D p1, Point2D p2) Calculates the distance in pixels between two pointsstatic double
CalcDistanceDouble
(POINT2 p1, POINT2 p2) Calculates the distance in pixels between two pointsstatic double
CalcDistanceToLineDouble
(POINT2 pt1, POINT2 pt2, POINT2 pt3) Computes the distance in pixels of pt3 to the line from pt1 to pt2.static void
CalcMBRPoints
(POINT2[] pLinePoints, int numpts, POINT2 ul, POINT2 lr) protected static double
CalcSegmentAngleDouble
(POINT2 pt0, POINT2 pt1) Computes the angle in radians between two pointsprotected static int
CalcTrueIntersectDouble
(double m1, double b1, double m2, double b2, POINT2 p2, int bolVerticalSlope1, int bolVerticalSlope2, double dWidth, int lOrient, ref<double[]> X, ref<double[]> Y) Calculates the intersection of 2 lines pelative to a point.static POINT2
CalcTrueIntersectDouble2
(double m1, double b1, double m2, double b2, int bolVertical1, int bolVertical2, double X1, double X2) Calculates the intersection of two lines.protected static int
CalcTrueLinesDouble
(long nDistance, POINT2 linePoint1, POINT2 linePoint2, ref<double[]> pdResult) Calculates the slopes and y intercepts in pixels for the line from pt1 to pt2 and a parallel line a vertical distance from the lineprotected static int
CalcTrueSlopeDouble
(POINT2 firstLinePoint, POINT2 lastLinePoint, ref<double[]> slope) Computes the slope of a linestatic boolean
CalcTrueSlopeDouble2
(POINT2 firstLinePoint, POINT2 lastLinePoint, ref<double[]> slope) Computes the slope of a linestatic boolean
CalcTrueSlopeDoubleForRoutes
(POINT2 firstLinePoint, POINT2 lastLinePoint, ref<double[]> slope) Deprecated.Deprecated.static Shape
createStrokedShape
(Shape shape) Creates a GeneralPath from a Path2Dstatic POINT2
ExtendAlongLineDouble
(POINT2 pt1, POINT2 pt2, double dist) Extends a point along a line.static POINT2
ExtendAlongLineDouble
(POINT2 pt1, POINT2 pt2, double dist, int styl) static Point2D
ExtendAlongLineDouble2
(Point2D pt1, Point2D pt2, double dist) static POINT2
ExtendAlongLineDouble2
(POINT2 pt1, POINT2 pt2, double dist) static POINT2
ExtendAngledLine
(POINT2 pt0, POINT2 pt1, POINT2 pt2, double alpha, double d) Extends a point at an angle from a line.static POINT2
ExtendDirectedLine
(POINT2 pt1, POINT2 pt2, POINT2 pt0, int direction, double d) Returns a point extended perpendicularly from a line at a given directionstatic POINT2
ExtendDirectedLine
(POINT2 pt1, POINT2 pt2, POINT2 pt0, int direction, double d, int style) Returns a point extended perpendicularly from a line at a given directionstatic POINT2
ExtendDirectedLineText
(POINT2 pt1, POINT2 pt2, POINT2 pt0, int direction, double d) Deprecated.Returns a point extended perpendicularly from a line at a given direction same as original function except it accounts for vertical lines and negative d valuesprotected static POINT2
ExtendLine2Double
(POINT2 pt1, POINT2 pt2, double dist, int styl) Calculates a point along a lineprotected static int
ExtendLineAbove
(POINT2 pt1, POINT2 pt2, POINT2 pt3, double d, ref<double[]> X, ref<double[]> Y, int direction) Extends a point above a linestatic POINT2
ExtendLineDouble
(POINT2 pt1, POINT2 pt2, double dist) Calculates a point along a line.protected static int
ExtendLineLeft
(POINT2 pt1, POINT2 pt2, POINT2 pt3, double d, ref<double[]> X, ref<double[]> Y, int direction) Extends a point to the left of a linestatic POINT2
ExtendTrueLinePerpDouble
(POINT2 pt0, POINT2 pt1, POINT2 pt2, double d, int styl) Returns a point a distance d pixels perpendicular to the pt0-pt1 line and going toward pt2protected static void
GetArrowHead4Double
(POINT2 startLinePoint, POINT2 endLinePoint, int nBiSector, int nBase, POINT2[] pResultLinePoints, int styl) Computes the points for an arrowhead based on a line segmentgetDeepCopy
(ArrayList<POINT2> pts) static int
GetDirAtkAirMiddleSegment
(POINT2[] pLinePoints, int vblSaveCounter) Calculates the middle segment for the Direction of Attack Aviation symbolprotected static int
GetDitchSpikeDouble
(TGLight tg, POINT2[] pLinePoints, int nOldCounter, int bWayIs) Computes Ditch spikes for the ATDITCH line types.static void
getExteriorPoints
(POINT2[] pLinePoints, int vblCounter, int lineType, boolean interior) protected static POINT2
GetOffsetPointDouble
(POINT2 startLinePoint, POINT2 endLinePoint, long nOffset) Calculates an offset point for channel types which require arrows.static void
GetPixelsMax
(POINT2[] ptsSeize, int vblCounter, ref<double[]> x, ref<double[]> y) Returns the largest x and y pixel values from an array of pointsstatic void
GetPixelsMin
(POINT2[] ptsSeize, int vblCounter, ref<double[]> x, ref<double[]> y) Returns the smallest x and y pixel values from an array of pointsstatic int
GetQuadrantDouble
(double x1, double y1, double x2, double y2) static int
GetQuadrantDouble
(POINT2 pt1, POINT2 pt2) Returns an integer indicating the quadrant for the direction of the line from pt1 to pt2protected static void
GetSAAFRFillSegment
(POINT2[] pLinePoints, double dMRR) Called by arraysupport for SAAFR and AC fill shapesprotected static POINT2[]
GetSAAFRMiddleLine
(POINT2[] pLinePoints) gets the middle line for Rev B air corridors AC, LLTR, MRR, UAV Middle line is handled separately now because the line may have been segmentedprotected static void
GetSAAFRSegment
(POINT2[] pLinePoints, int lineType, double dMRR) Computes the points for a SAAFR segmentprotected static int
GetSquallSegment
(POINT2 StartPt, POINT2 EndPt, POINT2[] pSquallPts, ref<int[]> sign, double amplitude, int quantity, double length) Gets the squall curves for a line segment Assumes pSquallPts has been allocated the proper number of points.protected static void
InitializePOINT2Array
(POINT2[] pts) POINT2 in previous applications has been a struct that did not require initialization.protected static ArrayList
LineOfXPoints
(TGLight tg, POINT2[] pLinePoints) Used for DMAFstatic void
Returns in pt2 and pt3 the line segment parallel to segment pt0-pt1 which would contain ptRelative.protected static double
MBRDistance
(POINT2[] pLinePoints, int numpts) Computes the distance in pixels from upper left to lower right of the minimum bounding rectangle for the first numpts of pLinePointsstatic POINT2
MidPointDouble
(POINT2 pt0, POINT2 pt1, int styl) Returns the midpoint between two points.protected static void
MoveChannelPixels
(POINT2[] pLinePoints) Moves pixels if points are identical, used for the channel typesprotected static void
moveSingleCPixels
(int linetype, POINT2[] pLinePoints) Single Concertina cannot have horizontal first segmentprotected static POINT2
PointRelativeToLine
(POINT2 pt0, POINT2 pt1, POINT2 ptRelative) Returns the point perpendicular to the line (pt0 to pt1) at the midpoint the same distance from (and on the same side of) the the line as ptRelative.static POINT2
PointRelativeToLine
(POINT2 pt0, POINT2 pt1, POINT2 atPoint, POINT2 ptRelative) Returns the point perpendicular to the line (pt0 to pt1) at atPoint the same distance from (and on the same side of) the the line as ptRelative.protected static POINT2[]
ResizeArray
(POINT2[] pLinePoints, int length) Resizes the array to the length speicifed, called by the Channels class.protected static void
Reverse2Points
(POINT2 pt1, POINT2 pt2) Swaps two points.protected static void
ReversePointsDouble2
(POINT2[] pLowerLinePoints, int vblCounter) reverses the first vblCounter pointsprotected static void
RotateGeometryDouble
(POINT2[] pLinePoints, int vblCounter, double lAngle) Rotates an the first vblCounter points in the array about its first pointprotected static POINT2[]
RotateGeometryDoubleOrigin
(POINT2[] pLinePoints, int vblCounter, int lAngle) Rotates an the first vblCounter points in the array about its first pointprotected static void
SegmentLineShape
(POINT2 pt0, POINT2 pt1, Shape2 shape) post-segments a line segment into 50 pixel intervalsstatic void
-
Field Details
-
extend_left
- See Also:
-
extend_right
- See Also:
-
extend_above
- See Also:
-
extend_below
- See Also:
-
-
Constructor Details
-
lineutility
public lineutility()
-
-
Method Details
-
ResizeArray
Resizes the array to the length speicifed, called by the Channels class.- Parameters:
pLinePoints
- the array to resizelength
- the length to which to resize the array.- Returns:
- the resized array
-
SegmentLineShape
post-segments a line segment into 50 pixel intervals- Parameters:
pt0
-pt1
-shape
-
-
GetDirAtkAirMiddleSegment
Calculates the middle segment for the Direction of Attack Aviation symbol- Parameters:
pLinePoints
- the point arrayvblSaveCounter
- the size of the point array- Returns:
- the middle segment
-
CalcSegmentAngleDouble
Computes the angle in radians between two points- Parameters:
pt0
- the first pointpt1
- the last point- Returns:
- the angle in radians
-
InitializePOINT2Array
POINT2 in previous applications has been a struct that did not require initialization.- Parameters:
pts
- array of points to instantiate.
-
CalcCenterPointDouble
Calculates the center point of an area using the first vblCounter points in the array.- Parameters:
pLinePoints
- the client pointsvblCounter
- the number of points in the array to use- Returns:
- the center point
-
CalcCenterPointDouble2
Called by renderer Modifier2 class after ArrayList.ToArray was called, which produces an array of objects.- Parameters:
pLinePoints
-vblCounter
-- Returns:
-
CalcDistanceDouble
Calculates the distance in pixels between two points- Parameters:
p1
- the first pointp2
- the last point- Returns:
- the distance between p1 and p2 in pixels
-
CalcDistanceDouble
Calculates the distance in pixels between two points- Parameters:
p1
- the first pointp2
- the last point- Returns:
- the distance between p1 and p2 in pixels
-
CalcTrueSlopeDouble
protected static int CalcTrueSlopeDouble(POINT2 firstLinePoint, POINT2 lastLinePoint, ref<double[]> slope) Computes the slope of a line- Parameters:
firstLinePoint
- the first line pointlastLinePoint
- the last line pointslope
- OUT - object with member to hold the slope of the line- Returns:
- 1 if successful, else return 0
-
WriteFile
-
ReversePointsDouble2
reverses the first vblCounter points- Parameters:
pLowerLinePoints
- OUT - points to reversevblCounter
-
-
CalcTrueSlopeDoubleForRoutes
public static boolean CalcTrueSlopeDoubleForRoutes(POINT2 firstLinePoint, POINT2 lastLinePoint, ref<double[]> slope) -
CalcTrueSlopeDouble2
public static boolean CalcTrueSlopeDouble2(POINT2 firstLinePoint, POINT2 lastLinePoint, ref<double[]> slope) Computes the slope of a line- Parameters:
firstLinePoint
- the first line pointlastLinePoint
- the last line pointslope
- OUT - object with member to hold the slope of the line- Returns:
- true if successful
-
CalcTrueLinesDouble
protected static int CalcTrueLinesDouble(long nDistance, POINT2 linePoint1, POINT2 linePoint2, ref<double[]> pdResult) Calculates the slopes and y intercepts in pixels for the line from pt1 to pt2 and a parallel line a vertical distance from the line- Parameters:
nDistance
- the distance in pixelslinePoint1
- first point on the linelinePoint2
- last point on the linepdResult
- OUT - array to hold m, b for both lines- Returns:
- 1 if the lines are not vertical, else return 0
-
CalcTrueIntersectDouble2
public static POINT2 CalcTrueIntersectDouble2(double m1, double b1, double m2, double b2, int bolVertical1, int bolVertical2, double X1, double X2) Calculates the intersection of two lines.- Parameters:
m1
- slope of first lineb1
- Y intercept of first linem2
- slope of second lineb2
- Y intercept of second linebolVertical1
- 0 if first line is vertical, else 1bolVertical2
- 0 if second line is vertical, else 1X1
- X intercept if first line is verticalX2
- X intercept if 2nd line is vertical.- Returns:
- intersection point
-
GetOffsetPointDouble
protected static POINT2 GetOffsetPointDouble(POINT2 startLinePoint, POINT2 endLinePoint, long nOffset) Calculates an offset point for channel types which require arrows.- Parameters:
startLinePoint
- the first pointendLinePoint
- the last pointnOffset
- the offset in pixels- Returns:
- the offset point
-
LineOfXPoints
Used for DMAF- Parameters:
pLinePoints
- the client points- Returns:
- ArrayList of X points
-
CalcDistanceToLineDouble
Computes the distance in pixels of pt3 to the line from pt1 to pt2.- Parameters:
pt1
- first line pointpt2
- last line pointpt3
- point distance to compute- Returns:
- distance to pt3
-
ExtendLineDouble
Calculates a point along a line. Returns the past point if the distance is 0.- Parameters:
pt1
- first line pointpt2
- last line pointdist
- extension distance in pixels from the beginning of the line- Returns:
- the extension point
-
ExtendAlongLineDouble
Extends a point along a line. If dist is 0 returns last point.- Parameters:
pt1
- first point on the linept2
- last point on the linedist
- the distance in pixels from pt1- Returns:
- the extended point
-
ExtendAlongLineDouble2
-
ExtendAlongLineDouble2
-
ExtendAlongLineDouble
-
ExtendLineAbove
protected static int ExtendLineAbove(POINT2 pt1, POINT2 pt2, POINT2 pt3, double d, ref<double[]> X, ref<double[]> Y, int direction) Extends a point above a line- Parameters:
pt1
- first line pointpt2
- last line pointpt3
- point at which to extendd
- distance in pixels to extend above the lineX
- OUT - extended point x valueY
- OUT - extended point y valuedirection
- direction to extend the line- Returns:
- 1 if successful, else return 0
-
ExtendLineLeft
protected static int ExtendLineLeft(POINT2 pt1, POINT2 pt2, POINT2 pt3, double d, ref<double[]> X, ref<double[]> Y, int direction) Extends a point to the left of a line- Parameters:
pt1
- first line pointpt2
- last line pointpt3
- point at which to extendd
- distance in pixels to extend above the lineX
- OUT - extended point x valueY
- OUT - extended point y valuedirection
- direction to extend the line- Returns:
- 1 if successful, else return 0
-
CalcDirectionFromLine
Deprecated.Calculates the direction of a point relative to a line- Parameters:
pt0
- first point fo the linept1
- last point of the linept2
- relative point- Returns:
- 0 if left, 1 if right, 2 if above, 3 if below
-
ExtendDirectedLine
public static POINT2 ExtendDirectedLine(POINT2 pt1, POINT2 pt2, POINT2 pt0, int direction, double d) Returns a point extended perpendicularly from a line at a given direction- Parameters:
pt1
- first line pointpt2
- last line pointpt0
- on line from which to extenddirection
- the direction to extend: above, below, left, rightd
- the length to extend in pixels
-
ExtendDirectedLineText
public static POINT2 ExtendDirectedLineText(POINT2 pt1, POINT2 pt2, POINT2 pt0, int direction, double d) Deprecated.Returns a point extended perpendicularly from a line at a given direction same as original function except it accounts for vertical lines and negative d values- Parameters:
pt1
- first line pointpt2
- last line pointpt0
- on line from which to extenddirection
- the direction to extend: above, below, left, rightd
- the length to extend in pixels
-
ExtendDirectedLine
public static POINT2 ExtendDirectedLine(POINT2 pt1, POINT2 pt2, POINT2 pt0, int direction, double d, int style) Returns a point extended perpendicularly from a line at a given direction- Parameters:
pt1
- first line pointpt2
- last line pointpt0
- on line from which to extenddirection
- the direction to extend: above, below, left, rightd
- the length to extend in pixelsstyle
- the style to assign the return point
-
ExtendLine2Double
Calculates a point along a line- Parameters:
pt1
- first line pointpt2
- last line pointdist
- extension distance in pixels from the beginning of the linestyl
- the line style to assign the point- Returns:
- the extension point
-
ExtendAngledLine
Extends a point at an angle from a line.- Parameters:
pt0
- the first line pointpt1
- the second line pointpt2
- point on line from which to extendalpha
- angle of extension in degreesd
- the distance in pixels to extend- Returns:
- the extension point
-
GetQuadrantDouble
Returns an integer indicating the quadrant for the direction of the line from pt1 to pt2- Parameters:
pt1
- first line pointpt2
- second line point- Returns:
- the quadrant
-
GetQuadrantDouble
-
GetPixelsMin
public static void GetPixelsMin(POINT2[] ptsSeize, int vblCounter, ref<double[]> x, ref<double[]> y) Returns the smallest x and y pixel values from an array of points- Parameters:
ptsSeize
- array of points from which to find minimum vaulesvblCounter
- the number of points to test in the arrayx
- OUT - an object with a member to hold the xminimumy
- OUT - an object with a member to hold the y minimum value
-
GetPixelsMax
public static void GetPixelsMax(POINT2[] ptsSeize, int vblCounter, ref<double[]> x, ref<double[]> y) Returns the largest x and y pixel values from an array of points- Parameters:
ptsSeize
- array of points from which to find maximum valuesvblCounter
- the number of points to test in the arrayx
- OUT - an object with a member to hold the x maximum valuey
- OUT - an object with a member to hold the y maximum value
-
CalcClockwiseCenterDouble
Returns center point for a clockwise arc to connect pts 1 and 2. Also returns an extended point on the line between pt1 and the new center Caller passes a POINT1 array of size 2 for ptsSeize, passes pt1 and pt2 in ptsSeize Returns the radius of the 90 degree arc between C (arc center) and pt1- Parameters:
ptsSeize
- OUT - two point array also used for the returned two points- Returns:
- the radius
-
GetArrowHead4Double
protected static void GetArrowHead4Double(POINT2 startLinePoint, POINT2 endLinePoint, int nBiSector, int nBase, POINT2[] pResultLinePoints, int styl) Computes the points for an arrowhead based on a line segment- Parameters:
startLinePoint
- segment start pointendLinePoint
- segment end pointnBiSector
- bisecotr in pixelsnBase
- base size in pixelspResultLinePoints
- OUT - the arrowhead pointsstyl
- the line style to assign the last aroowhead point
-
MidPointDouble
Returns the midpoint between two points.- Parameters:
pt0
- the first pointpt1
- the second pointstyl
- the style to assign the mid point- Returns:
- the mid point
-
RotateGeometryDoubleOrigin
protected static POINT2[] RotateGeometryDoubleOrigin(POINT2[] pLinePoints, int vblCounter, int lAngle) Rotates an the first vblCounter points in the array about its first point- Parameters:
pLinePoints
- OUT - the points to rotatevblCounter
- the number of points to rotatelAngle
- the angle in degrees to rotate- Returns:
- pLinePoints
-
ExtendTrueLinePerpDouble
public static POINT2 ExtendTrueLinePerpDouble(POINT2 pt0, POINT2 pt1, POINT2 pt2, double d, int styl) Returns a point a distance d pixels perpendicular to the pt0-pt1 line and going toward pt2- Parameters:
pt0
- the first line pointpt1
- the second line pointpt2
- the relative line pointd
- the distance in pixelsstyl
- the linestyle to assign the computed point- Returns:
- the extended point
-
CalcTrueIntersectDouble
protected static int CalcTrueIntersectDouble(double m1, double b1, double m2, double b2, POINT2 p2, int bolVerticalSlope1, int bolVerticalSlope2, double dWidth, int lOrient, ref<double[]> X, ref<double[]> Y) Calculates the intersection of 2 lines pelative to a point. if one of the lines is vertical use a distance dWidth above or below the line. pass bolVertical1 = 1, or bolVertical2 = 1 if either line segment is vertical, else pass 0. return the unique intersection in X,Y pointers. p2 is the point that connects the 2 line segments to which the intersecting lines are related, i.e. the intersecting lines are a distance dWidth pixels above or below p2. uses dWidth and lOrient for cases in which at least one of the lines is vertical. for normal lines this function assumes the caller has passed the m, b for the appropriate upper or lower lines to get the desired intgercept. this function is used for calculating the upper and lower channel lines for channel types. For lOrient: see comments in Channels.ConnectTrueDouble2- Parameters:
m1
- slope of the first lineb1
- intercept of the first linem2
- slope of the second lineb2
- y intercept of the second linep2
- point that connects the 2 line segments to which the intersecting lines are relatedbolVerticalSlope1
- 1 if first segment is vertical, else 0bolVerticalSlope2
- 1 if second line segment is vertical, else 0dWidth
- the distance of the intersecting lines from p2 in pixelslOrient
- the orientation of the intersecting lines relative to the segments connecting p2X
- OUT - object holds the x value of the intersection pointY
- OUT - object holds the y value of the intersection point
-
CalcDistance2
Returns the distance in pixels from x1,y1 to x2,y2- Parameters:
x1
- first point x location in pixelsy1
- first point y location in pixelsx2
- second point x location in pixelsy2
- second point y location in pixels- Returns:
- the distance
-
GetSAAFRMiddleLine
gets the middle line for Rev B air corridors AC, LLTR, MRR, UAV Middle line is handled separately now because the line may have been segmented- Parameters:
pLinePoints
-- Returns:
-
GetSAAFRSegment
Computes the points for a SAAFR segment- Parameters:
pLinePoints
- OUT - the client points also used for the returned pointslineType
- the line typedMRR
- the symbol width
-
GetSAAFRFillSegment
Called by arraysupport for SAAFR and AC fill shapes- Parameters:
pLinePoints
-dMRR
-
-
ArcArrayDouble
protected static POINT2[] ArcArrayDouble(POINT2[] pResultLinePoints, int vblCounter, double dRadius, int linetype, IPointConversion converter) Computes an arc.- Parameters:
pResultLinePoints
- OUT - contains center and start point and holds the result arc pointsvblCounter
- the number of client pointsdRadius
- the arc radius in pixelslinetype
- the linetype determines start andgle and end angle for the arc
-
CalcCircleDouble2
protected static void CalcCircleDouble2(POINT2 Center, POINT2 pt1, int numpts, POINT2[] CirclePoints, IPointConversion converter) Gets geodesic circle using the converter- Parameters:
Center
- in pixelspt1
- a point on the radius in pixelsnumpts
- number of points to returnCirclePoints
- the result pointsconverter
-
-
CalcCircleDouble
protected static void CalcCircleDouble(POINT2 Center, double radius, int numpts, POINT2[] CirclePoints, int styl) Computes the points for a circle. Assumes CirclePoints has been allocated with size numpts.- Parameters:
Center
- the cicle centerradius
- the circle radius in pixelsnumpts
- the number of circle pointsCirclePoints
- - OUT - array of circle pointsstyl
- the style to set the last circle point
-
CalcCircleShape
protected static Shape2 CalcCircleShape(POINT2 Center, double radius, int numpts, POINT2[] CirclePoints, int styl) -
GetSquallSegment
protected static int GetSquallSegment(POINT2 StartPt, POINT2 EndPt, POINT2[] pSquallPts, ref<int[]> sign, double amplitude, int quantity, double length) Gets the squall curves for a line segment Assumes pSquallPts has been allocated the proper number of points.- Parameters:
StartPt
- segment start pointEndPt
- segment end pointpSquallPts
- OUT - the squall pointssign
- OUT - an object with a member to hold the starting curve sign for the segment.amplitude
- the sin curve amplitutdequantity
- the number of points for each sin curvelength
- the desired length of the curve along the segment for each sin curve- Returns:
- segment squall points count
-
BoundOneSegment
side 1 ----- | | side 0 | | side 2 | | ------ side 3 bounds one segment for autoshapes that need it: bydif, fordif, fix, mnfldfix if null is returned the client should conect the original line points (i.e. no jaggies)- Parameters:
pt0
-pt1
-ul
-lr
-- Returns:
- bounded segment or null
-
GetDitchSpikeDouble
protected static int GetDitchSpikeDouble(TGLight tg, POINT2[] pLinePoints, int nOldCounter, int bWayIs) Computes Ditch spikes for the ATDITCH line types. This function uses linestyles provided by the caller to skip segments.- Parameters:
pLinePoints
- OUT - the client points also used for the return pointsnOldCounter
- the number of client pointsbWayIs
- the parallel line to use (0) for inner or outer spikeslinetype
- the line type- Returns:
- the symbol point count
-
MoveChannelPixels
Moves pixels if points are identical, used for the channel types- Parameters:
pLinePoints
- OUT - client points also for returned points
-
moveSingleCPixels
Single Concertina cannot have horizontal first segment- Parameters:
linetype
-pLinePoints
-
-
RotateGeometryDouble
Rotates an the first vblCounter points in the array about its first point- Parameters:
pLinePoints
- OUT - the points to rotatevblCounter
- the number of points to rotatelAngle
- the angle in degrees to rotate
-
PointRelativeToLine
Returns the point perpendicular to the line (pt0 to pt1) at the midpoint the same distance from (and on the same side of) the the line as ptRelative.- Parameters:
pt0
- the first pointpt1
- the second pointptRelative
- the point to use for computing the return point- Returns:
- the point perpendicular to the line at the midpoint
-
adjustCATKBYFIREControlPoint
public static void adjustCATKBYFIREControlPoint(int linetype, ArrayList<POINT2> pLinePoints, double dist) shift the control point to match the shift that occurs in Channels.GetAXADDouble for CATKBYFIRE. This is because the rotary feature arrow tip must align with the anchor point- Parameters:
linetype
-pLinePoints
- the anchor points including the control pointdist
- the minimum required distance from the front of the rotary arrow
-
PointRelativeToLine
Returns the point perpendicular to the line (pt0 to pt1) at atPoint the same distance from (and on the same side of) the the line as ptRelative.- Parameters:
pt0
- the first pointpt1
- the second pointatPoint
- the point on the line at which to compute the extended pointptRelative
- the point to use for computing the return point- Returns:
- the point perpendicular to the line at ptRelative
-
LineRelativeToLine
public static void LineRelativeToLine(POINT2 pt0, POINT2 pt1, POINT2 ptRelative, POINT2 pt2, POINT2 pt3) Returns in pt2 and pt3 the line segment parallel to segment pt0-pt1 which would contain ptRelative. pt2 corresponds to pt0 and pt3 corresponds to pt1.- Parameters:
pt0
- first line pointpt1
- second line pointptRelative
- relative line pointpt2
- OUT - first computed relative line pointpt3
- OUT - second computed relative line point
-
CalcMBRPoints
-
MBRDistance
Computes the distance in pixels from upper left to lower right of the minimum bounding rectangle for the first numpts of pLinePoints- Parameters:
pLinePoints
- the inpupt point arraynumpts
- the number of points to use- Returns:
- the distance in pixels
-
Reverse2Points
Swaps two points.- Parameters:
pt1
- OUT - first pointpt2
- OUT - second point
-
createStrokedShape
Creates a GeneralPath from a Path2D- Parameters:
shape
-- Returns:
-
cHull
Deprecated.- Parameters:
array
-- Returns:
-
cHull2
Deprecated.- Parameters:
array
-- Returns:
-
getExteriorPoints
public static void getExteriorPoints(POINT2[] pLinePoints, int vblCounter, int lineType, boolean interior) -
getDeepCopy
-