Ejemplo n.º 1
0
    float perspectivePara  = 15f;            //透视相机小于这一值为近距离,按照自己的模型调整

    void Awake()
    {
        camerafree = GameObject.Find("CameraFree").GetComponent <Camera>();
        mGuisty_Point.stretchWidth      = true;
        mGuisty_Point.stretchHeight     = true;
        mGuisty_Point.normal.background = (Texture2D)Resources.Load("LineResources/Picture/2");
        //读取零件树;
        m_read_Tree_xls = new readExcel();
        m_read_Tree_xls.readXLS("/StreamingAssets/Excel/DoLable.xls");

        mbtnsty1.normal.background = (Texture2D)Resources.Load("LineResources/Picture/bg");
        mbtnsty1.hover.background  = (Texture2D)Resources.Load("LineResources/Picture/bg");
        mbtnsty1.alignment         = TextAnchor.MiddleCenter;
        mbtnsty1.hover.textColor   = new Color(1, 1, 1, 1);
        mbtnsty1.border.top        = 10; mbtnsty1.border.bottom = 10; mbtnsty1.border.left = 10; mbtnsty1.border.right = 10;
        mbtnsty1.stretchWidth      = true;

        mbtnsty2.normal.background = (Texture2D)Resources.Load("LineResources/Picture/bgImg");
        mbtnsty2.hover.background  = (Texture2D)Resources.Load("LineResources/Picture/bgImg");
        mbtnsty2.hover.textColor   = new Color(0, 0, 0);
        mbtnsty2.alignment         = TextAnchor.MiddleCenter;
        mbtnsty2.hover.textColor   = new Color(1, 1, 1, 1);
        mbtnsty2.border.top        = 10; mbtnsty2.border.bottom = 10; mbtnsty2.border.left = 10; mbtnsty2.border.right = 10;
        mbtnsty2.stretchWidth      = true;
        mmaterial = (Material)Resources.Load("LineResources/LineColor/linecolor");
        if (camerafree.orthographic)
        {
            cameraType = "Orthographic";              //此为正交相机
        }
        else
        {
            cameraType = "Perspective";              //此为透视相机
        }
    }
Ejemplo n.º 2
0
        private void confirmCategory()
        {
            string[] shp = new string[2];
            shp[0] = System.IO.Path.GetDirectoryName(shpPathText.Text);
            shp[1] = System.IO.Path.GetFileName(shpPathText.Text);

            if (shp[0] == null)
            {
                return;
            }
            IFeatureClass  pFC         = mg.openShapefile(shp[0], shp[1]);
            IFeatureCursor pFeatureCur = pFC.Search(null, false);
            IFeature       pFeature    = pFeatureCur.NextFeature();

            Hashtable i = mg.Index(pFC);

            readExcel t = new readExcel();

            t.OpenExcel(excelText.Text);
            List <TrashInfo> trashItems = t.readTrashTables();

            t.closeExcel();

            IQueryFilter tQueryFilter = new QueryFilterClass();

            tQueryFilter.WhereClause = "";
            tQueryFilter.AddField(pFC.OIDFieldName);
            //Invoke(new MethodInvoker(() =>
            //{
            //    proWork.Maximum = pFC.FeatureCount(tQueryFilter);
            //    proWork.Value = 0;
            //}));

            //int number = 1;
            while (pFeature != null)
            {
                ResultItem value = new ResultItem();
                value = mg.getFields(i, pFeature);

                #region 查找与excel中匹配的数据
                TrashInfo right = trashItems.Find(
                    delegate(TrashInfo T)
                {
                    return(T.Figure == value.Figure);
                });

                pFeature.set_Value((int)i["垃圾类别"], right.Category); //如果垃圾类别没设置,则取消注释
                pFeature.Store();
                #endregion
                //Invoke(new MethodInvoker(() =>
                //{
                //    proWork.Value = number++;
                //}));
                pFeature = pFeatureCur.NextFeature();
            }
        }