/// <summary>
 /// Get the coordinate system defined by this object for the specified position along a linear element
 /// </summary>
 /// <param name="element">The linear element the coordinate system relates to</param>
 /// <param name="t">The position along the linear element that the coordinate system relates to</param>
 /// <returns></returns>
 public override ICoordinateSystem GetCoordinateSystem(LinearElement element, double t)
 {
     if (element?.Geometry != null)
     {
         return(element.Geometry.LocalCoordinateSystem(t, element.Orientation));
     }
     return(null);
 }
示例#2
0
        /// <summary>
        /// Create a new (or update an existing) linear element in the model.
        /// </summary>
        /// <param name="geometry">The set-out geometry of the element</param>
        /// <param name="exInfo">Optional.  The execution information of the current action.
        /// If an object has been created previously with matching execution information then
        /// instead of creating a new item this previous one will be updated and returned instead.
        /// This enables this method to be used parametrically.</param>
        /// <returns></returns>
        public LinearElement LinearElement(Curve geometry, ExecutionInfo exInfo = null)
        {
            LinearElement result = new LinearElement();

            result = Model.History.Update(exInfo, result);
            result.ReplaceGeometry(geometry);
            Model.Add(result);
            return(result);
        }
示例#3
0
        /// <summary>
        /// Create a new (or update an existing) linear element as a copy of another one
        /// </summary>
        /// <param name="element">The element to copy.</param>
        /// <param name="newGeometry">Optional.  The set-out geometry to be used for the new element.</param>
        /// <param name="exInfo">Optional.  The execution information of the current action.
        /// If an object has been created previously with matching execution information then
        /// instead of creating a new item this previous one will be updated and returned instead.
        /// This enables this method to be used parametrically.</param>
        /// <returns></returns>
        public LinearElement CopyOf(LinearElement element, Curve newGeometry = null, ExecutionInfo exInfo = null)
        {
            LinearElement result = new LinearElement();

            result = Model.History.Update(exInfo, result);
            result.CopyPropertiesFrom(element);
            if (newGeometry != null)
            {
                result.ReplaceGeometry(newGeometry);
            }
            Model.Add(result);
            return(result);
        }
示例#4
0
        /// <summary>
        /// Create a copy of an element from another model inside this one.
        /// </summary>
        /// <param name="element">The element to copy</param>
        /// <returns></returns>
        public LinearElement CopyFromAnotherModel(LinearElement element)
        {
            Model         oldModel   = element.Model;
            ExecutionInfo exInfo     = oldModel?.History.ExecutionInfoFor(element);
            LinearElement newElement = CopyOf(element, null, exInfo);

            if (element.Family != null)
            {
                ExecutionInfo famExInfo = oldModel?.History.ExecutionInfoFor(element.Family);
                newElement.Family = CopyOf(element.Family, famExInfo);
                //TODO: New Family's material etc. will need to be redone...
            }
            //TODO: Copy other properties?
            return(newElement);
        }
示例#5
0
 /// <summary>
 /// Get the coordinate system defined by this object for the specified position along a linear element
 /// </summary>
 /// <param name="element">The linear element the coordinate system relates to</param>
 /// <param name="t">The position along the linear element that the coordinate system relates to</param>
 /// <returns></returns>
 public override ICoordinateSystem GetCoordinateSystem(LinearElement element, double t)
 {
     return(CoordinateSystem);
 }
 /// <summary>
 /// Get the coordinate system defined by this object for the specified position along a linear element
 /// </summary>
 /// <param name="element">The linear element the coordinate system relates to</param>
 /// <param name="t">The position along the linear element that the coordinate system relates to</param>
 /// <returns></returns>
 public abstract ICoordinateSystem GetCoordinateSystem(LinearElement element, double t);
 /// <summary>
 /// Get the coordinate system defined by this object for the specified position along a linear element
 /// </summary>
 /// <param name="element">The linear element the coordinate system relates to</param>
 /// <param name="t">The position along the linear element that the coordinate system relates to</param>
 /// <returns></returns>
 public override ICoordinateSystem GetCoordinateSystem(LinearElement element, double t)
 {
     return(new CartesianCoordinateSystem(element.Geometry.PointAt(t)));
 }