add LineRender

This commit is contained in:
wyq 2022-12-15 23:48:31 +08:00
parent 54b2cdebca
commit 9ed488ee07
19 changed files with 686 additions and 171 deletions

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-math4-core:4.0-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-20221208.135027-537.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-20221208.135027-537-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-20221208.135027-537-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-core/4.0-SNAPSHOT/commons-math4-core-4.0-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-math4-legacy:4.0-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy/4.0-SNAPSHOT/commons-math4-legacy-4.0-20221208.135027-663.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy/4.0-SNAPSHOT/commons-math4-legacy-4.0-20221212.124431-669.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy/4.0-SNAPSHOT/commons-math4-legacy-4.0-20221208.135027-663-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy/4.0-SNAPSHOT/commons-math4-legacy-4.0-20221212.124431-669-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy/4.0-SNAPSHOT/commons-math4-legacy-4.0-20221208.135027-663-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy/4.0-SNAPSHOT/commons-math4-legacy-4.0-20221212.124431-669-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-math4-legacy-core:4.0-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-20221208.135027-671.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-20221208.135027-671-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-20221208.135027-671-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-core/4.0-SNAPSHOT/commons-math4-legacy-core-4.0-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-math4-legacy-exception:4.0-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-exception/4.0-SNAPSHOT/commons-math4-legacy-exception-4.0-20221208.135027-682.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-exception/4.0-SNAPSHOT/commons-math4-legacy-exception-4.0-20221212.124431-688.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-exception/4.0-SNAPSHOT/commons-math4-legacy-exception-4.0-20221208.135027-682-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-exception/4.0-SNAPSHOT/commons-math4-legacy-exception-4.0-20221212.124431-688-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-exception/4.0-SNAPSHOT/commons-math4-legacy-exception-4.0-20221208.135027-682-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-math4-legacy-exception/4.0-SNAPSHOT/commons-math4-legacy-exception-4.0-20221212.124431-688-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1647,7 +1647,12 @@ public class GLChartPanel extends GLJPanel implements IChartPanel{
* @return View image
*/
public BufferedImage paintViewImage(int width, int height) {
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
BufferedImage image;
if (this.chart.containsGLPlot()) {
image = JOGLUtil.paintViewImage(this.chart, width, height);
} else {
image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
}
Graphics2D g = image.createGraphics();
paintGraphics(g);
@ -1682,8 +1687,12 @@ public class GLChartPanel extends GLJPanel implements IChartPanel{
*/
public BufferedImage paintViewImage(int width, int height, int dpi) {
double scaleFactor = dpi / 72.0;
BufferedImage image = new BufferedImage((int)(width * scaleFactor), (int)(height * scaleFactor),
BufferedImage.TYPE_INT_ARGB);
BufferedImage image;
if (this.chart.containsGLPlot()) {
image = JOGLUtil.paintViewImage(this.chart, width, height, dpi);
} else {
image = new BufferedImage((int)(width * scaleFactor), (int)(height * scaleFactor), BufferedImage.TYPE_INT_ARGB);
}
Graphics2D g = image.createGraphics();
AffineTransform at = g.getTransform();
at.scale(scaleFactor, scaleFactor);

View File

@ -268,6 +268,8 @@ public class EarthGLPlot extends GLPlot {
this.setLight(gl);
this.updateTextRender(this.xAxis.getTickLabelFont());
//Draw graphics
for (int m = 0; m < this.graphics.getNumGraphics(); m++) {
Graphic graphic = this.graphics.get(m);
@ -314,6 +316,9 @@ public class EarthGLPlot extends GLPlot {
//Draw title
this.drawTitle();
this.textRenderer.dispose();
this.textRenderer = null;
gl.glFlush();
//Do screen-shot

View File

@ -23,10 +23,7 @@ import org.meteoinfo.chart.jogl.tessellator.TessPolygon;
import org.meteoinfo.chart.plot.GridLine;
import org.meteoinfo.chart.plot.Plot;
import org.meteoinfo.chart.plot.PlotType;
import org.meteoinfo.chart.render.jogl.JOGLGraphicRender;
import org.meteoinfo.chart.render.jogl.MeshRender;
import org.meteoinfo.chart.render.jogl.TriMeshRender;
import org.meteoinfo.chart.render.jogl.VolumeRender;
import org.meteoinfo.chart.render.jogl.*;
import org.meteoinfo.chart.shape.TextureShape;
import org.meteoinfo.common.*;
import org.meteoinfo.common.colors.ColorMap;
@ -2444,12 +2441,7 @@ public class GLPlot extends Plot {
}
}
if (graphic.getNumGraphics() == 1) {
Graphic gg = graphic.getGraphicN(0);
this.drawGraphic(gl, gg);
} else {
if (graphic instanceof MeshGraphic) {
//this.drawSurface(gl, (SurfaceGraphics) graphic);
if (!this.renderMap.containsKey(graphic)) {
renderMap.put(graphic, new MeshRender(gl, (MeshGraphic) graphic));
}
@ -2515,6 +2507,45 @@ public class GLPlot extends Plot {
this.drawPoints(gl, graphic);
}
break;
case POLYLINE_Z:
boolean useRender = true;
ColorBreak cb = graphic.getGraphicN(0).getLegend();
if (cb instanceof StreamlineBreak) {
useRender = false;
} else if (cb instanceof ColorBreakCollection) {
if (((ColorBreakCollection) cb).get(0) instanceof StreamlineBreak) {
useRender = false;
}
}
if (useRender) {
if (graphic.getGraphicN(0).getShape() instanceof PipeShape) {
if (!this.renderMap.containsKey(graphic)) {
renderMap.put(graphic, new PipeRender(gl, (GraphicCollection3D) graphic));
}
PipeRender pipeRender = (PipeRender) renderMap.get(graphic);
pipeRender.setTransform(this.transform, this.alwaysUpdateBuffers);
pipeRender.setOrthographic(this.orthographic);
pipeRender.setLighting(this.lighting);
pipeRender.updateMatrix();
pipeRender.draw();
} else {
if (!this.renderMap.containsKey(graphic)) {
renderMap.put(graphic, new LineRender(gl, (GraphicCollection3D) graphic));
}
LineRender lineRender = (LineRender) renderMap.get(graphic);
lineRender.setTransform(this.transform, this.alwaysUpdateBuffers);
lineRender.setOrthographic(this.orthographic);
lineRender.setLighting(this.lighting);
lineRender.updateMatrix();
lineRender.draw();
}
} else {
for (int i = 0; i < graphic.getNumGraphics(); i++) {
Graphic gg = graphic.getGraphicN(i);
this.drawGraphic(gl, gg);
}
}
break;
default:
for (int i = 0; i < graphic.getNumGraphics(); i++) {
Graphic gg = graphic.getGraphicN(i);
@ -2524,7 +2555,7 @@ public class GLPlot extends Plot {
}
}
}
}
if (graphic instanceof GraphicCollection3D) {
if (lightEnabled && !((GraphicCollection3D)graphic).isUsingLight()) {
this.lighting.start(gl);
@ -2878,7 +2909,7 @@ public class GLPlot extends Plot {
Vector<Vector3f> n1 = pipe.getNormal(i);
Vector<Vector3f> n2 = pipe.getNormal(i+1);
gl.glBegin(GL_TRIANGLE_STRIP);
for(int j = 0; j < (int)c2.size(); ++j)
for(int j = 0; j < c2.size(); ++j)
{
gl.glNormal3fv(JOGLUtil.toArray(n2.get(j)), 0);
gl.glVertex3fv(JOGLUtil.toArray(c2.get(j)), 0);

View File

@ -110,6 +110,14 @@ public class Pipe {
return this.contours.size();
}
/**
* Get vertex number
* @return Vertex number
*/
public int getVertexCount() {
return this.path.size() * this.contour.size();
}
/**
* Get normal
* @param idx Index

View File

@ -60,6 +60,10 @@ public class PipeShape extends PolylineZShape {
return this.steps;
}
public int getVertexCount() {
return this.getPointNum() * (this.steps + 1);
}
void generatePipe() {
Vector<Vector3f> path = new Vector<>();
for (PointZ p : (List<PointZ>) this.getPoints()) {

View File

@ -0,0 +1,198 @@
package org.meteoinfo.chart.render.jogl;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
import com.jogamp.opengl.util.GLBuffers;
import com.jogamp.opengl.util.texture.awt.AWTTextureIO;
import org.meteoinfo.chart.graphic.GraphicCollection3D;
import org.meteoinfo.chart.jogl.Program;
import org.meteoinfo.chart.jogl.Transform;
import org.meteoinfo.chart.jogl.Utils;
import org.meteoinfo.geometry.graphic.Graphic;
import org.meteoinfo.geometry.legend.*;
import org.meteoinfo.geometry.shape.PointZ;
import org.meteoinfo.geometry.shape.Polyline;
import org.meteoinfo.geometry.shape.PolylineZ;
import org.meteoinfo.geometry.shape.PolylineZShape;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.List;
import static com.jogamp.opengl.GL.GL_TEXTURE_2D;
public class LineRender extends JOGLGraphicRender {
private GraphicCollection3D graphics;
private IntBuffer vbo;
private Program program;
private int vertexNum;
private int sizePosition;
private int sizeColor;
private int sizeNormal;
private float[] vertexColor;
private float lineWidth = 1.0f;
private List<Integer> linePointNumbers;
/**
* Constructor
*
* @param gl The JOGL GL2 object
*/
public LineRender(GL2 gl) {
super(gl);
if (useShader) {
try {
this.compileShaders();
} catch (Exception e) {
e.printStackTrace();
}
}
initVertexBuffer();
}
/**
* Constructor
*
* @param gl The JOGL GL2 object
* @param graphics Linestring 3D graphics
*/
public LineRender(GL2 gl, GraphicCollection3D graphics) {
this(gl);
this.graphics = graphics;
this.updateVertexColor();
}
void compileShaders() throws Exception {
String vertexShaderCode = Utils.loadResource("/shaders/surface/vertex.vert");
String fragmentShaderCode = Utils.loadResource("/shaders/surface/surface.frag");
program = new Program("surface", vertexShaderCode, fragmentShaderCode);
}
private void initVertexBuffer() {
vbo = GLBuffers.newDirectIntBuffer(1);
}
private void updateVertexColor() {
this.vertexNum = 0;
for (Graphic graphic : this.graphics.getGraphics()) {
this.vertexNum += graphic.getShape().getPointNum();
}
this.vertexColor = new float[this.vertexNum * 4];
int i = 0;
float[] color;
for (Graphic graphic : this.graphics.getGraphics()) {
int n = graphic.getShape().getPointNum();
ColorBreak cb = graphic.getLegend();
if (cb.getBreakType() == BreakTypes.COLOR_BREAK_COLLECTION) {
PolylineBreak lineBreak;
for (int j = 0; j < n; j++) {
lineBreak = (PolylineBreak) ((ColorBreakCollection) cb).get(j);
this.lineWidth = lineBreak.getWidth();
color = lineBreak.getColor().getRGBComponents(null);
System.arraycopy(color, 0, vertexColor, i * 4, 4);
i++;
}
} else {
this.lineWidth = ((PolylineBreak) cb).getWidth();
color = cb.getColor().getRGBComponents(null);
for (int j = 0; j < n; j++) {
System.arraycopy(color, 0, vertexColor, i * 4, 4);
i++;
}
}
}
}
private float[] getVertexPosition() {
float[] vertexData = new float[this.vertexNum * 3];
int i = 0;
linePointNumbers = new ArrayList<>();
for (Graphic graphic : this.graphics.getGraphics()) {
PolylineZShape shape = (PolylineZShape) graphic.getShape();
for (Polyline line : shape.getPolylines()) {
List<PointZ> ps = (List<PointZ>) line.getPointList();
linePointNumbers.add(ps.size());
for (PointZ p : ps) {
vertexData[i] = transform.transform_x((float) p.X);
vertexData[i + 1] = transform.transform_y((float) p.Y);
vertexData[i + 2] = transform.transform_z((float) p.Z);
i += 3;
}
}
}
return vertexData;
}
@Override
public void setTransform(Transform transform, boolean alwaysUpdateBuffers) {
boolean updateBuffer = true;
if (!alwaysUpdateBuffers && this.transform != null && this.transform.equals(transform))
updateBuffer = false;
super.setTransform((Transform) transform.clone());
if (updateBuffer) {
float[] vertexData = this.getVertexPosition();
FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(vertexData);
sizePosition = vertexBuffer.capacity() * Float.BYTES;
FloatBuffer colorBuffer = GLBuffers.newDirectFloatBuffer(vertexColor);
sizeColor = colorBuffer.capacity() * Float.BYTES;
int totalSize = sizePosition + sizeColor;
gl.glGenBuffers(1, vbo);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo.get(0));
gl.glBufferData(GL.GL_ARRAY_BUFFER, totalSize, null, GL.GL_STATIC_DRAW);
gl.glBufferSubData(GL.GL_ARRAY_BUFFER, 0, sizePosition, vertexBuffer);
gl.glBufferSubData(GL.GL_ARRAY_BUFFER, sizePosition, sizeColor, colorBuffer);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
}
}
void setUniforms() {
}
@Override
public void draw() {
if (useShader) { // not working now
program.use(gl);
setUniforms();
gl.glUseProgram(0);
} else {
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo.get(0));
// enable vertex arrays
gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
gl.glEnableClientState(GL2.GL_COLOR_ARRAY);
gl.glColorPointer(4, GL.GL_FLOAT, 0, sizePosition);
boolean lightEnabled = this.lighting.isEnable();
if (lightEnabled) {
this.lighting.stop(gl);
}
gl.glLineWidth(this.lineWidth * this.dpiScale);
int sIdx = 0;
for (int np : linePointNumbers) {
gl.glDrawArrays(GL.GL_LINE_STRIP, sIdx, np);
sIdx += np;
}
if (lightEnabled) {
this.lighting.start(gl);
}
gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);
gl.glDisableClientState(GL2.GL_COLOR_ARRAY);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
}
}
}

View File

@ -0,0 +1,263 @@
package org.meteoinfo.chart.render.jogl;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
import com.jogamp.opengl.util.GLBuffers;
import org.joml.Vector3f;
import org.meteoinfo.chart.graphic.GraphicCollection3D;
import org.meteoinfo.chart.jogl.Program;
import org.meteoinfo.chart.jogl.Transform;
import org.meteoinfo.chart.jogl.Utils;
import org.meteoinfo.chart.jogl.pipe.Pipe;
import org.meteoinfo.chart.jogl.pipe.PipeShape;
import org.meteoinfo.geometry.graphic.Graphic;
import org.meteoinfo.geometry.legend.BreakTypes;
import org.meteoinfo.geometry.legend.ColorBreak;
import org.meteoinfo.geometry.legend.ColorBreakCollection;
import org.meteoinfo.geometry.legend.PolylineBreak;
import org.meteoinfo.geometry.shape.PointZ;
import org.meteoinfo.geometry.shape.Polyline;
import org.meteoinfo.geometry.shape.PolylineZShape;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
public class PipeRender extends JOGLGraphicRender{
private GraphicCollection3D graphics;
private IntBuffer vbo;
private Program program;
private int vertexNum;
private int sizePosition;
private int sizeColor;
private int sizeNormal;
private float[] vertexColor;
private int[] vertexIndices;
private List<Integer> linePointNumbers;
/**
* Constructor
*
* @param gl The JOGL GL2 object
*/
public PipeRender(GL2 gl) {
super(gl);
if (useShader) {
try {
this.compileShaders();
} catch (Exception e) {
e.printStackTrace();
}
}
initVertexBuffer();
}
/**
* Constructor
*
* @param gl The JOGL GL2 object
* @param graphics Linestring 3D graphics
*/
public PipeRender(GL2 gl, GraphicCollection3D graphics) {
this(gl);
this.graphics = graphics;
this.vertexNum = 0;
for (Graphic graphic : this.graphics.getGraphics()) {
this.vertexNum += ((PipeShape) graphic.getShape()).getVertexCount();
}
}
void compileShaders() throws Exception {
String vertexShaderCode = Utils.loadResource("/shaders/surface/vertex.vert");
String fragmentShaderCode = Utils.loadResource("/shaders/surface/surface.frag");
program = new Program("surface", vertexShaderCode, fragmentShaderCode);
}
private void initVertexBuffer() {
vbo = GLBuffers.newDirectIntBuffer(2);
}
private void updateVertexColor() {
this.vertexColor = new float[this.vertexNum * 4];
int i = 0;
float[] color;
for (Graphic graphic : this.graphics.getGraphics()) {
PipeShape shape = (PipeShape) graphic.getShape();
Pipe pipe = shape.getPipe();
int n = pipe.getContourCount();
int m = pipe.getContour().size();
ColorBreak cb = graphic.getLegend();
if (cb.getBreakType() == BreakTypes.COLOR_BREAK_COLLECTION) {
ColorBreak lineBreak;
for (int j = 0; j < n; j++) {
lineBreak = ((ColorBreakCollection) cb).get(j);
color = lineBreak.getColor().getRGBComponents(null);
for (int k = 0; k < m; k++) {
System.arraycopy(color, 0, vertexColor, i * 4, 4);
i++;
}
}
} else {
color = cb.getColor().getRGBComponents(null);
for (int j = 0; j < n * m; j++) {
System.arraycopy(color, 0, vertexColor, i * 4, 4);
i++;
}
}
}
}
private float[] getVertexPosition() {
float[] vertexData = new float[this.vertexNum * 3];
int i = 0;
linePointNumbers = new ArrayList<>();
for (Graphic graphic : this.graphics.getGraphics()) {
PipeShape shape = (PipeShape) graphic.getShape();
shape.transform(transform);
Pipe pipe = shape.getPipe();
linePointNumbers.add(pipe.getVertexCount());
for (int j = 0; j < pipe.getContourCount(); j++) {
for (Vector3f vector3f : shape.getPipe().getContour(j)) {
vertexData[i] = vector3f.x;
vertexData[i + 1] = vector3f.y;
vertexData[i + 2] = vector3f.z;
i += 3;
}
}
}
return vertexData;
}
private void updateVertexIndices() {
int idxNum = 0;
for (Graphic graphic : this.graphics.getGraphics()) {
PipeShape shape = (PipeShape) graphic.getShape();
Pipe pipe = shape.getPipe();
idxNum += (pipe.getContourCount() - 1) * (pipe.getContour().size() - 1) * 6;
}
vertexIndices = new int[idxNum];
int i = 0;
int b = 0;
for (Graphic graphic : this.graphics.getGraphics()) {
PipeShape shape = (PipeShape) graphic.getShape();
Pipe pipe = shape.getPipe();
int n = pipe.getContour().size();
for (int j = 0; j < pipe.getContourCount() - 1; j++) {
Vector<Vector3f> c1 = pipe.getContour(j);
Vector<Vector3f> c2 = pipe.getContour(j + 1);
for (int k = 0; k < n - 1; k++) {
vertexIndices[i++] = b + j * n + k;
vertexIndices[i++] = b + j * n + k + 1;
vertexIndices[i++] = b + (j + 1) * n + k;
vertexIndices[i++] = b + j * n + k + 1;
vertexIndices[i++] = b + (j + 1) * n + k + 1;
vertexIndices[i++] = b + (j + 1) * n + k;
}
}
b += pipe.getVertexCount();
}
}
private float[] getVertexNormal() {
float[] vertexNormal = new float[this.vertexNum * 3];
int i = 0;
for (Graphic graphic : this.graphics.getGraphics()) {
PipeShape shape = (PipeShape) graphic.getShape();
Pipe pipe = shape.getPipe();
for (int j = 0; j < pipe.getContourCount(); j++) {
for (Vector3f vector3f : shape.getPipe().getNormal(j)) {
vertexNormal[i] = vector3f.x;
vertexNormal[i + 1] = vector3f.y;
vertexNormal[i + 2] = vector3f.z;
i += 3;
}
}
}
return vertexNormal;
}
@Override
public void setTransform(Transform transform, boolean alwaysUpdateBuffers) {
boolean updateBuffer = true;
if (!alwaysUpdateBuffers && this.transform != null && this.transform.equals(transform))
updateBuffer = false;
super.setTransform((Transform) transform.clone());
if (updateBuffer) {
float[] vertexData = this.getVertexPosition();
FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(vertexData);
sizePosition = vertexBuffer.capacity() * Float.BYTES;
float[] vertexNormal = this.getVertexNormal();
FloatBuffer normalBuffer = GLBuffers.newDirectFloatBuffer(vertexNormal);
sizeNormal = normalBuffer.capacity() * Float.BYTES;
if (vertexColor == null) {
this.updateVertexColor();
}
FloatBuffer colorBuffer = GLBuffers.newDirectFloatBuffer(vertexColor);
sizeColor = colorBuffer.capacity() * Float.BYTES;
int totalSize = sizePosition + sizeNormal + sizeColor;
gl.glGenBuffers(2, vbo);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo.get(0));
gl.glBufferData(GL.GL_ARRAY_BUFFER, totalSize, null, GL.GL_STATIC_DRAW);
gl.glBufferSubData(GL.GL_ARRAY_BUFFER, 0, sizePosition, vertexBuffer);
gl.glBufferSubData(GL.GL_ARRAY_BUFFER, sizePosition, sizeNormal, normalBuffer);
gl.glBufferSubData(GL.GL_ARRAY_BUFFER, sizePosition + sizeNormal, sizeColor, colorBuffer);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
if (vertexIndices == null) {
this.updateVertexIndices();
}
IntBuffer indexBuffer = GLBuffers.newDirectIntBuffer(vertexIndices);
gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, vbo.get(1));
gl.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, indexBuffer.capacity() * Integer.BYTES, indexBuffer, GL.GL_STATIC_DRAW);
gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
}
}
void setUniforms() {
}
@Override
public void draw() {
if (useShader) { // not working now
program.use(gl);
setUniforms();
gl.glUseProgram(0);
} else {
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo.get(0));
gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, vbo.get(1));
// enable vertex arrays
gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
gl.glEnableClientState(GL2.GL_NORMAL_ARRAY);
gl.glNormalPointer(GL.GL_FLOAT, 0, sizePosition);
gl.glEnableClientState(GL2.GL_COLOR_ARRAY);
gl.glColorPointer(4, GL.GL_FLOAT, 0, sizePosition + sizeNormal);
gl.glDrawElements(GL2.GL_TRIANGLES, vertexIndices.length, GL.GL_UNSIGNED_INT, 0);
gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);
gl.glDisableClientState(GL2.GL_NORMAL_ARRAY);
gl.glDisableClientState(GL2.GL_COLOR_ARRAY);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
}
}
}

