예제 #1
0
 private CoordinateSystem(ICoordinateSystemEntity host, bool visible)
     : base(host)
 {
     InitializeGuaranteedProperties();
     if (visible)
         Visible = visible;
 }
예제 #2
0
 public bool UpdateByCoordinateSystem(ICoordinateSystemEntity cs, int orientation, string textString, double fontSize)
 {
     this.Orientation = orientation;
     this.String      = textString;
     this.FontSize    = fontSize;
     return(true);
 }
 public void WriteObject(ICoordinateSystemEntity entity)
 {
     WriteEntity("Origin", entity.Origin);
     WriteEntity("XAxis", entity.XAxis);
     WriteEntity("YAxis", entity.YAxis);
     WriteEntity("ZAxis", entity.ZAxis);
 }
예제 #4
0
        internal override DSGeometry TransformBy(ICoordinateSystemEntity csEntity)
        {
            DSSubDivisionMesh mesh = base.TransformBy(csEntity) as DSSubDivisionMesh;

            mesh.SubDivisionLevel = this.SubDivisionLevel;
            return(mesh);
        }
예제 #5
0
        private static ICuboidEntity CuboidByLengthsCore(ICoordinateSystemEntity contextCoordinateSystem, double length, double width, double height)
        {
            string kMethod = "Cuboid.ByLengths";

            if (length.LessThanOrEqualTo(0.0))
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "length"), "length");
            }
            if (height.LessThanOrEqualTo(0.0))
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "height"), "height");
            }
            if (width.LessThanOrEqualTo(0.0))
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "width"), "width");
            }
            if (null == contextCoordinateSystem)
            {
                throw new System.ArgumentNullException("contextCoordinateSystem");
            }
            if (!contextCoordinateSystem.IsScaledOrtho())
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Shear CoordinateSystem", kMethod));
            }

            ICuboidEntity entity = HostFactory.Factory.CuboidByLengths(contextCoordinateSystem, length, width, height);

            if (null == entity)
            {
                throw new System.Exception(string.Format(Properties.Resources.OperationFailed, kMethod));
            }
            return(entity);
        }
예제 #6
0
 public bool UpdateByCoordinateSystem(ICoordinateSystemEntity cs, int orientation, string textString, double fontSize)
 {
     this.Orientation = orientation;
     this.String = textString;
     this.FontSize = fontSize;
     return true;
 }
예제 #7
0
        public ICuboidEntity CuboidByLengths(ICoordinateSystemEntity cs, double length, double width, double height)
        {
            DSGeometryApplication.Check();
            ICuboidEntity cub = new CuboidEntity(new double[] { cs.Origin.X, cs.Origin.Y, cs.Origin.Z }, length, width, height);

            return(cub);
        }
예제 #8
0
        internal override Geometry TransformBy(ICoordinateSystemEntity csEntity)
        {
            AssertUniScaledOrtho(csEntity);

            Text text = base.TransformBy(csEntity) as Text;

            text.Orientation = Orientation;
            return(text);
        }
예제 #9
0
        public IConeEntity ConeByRadiusLength(ICoordinateSystemEntity cs, double startRadius, double endRadius, double height)
        {
            DSGeometryApplication.Check();
            ConeEntity   cone       = new ConeEntity();
            IPointEntity startPoint = cs.Origin;
            IPointEntity endPoint   = new PointEntity(cs.Origin.X, cs.Origin.Y, cs.Origin.Z + height);

            cone.UpdateCone(startPoint, endPoint, startRadius, endRadius);
            return(cone);
        }
예제 #10
0
 private DSSurfaceCurvature(DSSurface contextSurface, double u, double v, ICoordinateSystemEntity coordinateSystemEntity)
 {
     FirstPrincipleCurvature = new DSVector(coordinateSystemEntity.XAxis);
     SecondPrincipleCurvature = new DSVector(coordinateSystemEntity.YAxis);
     GaussianCurvature = FirstPrincipleCurvature.Length * SecondPrincipleCurvature.Length;
     mPointOnSurface = DSPoint.ToGeometry(coordinateSystemEntity.Origin, false, contextSurface) as DSPoint;
     U = u;
     V = v;
     ContextSurface = contextSurface;
     mCoordinateSystem = DSCoordinateSystem.ToCS(coordinateSystemEntity, false);
 }
