示例#1
0
        internal static StepDirection CreateFromSyntaxList(StepSyntaxList syntaxList, int id)
        {
            var stepDirection = new StepDirection();

            stepDirection.SyntaxList = syntaxList;
            stepDirection.Id         = id;
            return((StepDirection)AssignTo(stepDirection, syntaxList));
        }
示例#2
0
        internal static StepCartesianPoint CreateFromSyntaxList(StepSyntaxList syntaxList, int id)
        {
            var item = new StepCartesianPoint();

            item.SyntaxList = syntaxList;
            item.Id         = id;
            return((StepCartesianPoint)AssignTo(item, syntaxList));
        }
示例#3
0
        internal static StepVertexPoint CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var vertex = new StepVertexPoint();

            syntaxList.AssertListCount(2);
            vertex.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => vertex.Location = v.AsType <StepCartesianPoint>());
            return(vertex);
        }
示例#4
0
文件: StepPlane.cs 项目: suruz/Step
        internal static StepPlane CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var plane = new StepPlane();

            syntaxList.AssertListCount(2);
            plane.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => plane.Position = v.AsType <StepAxis2Placement3D>());
            return(plane);
        }
示例#5
0
文件: StepLine.cs 项目: suruz/Step
        internal static StepLine CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var line = new StepLine();

            syntaxList.AssertListCount(3);
            line.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => line.Point  = v.AsType <StepCartesianPoint>());
            binder.BindValue(syntaxList.Values[2], v => line.Vector = v.AsType <StepVector>());
            return(line);
        }
示例#6
0
        internal static StepCircle CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var circle = new StepCircle();

            syntaxList.AssertListCount(3);
            circle.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => circle.Position = v.AsType <StepAxis2Placement>());
            circle.Radius = syntaxList.Values[2].GetRealVavlue();
            return(circle);
        }
示例#7
0
        internal static StepFaceBound CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            syntaxList.AssertListCount(3);
            var faceBound = new StepFaceBound();

            faceBound.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => faceBound.Bound = v.AsType <StepLoop>());
            faceBound.Orientation = syntaxList.Values[2].GetBooleanValue();
            return(faceBound);
        }
示例#8
0
        internal static StepAxis2Placement2D CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var axis = new StepAxis2Placement2D();

            syntaxList.AssertListCount(3);
            axis.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => axis.Location     = v.AsType <StepCartesianPoint>());
            binder.BindValue(syntaxList.Values[2], v => axis.RefDirection = v.AsType <StepDirection>());
            return(axis);
        }
示例#9
0
        internal static StepVector CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var vector = new StepVector();

            syntaxList.AssertListCount(3);
            vector.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => vector.Direction = v.AsType <StepDirection>());
            vector.Length = syntaxList.Values[2].GetRealVavlue();
            return(vector);
        }
示例#10
0
        internal static StepClosedShell CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var closedShell = new StepClosedShell();

            closedShell.SyntaxList = syntaxList;
            syntaxList.AssertListCount(2);
            closedShell.Id   = id;
            closedShell.Name = syntaxList.Values[0].GetStringValue();
            closedShell.BindSyntaxList(binder, syntaxList);
            return(closedShell);
        }
示例#11
0
        internal static StepAxis2Placement2D CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var axis = new StepAxis2Placement2D();

            axis.SyntaxList = syntaxList;
            axis.Id         = id;
            syntaxList.AssertListCount(3);
            axis.Name = syntaxList.Values[0].GetStringValue();
            axis.BindSyntaxList(binder, syntaxList, 1);
            return(axis);
        }
示例#12
0
        internal static StepDynamicItem CreateFromSyntaxList(StepBinder binder, StepSimpleItemSyntax stepSimpleSyntax, int id)
        {
            StepSyntaxList syntaxList  = stepSimpleSyntax.Parameters;
            var            dynamicItem = new StepDynamicItem();

            dynamicItem.SyntaxList = syntaxList;
            dynamicItem.Id         = id;
            dynamicItem.Keyword    = stepSimpleSyntax.Keyword;
            dynamicItem.BindSyntaxList(binder, syntaxList, 0);
            return(dynamicItem);
        }
示例#13
0
        internal static StepStyledItem CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var styledItem = new StepStyledItem();

            styledItem.SyntaxList = syntaxList;
            syntaxList.AssertListCount(3);
            styledItem.Id   = id;
            styledItem.Name = syntaxList.Values[0].GetStringValue();
            styledItem.BindSyntaxList(binder, syntaxList, 1);
            return(styledItem);
        }
