Exemple #1
0
            internal Column(string name, VectorKind vecKind, ColumnType itemType, bool isKey, SchemaShape metadata = null)
            {
                Contracts.CheckNonEmpty(name, nameof(name));
                Contracts.CheckValueOrNull(metadata);
                Contracts.CheckParam(!itemType.IsKey, nameof(itemType), "Item type cannot be a key");
                Contracts.CheckParam(!itemType.IsVector, nameof(itemType), "Item type cannot be a vector");
                Contracts.CheckParam(!isKey || KeyType.IsValidDataKind(itemType.RawKind), nameof(itemType), "The item type must be valid for a key");

                Name     = name;
                Kind     = vecKind;
                ItemType = itemType;
                IsKey    = isKey;
                Metadata = metadata ?? _empty;
            }
            internal Column(string name, VectorKind vecKind, DataViewType itemType, bool isKey, SchemaShape annotations = null)
            {
                Contracts.CheckNonEmpty(name, nameof(name));
                Contracts.CheckValueOrNull(annotations);
                Contracts.CheckParam(!(itemType is KeyType), nameof(itemType), "Item type cannot be a key");
                Contracts.CheckParam(!(itemType is VectorType), nameof(itemType), "Item type cannot be a vector");
                Contracts.CheckParam(!isKey || KeyType.IsValidDataType(itemType.RawType), nameof(itemType), "The item type must be valid for a key");

                Name        = name;
                Kind        = vecKind;
                ItemType    = itemType;
                IsKey       = isKey;
                Annotations = annotations ?? _empty;
            }
            public Column(string name, VectorKind vecKind, ColumnType itemType, bool isKey, string[] metadataKinds = null)
            {
                Contracts.CheckNonEmpty(name, nameof(name));
                Contracts.CheckValueOrNull(metadataKinds);
                Contracts.CheckParam(!itemType.IsKey, nameof(itemType), "Item type cannot be a key");
                Contracts.CheckParam(!itemType.IsVector, nameof(itemType), "Item type cannot be a vector");

                Contracts.CheckParam(!isKey || KeyType.IsValidDataKind(itemType.RawKind), nameof(itemType), "The item type must be valid for a key");

                Name          = name;
                Kind          = vecKind;
                ItemType      = itemType;
                IsKey         = isKey;
                MetadataKinds = metadataKinds ?? new string[0];
            }
Exemple #4
0
        public void MoveScene(VectorKind k, Coordinate c, Direction d)
        {
            int i = d == Direction.Backward ? -1 : 1;

            switch (k)
            {
            case VectorKind.Rotate:
                switch (c)
                {
                case Coordinate.X:
                    _camera.Rotate(i * xRotation);
                    break;

                case Coordinate.Y:
                    _camera.Rotate(i * yRotation);
                    break;

                case Coordinate.Z:
                    _camera.Rotate(i * zRotation);
                    break;
                }

                break;

            case VectorKind.Transform:
                switch (c)
                {
                case Coordinate.X:
                    _camera.Transform(i * xVector);
                    break;

                case Coordinate.Y:
                    _camera.Transform(i * yVector);
                    break;

                case Coordinate.Z:
                    _camera.Transform(i * zVector);
                    break;
                }

                break;
            }

            Refresh();
        }