예제 #11
0
 private SurfaceCurvature(Surface contextSurface, double u, double v, ICoordinateSystemEntity coordinateSystemEntity)
 {
     FirstPrincipleCurvature  = new Vector(coordinateSystemEntity.XAxis);
     SecondPrincipleCurvature = new Vector(coordinateSystemEntity.YAxis);
     GaussianCurvature        = FirstPrincipleCurvature.Length * SecondPrincipleCurvature.Length;
     mPointOnSurface          = Point.ToGeometry(coordinateSystemEntity.Origin, false, contextSurface) as Point;
     U = u;
     V = v;
     ContextSurface    = contextSurface;
     mCoordinateSystem = CoordinateSystem.ToCS(coordinateSystemEntity, false);
 }
예제 #12
0
        public ICoordinateSystemEntity CoordinateSystemBySphericalCoordinates(ICoordinateSystemEntity contextCS, double radius, double theta, double phi)
        {
            DSGeometryApplication.Check();
            CoordinateEntity cs = new CoordinateEntity();

            cs.Set(new PointEntity()
            {
                X = radius * Math.Sin(DegreeToRadian(theta)) * Math.Cos(DegreeToRadian(phi)), Y = radius * Math.Sin(DegreeToRadian(theta)) * Math.Sin(DegreeToRadian(phi)), Z = radius * Math.Cos(DegreeToRadian(theta))
            }, contextCS.XAxis, contextCS.YAxis, contextCS.ZAxis);
            return(cs);
        }
        public ICoordinateSystemEntity ReadCoordinateSystem()
        {
            ICoordinateSystemEntity cs = HostFactory.Factory.CoordinateSystemByData(null);

            using (IPointEntity origin = ReadPoint("Origin"))
            {
                IVector xAxis = ReadVector("XAxis");
                IVector yAxis = ReadVector("YAxis");
                IVector zAxis = ReadVector("ZAxis");
                cs.Set(origin, xAxis, yAxis, zAxis);
                return(cs);
            }
        }
예제 #14
0
        public ICoordinateSystemEntity CoordinateSystemByCylindricalCoordinates(ICoordinateSystemEntity contextCS, double radius, double theta, double height)
        {
            DSGeometryApplication.Check();
            CoordinateEntity cs = new CoordinateEntity();

            cs.Set(new PointEntity()
            {
                X = radius * Math.Cos(DegreeToRadian(theta)), Y = radius * Math.Sin(DegreeToRadian(theta)), Z = height
            }, contextCS.XAxis, contextCS.YAxis, contextCS.ZAxis);
            return(cs);
            // return new CoordinateEntity() { Origin = new PointEntity() { X = radius*Math.Sin(theta), Y = radius*Math.Cos(theta), Z = height } };
            // return new CoordinateEntity();
        }
예제 #15
0
        /// <summary>
        /// Transforms this geometry from source CoordinateSystem to a new
        /// context CoordinateSystem.
        /// </summary>
        /// <param name="fromCoordinateSystem"></param>
        /// <param name="contextCoordinateSystem"></param>
        /// <returns>Transformed Geometry.</returns>
        public DSGeometry Transform(DSCoordinateSystem fromCoordinateSystem, DSCoordinateSystem contextCoordinateSystem)
        {
            ICoordinateSystemEntity csEntity = contextCoordinateSystem.CSEntity.PostMultiplyBy(fromCoordinateSystem.CSEntity.Inverse());
            DSGeometry geom = TransformBy(csEntity);

            if (null == geom)
            {
                throw new InvalidOperationException(string.Format(Properties.Resources.OperationFailed, "DSGeometry.Transform"));
            }

            geom.ContextCoordinateSystem = contextCoordinateSystem;
            SetDisplayPropertiesTo(geom.Display);
            return(geom);
        }
        public string WriteEntity(ICoordinateSystemEntity cs, string paramName = null)
        {
            if (string.IsNullOrEmpty(paramName))
            {
                paramName = string.Format("__cs_{0}", ++id);
            }

            string origin = WriteEntity(cs.Origin);
            string xaxis  = WriteEntity(cs.XAxis);
            string yaxis  = WriteEntity(cs.YAxis);
            string zaxis  = WriteEntity(cs.ZAxis);

            mExpression.AppendFormat("{0} = CoordinateSystem.ByOriginVectors({1}, {2}, {3}, {4});", paramName, origin, xaxis, yaxis, zaxis);
            mExpression.AppendLine();
            return(paramName);
        }
