Beispiel #1
0
        private void  FromJson_Vertex(List <float> vertex, BxCmSeparatePatch_Surface surface)
        {
            ushort dstCnt = 0;

            foreach (float val in vertex)
            {
                byte dstIdx = ( byte )(dstCnt / 3);
                byte dstMod = ( byte )(dstCnt % 3);

                switch (dstMod)
                {
                case 0:
                    surface.Vertex[dstIdx].Pos.X = val;
                    break;

                case 1:
                    surface.Vertex[dstIdx].Pos.Y = val;
                    break;

                default:
                    Debug.Assert(dstMod == 2);
                    surface.Vertex[dstIdx].Pos.Z = val;
                    break;
                }

                dstCnt++;
            }
            Debug.Assert(dstCnt == (4 * 3));
        }
Beispiel #2
0
        private bool  FromJson_TNodeType(JsonPatchInfo_TNodeType tNodeType, BxCmSeparatePatch_Surface surface)
        {
            if (tNodeType.edge00 == null || tNodeType.edge01 == null || tNodeType.edge10 == null || tNodeType.edge11 == null)
            {
                return(false);
            }

            surface.TNodeType[0][0] = FromJson_TNodeTypeOne(tNodeType.edge00);
            surface.TNodeType[0][1] = FromJson_TNodeTypeOne(tNodeType.edge01);
            surface.TNodeType[1][0] = FromJson_TNodeTypeOne(tNodeType.edge10);
            surface.TNodeType[1][1] = FromJson_TNodeTypeOne(tNodeType.edge11);

            return(true);
        }
Beispiel #3
0
        private bool  FromJson_SurfaceEdge(JsonPatchInfo_SurfaceEdge surfaceEdge, BxCmSeparatePatch_Surface surface)
        {
            if (surfaceEdge.bez00 == null || surfaceEdge.bez01 == null || surfaceEdge.bez10 == null || surfaceEdge.bez11 == null)
            {
                return(false);
            }

            FromJson_SurfaceEdgeOne(surfaceEdge.bez00, surface.SurfaceEdge[0][0]);
            FromJson_SurfaceEdgeOne(surfaceEdge.bez01, surface.SurfaceEdge[0][1]);
            FromJson_SurfaceEdgeOne(surfaceEdge.bez10, surface.SurfaceEdge[1][0]);
            FromJson_SurfaceEdgeOne(surfaceEdge.bez11, surface.SurfaceEdge[1][1]);

            return(true);
        }
Beispiel #4
0
        private bool  FromJson_PreDivided(string preDivided, BxCmSeparatePatch_Surface surface)
        {
            if (preDivided == null)
            {
                return(false);
            }

            if (preDivided == "true")
            {
                surface.PreDivided = true;
            }
            else
            {
                Debug.Assert(preDivided == "false");
                surface.PreDivided = false;
            }

            return(true);
        }