Exemple #1
0
        //화면상에 점을찍을때 나타나는 마우스커서모양 지정
        public KcsStat_point2D_req PointState(string cursortype, string defmode)
        {
            KcsPoint2D          startpoint  = new KcsPoint2D(0.0d, 0.0d);
            KcsPoint2D          point       = new KcsPoint2D();
            KcsHighlightSet     highlighter = new KcsHighlightSet();
            KcsStat_point2D_req status      = new KcsStat_point2D_req();

            status.DefMode = defmode;
            KcsHighlightSet highlight = new KcsHighlightSet();
            KcsCursorType   Curtype   = new KcsCursorType();

            if (cursortype == "CrossHair")
            {
                Curtype.SetCrossHair();
            }
            else if (cursortype == "RubberBand")
            {
                Curtype.SetRubberBand(startpoint);
            }
            else if (cursortype == "RubberRectangle")
            {
                Curtype.SetRubberRectangle(startpoint);
            }
            else if (cursortype == "RubberCircle")
            {
                Curtype.SetRubberCircle(startpoint);
            }
            else if (cursortype == "DragCursor")
            {
                Curtype.SetDragCursor(highlighter, startpoint);
            }

            status.Cursor = Curtype;
            return(status);
        }
Exemple #2
0
        public void SelectbyBox(int sel = 3, int cut = 1)
        {
            try
            {
                handler = new List <KcsElementHandle>();
                int resp = kcs_ui.PointPlanarReq("첫번째 코너를 찍으세요", p1);
                if (resp == kcs_util.Reject() || resp == 253 || resp == 254)
                {
                    return;
                }
                KcsCursorType       cursor = new KcsCursorType();
                KcsStat_point2D_req stat   = new KcsStat_point2D_req();
                stat.Cursor = cursor;
                cursor.SetRubberRectangle(p1);

                int resp2 = kcs_ui.PointPlanarReq("두번째 코너를 찍으세요", p2, stat);
                if (resp2 == kcs_util.Reject() || resp2 == 253 || resp == 254)
                {
                    return;
                }
                kcs_draft.HighlightOff(0);
                KcsRectangle2D     rect   = new KcsRectangle2D(p1, p2);
                KcsCaptureRegion2D region = new KcsCaptureRegion2D();
                region.SetInside();
                region.SetRectangle(rect);
                region.Cut = cut;
                KcsElementHandle[] capturehandles = this.DetermineCapture(sel);
                kcs_draft.ElementHighlight(capturehandles);
                kcs_ui.MessageNoConfirm("캡쳐된 Element 갯수는: " + capturehandles.Count().ToString());
                handler = capturehandles.ToList();
                kcs_draft.HighlightOff(0);
            }
            catch (Exception ee)
            {
                kcs_ui.MessageConfirm("캡쳐된 Element가 없습니다.");
            }
        }