Merge from branch giga
This commit is contained in:
@@ -28,24 +28,25 @@
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Modeling.Items
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepAxis2Placement2D : StepAxis2Placement
|
||||
public class StepAxis2Placement2D : StepAxis2Placement, IExpConvertableFrom<StepAxis2Placement2D>
|
||||
{
|
||||
|
||||
private StepAxis2Placement2D() : base( string.Empty ) { }
|
||||
private StepAxis2Placement2D( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepAxis2Placement2D(
|
||||
string label,
|
||||
StepModel model,
|
||||
StepCartesianPoint location,
|
||||
StepDirection direction )
|
||||
: base( label )
|
||||
: base( model )
|
||||
{
|
||||
Location = location;
|
||||
RefDirection = direction;
|
||||
@@ -53,25 +54,24 @@ namespace StgSharp.Modeling.Items
|
||||
|
||||
public override StepItemType ItemType => StepItemType.AxisPlacement2D;
|
||||
|
||||
internal static StepAxis2Placement2D CreateFromSyntaxList(
|
||||
StepBinder binder,
|
||||
ExpNode syntaxList )
|
||||
public void FromInstance( StepAxis2Placement2D entity )
|
||||
{
|
||||
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;
|
||||
base.FromInstance( entity );
|
||||
Location = entity.Location;
|
||||
RefDirection = entity.RefDirection;
|
||||
}
|
||||
|
||||
internal override IEnumerable<StepRepresentationItem> GetReferencedItems()
|
||||
internal static StepAxis2Placement2D FromSyntax(
|
||||
StepModel binder,
|
||||
ExpSyntaxNode syntaxList )
|
||||
{
|
||||
yield return Location;
|
||||
yield return RefDirection;
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user