Bug 13022 fixed: Vectorial export did not clip large segments
[scilab.git] / scilab / modules / scirenderer / src / org / scilab / forge / scirenderer / implementation / g2d / motor / Motor3D.java
index a90b5bc..3d2267b 100644 (file)
@@ -375,7 +375,7 @@ public class Motor3D {
                         v = new Vector3d[] {verticesArray[i], verticesArray[i + 1]};
                         c = new Color[] {colorsArray[i], colorsArray[i + 1]};
                         try {
-                            add(new Segment(v, c, G2DStroke.getStroke(appearance, cumLength)));
+                            add(new Segment(v, c, G2DStroke.getStroke(appearance, cumLength), false));
                             cumLength += Segment.getLength(v);
                         } catch (InvalidPolygonException e) {
                             cumLength = 0;
@@ -394,7 +394,7 @@ public class Motor3D {
                         v = new Vector3d[] {verticesArray[i], verticesArray[i + 1]};
                         c = new Color[] {colorsArray[i], colorsArray[i + 1]};
                         try {
-                            add(new Segment(v, c, G2DStroke.getStroke(appearance, cumLength)));
+                            add(new Segment(v, c, G2DStroke.getStroke(appearance, cumLength), false));
                             cumLength += Segment.getLength(v);
                         } catch (InvalidPolygonException e) {
                             cumLength = 0;
@@ -404,7 +404,7 @@ public class Motor3D {
                     v = new Vector3d[] {verticesArray[n], verticesArray[0]};
                     c = new Color[] {colorsArray[n], colorsArray[0]};
                     try {
-                        add(new Segment(v, c, G2DStroke.getStroke(appearance, cumLength)));
+                        add(new Segment(v, c, G2DStroke.getStroke(appearance, cumLength), false));
                     } catch (InvalidPolygonException e) { }
                 }
                 break;
@@ -414,7 +414,7 @@ public class Motor3D {
                     v = new Vector3d[] {verticesArray[i], verticesArray[i + 1]};
                     c = new Color[] {colorsArray[i], colorsArray[i + 1]};
                     try {
-                        add(new Segment(v, c, G2DStroke.getStroke(appearance, 0)));
+                        add(new Segment(v, c, G2DStroke.getStroke(appearance, 0), is2DView()));
                     } catch (InvalidPolygonException e) { }
                 }
                 break;
@@ -580,7 +580,7 @@ public class Motor3D {
         float[] vertexTransf = lightManager.getVertexTransform();
         float[] normalTransf = lightManager.getNormalTransform();
         //for transformed vertices camera is at origin.
-        Vector3f camera = new Vector3f(0.f, 0.f ,0.f);
+        Vector3f camera = new Vector3f(0.f, 0.f , 0.f);
         Vector3f[] vertexArray = LightHelper.getIndexedVector3f(vertices, index, G2DElementsBuffer.ELEMENT_SIZE, vertexTransf);
         Vector3f[] normalArray = LightHelper.getIndexedVector3f(normals, index, G2DElementsBuffer.ELEMENT_SIZE, normalTransf);
 
@@ -594,7 +594,9 @@ public class Motor3D {
         for (int i = 0; i < lightManager.getLightNumber(); ++i) {
             G2DLight l = (G2DLight)lightManager.getLight(i);
 
-            if (l == null || !l.isEnable()) continue;
+            if (l == null || !l.isEnable()) {
+                continue;
+            }
 
             outColors = LightHelper.applyLight(l, mat, camera, vertexArray, normalArray, colors, outColors, vertexTransf, !first);
             first = false;