From 8768a855af9ccc482a9520ce708ef32e0e6e0e7d Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Fri, 04 Oct 2019 20:06:36 -0400 Subject: [PATCH] Block multiple download. --- cMesh.java | 126 +++++------------------------------------ 1 files changed, 17 insertions(+), 109 deletions(-) diff --git a/cMesh.java b/cMesh.java index 942d155..e79623b 100644 --- a/cMesh.java +++ b/cMesh.java @@ -1,6 +1,6 @@ import java.util.Hashtable; -import javax.media.opengl.GL; +//import javax.media.opengl.GL; public class cMesh extends cSpring { @@ -49,7 +49,7 @@ cMesh(Object3D bRep) { - this("Me:" + bRep.name, bRep); + this("Mesh:" + bRep.name, bRep); } cMesh(String name, Object3D bRep) @@ -78,7 +78,7 @@ live = true; } - + Object3D deepCopy() { /* @@ -404,8 +404,8 @@ if (ref == null) return; - GrafreeD.epsequal = IsEpsEqual(); - GrafreeD.linkUV = IsLinkUV(); + Grafreed.epsequal = IsEpsEqual(); + Grafreed.linkUV = IsLinkUV(); // BoundaryRep oldrep = transientrep; @@ -417,19 +417,21 @@ ref.count = 1; Object3D obj = ref.GetObject(); + Object3D par = obj.parent; + obj.parent = null; // may 2014: side-effect with UVs!! - obj = (Object3D) GrafreeD.clone(obj); - - merge(obj); + merge((Object3D) Grafreed.clone(obj)); + obj.parent = par; + ref.count = keepcount; System.out.println("RESULT " + ref + "; #vertices = " + bRep.VertexCount() + "; #faces = " + bRep.FaceCount()); bRep.Trim(false, false,false,false,false); System.out.println("------> TRIM " + ref + "; #vertices = " + bRep.VertexCount() + "; #faces = " + bRep.FaceCount()); - GrafreeD.epsequal = false; + Grafreed.epsequal = false; if (transientrep != null && bRep.VertexCount() == transientrep.VertexCount()) { @@ -470,7 +472,7 @@ } else // geometry is merged... - refcopy = (BoundaryRep) GrafreeD.clone(transientrep); + refcopy = (BoundaryRep) Grafreed.clone(transientrep); } transient cVector minima = new cVector(); @@ -484,7 +486,7 @@ } - void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) // ?? + void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ?? { // ?????? if (size() > 0) // { @@ -545,106 +547,10 @@ if(/*showsprings &&*/ Phys != null) { - GL gl = display.GetGL(); // getGL(); - - gl.glDisable(gl.GL_LIGHTING); - - gl.glLineWidth(1); - gl.glColor3f(1,1,1); - gl.glBegin(gl.GL_LINES); - double scale = 0; - int count = 0; - for (int s=0; s<Phys.allSprings.size(); s++) - { - Spring spring = Phys.allSprings.get(s); - if(s == 0) - { - //System.out.println(" spring : " + spring.a.position + "; " + spring.b.position); - } - if (showsprings) - { - temp.set(spring.a.position); - temp.add(spring.b.position); - temp.mul(0.5); - temp2.set(spring.a.position); - temp2.sub(spring.b.position); - temp2.mul(spring.restLength/2); - temp.sub(temp2); - gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z); - temp.add(temp2); - temp.add(temp2); - gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z); - } - - if (spring.isHandle) - continue; - - //if (scale < spring.restLength) - scale += spring.restLength; - count++; - } - gl.glEnd(); - - if (count == 0) - scale = 0.01; - else - scale /= count * 3; - - //scale = 0.25; - - if (ShowInfo()) - { - gl.glLineWidth(4); - for (int s=0; s<Phys.allNodes.size(); s++) - { - DynamicNode node = Phys.allNodes.get(s); - if (node.mass == 0) - continue; - - int i = node.springs==null?-1:node.springs.size(); - gl.glColor3f((i>>2)&1,(i>>1)&1,i&1); - //temp.set(node.springForce.x, node.springForce.y, node.springForce.z); - //temp.normalize(); - //gl.glColor3d((temp.x+1)/2, (temp.y+1)/2, (temp.z+1)/2); - gl.glBegin(gl.GL_LINES); - gl.glVertex3d(node.position.x, node.position.y, node.position.z); - //gl.glVertex3d(node.position.x + node.normal.x*scale, node.position.y + node.normal.y*scale, node.position.z + node.normal.z*scale); - gl.glVertex3d(node.position.x + bRep.GetVertex(s).norm.x*scale, - node.position.y + bRep.GetVertex(s).norm.y*scale, - node.position.z + bRep.GetVertex(s).norm.z*scale); - gl.glEnd(); - } - - gl.glLineWidth(8); - for (int s=0; s<Phys.allNodes.size(); s++) - { - DynamicNode node = Phys.allNodes.get(s); - - if (node.springs != null) - { - for (int i=0; i<node.springs.size(); i+=1) - { - DynamicNode f = node.springs.get(i).GetOther(node); - - int c = i+1; - // c = node.springs.get(i).nbcopies; - - gl.glColor3f((c>>2)&1,(c>>1)&1,c&1); - gl.glBegin(gl.GL_LINES); - gl.glVertex3d(node.position.x, node.position.y, node.position.z); - gl.glVertex3d(f.position.x/3+node.position.x*2/3, f.position.y/3+node.position.y*2/3, f.position.z/3+node.position.z*2/3); - gl.glEnd(); - } - } - } - - gl.glLineWidth(1); - } - - gl.glEnable(gl.GL_LIGHTING); + display.DrawDynamicMesh(this); } - if (live && display.isLIVE() && display.drawMode == CameraPane.DEFAULT) + if (live && Globals.isLIVE() && display.DrawMode() == CameraPane.DEFAULT) { //System.out.println("UPDATE"); if (Phys == null) @@ -656,6 +562,8 @@ maxima = new cVector(); } + CameraPane.CreateSelectedPoint(); + // ref.getBounds(minima, maxima, true); // Phys.reference.set((maxima.x+minima.x)/2,(maxima.y+minima.y)/2,(maxima.z+minima.z)/2); //ref. -- Gitblit v1.6.2