using System; namespace Netron.Diagramming.Core.Layout.Force { /// /// Interface for force functions in a force simulation. /// public interface IForce { /// /// Initialize this force function. /// /// the encompassing ForceSimulator void Init(ForceSimulator fsim); /// /// Returns the number of parameters (e.g., gravitational constant or /// spring force coefficient) affecting this force function. /// int ParameterCount { get; } /// /// Returns the specified, numbered parameter. /// /// i the index of the parameter to return /// the parameter value float GetParameter(int i); /// /// Get the suggested minimum value for a parameter. This value is not /// strictly enforced, but is used by interface components that allow force /// parameters to be varied. /// /// the parameter index /// the suggested minimum value. float GetMinValue(int param); /// /// Get the suggested maximum value for a parameter. This value is not /// strictly enforced, but is used by interface components that allow force /// parameters to be varied. /// /// the parameter index /// the suggested maximum value. float GetMaxValue(int param); /// /// Gets the text name of the requested parameter. /// /// the index of the parameter /// a String containing the name of this parameter String GetParameterName(int i); /// /// Sets the specified parameter value. /// /// the index of the parameter /// the new value of the parameter void SetParameter(int i, float val); /// /// Set the suggested minimum value for a parameter. This value is not /// strictly enforced, but is used by interface components that allow force /// parameters to be varied. /// /// the parameter index /// the suggested minimum value to use void SetMinValue(int i, float val); /// /// Set the suggested maximum value for a parameter. This value is not /// strictly enforced, but is used by interface components that allow force /// parameters to be varied. /// /// the parameter index /// the suggested maximum value to use void SetMaxValue(int i, float val); /// /// Indicates if this force function will compute forces on Spring instances. /// /// /// true if this force function processes Spring instances; otherwise, false. /// bool IsSpringForce { get; } /// /// Indicates if this force function will compute forces on ForceItem instances /// /// /// true if this force function processes IForce instances; otherwise, false. /// bool IsItemForce { get; } /// /// Updates the force calculation on the given ForceItem /// /// the ForceItem on which to compute updated forces void GetForce(ForceItem item); /// /// Updates the force calculation on the given Spring. The ForceItems /// attached to Spring will have their force values updated appropriately. /// /// spring the Spring on which to compute updated forces void GetForce(Spring spring); } }