예제 #17
0
        private static void AssertUniScaledOrtho(ICoordinateSystemEntity csEntity)
        {
            if (csEntity.IsUniscaledOrtho())
            {
                return;
            }

            if (csEntity.IsScaledOrtho())
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.NotSupported, "Non Uniform Scaling", "Text"));
            }
            else
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.NotSupported, "Shear Transform", "Text"));
            }
        }
예제 #18
0
        internal override DSGeometry TransformBy(ICoordinateSystemEntity csEntity)
        {
            IGeometryEntity clone = GeomEntity.CopyAndTransform(DSCoordinateSystem.WCS.CSEntity, csEntity);

            if (null == clone)
            {
                throw new System.InvalidOperationException("Failed to clone and transform cone.");
            }

            IConeEntity cone = clone as IConeEntity;

            if (null != cone)
            {
                return(new DSCone(cone, true));
            }
            return(ToGeometry(clone, true));
        }
예제 #19
0
        internal override Geometry TransformBy(ICoordinateSystemEntity csEntity)
        {
            //Let the default code handle orthogonal transform.
            if (csEntity.IsScaledOrtho())
            {
                return(base.TransformBy(csEntity));
            }

            using (IPointEntity origin = Origin.PointEntity.CopyAndTransform(CoordinateSystem.WCS.CSEntity, csEntity) as IPointEntity)
            {
                using (IPointEntity pt = Origin.PointEntity.CopyAndTranslate(Normal.IVector) as IPointEntity)
                {
                    using (IPointEntity transformPt = pt.CopyAndTransform(CoordinateSystem.WCS.CSEntity, csEntity) as IPointEntity)
                    {
                        Vector normal = origin.GetVectorTo(transformPt).Normalize();
                        return(Plane.ByOriginNormal(origin.ToPoint(false, null), normal, Size));
                    }
                }
            }
        }
예제 #20
0
        private Polygon CreatePlaneVisuals(double size, bool persist)
        {
            //  to display a plane we would be required to draw a rectangle in the plane
            //
            //

            /*
             * given origin, X & Y
             * we want to evaluate the four corner points based on size
             *
             * where o is the origin of the plane
             *
             *  Y
             |
             |
             |      v1  ______________  v2
             |         |              |
             |         |              |
             |         |      o       |
             |         |              |
             |      v4 |______________| v3
             |
             |                                       X
             |_________________________________________
             *
             */
            ICoordinateSystemEntity coordSys = PlaneEntity.GetCoordinateSystem();
            IPointEntity            orig     = coordSys.Origin;

            var xNorm = new Vector(coordSys.XAxis).Normalize().MultiplyBy(size / 2.0);
            var yNorm = new Vector(coordSys.YAxis).Normalize().MultiplyBy(size / 2.0);

            var dirv1 = yNorm - xNorm;
            var dirv2 = yNorm + xNorm;
            var dirv3 = dirv1.Negate();
            var dirv4 = dirv2.Negate();

            Point[] positions = { orig.Add(dirv1).ToPoint(false, null), orig.Add(dirv2).ToPoint(false, null),
                                  orig.Add(dirv3).ToPoint(false, null), orig.Add(dirv4).ToPoint(false, null) };
            return(new Polygon(positions, persist));
        }
예제 #21
0
        private static IConeEntity CylinderByRadiusHeightCore(ICoordinateSystemEntity contextCoordinateSystem, double radius, double height)
        {
            string kMethod = "Cylinder.ByRadiusHeight";

            if (radius.LessThanOrEqualTo(0.0))
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "radius"), "radius");
            }
            if (height.LessThanOrEqualTo(0.0))
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "height"), "height");
            }
            if (null == contextCoordinateSystem)
            {
                throw new System.ArgumentNullException("contextCoordinateSystem");
            }
            if (!contextCoordinateSystem.IsUniscaledOrtho())
            {
                if (contextCoordinateSystem.IsScaledOrtho())
                {
                    throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Non Uniform Scaled CoordinateSystem", kMethod));
                }
                else
                {
                    throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Shear CoordinateSystem", kMethod));
                }
            }

            IConeEntity entity = HostFactory.Factory.ConeByRadiusLength(contextCoordinateSystem,
                                                                        radius, radius, height);

            if (null == entity)
            {
                throw new System.Exception(string.Format(Properties.Resources.OperationFailed, kMethod));
            }
            return(entity);
        }
