This commit is contained in:
Nitload
2025-08-25 09:50:30 +08:00
parent bd0e31e922
commit 1359ff4ecc
1630 changed files with 738486 additions and 2399 deletions
@@ -28,25 +28,24 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Model.Step;
using StgSharp.Script;
using StgSharp.Script.Express;
using System.Collections.Generic;
namespace StgSharp.Model.Step
namespace StgSharp.Modeling.Items
{
public class StepAxis2Placement2D : StepAxis2Placement, IExpConvertableFrom<StepAxis2Placement2D>
public class StepAxis2Placement2D : StepAxis2Placement
{
private StepAxis2Placement2D( StepModel model ) : base( model ) { }
private StepAxis2Placement2D() : base( string.Empty ) { }
public StepAxis2Placement2D(
StepModel model,
string label,
StepCartesianPoint location,
StepDirection direction )
: base( model )
: base( label )
{
Location = location;
RefDirection = direction;
@@ -54,24 +53,25 @@ namespace StgSharp.Model.Step
public override StepItemType ItemType => StepItemType.AxisPlacement2D;
public void FromInstance( StepAxis2Placement2D entity )
internal static StepAxis2Placement2D CreateFromSyntaxList(
StepBinder binder,
ExpNode syntaxList )
{
base.FromInstance( entity );
Location = entity.Location;
RefDirection = entity.RefDirection;
ExpNodeNextEnumerator enumerator = new ExpNodeNextEnumerator( syntaxList );
StepAxis2Placement2D axis = new StepAxis2Placement2D();
enumerator.AssertEnumeratorCount( 3 );
axis.Name = enumerator.Values[ 0 ].CodeConvertTemplate;
binder.BindValue(
enumerator.Values[ 1 ], v => axis.Location = v.AsType<StepCartesianPoint>() );
binder.BindValue(
enumerator.Values[ 2 ], v => axis.RefDirection = v.AsType<StepDirection>() );
return axis;
}
internal static StepAxis2Placement2D FromSyntax(
StepModel binder,
ExpSyntaxNode syntaxList )
internal override IEnumerable<StepRepresentationItem> GetReferencedItems()
{
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
StepAxis2Placement2D axis = new StepAxis2Placement2D( binder );
enumerator.AssertEnumeratorCount( 3 );
axis.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
axis.Location = binder[ enumerator[ 1 ] ] as StepCartesianPoint;
axis.RefDirection = binder[ enumerator[ 2 ] ] as StepDirection;
return axis;
yield return Location;
yield return RefDirection;
}
}