ok i got u point
and i made the repair an it work
- import java.util.Map;
- Map<Integer, Map<Integer, Boolean>> edjesMap = new HashMap();
- Map<Integer, Boolean> sub = new HashMap();
- int vb = 0;
- int va = 0;
- Boolean help;
-
-
- // AAAAA-------------------
-
- sub = edjesMap.get(va);
- if(sub == null) {
- sub = new HashMap();
- }
-
- // BBBBB-------------------
- help = sub.get(vb);
- if(help == null) {
-
- sub.put(vb,true);
- edjesMap.put(va,sub);
- Map<Integer,Boolean> sub1 = new HashMap();
- sub1 = edjesMap.get(vb);
- sub1.put(va,true);
- edjesMap.put(vb,sub1);
- }
but when i made the reapir in my
semi-full code, it still wrong.
i cant show u the full code because is too bigg
but do u know a way that that could go wrong
note:the error is in that part of the code.
i can show the page of the code, but will not compile ,because , all the other classes are in diferente pages
watch:
(ps : that is the class object, resposeble for holding all the hashmap and arraylists that hold vertex , surfaces,and edjes
ps : the error is in the function addSurf, this one should create the surface and check if the edjes of that surface already exist, if not it will create them)
- ArrayList objs = new ArrayList();
- // CLASS -----------------------------------------------------------------------------------------------------------------
- class obj {
- obj() {
- }
- obj(float x ,float y , float z) {
- posx = x;
- posy = y;
- posz = z;
- }
- obj(float x ,float y , float z,float rx ,float ry , float rz) {
- posx = x;
- posy = y;
- posz = z;
- rotx = rx;
- roty = ry;
- rotz = rz;
- }
- // VARIABLES -----------------------------------------------------------------------------------------------------------------
- boolean selected = false;
- ArrayList surfs = new ArrayList();
- ArrayList edjes = new ArrayList();
- Map <Integer,vert> verts = new HashMap<Integer,vert>();
- Map<Integer, Map<Integer,Boolean>> edjesMap = new HashMap();
- int[] selectVerts =new int [0];
- int[] selectFaces =new int [0];
- int[] selectEdjes =new int [0];
-
-
- float posx=0;
- float posy=0;
- float posz=0;
- int sPosx;
- int sPosy;
- float rotx = 0;
- float roty = 0;
- float rotz = 0;
- boolean visible = false;
- int cont = -1;
- int []delVerts = new int[0];
-
-
- //EDJE_CONTROLL------------------------------------------------------------------------------------------------------------------------
-
- void edjesMove() {
- for(int i = 0; i < edjes.size();i++) {
- edje e = (edje) edjes.get(i);
- vert v1 = (vert) verts.get(e.v1);
- vert v2 = (vert) verts.get(e.v2);
- e.cPosx = (v1.posx + v2.posx)*0.5;
- e.cPosy = (v1.posy + v2.posy)*0.5;
- e.cPosz = (v1.posz + v2.posz)*0.5;
- }
-
-
- }
- // CLASS FUNCTIONS -----------------------------------------------------------------------------------------------------------------
- void facesMove() {
- for(int i = 0; i < surfs.size();i++) {
- surf s =(surf) surfs.get(i);
- vert v1 = (vert) verts.get(s.p1);
- vert v2 = (vert) verts.get(s.p2);
- vert v3 = (vert) verts.get(s.p3);
-
- s.cPosx = (v1.posx + v2.posx + v3.posx)*0.333;
- s.cPosy = (v1.posy + v2.posy + v3.posy)*0.333;
- s.cPosz = (v1.posz + v2.posz + v3.posz)*0.333;
-
- }
- }
- // CREATE VERTEX -----------------------------------------------------
- int createVert(float x, float y , float z) {
-
- if(delVerts.length >0){
- int i = delVerts[delVerts.length -1];
- delVerts = shorten(delVerts);
- verts.put(i,new vert(x,y,z,i));
- return i;
- }
- else{
- cont++;
- verts.put(cont,new vert(x,y,z,cont));
- return cont;
- }
-
- }
- // DELETE VERTEX -----------------------------------------------------
- void delVert(int i){
- delVerts = append(delVerts,i);
- verts.remove(i);
-
- }
- // ADDING SURFS -----------------------------------------
- void addSurf(int a , int b, int c) {
- int va = 0;
- int vb = 0;
- int vc = 0;
- surfs.add(new surf(a,b,c));
- for(int i= 0; i<3 ; i++) {
- if(i == 0) {va =a;vb = b; vc = c;}
- else if(i == 1) {va =c;vb = a; vc = b;}
- else if(i == 2) {va =b;vb = a; vc = c;}
- Map<Integer,Boolean> sub = new HashMap();
-
- boolean help;
- // AAAAA-------------------
-
- sub = edjesMap.get(va);
- if(sub == null){
- sub = new HashMap();
- }
-
- // BBBBB-------------------
- help = sub.get(vb);
- if(help == null) {
-
- sub.put(vb,true);
- edjesMap.put(va,sub);
- Map<Integer,Boolean> sub1 = new HashMap();
- sub1 = edjesMap.get(vb);
- if(sub1 == null) {
- sub1 = new HashMap();
- }
- sub1.put(va,true);
- edjesMap.put(vb,sub1);
- edjes.add(new edje(va,vb));
-
- }
- //-----
-
- // CCCCC-------------------
- /*try{
- help = sub.get(vc);
- }
- catch(Exception e ){
- e.printStackTrace();
- sub.put(vc,true);
- HashMap<Integer,Boolean> sub1 = new HashMap();
- try{
- sub1 = edjesMap.get(vc);
- sub1.put(va,true);
- }
- catch(Exception w ){
- w.printStackTrace();
- sub1.put(va,true);
- }
- edjesMap.put(vc,sub1);
- edjes.add(new edje(va,vc));
- }*/
-
-
- }
- }
- }
if it is any way form e send u the full project´
plz say.
:D
ty for u ilemited patience.
:D
just one more thing is u are interested in elpping me in this project i will be very grateffull(let me know)
note:
this project is a software toedit and create geometry
then will slice the geometric in 2d data to be later printer in a 3d printer that im doing
if u were interested let me know and i will tell u more of wht is done and wht is stilll needed to do
:D
cya