bool ContainsFeature(FdoSequence <IPhFeatureConstraint> vars, int hvoClosedFeature)
 {
     foreach (IPhFeatureConstraint var in vars)
     {
         if (var.FeatureRAHvo == hvoClosedFeature)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
        /// <summary>
        /// Gets the maximum number of lines to display the specified sequence of simple contexts.
        /// </summary>
        /// <param name="seq">The sequence.</param>
        /// <returns></returns>
        protected int GetNumLines(FdoSequence <IPhSimpleContext> seq)
        {
            int maxNumLines = 1;

            foreach (IPhSimpleContext ctxt in seq)
            {
                int numLines = GetNumLines(ctxt);
                if (numLines > maxNumLines)
                {
                    maxNumLines = numLines;
                }
            }
            return(maxNumLines);
        }
예제 #3
0
        int GetVariablesWidth(IPhSimpleContextNC ctxt, IVwEnv vwenv, bool polarity)
        {
            FdoSequence <IPhFeatureConstraint> vars = polarity ? ctxt.PlusConstrRS : ctxt.MinusConstrRS;
            int maxLen = 0;

            for (int i = 0; i < vars.Count; i++)
            {
                ITsString varLine = CreateVariableLine(vars[i], polarity);
                int       len     = GetStrWidth(varLine, null, vwenv);
                if (len > maxLen)
                {
                    maxLen = len;
                }
            }
            return(maxLen);
        }
예제 #4
0
		/// <summary>
		/// Collects all of the alpha variables in the specified sequence.
		/// </summary>
		/// <param name="vars">The sequence of variables.</param>
		/// <param name="featureConstrs">The feature constraints.</param>
		void CollectVars(FdoSequence<IPhFeatureConstraint> vars, List<int> featureConstrs)
		{
			foreach (IPhFeatureConstraint var in vars)
			{
				bool found = false;
				foreach (int hvo in featureConstrs)
				{
					if (var.Hvo == hvo)
					{
						found = true;
						break;
					}
				}

				if (!found)
					featureConstrs.Add(var.Hvo);
			}
		}
예제 #5
0
		/// <summary>
		/// Collects all of the alpha variables in the specified sequence of simple contexts.
		/// </summary>
		/// <param name="seq">The sequence.</param>
		/// <param name="featureConstrs">The feature constraints.</param>
		/// <param name="excludeCtxt">The natural class context to exclude.</param>
		void CollectVars(FdoSequence<IPhSimpleContext> seq, List<int> featureConstrs, IPhSimpleContextNC excludeCtxt)
		{
			foreach (IPhSimpleContext ctxt in seq)
			{
				if ((excludeCtxt == null || ctxt.Hvo != excludeCtxt.Hvo)
					&& ctxt.ClassID == PhSimpleContextNC.kclsidPhSimpleContextNC)
				{
					IPhSimpleContextNC ncCtxt = ctxt as IPhSimpleContextNC;
					CollectVars(ncCtxt, featureConstrs, excludeCtxt);
				}
			}
		}
예제 #6
0
		/// <summary>
		/// Gets the maximum number of lines to display the specified sequence of simple contexts.
		/// </summary>
		/// <param name="seq">The sequence.</param>
		/// <returns></returns>
		protected int GetNumLines(FdoSequence<IPhSimpleContext> seq)
		{
			int maxNumLines = 1;
			foreach (IPhSimpleContext ctxt in seq)
			{
				int numLines = GetNumLines(ctxt);
				if (numLines > maxNumLines)
					maxNumLines = numLines;
			}
			return maxNumLines;
		}
		bool ContainsFeature(FdoSequence<IPhFeatureConstraint> vars, int hvoClosedFeature)
		{
			foreach (IPhFeatureConstraint var in vars)
			{
				if (var.FeatureRAHvo == hvoClosedFeature)
					return true;
			}
			return false;
		}