using System.Collections.Generic; using Bentley.DgnPlatformNET; using Bentley.DgnPlatformNET.Elements; using Bentley.GeometryNET; namespace Mstn.Toolkit.Extensions { public class CurveProcessor : ElementGraphicsProcessor { private IList m_outputCurve; private DTransform3d m_currentTransform; public CurveProcessor(ref IList outputCurve) { m_outputCurve = outputCurve; m_currentTransform = DTransform3d.Identity; } public override bool ProcessAsBody(bool isCurved) { return false; } public override bool ProcessAsFacets(bool isPolyface) { return false; } public override BentleyStatus ProcessCurveVector(CurveVector curves, bool isFilled = false) { CurveVector cvs = curves.Clone(); cvs.Transform(m_currentTransform); m_outputCurve.Add(cvs); return BentleyStatus.Success; } public void Process(Element element) { ElementGraphicsOutput.Process(element, this); } public override void AnnounceTransform(DTransform3d transform) { m_currentTransform = transform != null ? transform : DTransform3d.Identity; } public override void AnnounceIdentityTransform() { m_currentTransform = DTransform3d.Identity; } } }