class Roca { float geoposxant; float geoposyant; int geoaltitudant; void dibujarforma() { cubo=200+zoom; if (cubo<20){cubo=20;} //// geoposxant=screenX(posx, posy, altitud/4); geoposyant=screenY(posx, posy, altitud/4); if(id.equals (docSelect)==true) { setposx2=geoposxant; setposy2=geoposyant; } ////////// pushMatrix(); dibujarrocas(); strokeWeight(1); textFont(futura30, fontsize); textAlign(LEFT); /// geoaltitudant=height-((altitud*(100))/(3000/20)); if(overRect(altitud/4) == true) { textos_overroca(); overgeo(); alert(); println(geoposxant+" "+geoposyant); } if(overRect2() == true) { overroca(); textos_overroca(); overgeo(); alert(); //transy=transy2; // if (mousePressed==true){ transy=height/2+transy-setposy; // } } popMatrix(); } void textos_overroca(){ transp=255; clabel=c1; labelline1=label; labelline2=descub; labelline3=fecha + forigen; //textodesc=desc; } void overgeo() { rocaSelect=id; setposx=screenX(posx, posy, altitud/4); setposy=screenY(posx, posy, altitud/4); setfecha=height-120-(fecha*(height-150))/(year()-forigen); sval=sval; transp3=255; label3line1=id; label3line2=mun; label3line3=altitud*20; geoaltitud=height-((altitud*(100))/(3000/20)); } void alert(){ alert="!"; if (riesgo==4){ calert=color(255,255,0); } if (riesgo==5){ calert=color(255,0,0); } else{ calert=color(255,0); } } void vertexgeo() { vertex(geoposxant, geoaltitudant); } void dibujarrocas(){ pushMatrix(); noStroke(); /*fill(100, 20); if (tipo == 1){ rectMode(CENTER); rect(posx, posy, cubo, cubo); }if(tipo == 2){ ellipse(posx, posy, cubo, cubo); }if(tipo == 3) { triangle(posx, posy+(cubo/2), posx+(cubo/2), posy-(cubo/2), posx-(cubo/2), posy-(cubo/2)); }*/ //translate(0,0,altitud/4); /////empiezan las rocas if (tipo == 1){ clabel1 = color(200, 255, 0, conser); fill(clabel1); rectMode(CENTER); rect(posx, posy, cubo, cubo); }if(tipo == 2){ clabel1 = color(255, 0, 95, conser); fill(clabel1); ellipse(posx, posy, cubo, cubo); }if(tipo == 3) { clabel1 = color(205, 255, 0, conser); fill(clabel1); triangle(posx, posy+(cubo/2), posx+(cubo/2), posy-(cubo/2), posx-(cubo/2), posy-(cubo/2)); } ////// finaliza las rocas noFill(); popMatrix(); } void puntoslinea() { //strokeWeight(9); fill(175, 90); rect(geoposxant, geoaltitudant, 6, 6); strokeWeight(1); stroke(175,30); line(geoposxant, geoaltitudant, width, height); line(geoposxant, geoaltitudant, 0, height); } boolean overRect(float zeta) { rango = cubo/10; equis = screenX(posx, posy, zeta); ye = screenY(posx, posy, zeta); if(mouseX >= equis-rango && mouseX <= equis+rango && mouseY >= ye-rango && mouseY <= ye+rango && mouseX <= width-ancho_nivelhis){ return true; } else { return false; } } boolean overRect2() { rango = 3; equis = geoposxant; ye = geoaltitudant; if(mouseX >= equis-rango && mouseX <= equis+rango && mouseY >= ye-rango && mouseY <= ye+rango){ return true; } else { return false; } } void overroca() { pushMatrix(); translate(0,0,altitud/4); fill(0); ellipse(posx, posy, 5, 5); strokeWeight(1); stroke(125, transp); noFill(); if (tipo == 1){ rect(posx, posy, cubo, cubo); }if(tipo == 2){ ellipse(posx, posy, cubo, cubo); }if(tipo == 3) { triangle(posx, posy+(cubo/2), posx+(cubo/2), posy-(cubo/2), posx-(cubo/2), posy-(cubo/2)); } popMatrix(); } }