示例#14
0
文件: StepEllipse.cs 项目: suruz/Step
        internal static StepEllipse CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var ellipse = new StepEllipse();

            syntaxList.AssertListCount(4);
            ellipse.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => ellipse.Position = v.AsType <StepAxis2Placement2D>());
            ellipse.SemiAxis1 = syntaxList.Values[2].GetRealVavlue();
            ellipse.SemiAxis2 = syntaxList.Values[3].GetRealVavlue();
            return(ellipse);
        }
示例#15
0
        internal static StepProduct CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var product = new StepProduct();

            syntaxList.AssertListCount(4);
            product.Id          = id;
            product.Name        = syntaxList.Values[0].GetStringValue();
            product.Description = syntaxList.Values[1].GetStringValue();

            return(product);
        }
示例#16
0
 private void ApplyFileName(StepSyntaxList valueList)
 {
     valueList.AssertListCount(7);
     _file.Name                = valueList.Values[0].GetStringValue();
     _file.Timestamp           = valueList.Values[1].GetDateTimeValue();
     _file.Author              = valueList.Values[2].GetConcatenatedStringValue();
     _file.Organization        = valueList.Values[3].GetConcatenatedStringValue();
     _file.PreprocessorVersion = valueList.Values[4].GetStringValue();
     _file.OriginatingSystem   = valueList.Values[5].GetStringValue();
     _file.Authorization       = valueList.Values[6].GetStringValue();
 }
示例#17
0
        internal static StepCircle CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var circle = new StepCircle();

            circle.SyntaxList = syntaxList;
            circle.Id         = id;
            syntaxList.AssertListCount(3);
            circle.Name = syntaxList.Values[0].GetStringValue();
            circle.BindSyntaxList(binder, syntaxList, 1, 2);
            circle.Radius = syntaxList.Values[2].GetRealVavlue();
            return(circle);
        }
示例#18
0
        internal static StepEdgeCurve CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var edgeCurve = new StepEdgeCurve();

            syntaxList.AssertListCount(5);
            edgeCurve.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => edgeCurve.EdgeStart    = v.AsType <StepVertex>());
            binder.BindValue(syntaxList.Values[2], v => edgeCurve.EdgeEnd      = v.AsType <StepVertex>());
            binder.BindValue(syntaxList.Values[3], v => edgeCurve.EdgeGeometry = v.AsType <StepCurve>());
            edgeCurve.IsSameSense = syntaxList.Values[4].GetBooleanValue();
            return(edgeCurve);
        }
示例#19
0
        internal static StepFillAreaStyle CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var fillAreaStyle = new StepFillAreaStyle();

            fillAreaStyle.SyntaxList = syntaxList;
            syntaxList.AssertListCount(2);
            fillAreaStyle.Id   = id;
            fillAreaStyle.Name = syntaxList.Values[0].GetStringValue();

            fillAreaStyle.BindSyntaxList(binder, syntaxList, 1);
            return(fillAreaStyle);
        }
示例#20
0
文件: StepWriter.cs 项目: suruz/Step
 public StepSyntax GetItemSyntax(StepRepresentationItem item)
 {
     if (_inlineReferences)
     {
         var parameters = new StepSyntaxList(-1, -1, item.GetParameters(this));
         return(new StepSimpleItemSyntax(item.ItemType.GetItemTypeString(), parameters));
     }
     else
     {
         return(new StepEntityInstanceReferenceSyntax(_itemMap[item]));
     }
 }
示例#21
0
        internal static StepTriple AssignTo(StepTriple triple, StepSyntaxList values)
        {
            values.AssertListCount(2);
            triple.Name = values.Values[0].GetStringValue();
            var pointValues = values.Values[1].GetValueList();

            pointValues.AssertListCount(triple.MinimumValueCount, 3);
            triple.X = pointValues.GetRealValueOrDefault(0);
            triple.Y = pointValues.GetRealValueOrDefault(1);
            triple.Z = pointValues.GetRealValueOrDefault(2);
            return(triple);
        }
示例#22
0
        internal static StepOrientedEdge CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var orientedEdge = new StepOrientedEdge();

            syntaxList.AssertListCount(5);
            orientedEdge.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => orientedEdge.EdgeStart   = v.AsType <StepVertex>());
            binder.BindValue(syntaxList.Values[2], v => orientedEdge.EdgeEnd     = v.AsType <StepVertex>());
            binder.BindValue(syntaxList.Values[3], v => orientedEdge.EdgeElement = v.AsType <StepEdge>());
            orientedEdge.Orientation = syntaxList.Values[4].GetBooleanValue();
            return(orientedEdge);
        }
