예제 #1
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);
        }
예제 #2
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);
        }
예제 #3
0
        internal static StepShapeDefinitionRepresentation CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var shapeDefinitionRepresentation = new StepShapeDefinitionRepresentation();

            syntaxList.AssertListCount(2);
            shapeDefinitionRepresentation.Id = id;

            binder.BindValue(syntaxList.Values[0], v => shapeDefinitionRepresentation.DefinitionShape    = v.AsType <StepProductDefinitionShape>());
            binder.BindValue(syntaxList.Values[1], v => shapeDefinitionRepresentation.UsedRepresentation = v.AsType <StepShapeRepresentation>());

            return(shapeDefinitionRepresentation);
        }
예제 #4
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);
        }
예제 #5
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);
        }
예제 #6
0
        internal static StepShapeRepresentationRelationShip CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var shapeRepresentationRelationShip = new StepShapeRepresentationRelationShip();

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

            binder.BindValue(syntaxList.Values[2], v => shapeRepresentationRelationShip.UsedRepresentation = v.AsType <StepShapeRepresentation>());
            binder.BindValue(syntaxList.Values[3], v => shapeRepresentationRelationShip.AdvancedBrepShapeRepresentation = v.AsType <StepAdvancedBrepShapeRepresentation>());

            return(shapeRepresentationRelationShip);
        }
예제 #7
0
        internal static StepNextAssemblyUsageOccrrence CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var assemblyUsageOccrrence = new StepNextAssemblyUsageOccrrence();

            syntaxList.AssertListCount(6);
            assemblyUsageOccrrence.Id          = id;
            assemblyUsageOccrrence.AssembleId  = syntaxList.Values[0].GetStringValue();
            assemblyUsageOccrrence.Name        = syntaxList.Values[1].GetStringValue();
            assemblyUsageOccrrence.Description = syntaxList.Values[2].GetStringValue();

            binder.BindValue(syntaxList.Values[3], v => assemblyUsageOccrrence.Parent = v.AsType <StepProductDefinition>());
            binder.BindValue(syntaxList.Values[4], v => assemblyUsageOccrrence.Child  = v.AsType <StepProductDefinition>());

            return(assemblyUsageOccrrence);
        }
예제 #8
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);
        }
예제 #9
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);
        }
        internal static StepRepresentationItem CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            syntaxList.AssertListCount(3);
            var surface = new StepCylindricalSurface();

            surface.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => surface.Position = v.AsType <StepAxis2Placement3D>());
            surface.Radius = syntaxList.Values[2].GetRealVavlue();
            return(surface);
        }
예제 #11
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);
        }
예제 #12
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);
        }
예제 #13
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);
        }
예제 #14
0
        internal static StepAdvancedFace CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            var face = new StepAdvancedFace();

            syntaxList.AssertListCount(4);
            face.Name = syntaxList.Values[0].GetStringValue();

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

            face.Bounds = new List <StepFaceBound>(new StepFaceBound[boundsList.Values.Count]);
            for (int i = 0; i < boundsList.Values.Count; i++)
            {
                var j = i; // capture to avoid rebinding.
                binder.BindValue(boundsList.Values[j], v => face.Bounds[j] = v.AsType <StepFaceBound>());
            }
            binder.BindValue(syntaxList.Values[2], v => face.FaceGeometry = v.AsType <StepSurface>());
            face.SameSense = syntaxList.Values[3].GetBooleanValue();

            return(face);
        }
예제 #15
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);
        }
예제 #16
0
        internal static StepSurfaceStyleFillArea CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var surfaceStyleFillArea = new StepSurfaceStyleFillArea();

            syntaxList.AssertListCount(1);
            surfaceStyleFillArea.Id = id;

            binder.BindValue(syntaxList.Values[0], v => surfaceStyleFillArea.FillAreaStyle = v.AsType <StepFillAreaStyle>());

            return(surfaceStyleFillArea);
        }
예제 #17
0
        internal static StepManifoldSolidBrep CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var manifoldSolidBrep = new StepManifoldSolidBrep();

            syntaxList.AssertListCount(2);
            manifoldSolidBrep.Id   = id;
            manifoldSolidBrep.Name = syntaxList.Values[0].GetStringValue();
            binder.BindValue(syntaxList.Values[1], v => manifoldSolidBrep.ClosedShell = v.AsType <StepClosedShell>());

            return(manifoldSolidBrep);
        }
        internal static StepFillAreaStyleColour CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var fillAreaStyleColor = new StepFillAreaStyleColour();

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

            binder.BindValue(syntaxList.Values[1], v => fillAreaStyleColor.Colour = v.AsType <StepColourRGB>());

            return(fillAreaStyleColor);
        }
예제 #19
0
        internal static StepSurfaceStyleUsage CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var surfaceStyleUsage = new StepSurfaceStyleUsage();

            syntaxList.AssertListCount(2);
            surfaceStyleUsage.Id   = id;
            surfaceStyleUsage.Side = syntaxList.Values[0].GetEnumerationValue();

            binder.BindValue(syntaxList.Values[1], v => surfaceStyleUsage.SurfaceSideStyle = v.AsType <StepSurfaceSideStyle>());

            return(surfaceStyleUsage);
        }
예제 #20
0
        internal static StepProductDefinitionShape CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var productDefinitionShape = new StepProductDefinitionShape();

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

            binder.BindValue(syntaxList.Values[2], v => productDefinitionShape.Definition = v.AsType <StepComponentAssemble>());

            return(productDefinitionShape);
        }
