public bool isProjectionListCorrect(TFProjectionList projList) { var arcs = new List <ArcElement>(); var lines = new List <LineElement>(); var points = new List <LineElement>(); TFProjectionList iter = projList; while (iter != null) { Element element; iter.AsTFProjection.GetElement(out element); if (element.IsArcElement()) { arcs.Add(element.AsArcElement()); } else if (element.IsLineElement()) { if (element.AsLineElement().IsPoint()) { points.Add(element.AsLineElement()); } else { lines.Add(element.AsLineElement()); } } iter = iter.GetNext(); } return(arcs.Count == 4 && lines.Count != 2 && points.Count != 1); }
public void processOld(TFFrameListClass frame, ref bool dirty, bool updateImidiatly) { // TODO необходимо полностью обновить старые проходки, // т.к. нужно назначить правильные Level всем элементам проходки // либо поэтапно ... // TODO формализовать список обновлений через Enum TFProjectionList projList = frame.GetProjectionList(); string name = projList.AsTFProjection.GetName(); // bool isCorrect = isProjectionListCorrect(projList); if (!hasRefPoint(projList)) { dirty = true; if (updateImidiatly) { Point3d origin = frame.Get3DElement().AsCellElement().Origin; frame.AddProjection( ElementHelper.createPoint(origin), "refPoint", PenetrTaskBase.LevelRefPoint ); } } }
public void process(TFFrameListClass frameList, ref bool dirty, bool updateImidiatly) { // smartsolids раскладываются на примитивы: окружности, линии TFProjectionList projList = frameList.GetProjectionList(); string name = projList.AsTFProjection.GetName(); if (!isProjectionListCorrect(projList)) { dirty = true; } }
public bool hasRefPoint(TFProjectionList projList) { TFProjectionList iter = projList; while (iter != null) { Element element; iter.AsTFProjection.GetElement(out element); if (element.IsLineElement() && element.AsLineElement().IsPoint()) { return(true); } iter = iter.GetNext(); } return(false); }