示例#23
0
        internal static StepFaceBound CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            syntaxList.AssertListCount(3);
            var faceBound = new StepFaceBound();

            faceBound.SyntaxList = syntaxList;
            faceBound.Id         = id;
            faceBound.Name       = syntaxList.Values[0].GetStringValue();
            faceBound.BindSyntaxList(binder, syntaxList, 1);
            faceBound.Orientation = syntaxList.Values[2].GetBooleanValue();
            return(faceBound);
        }
示例#24
0
        internal static StepEllipse CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var ellipse = new StepEllipse();

            ellipse.SyntaxList = syntaxList;
            ellipse.Id         = id;
            syntaxList.AssertListCount(4);
            ellipse.Name = syntaxList.Values[0].GetStringValue();
            ellipse.BindSyntaxList(binder, syntaxList, 1, 2);
            ellipse.SemiAxis1 = syntaxList.Values[2].GetRealVavlue();
            ellipse.SemiAxis2 = syntaxList.Values[3].GetRealVavlue();
            return(ellipse);
        }
示例#25
0
        internal static new StepAdvancedFace CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var face = new StepAdvancedFace();

            face.SyntaxList = syntaxList;
            syntaxList.AssertListCount(4);
            face.Id   = id;
            face.Name = syntaxList.Values[0].GetStringValue();
            face.BindSyntaxList(binder, syntaxList, 1, 3);
            face.SameSense = syntaxList.Values[3].GetBooleanValue();

            return(face);
        }
示例#26
0
        internal static StepColourRGB CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var colourRGB = new StepColourRGB();

            syntaxList.AssertListCount(4);
            colourRGB.Id   = id;
            colourRGB.Name = syntaxList.Values[0].GetStringValue();
            colourRGB.R    = syntaxList.Values[1].GetRealVavlue();
            colourRGB.G    = syntaxList.Values[2].GetRealVavlue();
            colourRGB.B    = syntaxList.Values[3].GetRealVavlue();

            return(colourRGB);
        }
示例#27
0
文件: StepWriter.cs 项目: suruz/Step
 private StepSyntax GetItemSyntax(StepRepresentationItem item, int expectedId)
 {
     if (!_itemMap.ContainsKey(item))
     {
         var parameters = new StepSyntaxList(-1, -1, item.GetParameters(this));
         var syntax     = new StepSimpleItemSyntax(item.ItemType.GetItemTypeString(), parameters);
         _itemMap.Add(item, expectedId);
         return(syntax);
     }
     else
     {
         return(GetItemSyntax(item));
     }
 }
示例#28
0
        internal static StepEdgeLoop CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            syntaxList.AssertListCount(2);
            var edgeSyntaxList = syntaxList.Values[1].GetValueList();
            var edgeLoop       = new StepEdgeLoop(string.Empty, new StepOrientedEdge[edgeSyntaxList.Values.Count]);

            edgeLoop.Name = syntaxList.Values[0].GetStringValue();
            for (int i = 0; i < edgeSyntaxList.Values.Count; i++)
            {
                var j = i; // capture to avoid rebinding
                binder.BindValue(edgeSyntaxList.Values[j], v => edgeLoop.EdgeList[j] = v.AsType <StepOrientedEdge>());
            }

            return(edgeLoop);
        }
示例#29
0
 private void ApplyFileSchema(StepSyntaxList valueList)
 {
     valueList.AssertListCount(1);
     foreach (var schemaName in valueList.Values[0].GetValueList().Values.Select(v => v.GetStringValue()))
     {
         StepSchemaTypes schemaType;
         if (StepSchemaTypeExtensions.TryGetSchemaTypeFromName(schemaName, out schemaType))
         {
             _file.Schemas.Add(schemaType);
         }
         else
         {
             _file.UnsupportedSchemas.Add(schemaName);
         }
     }
 }
示例#30
0
        internal static StepSurfaceSideStyle CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var surfaceSideStyle = new StepSurfaceSideStyle();

            syntaxList.AssertListCount(2);
            surfaceSideStyle.Id   = id;
            surfaceSideStyle.Name = syntaxList.Values[0].GetStringValue();

            var referList = syntaxList.Values[1].GetValueList();

            surfaceSideStyle.SurfaceStyleFillAreaList.Clear();
            surfaceSideStyle.SurfaceStyleFillAreaList.AddRange(Enumerable.Range(0, referList.Values.Count).Select(_ => (StepSurfaceStyleFillArea)null));
            for (int i = 0; i < referList.Values.Count; i++)
            {
                var j = i; // capture to avoid rebinding
                binder.BindValue(referList.Values[j], v => surfaceSideStyle.SurfaceStyleFillAreaList[j] = v.AsType <StepSurfaceStyleFillArea>());
            }

            return(surfaceSideStyle);
        }