old data
This commit is contained in:
@@ -28,46 +28,47 @@
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using StgSharp.Script;
|
||||
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
namespace StgSharp.Modeling.Items
|
||||
{
|
||||
public class StepAdvancedFace : StepFaceSurface, IExpConvertableFrom<StepAdvancedFace>
|
||||
public class StepAdvancedFace : StepFaceSurface
|
||||
{
|
||||
|
||||
public StepAdvancedFace( StepModel model ) : base( model ) { }
|
||||
private StepAdvancedFace() : base( string.Empty ) { }
|
||||
|
||||
public StepAdvancedFace( string name ) : base( name ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.AdvancedFace;
|
||||
|
||||
public void FromInstance( StepAdvancedFace entity )
|
||||
internal static StepAdvancedFace CreateFromSyntaxList(
|
||||
StepBinder binder,
|
||||
ExpNode syntaxList )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
internal static StepAdvancedFace FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepAdvancedFace face = new StepAdvancedFace( binder );
|
||||
ExpNodeNextEnumerator enumerator = new ExpNodeNextEnumerator( syntaxList );
|
||||
StepAdvancedFace face = new StepAdvancedFace();
|
||||
enumerator.AssertEnumeratorCount( 4 );
|
||||
face.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
face.Name = enumerator.Values[ 0 ].CodeConvertTemplate;
|
||||
|
||||
ExpNodePresidentEnumerator boundsList = enumerator[ 1 ].TupleToPresidentEnumerator();
|
||||
object boundsList = enumerator.Values[ 1 ].GetValueList();
|
||||
face.Bounds.Clear();
|
||||
face.Bounds
|
||||
.AddRange(
|
||||
Enumerable.Range( 0, enumerator.Count ).Select( _ => ( StepFaceBound )null ) );
|
||||
for( int i = 0; i < boundsList.Count; i++ )
|
||||
Enumerable.Range( 0, enumerator.Values.Count )
|
||||
.Select( _ => ( StepFaceBound )null ) );
|
||||
for( int i = 0; i < enumerator.Values.Count; i++ )
|
||||
{
|
||||
int j = i; // capture to avoid rebinding
|
||||
face.Bounds[ j ] = binder[ boundsList[ j ] ] as StepFaceBound;
|
||||
binder.BindValue(
|
||||
enumerator.Values[ j ], v => face.Bounds[ j ] = v.AsType<StepFaceBound>() );
|
||||
}
|
||||
face.FaceGeometry = binder[ enumerator[ 2 ] ] as StepSurface;
|
||||
face.SameSense = ( enumerator[ 3 ] as ExpBoolNode )!.Value;
|
||||
binder.BindValue(
|
||||
enumerator.Values[ 2 ], v => face.FaceGeometry = v.AsType<StepSurface>() );
|
||||
face.SameSense = ( enumerator.Values[ 3 ] as ExpBoolNode )!.Value;
|
||||
|
||||
return face;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user