private GCodeVertexBuffer Create3DDataForLayer(int layerIndex, GCodeRenderInfo renderInfo)
        {
            var colorVertexData  = new VectorPOD <ColorVertexData>();
            var vertexIndexArray = new VectorPOD <int>();

            featureStartIndex[layerIndex].Clear();
            featureEndIndex[layerIndex].Clear();

            for (int i = 0; i < renderFeatures[layerIndex].Count; i++)
            {
                featureStartIndex[layerIndex].Add(vertexIndexArray.Count);

                RenderFeatureBase feature = renderFeatures[layerIndex][i];

                if (feature != null)
                {
                    // Build the color and index data for the feature
                    feature.CreateRender3DData(colorVertexData, vertexIndexArray, renderInfo);
                }

                featureEndIndex[layerIndex].Add(vertexIndexArray.Count);
            }

            // Construct and return the new VertexBuffer object with all color/index data
            return(new GCodeVertexBuffer(vertexIndexArray.Array, colorVertexData.Array));
        }
Example #2
0
        private void Create3DDataForLayer(int layerIndex,
                                          VectorPOD <ColorVertexData> colorVertexData,
                                          VectorPOD <int> vertexIndexArray,
                                          GCodeRenderInfo renderInfo)
        {
            colorVertexData.Clear();
            vertexIndexArray.Clear();
            featureStartIndex[layerIndex].Clear();
            featureEndIndex[layerIndex].Clear();

            for (int i = 0; i < renderFeatures[layerIndex].Count; i++)
            {
                featureStartIndex[layerIndex].Add(vertexIndexArray.Count);
                RenderFeatureBase feature = renderFeatures[layerIndex][i];
                if (feature != null)
                {
                    feature.CreateRender3DData(colorVertexData, vertexIndexArray, renderInfo);
                }
                featureEndIndex[layerIndex].Add(vertexIndexArray.Count);
            }
        }