View File

@ -12,19 +12,51 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="meteoinfo-math" />
<orderEntry type="module" module-name="meteoinfo-geometry" />
<orderEntry type="module" module-name="meteoinfo-table" />
<orderEntry type="module" module-name="meteoinfo-image" />
<orderEntry type="module" module-name="meteoinfo-data" />
<orderEntry type="library" name="Maven: org.meteothink:wContour:1.7.1" level="project" />
<orderEntry type="library" name="Maven: com.l2fprod:l2fprod-common-all:6.9.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
<orderEntry type="library" name="Maven: org.scilab.forge:jlatexmath:1.0.7" level="project" />
<orderEntry type="library" name="Maven: com.formdev:flatlaf:2.6" level="project" />
<orderEntry type="library" name="Maven: com.formdev:flatlaf-extras:2.6" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-util:2.0.2" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio-emf:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio-pdf:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphics2d:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio-ps:2.4" level="project" />
<orderEntry type="library" name="Maven: com.itextpdf:itextpdf:5.5.13.3" level="project" />
<orderEntry type="module" module-name="meteoinfo-ndarray" />
<orderEntry type="module" module-name="meteoinfo-common" />
<orderEntry type="library" name="Maven: org.ejml:ejml-experimental:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-simple:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ojalgo:ojalgo:52.0.1" level="project" />
<orderEntry type="library" name="Maven: com.github.haifengl:smile-interpolation:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:javacpp-platform:1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:openblas-platform:0.3.10-1.5.4" level="project" />
<orderEntry type="module" module-name="meteoinfo-ui" />
<orderEntry type="library" name="Maven: org.locationtech.jts:jts-core:1.19.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-imaging:1.0-alpha3" level="project" />
<orderEntry type="library" name="Maven: com.twelvemonkeys.imageio:imageio-jpeg:3.9.4" level="project" />
<orderEntry type="module" module-name="meteoinfo-projection" />
<orderEntry type="module" module-name="meteoinfo-dataframe" />
<orderEntry type="library" name="Maven: edu.ucar:netcdfAll:5.5.3" level="project" />
<orderEntry type="library" name="Maven: com.github.albfernandez:juniversalchardet:2.4.0" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.21" level="project" />
<orderEntry type="library" name="Maven: org.scilab.forge:jlatexmath-font-greek:1.0.7" level="project" />
<orderEntry type="library" name="Maven: org.scilab.forge:jlatexmath-font-cyrillic:1.0.7" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.formdev:svgSalamander:1.1.3" level="project" />
<orderEntry type="library" name="Maven: org.netbeans:openide-lookup:1.9-patched-1.0" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio-tests:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsbase:2.4" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math4-legacy:4.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-complex:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-angle:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-rootfinder:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-quaternion:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-rng-sampling:1.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math4-legacy-exception:4.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math4-legacy-core:4.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math4-core:4.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-core:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-gamma:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-fraction:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-combinatorics:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-arrays:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-field:1.1-SNAPSHOT" level="project" />
@ -33,28 +65,15 @@
<orderEntry type="library" name="Maven: org.apache.commons:commons-rng-client-api:1.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-statistics-distribution:1.0" level="project" />
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:2.1.0" level="project" />
<orderEntry type="module" module-name="meteoinfo-common" />
<orderEntry type="library" name="Maven: com.google.guava:guava:31.1-jre" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-experimental:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-core:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-ddense:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-dsparse:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-zdense:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-simple:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-fdense:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-cdense:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ejml:ejml-fsparse:0.41" level="project" />
<orderEntry type="library" name="Maven: org.ojalgo:ojalgo:52.0.1" level="project" />
<orderEntry type="library" name="Maven: com.github.haifengl:smile-interpolation:2.6.0" level="project" />
<orderEntry type="library" name="Maven: com.github.haifengl:smile-math:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:javacpp-platform:1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:javacpp:1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:javacpp:android-arm:1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:javacpp:android-arm64:1.5.4" level="project" />
@ -70,7 +89,6 @@
<orderEntry type="library" name="Maven: org.bytedeco:javacpp:macosx-x86_64:1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:javacpp:windows-x86:1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:javacpp:windows-x86_64:1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:openblas-platform:0.3.10-1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:openblas:0.3.10-1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:openblas:android-arm:0.3.10-1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:openblas:android-arm64:0.3.10-1.5.4" level="project" />
@ -86,49 +104,31 @@
<orderEntry type="library" name="Maven: org.bytedeco:openblas:macosx-x86_64:0.3.10-1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:openblas:windows-x86:0.3.10-1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.bytedeco:openblas:windows-x86_64:0.3.10-1.5.4" level="project" />
<orderEntry type="module" module-name="meteoinfo-geometry" />
<orderEntry type="module" module-name="meteoinfo-ui" />
<orderEntry type="library" name="Maven: com.toedter:jcalendar:1.4" level="project" />
<orderEntry type="library" name="Maven: org.locationtech.jts:jts-core:1.19.0" level="project" />
<orderEntry type="module" module-name="meteoinfo-table" />
<orderEntry type="module" module-name="meteoinfo-image" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-imaging:1.0-alpha3" level="project" />
<orderEntry type="library" name="Maven: com.twelvemonkeys.imageio:imageio-jpeg:3.9.4" level="project" />
<orderEntry type="library" name="Maven: com.twelvemonkeys.imageio:imageio-core:3.9.4" level="project" />
<orderEntry type="library" name="Maven: com.twelvemonkeys.imageio:imageio-metadata:3.9.4" level="project" />
<orderEntry type="library" name="Maven: com.twelvemonkeys.common:common-lang:3.9.4" level="project" />
<orderEntry type="library" name="Maven: com.twelvemonkeys.common:common-io:3.9.4" level="project" />
<orderEntry type="library" name="Maven: com.twelvemonkeys.common:common-image:3.9.4" level="project" />
<orderEntry type="module" module-name="meteoinfo-data" />
<orderEntry type="module" module-name="meteoinfo-projection" />
<orderEntry type="library" name="Maven: org.locationtech.proj4j:proj4j:1.1.6-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: net.sf.geographiclib:GeographicLib-Java:2.0" level="project" />
<orderEntry type="module" module-name="meteoinfo-dataframe" />
<orderEntry type="library" name="Maven: edu.ucar:netcdfAll:5.5.3" level="project" />
<orderEntry type="library" name="Maven: com.github.albfernandez:juniversalchardet:2.4.0" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.21" level="project" />
<orderEntry type="library" name="Maven: org.meteothink:wContour:1.7.1" level="project" />
<orderEntry type="library" name="Maven: com.l2fprod:l2fprod-common-all:6.9.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
<orderEntry type="library" name="Maven: org.scilab.forge:jlatexmath:1.0.7" level="project" />
<orderEntry type="library" name="Maven: org.scilab.forge:jlatexmath-font-greek:1.0.7" level="project" />
<orderEntry type="library" name="Maven: org.scilab.forge:jlatexmath-font-cyrillic:1.0.7" level="project" />
<orderEntry type="library" name="Maven: com.formdev:flatlaf:2.6" level="project" />
<orderEntry type="library" name="Maven: com.formdev:flatlaf-extras:2.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.formdev:svgSalamander:1.1.3" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-util:2.0.2" level="project" />
<orderEntry type="library" name="Maven: org.netbeans:openide-lookup:1.9-patched-1.0" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio-emf:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-io:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio-tests:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsbase:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio-pdf:2.4" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphics2d:2.4" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" name="Maven: org.freehep:freehep-graphicsio-ps:2.4" level="project" />
<orderEntry type="library" name="Maven: com.itextpdf:itextpdf:5.5.13.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-complex:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-angle:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-rootfinder:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-quaternion:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-rng-sampling:1.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math4-legacy-exception:4.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math4-legacy-core:4.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-numbers-fraction:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math4-core:4.0-SNAPSHOT" level="project" />
</component>
</module>

