use of com.ait.tooling.nativetools.client.collection.NFastDoubleArrayJSO in project lienzo-core by ahome-it.
the class OrthogonalPolyLine method parse.
@Override
public boolean parse(final Attributes attr) {
Point2DArray points = attr.getControlPoints();
points = correctBreakDistance(points, m_breakDistance);
if (null != points) {
if (points.size() > 1) {
final double headOffset = attr.getHeadOffset();
final double correction = attr.getCorrectionOffset();
Direction headDirection = attr.getHeadDirection();
final Direction tailDirection = attr.getTailDirection();
if (headDirection == NONE) {
final Point2D p0 = points.get(0);
final Point2D p1 = points.get(1);
final double headOffsetAndCorrect = headOffset + correction;
headDirection = getHeadDirection(points, null, headDirection, tailDirection, p0, p1, headOffsetAndCorrect, correction, this);
}
final NFastDoubleArrayJSO opoint = drawOrthogonalLinePoints(points, headDirection, tailDirection, correction, this, m_breakDistance, true);
m_headOffsetPoint = points.get(0);
m_tailOffsetPoint = points.get(points.size() - 1);
if (null != opoint) {
final PathPartList list = getPathPartList();
list.M(m_headOffsetPoint.getX(), m_headOffsetPoint.getY());
final double radius = getCornerRadius();
m_computedPoint2DArray = Point2DArray.fromNFastDoubleArrayJSO(opoint);
if (radius > 0) {
Geometry.drawArcJoinedLines(list, m_computedPoint2DArray, radius);
} else {
final int size = opoint.size();
// start at 2, as M is for opoint[0]
for (int i = 2; i < size; i += 2) {
list.L(opoint.get(i), opoint.get(i + 1));
}
}
return true;
}
}
}
m_computedPoint2DArray = null;
return false;
}
Aggregations