예제 #22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="contextSurface"></param>
        /// <param name="u"></param>
        /// <param name="v"></param>
        /// <returns></returns>
        public static SurfaceCurvature BySurfaceParameters(Surface contextSurface, double u, double v)
        {
            if (contextSurface == null)
            {
                return(null);
            }

            ISurfaceEntity host = contextSurface.GetSurfaceEntity();

            if (host == null)
            {
                return(null);
            }

            ICoordinateSystemEntity coordinateSystemEntity = host.CurvatureAtParameter(u, v);

            if (null != coordinateSystemEntity)
            {
                SurfaceCurvature surfCurv = new SurfaceCurvature(contextSurface, u, v, coordinateSystemEntity);
                return(surfCurv);
            }

            return(null);
        }
예제 #23
0
 public virtual ICuboidEntity CuboidByLengths(ICoordinateSystemEntity cs, double length, double width, double height)
 {
     throw new NotImplementedException("Factory method CuboidByLengths not implemented");
 }
예제 #24
0
 private static CoordinateSystem CreateCoordinateSystem(CoordinateSystem contextCoordinateSystem, ICoordinateSystemEntity localCoordSys, bool visible)
 {
     ICoordinateSystemEntity csEntity = contextCoordinateSystem.CSEntity.PostMultiplyBy(localCoordSys);
     var cs = new CoordinateSystem(csEntity, visible);
     cs.ContextCoordinateSystem = contextCoordinateSystem;
     cs.LocalXAxis = new Vector(localCoordSys.XAxis);
     cs.LocalYAxis = new Vector(localCoordSys.YAxis);
     cs.LocalZAxis = new Vector(localCoordSys.ZAxis);
     cs.XTranslation = localCoordSys.Origin.X;
     cs.YTranslation = localCoordSys.Origin.Y;
     cs.ZTranslation = localCoordSys.Origin.Z;
     return cs;
 }
예제 #25
0
 public IGeometryEntity CopyAndTransform(ICoordinateSystemEntity toCS)
 {
     throw new NotImplementedException();
 }
예제 #26
0
 public bool IsEqualTo(ICoordinateSystemEntity other)
 {
     return false;
 }
예제 #27
0
 public ICoordinateSystemEntity PreMultiplyBy(ICoordinateSystemEntity other)
 {
     return this;
 }
예제 #28
0
 public ICoordinateSystemEntity CoordinateSystemByCylindricalCoordinates(ICoordinateSystemEntity contextCS, double radius, double theta, double height)
 {
     DSGeometryApplication.Check();
     CoordinateEntity cs = new CoordinateEntity();
     cs.Set(new PointEntity() { X = radius * Math.Cos(DegreeToRadian(theta)), Y = radius * Math.Sin(DegreeToRadian(theta)), Z = height }, contextCS.XAxis, contextCS.YAxis, contextCS.ZAxis);
     return cs;
        // return new CoordinateEntity() { Origin = new PointEntity() { X = radius*Math.Sin(theta), Y = radius*Math.Cos(theta), Z = height } };
        // return new CoordinateEntity();
 }
예제 #29
0
 public virtual ITextEntity TextByCoordinateSystem(ICoordinateSystemEntity parentCoordinateSystem, int orientation, string textString, double fontSize)
 {
     throw new NotImplementedException("Factory method TextByCoordinateSystem not implemented");
 }
예제 #30
0
 public virtual IPointEntity PointByCartesianCoordinates(ICoordinateSystemEntity cs, double x, double y, double z)
 {
     throw new NotImplementedException("Factory method PointByCartesianCoordinates not implemented");
 }
예제 #31
0
 public virtual IGeometryEntity CopyAndTransform(ICoordinateSystemEntity fromCS, ICoordinateSystemEntity toCS)
 {
     return this;
 }
예제 #32
0
 public ITextEntity TextByCoordinateSystem(ICoordinateSystemEntity contextCoordinateSystem, int orientation, string textString, double fontSize)
 {
     DSGeometryApplication.Check();
     return new TextEntity();
 }
예제 #33
0
 public IPointEntity PointByCartesianCoordinates(ICoordinateSystemEntity cs, double x, double y, double z)
 {
     DSGeometryApplication.Check();
     return new PointEntity(cs.Origin.X + x,cs.Origin.Y + y,cs.Origin.Z + z);
 }
예제 #34
0
 public virtual ICoordinateSystemEntity CoordinateSystemByUniversalTransform(ICoordinateSystemEntity contextCoordinateSys, double[] scaleFactors,
     double[] rotationAngles, int[] rotationSequence, double[] translationVector, bool translationSequence)
 {
     throw new NotImplementedException("Factory method CoordinateSystemByUniversalTransform not implemented");
 }