View File

@ -800,7 +800,7 @@ public class GeometryUtil {
}
if (isZ) {
return new Array[]{xArray, yArray, zArray};
return new Array[]{xArray, yArray, zArray, mArray};
} else {
return new Array[]{xArray, yArray};
}

View File

@ -1,32 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MeteoInfo File="milconfig.xml" Type="configurefile">
<Path OpenPath="D:\Working\MIScript\Jython\mis\meteo\interpolation">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\traj\TrajStat"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\LaSW\airship"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\geoshow"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\traj"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\projection"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\geoshow"/>
<Path OpenPath="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\stats"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\random"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\interpolation"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\3d_earth"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\isosurface"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\geoshow"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\image"/>
<RecentFolder Folder="D:\Working\MIScript\cuace_dust\py\plot"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot"/>
</Path>
<File>
<OpenedFiles>
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\meteoview3d\mainGUI.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\bar\bar_3.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot\plot3_pipe_color_1.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot\traj_8.py"/>
</OpenedFiles>
<RecentFiles>
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\meteoview3d\mainGUI.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\bar\bar_3.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot\plot3_pipe_color_1.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot\traj_8.py"/>
</RecentFiles>
</File>
<Font>

View File

@ -6,7 +6,7 @@ NDArray class - multiple dimensional array
from org.meteoinfo.data import GridArray
from org.meteoinfo.ndarray.math import ArrayMath, ArrayUtil
from org.meteoinfo.math.linalg import LinalgUtil
from org.meteoinfo.ndarray import Array, Range, MAMath, Complex
from org.meteoinfo.ndarray import Array, Range, MAMath, Complex, DataType
import datetime
@ -20,7 +20,7 @@ class NDArray(object):
if not isinstance(array, Array):
array = ArrayUtil.array(array, None)
if array.getRank() == 0:
if array.getRank() == 0 and array.getDataType() != DataType.STRUCTURE:
array = ArrayUtil.array([array.getIndexIterator().getObjectNext()])
self._array = array