예제 #21
0
        internal static StepStyledItem CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var styledItem = new StepStyledItem();

            syntaxList.AssertListCount(3);
            styledItem.Id   = id;
            styledItem.Name = syntaxList.Values[0].GetStringValue();

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

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

            binder.BindValue(syntaxList.Values[2], v => styledItem.UsedSolidBrep = v.AsType <StepManifoldSolidBrep>());

            return(styledItem);
        }
        internal static StepProductDefFormationWithSpecSource CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var productDefFormationWithSpecSource = new StepProductDefFormationWithSpecSource();

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

            binder.BindValue(syntaxList.Values[2], v => productDefFormationWithSpecSource.Product = v.AsType <StepProduct>());

            return(productDefFormationWithSpecSource);
        }
예제 #23
0
        internal static StepAdvancedFace CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var face = new StepAdvancedFace();

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

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

            face.Bounds.Clear();
            face.Bounds.AddRange(Enumerable.Range(0, boundsList.Values.Count).Select(_ => (StepFaceBound)null));
            for (int i = 0; i < boundsList.Values.Count; i++)
            {
                var j = i; // capture to avoid rebinding
                binder.BindValue(boundsList.Values[j], v => face.Bounds[j] = v.AsType <StepFaceBound>());
            }
            binder.BindValue(syntaxList.Values[2], v => face.FaceGeometry = v.AsType <StepSurface>());
            face.SameSense = syntaxList.Values[3].GetBooleanValue();

            return(face);
        }
예제 #24
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);
        }
예제 #25
0
        internal static StepPresentationStyleAssignment CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var presentationStyleAssignment = new StepPresentationStyleAssignment();

            syntaxList.AssertListCount(1);
            presentationStyleAssignment.Id = id;

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

            presentationStyleAssignment.StyleUsageList.Clear();
            presentationStyleAssignment.StyleUsageList.AddRange(Enumerable.Range(0, referList.Values.Count).Select(_ => (StepSurfaceStyleUsage)null));
            for (int i = 0; i < referList.Values.Count; i++)
            {
                var j = i;
                binder.BindValue(referList.Values[j], v => presentationStyleAssignment.StyleUsageList[j] = v.AsType <StepSurfaceStyleUsage>());
            }

            return(presentationStyleAssignment);
        }
예제 #26
0
        internal static StepShapeRepresentation CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var shapeRepresentation = new StepShapeRepresentation();

            syntaxList.AssertListCount(3);
            shapeRepresentation.Id   = id;
            shapeRepresentation.Name = syntaxList.Values[0].GetStringValue();
            var referList = syntaxList.Values[1].GetValueList();

            shapeRepresentation.UsedRepresentationItems.Clear();
            shapeRepresentation.UsedRepresentationItems.AddRange(Enumerable.Range(0, referList.Values.Count).Select(_ => (StepRepresentationItem)null));
            for (int i = 0; i < referList.Values.Count; i++)
            {
                var j = i;
                binder.BindValue(referList.Values[j], v => shapeRepresentation.UsedRepresentationItems[j] = v.AsType <StepRepresentationItem>());
            }

            return(shapeRepresentation);
        }
예제 #27
0
        internal static StepClosedShell CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var closedShell = new StepClosedShell();

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

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

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

            return(closedShell);
        }
예제 #28
0
        internal static StepFillAreaStyle CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var fillAreaStyle = new StepFillAreaStyle();

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

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

            fillAreaStyle.FillAreaStyleColours.Clear();
            fillAreaStyle.FillAreaStyleColours.AddRange(Enumerable.Range(0, referList.Values.Count).Select(_ => (StepFillAreaStyleColour)null));
            for (int i = 0; i < referList.Values.Count; i++)
            {
                var j = i;
                binder.BindValue(referList.Values[j], v => fillAreaStyle.FillAreaStyleColours[j] = v.AsType <StepFillAreaStyleColour>());
            }

            return(fillAreaStyle);
        }
예제 #29
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);
        }
예제 #30
0
        internal static StepBSplineCurveWithKnots CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList)
        {
            syntaxList.AssertListCount(9);
            var controlPointsList = syntaxList.Values[2].GetValueList();

            var spline = new StepBSplineCurveWithKnots(string.Empty, new StepCartesianPoint[controlPointsList.Values.Count]);

            spline.Name   = syntaxList.Values[0].GetStringValue();
            spline.Degree = syntaxList.Values[1].GetIntegerValue();

            for (int i = 0; i < controlPointsList.Values.Count; i++)
            {
                var j = i; // capture to avoid rebinding
                binder.BindValue(controlPointsList.Values[j], v => spline.ControlPointsList[j] = v.AsType <StepCartesianPoint>());
            }

            spline.CurveForm     = ParseCurveForm(syntaxList.Values[3].GetEnumerationValue());
            spline.ClosedCurve   = syntaxList.Values[4].GetBooleanValue();
            spline.SelfIntersect = syntaxList.Values[5].GetBooleanValue();

            var knotMultiplicitiesList = syntaxList.Values[6].GetValueList();

            spline.KnotMultiplicities.Clear();
            for (int i = 0; i < knotMultiplicitiesList.Values.Count; i++)
            {
                spline.KnotMultiplicities.Add(knotMultiplicitiesList.Values[i].GetIntegerValue());
            }

            var knotslist = syntaxList.Values[7].GetValueList();

            spline.Knots.Clear();
            for (int i = 0; i < knotslist.Values.Count; i++)
            {
                spline.Knots.Add(knotslist.Values[i].GetRealVavlue());
            }

            spline.KnotSpec = ParseKnotSpec(syntaxList.Values[8].GetEnumerationValue());

            return(spline);
        }