示例#1
0
 /// <summary>
 /// Simple test to see if the RockFish service is operational
 /// </summary>
 /// <param name="str"></param>
 /// <returns>The echoed string if successful.</returns>
 public string Echo(string str)
 {
     if (IsValid)
     {
         try
         {
             var header = new RockfishHeader(ClientId);
             var result = m_channel.Echo(header, str);
             return(result);
         }
         catch (Exception ex)
         {
             HandleException(ex);
             Dispose();
         }
     }
     return(null);
 }
示例#2
0
        /// <summary>
        /// Creates a polyline curve from an array of points.
        /// Also removes points from the array if their common
        /// distance exceeds a specified threshold.
        /// </summary>
        /// <param name="inPoints">The array of points.</param>
        /// <param name="minimumDistance">
        /// Minimum allowed distance among a pair of points.
        /// If points are closer than this, only one of them will be kept.
        /// </param>
        /// <returns>The polyline curve if successful.</returns>
        public RockfishGeometry PolylineFromPoints(RockfishPoint[] inPoints, double minimumDistance)
        {
            if (null == inPoints || 0 == inPoints.Length)
            {
                return(null);
            }

            if (IsValid)
            {
                try
                {
                    var header = new RockfishHeader(ClientId);
                    var result = m_channel.PolylineFromPoints(header, inPoints, minimumDistance);
                    return(result);
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                    Dispose();
                }
            }
            return(null);
        }
示例#3
0
        /// <summary>
        /// Constructs a mesh from a Brep.
        /// </summary>
        /// <param name="inBrep">The Brep.</param>
        /// <param name="bSmooth">
        /// If true, a smooth mesh is returned.
        /// If false, then a coarse mesh is returned.
        /// </param>
        /// <returns>The mesh if successful.</returns>
        public RockfishGeometry CreateMeshFromBrep(RockfishGeometry inBrep, bool bSmooth)
        {
            if (null == inBrep?.Brep)
            {
                return(null);
            }

            if (IsValid)
            {
                try
                {
                    var header = new RockfishHeader(ClientId);
                    var result = m_channel.CreateMeshFromBrep(header, inBrep, bSmooth);
                    return(result);
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                    Dispose();
                }
            }
            return(null);
        }
示例#4
0
        /// <summary>
        /// Intersects two Brep objects and returns the intersection curves
        /// </summary>
        /// <param name="inBrep0">The first Brep.</param>
        /// <param name="inBrep1">The second Brep.</param>
        /// <param name="tolerance">The intersection tolerance.</param>
        /// <returns>The intersection curves if successful.</returns>
        public RockfishGeometry[] IntersectBreps(RockfishGeometry inBrep0, RockfishGeometry inBrep1, double tolerance)
        {
            if (null == inBrep0?.Brep || null == inBrep1?.Brep)
            {
                return(null);
            }

            if (IsValid)
            {
                try
                {
                    var header = new RockfishHeader(ClientId);
                    var result = m_channel.IntersectBreps(header, inBrep0, inBrep1, tolerance);
                    return(result);
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                    Dispose();
                }
            }
            return(new RockfishGeometry[0]);
        }