Merge from branch giga
This commit is contained in:
@@ -28,21 +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 StepCylindricalSurface : StepElementarySurface
|
||||
public class StepCylindricalSurface : StepElementarySurface, IExpConvertableFrom<StepCylindricalSurface>
|
||||
{
|
||||
|
||||
private StepCylindricalSurface() : base() { }
|
||||
public StepCylindricalSurface( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepCylindricalSurface( string name, StepAxis2Placement3D position, float radius )
|
||||
: base( name, position )
|
||||
public StepCylindricalSurface(
|
||||
StepModel model,
|
||||
StepAxis2Placement3D position,
|
||||
float radius )
|
||||
: base( model, position )
|
||||
{
|
||||
Radius = radius;
|
||||
}
|
||||
@@ -51,17 +55,22 @@ namespace StgSharp.Modeling.Items
|
||||
|
||||
public override StepItemType ItemType => StepItemType.CylindricalSurface;
|
||||
|
||||
internal static StepRepresentationItem CreateFromSyntaxList(
|
||||
StepBinder binder,
|
||||
ExpNode syntaxList )
|
||||
public void FromInstance( StepCylindricalSurface entity )
|
||||
{
|
||||
ExpNodeNextEnumerator enumerator = new ExpNodeNextEnumerator( syntaxList );
|
||||
base.FromInstance( entity );
|
||||
Radius = entity.Radius;
|
||||
}
|
||||
|
||||
internal static StepRepresentationItem FromSyntax(
|
||||
StepModel binder,
|
||||
ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
StepCylindricalSurface surface = new StepCylindricalSurface();
|
||||
surface.Name = enumerator.Values[ 0 ].CodeConvertTemplate;
|
||||
binder.BindValue(
|
||||
enumerator.Values[ 1 ], v => surface.Position = v.AsType<StepAxis2Placement3D>() );
|
||||
surface.Radius = ( enumerator.Values[ 2 ]as ExpRealNumberNode )!.Value;
|
||||
StepCylindricalSurface surface = new StepCylindricalSurface( binder );
|
||||
surface.Name = ( enumerator[ 0 ] as ExpStringNode )!.Value;
|
||||
surface.Position = binder[ enumerator[ 1 ] ]as StepAxis2Placement3D;
|
||||
surface.Radius = ( enumerator[ 2 ]as ExpRealNumberNode )!.Value;
|
||||
return surface;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user