예제 #35
0
 public virtual ICoordinateSystemEntity CoordinateSystemBySphericalCoordinates(ICoordinateSystemEntity contextCS, double radius, double theta, double phi)
 {
     throw new NotImplementedException("Factory method CoordinateSystemBySphericalCoordinates not implemented");
 }
예제 #36
0
 public virtual IConeEntity ConeByRadiusLength(ICoordinateSystemEntity cs, double startRadius, double endRadius, double height)
 {
     throw new NotImplementedException("Factory method ConeByRadiusLength not implemented");
 }
예제 #37
0
 public virtual ITextEntity TextByCoordinateSystem(ICoordinateSystemEntity parentCoordinateSystem, int orientation, string textString, double fontSize)
 {
     throw new NotImplementedException("Factory method TextByCoordinateSystem not implemented");
 }
예제 #38
0
        internal virtual DSGeometry TransformBy(ICoordinateSystemEntity csEntity)
        {
            IGeometryEntity clone = GeomEntity.CopyAndTransform(DSCoordinateSystem.WCS.CSEntity, csEntity);

            return(ToGeometry(clone, true));
        }
예제 #39
0
 public virtual ICuboidEntity CuboidByLengths(ICoordinateSystemEntity cs, double length, double width, double height)
 {
     throw new NotImplementedException("Factory method CuboidByLengths not implemented");
 }
예제 #40
0
 public void TransformBy(ICoordinateSystemEntity cs)
 {
     throw new NotImplementedException();
 }
예제 #41
0
 public bool IsEqualTo(ICoordinateSystemEntity other)
 {
     return(false);
 }
예제 #42
0
 public virtual IPointEntity PointByCartesianCoordinates(ICoordinateSystemEntity cs, double x, double y, double z)
 {
     throw new NotImplementedException("Factory method PointByCartesianCoordinates not implemented");
 }
예제 #43
0
 public IConeEntity ConeByRadiusLength(ICoordinateSystemEntity cs, double startRadius, double endRadius, double height)
 {
     DSGeometryApplication.Check();
     ConeEntity cone = new ConeEntity();
     IPointEntity startPoint = cs.Origin;
     IPointEntity endPoint = new PointEntity(cs.Origin.X, cs.Origin.Y, cs.Origin.Z + height);
     cone.UpdateCone(startPoint, endPoint, startRadius, endRadius);
     return cone;
 }
예제 #44
0
 public ICoordinateSystemEntity PostMultiplyBy(ICoordinateSystemEntity other)
 {
     return(other);
 }
예제 #45
0
 public void TransformFromTo(ICoordinateSystemEntity from, ICoordinateSystemEntity to)
 {
     throw new NotImplementedException();
 }
예제 #46
0
 public ICoordinateSystemEntity PreMultiplyBy(ICoordinateSystemEntity other)
 {
     return(this);
 }
예제 #47
0
 public ICoordinateSystemEntity PostMultiplyBy(ICoordinateSystemEntity other)
 {
     return other;
 }
예제 #48
0
 public ICuboidEntity CuboidByLengths(ICoordinateSystemEntity cs, double length, double width, double height)
 {
     DSGeometryApplication.Check();
     ICuboidEntity cub = new CuboidEntity();
     cub.UpdateCuboid(new double[] { cs.Origin.X, cs.Origin.Y, cs.Origin.Z }, length, width, height);
     return cub;
 }
예제 #49
0
        internal static CoordinateSystem ToCS(ICoordinateSystemEntity host, bool visible)
        {
            if(null != host)
            {
                return host.Owner == null ? new CoordinateSystem(host, visible) : host.Owner as CoordinateSystem;
            }

            return null;
        }
예제 #50
0
 public ICoordinateSystemEntity CoordinateSystemByUniversalTransform(ICoordinateSystemEntity contextCoordinateSys, double[] scaleFactors, double[] rotationAngles, int[] rotationSequence, IVector translationVector, bool translationSequence)
 {
     DSGeometryApplication.Check();
     return new CoordinateEntity();
 }
예제 #51
0
 internal PlaneEntity()
 {
     this.Origin = new PointEntity();
     this.Normal = DsVector.ByCoordinates(0, 0, 1);
     this.contextCS = new CoordinateEntity();
 }
