123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
-
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using JBIM;
- using RevitExport;
- using RevitExport.Export;
- using RevitExport.Parse;
- using RevitToJBim.Common;
- namespace RevitToJBim.ComponentParse
- {
- public abstract class ParseBase : IParseElement<JBimParseContext,BimId>
- {
- #region 接口类相关
-
-
-
-
- public virtual List<string> FastIndex()
- {
- return null;
- }
- public abstract bool Match(ElementWrapper wrapper);
- public virtual List<ElementWrapper> ArrangeRefElements(ElementWrapper wrapper, JBimParseContext context)
- {
- return null;
- }
- public virtual List<BimId> Parse(ElementWrapper wrapper, JBimParseContext context)
- {
- BimId result = context.GetBimId(wrapper.SourceId);
- if (result != null)
- {
- return new List<BimId>() { result };
- }
- var innerResults = ParseInner(wrapper, context);
- var refElements = ArrangeRefElements(wrapper, context);
- if (refElements != null)
- {
- foreach (var elementWrapper in refElements)
- {
- try
- {
- context.Parser.ParseElement(elementWrapper);
- }
- catch (Exception e)
- {
- ExceptionUtil.ThrowIfDubug(e);
- }
- }
- }
- return innerResults;
- }
- #endregion
- protected abstract List<BimId> ParseInner(ElementWrapper wrapper, JBimParseContext context);
- }
- }
|