Exemple #1
0
        public void OnUnselect()
        {
            if (selectedPrim != null)
            {
                selectedPrim = null;

                switch (activeTool)
                {
                case Tool.MaskDraw:
                case Tool.MaskErase:
                case Tool.ROIEdit:
                {
                    bUpdateROI = true;
                    break;
                }

                case Tool.TagCreate:
                case Tool.TagDelete:
                {
                    bUpdateSeqmentation = true;
                    break;
                }
                }

                ccContext.RequestRender();
                return;
            }
        }
Exemple #2
0
        public bool OnSelect(Vector2 posView)
        {
            float touchRange = ccContext.SelectRadius;

            Vector2 p      = CCContext.ViewToModel(posView, ccContext.ModelViewMatrix);
            float   radius = CCContext.ViewToModel(touchRange, ccContext.ModelViewMatrix);

            switch (activeTool)
            {
            case Tool.ROIEdit:
            {
                selectedPrim = SphereSelector.Select(roiSphere, p, radius, true, true);
                if (selectedPrim != null)
                {
                    ccContext.RequestRender();
                    return(true);
                }
                break;
            }

            case Tool.TagCreate:
            case Tool.TagDelete:
            {
                selectedPrim = TagSelector.Select(tags, p, radius);
                if (selectedPrim != null)
                {
                    ccContext.RequestRender();
                    Console.WriteLine("selected:" + selectedPrim.GetPrimitive());
                    return(true);
                }
                break;
            }
            }

            return(false);
        }