예제 #1
0
        private Layerage GetNodeCollectionLayer(Vector2 startingPoint, Matrix3x2 matrix)
        {
            switch (this.SelectionMode)
            {
            case ListViewSelectionMode.None: return(null);

            case ListViewSelectionMode.Single:
            {
                Layerage layerage = this.SelectionViewModel.SelectionLayerage;
                if (layerage == null)
                {
                    return(null);
                }
                ILayer layer = layerage.Self;

                if (layer.Type == LayerType.Curve)
                {
                    layer.Nodes.CacheTransform();
                    this.NodeCollectionMode = NodeCollection.ContainsNodeCollectionMode(startingPoint, layer.Nodes, matrix);
                    return(layerage);
                }
            }
            break;

            case ListViewSelectionMode.Multiple:
                foreach (Layerage layerage in this.SelectionViewModel.SelectionLayerages)
                {
                    ILayer layer = layerage.Self;

                    if (layer.Type == LayerType.Curve)
                    {
                        layer.Nodes.CacheTransform();
                        NodeCollectionMode mode = NodeCollection.ContainsNodeCollectionMode(startingPoint, layer.Nodes, matrix);
                        if (mode != NodeCollectionMode.None)
                        {
                            this.NodeCollectionMode = mode;
                            return(layerage);
                        }
                    }
                }
                break;
            }
            return(null);
        }
예제 #2
0
        private NodeCollectionMode GetNodeCollectionMode(Vector2 startingPoint, Matrix3x2 matrix)
        {
            switch (this.SelectionMode)
            {
            case ListViewSelectionMode.None: return(NodeCollectionMode.None);

            case ListViewSelectionMode.Single:
            {
                Layerage layerage = this.SelectionViewModel.SelectionLayerage;
                if (layerage is null)
                {
                    return(NodeCollectionMode.None);
                }
                ILayer layer = layerage.Self;

                if (layer.Type == LayerType.Curve)
                {
                    return(NodeCollection.ContainsNodeCollectionMode(startingPoint, layer.Nodes, matrix));
                }
            }
            break;

            case ListViewSelectionMode.Multiple:
                foreach (Layerage layerage in this.SelectionViewModel.SelectionLayerages)
                {
                    ILayer layer = layerage.Self;

                    if (layer.Type == LayerType.Curve)
                    {
                        return(NodeCollection.ContainsNodeCollectionMode(startingPoint, layer.Nodes, matrix));
                    }
                }
                break;
            }
            return(NodeCollectionMode.None);
        }