添加项目文件。
This commit is contained in:
53
Mstn.Toolkit/Extensions/CurveProcessor.cs
Normal file
53
Mstn.Toolkit/Extensions/CurveProcessor.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Bentley.DgnPlatformNET;
|
||||
using Bentley.DgnPlatformNET.Elements;
|
||||
using Bentley.GeometryNET;
|
||||
|
||||
namespace Mstn.Toolkit.Extensions
|
||||
{
|
||||
public class CurveProcessor : ElementGraphicsProcessor
|
||||
{
|
||||
private IList<CurveVector> m_outputCurve;
|
||||
private DTransform3d m_currentTransform;
|
||||
public CurveProcessor(ref IList<CurveVector> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user