Merge from branch giga
This commit is contained in:
@@ -28,23 +28,24 @@
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Modeling.Items
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepCircle : StepConic
|
||||
public class StepCircle : StepConic, IExpConvertableFrom<StepCircle>
|
||||
{
|
||||
|
||||
private StepAxis2Placement _position;
|
||||
|
||||
private StepCircle() : base( string.Empty ) { }
|
||||
public StepCircle( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepCircle( string label, StepAxis2Placement position, float radius )
|
||||
: base( label )
|
||||
public StepCircle( StepModel model, StepAxis2Placement position, float radius )
|
||||
: base( model )
|
||||
{
|
||||
Position = position;
|
||||
Radius = radius;
|
||||
@@ -67,21 +68,21 @@ namespace StgSharp.Modeling.Items
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Circle;
|
||||
|
||||
internal static StepCircle CreateFromSyntaxList( StepBinder binder, ExpNode syntaxList )
|
||||
public void FromInstance( StepCircle entity )
|
||||
{
|
||||
ExpNodeNextEnumerator enumerator = new ExpNodeNextEnumerator( syntaxList );
|
||||
StepCircle circle = new StepCircle();
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
circle.Name = enumerator.Values[ 0 ].CodeConvertTemplate;
|
||||
binder.BindValue(
|
||||
enumerator.Values[ 1 ], v => circle.Position = v.AsType<StepAxis2Placement>() );
|
||||
circle.Radius = ( enumerator.Values[ 2 ]as ExpRealNumberNode )!.Value;
|
||||
return circle;
|
||||
base.FromInstance( entity );
|
||||
this._position = entity.Position;
|
||||
}
|
||||
|
||||
internal override IEnumerable<StepRepresentationItem> GetReferencedItems()
|
||||
internal static StepCircle FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
yield return Position;
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepCircle circle = new StepCircle( binder );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
circle.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
circle.Position = binder[ enumerator[ 1 ] ] as StepAxis2Placement;
|
||||
circle.Radius = ( enumerator[ 2 ]as ExpRealNumberNode )!.Value;
|
||||
return circle;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user