/// <summary>
        /// Create a new geometry operation object
        /// base the information in the xml
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static GeometryOperation Create(XPathNavigator navigator, GEMSSingle parent)
        {
            GeometryOperation operation = null;

            try
            {
                //Get the type of the geometry operation
                GeometryOperation.GeometryOperationType operationType = (GeometryOperation.GeometryOperationType)Enum.Parse(typeof(GeometryOperation.GeometryOperationType), navigator.GetAttribute("name", string.Empty));

                //Create the geometry object based type
                switch (operationType)
                {
                case GeometryOperation.GeometryOperationType.CreateCone:
                    operation = new CreateCone(navigator, parent);
                    break;

                case GeometryOperation.GeometryOperationType.CreateCylinder:
                    operation = new CreateCylinder(navigator, parent);
                    break;

                case GeometryOperation.GeometryOperationType.CreateCuboid:
                    operation = new CreateCuboid(navigator, parent);
                    break;

                case GeometryOperation.GeometryOperationType.CreateLine:
                    operation = new CreateLine(navigator, parent);
                    break;

                case GeometryOperation.GeometryOperationType.CreatePoint:
                    operation = new CreatePoint(navigator, parent);
                    break;

                case GeometryOperation.GeometryOperationType.CreateRectangle:
                    operation = new CreateRectangle(navigator, parent);
                    break;

                case GeometryOperation.GeometryOperationType.CreateSphere:
                    operation = new CreateSphere(navigator, parent);
                    break;

                case GeometryOperation.GeometryOperationType.CreateRound:
                    operation = new CreateRound(navigator, parent);
                    break;

                default:
                    break;
                }
            }
            catch
            {
                return(operation);
            }

            return(operation);
        }
Example #2
0
        public override GeometryOperation Clone(int newId, GEMSSingle parent)
        {
            CreateRectangle rectangle = new CreateRectangle(newId, parent);

            rectangle.AlineAxis = this.alineAxis;
            rectangle.Width     = new Length(this.width);
            rectangle.Height    = new Length(this.height);
            rectangle.RefPoint  = new Vector3WithUnit(this.refPoint);

            return(rectangle);
        }