package fence;
|
|
import JNADell.DellJAN;
|
import PbuliClass.IsPtInPoly;
|
import tag.Tag;
|
import tag.Tag_Dell;
|
import tbDataModel.TbFence;
|
|
import java.awt.geom.Point2D;
|
import java.util.Vector;
|
|
/**ÅжϵãÊÇ·ñÔÚ¶¨Î»ÇøÓòÄÚ*/
|
public class PointIsInWall {
|
|
static int px[]=new int[1];
|
static int py[]=new int[1];
|
public static void is_in_wall(String tagid,int x,int y,String floor) {
|
Point2D.Double point=new Point2D.Double(x,y);
|
//Èç¹ûÎ§Ç½ÇøÓò´æÔÚ
|
int size=Fences.get_fence_vector("Î§Ç½ÇøÓò").size();
|
Tag tag=Tag_Dell.get_tag(tagid);
|
if(size==0) {
|
tag.setTag_in_wall(3);
|
return;
|
}
|
for(int i=0;i<size;i++) {
|
TbFence tbfenc=Fences.get_fence_vector("Î§Ç½ÇøÓò").get(i);
|
//ÅжÏID×ø±êÊÇ·ñÔÚΧÀ¸ÇøÓòÄÚ
|
boolean isin=IsPtInPoly.inPoly(point, tbfenc.getPts());
|
//ÔÚÇøÓòÄÚÔòÖ´ÐÐ
|
if(isin) {
|
tag.setTag_in_wall(1);
|
return;
|
}
|
}
|
tag.setTag_in_wall(0);
|
}
|
|
//±êÇ©ÔÚΧÀ¸ÄÚÏÔʾ
|
public static int[] inwall(int x,int y,String floor){
|
String floor1=null;
|
int [] jnaxy=null;
|
Vector<TbFence> fence = Fences.get_fence_vector("Î§Ç½ÇøÓò");
|
for (int i = 0; i < fence.size(); i++) {
|
floor1 =fence.get(i).getFloor();
|
if (floor.equals(floor1)){
|
DellJAN.get_position_in_fence(x,y,px,py);
|
int[] xy={px[0], py[0]};
|
jnaxy= xy;
|
}
|
}
|
return jnaxy;
|
}
|
|
|
}
|