View File

@ -974,7 +974,7 @@ def savefig(fname, width=None, height=None, dpi=None, sleep=None):
Save the current figure.
:param fname: (*string*) A string containing a path to a filename. The output format
is deduced from the extention of the filename. Supported format: 'png', 'bmp',
is deduced from the extension of the filename. Supported format: 'png', 'bmp',
'jpg', 'gif', 'tif', 'eps' and 'pdf'.
:param width: (*int*) Optional, width of the output figure with pixel units. Default
is None, the output figure size is same as *figures* window.
@ -2129,7 +2129,7 @@ def gifanimation(filename, repeat=0, delay=1000):
def gifaddframe(animation, width=None, height=None, dpi=None):
"""
Add a frame to an gif animation object
Add a frame to a gif animation object
:param animation: Gif animation object
:param width: (*int*) Image width

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MeteoInfo File="config.xml" Type="configurefile">
<Path OpenPath="D:\MyProgram\Distribution\Java\MeteoInfo\MeteoInfo\map"/>
<Path OpenPath="D:\Temp\Map"/>
<Font>
<TextFont FontName="YaHei Consolas Hybrid" FontSize="14"/>
<LegendFont FontName="宋体" FontSize="12"/>

View File

@ -2,15 +2,12 @@
<MeteoInfo File="default.mip" Type="projectfile">
<MapFrames>
<MapFrame Active="true" DrawGridLabel="true" DrawGridLine="false" DrawNeatLine="true" Expanded="true" GridFontName="Arial" GridFontSize="12" GridLineColor="0xff808080" GridLineSize="1.0" GridLineStyle="DASH" GridXDelt="10.0" GridXOrigin="-180.0" GridYDelt="10.0" GridYOrigin="-90.0" Height="364" Left="48" Name="New Map Frame" NeatLineColor="0xff000000" NeatLineSize="1.0" Order="0" Top="30" Width="776">
<Extents xMax="4510332.684792562" xMin="-4343332.171074408" yMax="6089847.77181815" yMin="1566077.4075065595"/>
<Extents xMax="180.0" xMin="-180.0" yMax="83.62359619140625" yMin="-90.0"/>
<MapProperty BackColor="0xffffffff" ForeColor="0xff000000" HighSpeedWheelZoom="true" MultiGlobalDraw="true" PointSmoothingMode="true" SelectColor="0xff66ffff" SmoothingMode="false" XYScaleFactor="1.0"/>
<GridLine DrawGridLine="false" DrawGridTickLine="false" GridLineColor="0xff808080" GridLineSize="1.0" GridLineStyle="DASH"/>
<MaskOut MaskLayer="china.shp" SetMaskLayer="false"/>
<Projection IsLonLatMap="false" ProjStr="+proj=aea +lat_1=25.0 +lat_2=47.0 +lat_0=0 +lon_0=110.0 +x_0=0.0 +y_0=0.0 "/>
<Projection IsLonLatMap="true" ProjStr="+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees "/>
<GroupLayer>
<Layer FileName="..\..\..\..\..\Temp\Map\中国省界-740万.JPG" Handle="1" Interpolation="nearest" IsMaskout="true" LayerDrawType="IMAGE" LayerName="中国省界-740万.JPG" LayerType="IMAGE_LAYER" SetTransColor="false" TransparencyColor="0xfffffffe" TransparencyPerc="0" Visible="true">
<VisibleScale EnableMaxVisScale="false" EnableMinVisScale="false" MaxVisScale="0.0" MinVisScale="0.0"/>
</Layer>
<Layer AvoidCollision="false" Expanded="true" FileName="..\..\..\..\Distribution\Java\MeteoInfo\MeteoInfo\map\cn_province.shp" Handle="2" IsMaskout="false" LayerDrawType="MAP" LayerName="cn_province.shp" LayerType="VECTOR_LAYER" ShapeType="POLYGON_Z" TransparencyPerc="0" Visible="true">
<LegendScheme BreakNum="1" FieldName="" HasNoData="false" LegendType="SINGLE_SYMBOL" MaxValue="0.0" MinValue="0.0" ShapeType="POLYGON_Z" UNDEF="-9999.0">
<Breaks>
@ -27,7 +24,7 @@
<ChartGraphics/>
<VisibleScale EnableMaxVisScale="false" EnableMinVisScale="false" MaxVisScale="0.0" MinVisScale="0.0"/>
</Layer>
<Layer AvoidCollision="false" Expanded="false" FileName="..\..\..\..\..\Temp\Map\country1.shp" Handle="3" IsMaskout="false" LayerDrawType="MAP" LayerName="country1.shp" LayerType="VECTOR_LAYER" ShapeType="POLYGON" TransparencyPerc="0" Visible="false">
<Layer AvoidCollision="false" Expanded="false" FileName="..\..\..\..\..\Temp\Map\country1.shp" Handle="3" IsMaskout="false" LayerDrawType="MAP" LayerName="country1.shp" LayerType="VECTOR_LAYER" ShapeType="POLYGON" TransparencyPerc="0" Visible="true">
<LegendScheme BreakNum="1" FieldName="" HasNoData="false" LegendType="SINGLE_SYMBOL" MaxValue="0.0" MinValue="0.0" ShapeType="POLYGON" UNDEF="-9999.0">
<Breaks>
<Break BackColor="0x00ffffff" Caption="" Color="0xfffffbc3" DrawFill="false" DrawOutline="true" DrawShape="true" EndValue="0" OutlineColor="0xff000000" OutlineSize="1.0" StartValue="0" Style="NONE" StyleSize="8" Tag=""/>