예제 #52
0
        private static ICuboidEntity CuboidByLengthsCore(ICoordinateSystemEntity contextCoordinateSystem, double length, double width, double height)
        {
            string kMethod = "Cuboid.ByLengths";

            if (length.LessThanOrEqualTo(0.0))
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "length"), "length");
            if (height.LessThanOrEqualTo(0.0))
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "height"), "height");
            if (width.LessThanOrEqualTo(0.0))
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "width"), "width");
            if (null == contextCoordinateSystem)
                throw new System.ArgumentNullException("contextCoordinateSystem");
            if(!contextCoordinateSystem.IsScaledOrtho())
                throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Shear CoordinateSystem", kMethod));

            ICuboidEntity entity = HostFactory.Factory.CuboidByLengths(contextCoordinateSystem, length, width, height);
            if (null == entity)
                throw new System.Exception(string.Format(Properties.Resources.OperationFailed, kMethod));
            return entity;
        }
예제 #53
0
 public virtual IConeEntity ConeByRadiusLength(ICoordinateSystemEntity cs, double startRadius, double endRadius, double height)
 {
     throw new NotImplementedException("Factory method ConeByRadiusLength not implemented");
 }
예제 #54
0
 public virtual IGeometryEntity CopyAndTransform(ICoordinateSystemEntity fromCS, ICoordinateSystemEntity toCS)
 {
     return(this);
 }
예제 #55
0
 public virtual ICoordinateSystemEntity CoordinateSystemBySphericalCoordinates(ICoordinateSystemEntity contextCS, double radius, double theta, double phi)
 {
     throw new NotImplementedException("Factory method CoordinateSystemBySphericalCoordinates not implemented");
 }
예제 #56
0
 public ICoordinateSystemEntity CoordinateSystemBySphericalCoordinates(ICoordinateSystemEntity contextCS, double radius, double theta, double phi)
 {
     DSGeometryApplication.Check();
     CoordinateEntity cs = new CoordinateEntity();
     cs.Set(new PointEntity() { X = radius * Math.Sin(DegreeToRadian(theta)) * Math.Cos(DegreeToRadian(phi)), Y = radius * Math.Sin(DegreeToRadian(theta)) * Math.Sin(DegreeToRadian(phi)), Z = radius * Math.Cos(DegreeToRadian(theta)) }, contextCS.XAxis, contextCS.YAxis, contextCS.ZAxis);
     return cs;
 }
예제 #57
0
 public virtual ICoordinateSystemEntity CoordinateSystemByUniversalTransform(ICoordinateSystemEntity contextCoordinateSys, double[] scaleFactors,
                                                                             double[] rotationAngles, int[] rotationSequence, double[] translationVector, bool translationSequence)
 {
     throw new NotImplementedException("Factory method CoordinateSystemByUniversalTransform not implemented");
 }
예제 #58
0
 internal override DSGeometry TransformBy(ICoordinateSystemEntity csEntity)
 {
     DSSubDivisionMesh mesh = base.TransformBy(csEntity) as DSSubDivisionMesh;
     mesh.SubDivisionLevel = this.SubDivisionLevel;
     return mesh;
 }
예제 #59
0
파일: Cone.cs 프로젝트: samuto/designscript
        internal override DSGeometry TransformBy(ICoordinateSystemEntity csEntity)
        {
            IGeometryEntity clone = GeomEntity.CopyAndTransform(DSCoordinateSystem.WCS.CSEntity, csEntity);
            if (null == clone)
                throw new System.InvalidOperationException("Failed to clone and transform cone.");

            IConeEntity cone = clone as IConeEntity;
            if (null != cone)
                return new DSCone(cone, true);
            return ToGeometry(clone, true);
        }
예제 #60
0
        internal override Geometry TransformBy(ICoordinateSystemEntity csEntity)
        {
            //Let the default code handle orthogonal transform.
            if (csEntity.IsScaledOrtho())
                return base.TransformBy(csEntity);

            using (IPointEntity origin = Origin.PointEntity.CopyAndTransform(CoordinateSystem.WCS.CSEntity, csEntity) as IPointEntity)
            {
                using (IPointEntity pt = Origin.PointEntity.CopyAndTranslate(Normal.IVector) as IPointEntity)
                {
                    using (IPointEntity transformPt = pt.CopyAndTransform(CoordinateSystem.WCS.CSEntity, csEntity) as IPointEntity)
                    {
                        Vector normal = origin.GetVectorTo(transformPt).Normalize();
                        return Plane.ByOriginNormal(origin.ToPoint(false, null), normal, Size);
                    }
                }
            }
        }