示例#1
0
 internal static IList <WW.Math.Point3D> smethod_2(
     IList <WW.Math.Point3D> vertices,
     ILeader leader,
     out Vector3D startDerivative,
     out Vector3D endDerivative)
 {
     if (vertices != null && vertices.Count >= 2)
     {
         List <WW.Math.Point3D> point3DList = new List <WW.Math.Point3D>((IEnumerable <WW.Math.Point3D>)vertices);
         double   effectiveArrowSize        = leader.GetEffectiveArrowSize();
         Vector3D vector3D = point3DList[1] - point3DList[0];
         double   length   = vector3D.GetLength();
         startDerivative = vector3D / length;
         endDerivative   = leader.Direction;
         if (leader.HookLineDirection == HookLineDirection.Same)
         {
             endDerivative = -endDerivative;
         }
         endDerivative.Normalize();
         if (DxfLeader.smethod_7(leader, vertices) && leader.LeaderArrowBlock == null && length >= effectiveArrowSize)
         {
             point3DList[0] += vector3D * (effectiveArrowSize / length);
         }
         return((IList <WW.Math.Point3D>)point3DList);
     }
     startDerivative = endDerivative = Vector3D.Zero;
     return((IList <WW.Math.Point3D>)null);
 }
示例#2
0
        internal static Matrix4D smethod_6(
            ILeader leader,
            IList <WW.Math.Point3D> vertices,
            Vector3D zaxis)
        {
            WW.Math.Point3D vertex1        = vertices[0];
            WW.Math.Point3D vertex2        = vertices[1];
            Matrix4D        toWcsTransform = DxfUtil.GetToWCSTransform(zaxis);
            Vector3D        v1             = new Vector3D(toWcsTransform.M00, toWcsTransform.M10, toWcsTransform.M20);
            Vector3D        v2             = new Vector3D(toWcsTransform.M01, toWcsTransform.M11, toWcsTransform.M21);
            Vector3D        u     = vertex1 - vertex2;
            double          angle = System.Math.Atan2(Vector3D.DotProduct(u, v2), Vector3D.DotProduct(u, v1));
            double          effectiveArrowSize = leader.GetEffectiveArrowSize();

            return(Transformation4D.Translation((Vector3D)vertex1) * toWcsTransform * Transformation4D.RotateZ(angle) * Transformation4D.Scaling(effectiveArrowSize, effectiveArrowSize, effectiveArrowSize));
        }
示例#3
0
        internal static bool smethod_7(ILeader leader, IList <WW.Math.Point3D> vertices)
        {
            if (!leader.ArrowHeadEnabled || leader.ArrowSize <= 0.0)
            {
                return(false);
            }
            bool flag = false;

            if (vertices.Count >= 2)
            {
                WW.Math.Point3D vertex             = vertices[0];
                double          lengthSquared      = (vertices[1] - vertex).GetLengthSquared();
                double          effectiveArrowSize = leader.GetEffectiveArrowSize();
                flag = effectiveArrowSize * effectiveArrowSize <= 0.25 * lengthSquared + 8.88178419700125E-16;
            }
            return(flag);
        }