Merge from branch giga
This commit is contained in:
@@ -28,21 +28,22 @@
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
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 StepFaceBound : StepTopologicalRepresentationItem
|
||||
public class StepFaceBound : StepTopologicalRepresentationItem, IExpConvertableFrom<StepFaceBound>
|
||||
{
|
||||
|
||||
protected StepFaceBound() : base( string.Empty ) { }
|
||||
public StepFaceBound( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepFaceBound( string name, StepLoop bound, bool orientation )
|
||||
: base( name )
|
||||
public StepFaceBound( StepModel model, StepLoop bound, bool orientation )
|
||||
: base( model )
|
||||
{
|
||||
Bound = bound;
|
||||
Orientation = orientation;
|
||||
@@ -54,20 +55,22 @@ namespace StgSharp.Modeling.Items
|
||||
|
||||
public StepLoop Bound { get; set; }
|
||||
|
||||
internal static StepFaceBound CreateFromSyntaxList( StepBinder binder, ExpNode syntaxList )
|
||||
public void FromInstance( StepFaceBound entity )
|
||||
{
|
||||
ExpNodeNextEnumerator enumerator = new ExpNodeNextEnumerator( syntaxList );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
StepFaceBound faceBound = new StepFaceBound();
|
||||
faceBound.Name = enumerator.Values[ 0 ].CodeConvertTemplate;
|
||||
binder.BindValue( enumerator.Values[ 1 ], v => faceBound.Bound = v.AsType<StepLoop>() );
|
||||
faceBound.Orientation = ( enumerator.Values[ 2 ]as ExpBoolNode )!.Value;
|
||||
return faceBound;
|
||||
base.FromInstance( entity );
|
||||
Bound = entity.Bound;
|
||||
Orientation = entity.Orientation;
|
||||
}
|
||||
|
||||
internal override IEnumerable<StepRepresentationItem> GetReferencedItems()
|
||||
internal static StepFaceBound FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
yield return Bound;
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
StepFaceBound faceBound = new StepFaceBound( binder );
|
||||
faceBound.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
faceBound.Bound = binder[ enumerator[ 1 ] ] as StepLoop;
|
||||
faceBound.Orientation = ( enumerator[ 2 ]as ExpBoolNode )!.Value;
|
||||
return faceBound;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user