(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为模拟器的缩放比。该值越小,模拟器尺寸越小;该值越大,模拟器尺寸越大。

posted @ 2012-05-25 16:30 可可西 阅读(164) 评论(0) 编辑

使用的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

posted @ 2012-05-22 11:49 可可西 阅读(24) 评论(0) 编辑

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

+++++++++++++++++++++

可视化结果:

posted @ 2012-05-14 14:51 可可西 阅读(9) 评论(0) 编辑

在MFC中使用AE(AO)进行二次开发时,当目标机器上若没有安装AE的Runtime,程序会直接挂掉。

对此,通过在CXXAppInitInstance()起始处增加环境的检测代码,来友好地提示用户安装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 }

 

posted @ 2012-04-30 16:07 可可西 阅读(144) 评论(0) 编辑

目标:给定一个任意点串序列的多边形(可能出现自相交的情况),判断其形点的存放序列方向。

注:输入的多边形点串的尾点首点相同,即多存一个点,将首点存两遍。

算法思想:

(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 }

 

posted @ 2012-04-25 11:44 可可西 阅读(85) 评论(0) 编辑
摘要: 具体做法是:打开一个obj文件,查找含有“v x y z"的字串,然后对z的字串进行符号处理:若为"-",直接将该符号删除;不为"-"且z值不为0,则在z的字串前加上"-"。示例(原始文件box.obj)## object Box01#v -39.306316 -32.828358 -29.183971v -39.306316 33.259296 -29.183971v 39.726025 33.259296 -29.183971v 39.726025 -32.828358 -29.183971v -39.306316 -3阅读全文
posted @ 2012-04-15 23:06 可可西 阅读(18) 评论(0) 编辑
摘要: 单件模式要保证的是:类只能实例化一个对象。为了保证这点,需要将类的构造函数和析构函数声明为私有类型!代码如下: 1 class single 2 { 3 private: 4 single():m_chs("Hello"){} 5 ~single(){} 6 7 public: 8 void printHello() 9 {10 printf("%s\n",m_chs);11 }12 13 public:14 static single* getInstance()15 {16 if (!m_instan...阅读全文
posted @ 2012-04-13 13:49 可可西 阅读(10) 评论(0) 编辑
摘要: 左眼图像:右眼图像:行偏振立体图像:阅读全文
posted @ 2012-04-01 11:02 可可西 阅读(27) 评论(0) 编辑
摘要: 下面讲解以上图逆时针序列三角形ABC为例,进行推导和讲解:A(x1,y1) B(x2,y2) C(x3,y3)S为三角形ABC的面积,Sm1为直角梯形AA'B'B的面积,Sm2为直角梯形BB'C'C的面积,Sn1为直角梯形AA'C'C的面积容易得知:S =-(Sm1+Sm2) +Sn1-Sm1 = (x1-x2)(y1+y2)/2 = (x1*y1+x1*y2-x2*y1-x2*y2)/2-Sm2 = (x2-x3)(y2+y3)/2 = (x2*y2+x2*y3-x3*y2-x3*y3)/2 Sn1 = (x3-x1)(y1+y3)/2 = (阅读全文
posted @ 2012-03-21 16:24 可可西 阅读(64) 评论(0) 编辑
摘要: 二维情况:对于线段AB,A(x1,y1)为起点,B(x2,y2)为终点,且AC/AB=t;求线段C(x,y)的坐标。x = (1-t)*x1+t*x2y = (1-t)*y1+t*y2三维情况:对于线段AB,A(x1,y1,z1)为起点,B(x2,y2,z2)为终点,且AC/AB=t;求线段C(x,y,z)的坐标。x = (1-t)*x1+t*x2y = (1-t)*y1+t*y2z = (1-t)*z1+t*z2阅读全文
posted @ 2012-03-21 11:06 可可西 阅读(45) 评论(0) 编辑