(1)各种常用机型的分辨率列表如下:
型号 宽高值
WXGA800 480X800
WVGA854 480X854
WXGA720 720X1280
WQVGA400 240X400
WSVGA 1024X600
WVGA800 480X800
QVGA 320X240
WQVGA432 240X432
HVGA 480X320
(2)模拟器测试 -- scale调节

将"Screen Size (in)"调小,模拟器也会同比例缩小。【模拟器最后的长宽为其原始宽高分辨率乘以"Scale"值。】
注:此处修改对Run和Debug应用程序不产生作用,Run和Debug时模拟器仍然使用原始宽高分辨率。
(3)模拟器运行和调试 -- scale调节


-scale XX XX为模拟器的缩放比。该值越小,模拟器尺寸越小;该值越大,模拟器尺寸越大。
使用的Eclipse的版本为:eclipse-java-indigo-SR2-win32
点击菜单"Help" - "Install New Software..."




点击"Finish",开始下载安装"ADT Plugin"。
+++++++++++++++++++++++++++++++++++++++++
若在下载安装时出现如下问题:
1 Cannot complete the install because one or more required items could not be found. 2 ... ...
则需要先安装"WST Server Adapters",安装办法:【"Help" - "Install New Software..."】
Work With: Indigo - Http://download.eclipse.org/releases/indigo
选择"Web, XML, Java EE and OSGi Enterprise Development"下的"WST Server Adapters",如下图:

安装完成之后,重启Eclipse进行ADT Plugin的安装即可。
更多请参考:http://developer.android.com/sdk/eclipse-adt.html
windows开发环境搭建:http://www.cnblogs.com/skynet/archive/2010/04/12/1709892.html
ubuntu开发环境搭建:http://coolshell.cn/articles/4270.html
ply点云具体格式如下:
(1)非彩色点云
ply
format ascii 1.0
element vertex 9667
property float x
property float y
property float z
end_header
497237.112000 3904845.386000 1139.977000
497331.254000 3904904.174000 1148.255000
... ...
498247.407000 3904889.411000 1162.406000
(2)彩色点云
ply
format ascii 1.0
element vertex 6002
property float x
property float y
property float z
property float nx
property float ny
property float nz
property uchar diffuse_red
property uchar diffuse_green
property uchar diffuse_blue
end_header
-14.6388 11.1257 4.151 -0.211109 0.0658741 0.97524 77 99 71
-14.6797 11.1037 4.15805 -0.227273 -0.205328 0.951939 70 84 69
... ...
-14.6212 11.0896 4.17834 0.34986 0.151395 0.924488 81 106 70
+++++++++++++++++++++
可视化结果:

在MFC中使用AE(AO)进行二次开发时,当目标机器上若没有安装AE的Runtime,程序会直接挂掉。
对此,通过在CXXApp的InitInstance()的起始处增加环境的检测代码,来友好地提示用户安装AE的Runtime。
代码如下:
1 BOOL CMap2DApp::InitInstance() 2 { 3 CoInitialize(NULL); 4 5 try 6 { 7 IAoInitializePtr ipAoInitialize(CLSID_AoInitialize); 8 if (ipAoInitialize==NULL) 9 { 10 MessageBox(NULL,"请先安装ArcGIS Engine Runtime!","Map 2D",MB_OK|MB_ICONEXCLAMATION); 11 CoUninitialize(); 12 return FALSE; 13 } 14 esriLicenseStatus licenseStatus; 15 HRESULT hr = ipAoInitialize->Initialize(esriLicenseProductCodeEngine,&licenseStatus); 16 17 if (licenseStatus!=esriLicenseCheckedOut) 18 { 19 MessageBox(NULL,"请先安装ArcGIS Engine Runtime!","Map 2D",MB_OK|MB_ICONEXCLAMATION); 20 CoUninitialize(); 21 return FALSE; 22 } 23 } 24 catch (...) 25 { 26 MessageBox(NULL,"请先安装ArcGIS Engine Runtime!","Map 2D",MB_OK|MB_ICONEXCLAMATION); 27 CoUninitialize(); 28 return FALSE; 29 } 30 }
目标:给定一个任意点串序列的多边形(可能出现自相交的情况),判断其形点的存放序列方向。

注:输入的多边形点串的尾点与首点相同,即多存一个点,将首点存两遍。
算法思想:
(1)判断多边形形点个数,若少于4,则表明该点串无法构成多多边形。【return -2】
(2)计算多边形外包围盒的宽度和高度,若其中一个为0,则表明该多边形退化成了一条线或一个点。【return -1】
(3)计算多边形落在其外包围盒四条边上的顶点的索引号(left, bottom,right,up)
(4)比较得到索引号中最小的索引值:hit = min{left, bottom,right,up}
(5)判断从hit开始之后,(left, bottom,right,up)索引值的单调性情况
若:单调递增,则点串序列为逆时针。【return 1】
若:单调递减,则点串序列为顺时针。【return 2】
若:没有单调性,则点窜为自相交情况。【return 0】
多边形自相交

代码实现:
1 int pts_sequence(const MxCutPolygon& cut_poly) 2 { 3 int pt_num = cut_poly.length(); 4 if (pt_num<4) return -2; 5 6 int i; 7 int lbrt[4]={0,0,0,0}; 8 MxVertex vmin = cut_poly[0]; 9 MxVertex vmax = cut_poly[0]; 10 for (i=1; i<(pt_num-1); i++) 11 { 12 const MxVertex& v=cut_poly[i]; 13 14 if (v[0]<vmin[0]) {vmin[0]=v[0];lbrt[0]=i;} 15 if (v[0]>vmax[0]) {vmax[0]=v[0];lbrt[2]=i;} 16 if (v[1]<vmin[1]) {vmin[1]=v[1];lbrt[1]=i;} 17 if (v[1]>vmax[1]) {vmax[1]=v[1];lbrt[3]=i;} 18 } 19 20 if (vmax[0]-vmin[0]<1e-6) return -1; 21 if (vmax[1]-vmin[1]<1e-6) return -1; 22 23 int hit_idx; 24 int midx=pt_num; 25 for (i=0; i<4; i++) 26 { 27 if (midx>lbrt[i]) 28 { 29 midx=lbrt[i]; 30 hit_idx = i; 31 } 32 } 33 34 int ccw_counter=0; 35 int cw_counter=0; 36 for (i=0; i<4; i++) 37 { 38 int curIdx=(hit_idx+i)%4; 39 int nextIdx=(hit_idx+i+1)%4; 40 if (lbrt[nextIdx]>=lbrt[curIdx]) 41 ccw_counter++; 42 if (lbrt[nextIdx]<=lbrt[curIdx]) 43 cw_counter++; 44 } 45 46 if (ccw_counter==4) return 1; 47 if (cw_counter==4) return 2; 48 49 return 0; 50 }
