Patch.java (pdfbox-2.0.23-src) | : | Patch.java (pdfbox-2.0.24-src) | ||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
level = {levelU, levelV}, levelU defines the patch's u direction edges shou ld be | level = {levelU, levelV}, levelU defines the patch's u direction edges shou ld be | |||
divided into 2^levelU parts, level V defines the patch's v direction edges should | divided into 2^levelU parts, level V defines the patch's v direction edges should | |||
be divided into 2^levelV parts | be divided into 2^levelV parts | |||
*/ | */ | |||
protected int[] level; | protected int[] level; | |||
protected List<ShadedTriangle> listOfTriangles; | protected List<ShadedTriangle> listOfTriangles; | |||
/** | /** | |||
* Constructor of Patch. | * Constructor of Patch. | |||
* | * | |||
* @param ctl control points, size is 12 (for type 6 shading) or 16 (for | ||||
* type 7 shading) | ||||
* @param color 4 corner's colors | * @param color 4 corner's colors | |||
*/ | */ | |||
Patch(Point2D[] ctl, float[][] color) | Patch(float[][] color) | |||
{ | { | |||
cornerColor = color.clone(); | cornerColor = color.clone(); | |||
} | } | |||
/** | /** | |||
* Get the implicit edge for flag = 1. | * Get the implicit edge for flag = 1. | |||
* | * | |||
* @return implicit control points | * @return implicit control points | |||
*/ | */ | |||
protected abstract Point2D[] getFlag1Edge(); | protected abstract Point2D[] getFlag1Edge(); | |||
skipping to change at line 184 | skipping to change at line 182 | |||
*/ | */ | |||
protected List<ShadedTriangle> getShadedTriangles(CoordinateColorPair[][] pa tchCC) | protected List<ShadedTriangle> getShadedTriangles(CoordinateColorPair[][] pa tchCC) | |||
{ | { | |||
List<ShadedTriangle> list = new ArrayList<ShadedTriangle>(); | List<ShadedTriangle> list = new ArrayList<ShadedTriangle>(); | |||
int szV = patchCC.length; | int szV = patchCC.length; | |||
int szU = patchCC[0].length; | int szU = patchCC[0].length; | |||
for (int i = 1; i < szV; i++) | for (int i = 1; i < szV; i++) | |||
{ | { | |||
for (int j = 1; j < szU; j++) | for (int j = 1; j < szU; j++) | |||
{ | { | |||
Point2D p0 = patchCC[i - 1][j - 1].coordinate, p1 = patchCC[i - | Point2D p0 = patchCC[i - 1][j - 1].coordinate; | |||
1][j].coordinate, p2 = patchCC[i][j].coordinate, | Point2D p1 = patchCC[i - 1][j].coordinate; | |||
p3 = patchCC[i][j - 1].coordinate; | Point2D p2 = patchCC[i][j].coordinate; | |||
Point2D p3 = patchCC[i][j - 1].coordinate; | ||||
boolean ll = true; | boolean ll = true; | |||
if (overlaps(p0, p1) || overlaps(p0, p3)) | if (overlaps(p0, p1) || overlaps(p0, p3)) | |||
{ | { | |||
ll = false; | ll = false; | |||
} | } | |||
else | else | |||
{ | { | |||
// p0, p1 and p3 are in counter clock wise order, p1 has pri ority over p0, p3 has priority over p1 | // p0, p1 and p3 are in counter clock wise order, p1 has pri ority over p0, p3 has priority over p1 | |||
Point2D[] llCorner = | Point2D[] llCorner = | |||
{ | { | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added |