41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System;
|
|
using Autodesk.AutoCAD.Geometry;
|
|
using CadParamPluging.Common;
|
|
using CadParamPluging.Domain.Models;
|
|
|
|
namespace CadParamPluging.Cad
|
|
{
|
|
public abstract class TemplateDrawingGeneratorBase : ITemplateDrawingGenerator
|
|
{
|
|
public abstract string TemplateKey { get; }
|
|
|
|
public virtual FeatureDrivenDrawer.ExpectedDrawingSize CalculateExpectedSize(ParamBag bag, TemplateParams templateParams)
|
|
{
|
|
return FeatureDrivenDrawer.CalculateExpectedSize(bag, templateParams?.SheetSize);
|
|
}
|
|
|
|
public virtual void Draw(CadContext ctx, ParamBag bag, TemplateParams templateParams, Point3d center, double scaleFactor)
|
|
{
|
|
if (ctx == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(ctx));
|
|
}
|
|
|
|
if (templateParams == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(templateParams));
|
|
}
|
|
|
|
HalfSectionDrawer.Draw(
|
|
ctx,
|
|
bag,
|
|
templateParams.ProjectType,
|
|
templateParams.SheetSize,
|
|
templateParams.Scale,
|
|
templateParams.DrawingType,
|
|
center,
|
|
scaleFactor);
|
|
}
|
|
}
|
|
}
|