Exemplo n.º 1
0
        protected void buildTextPrimitives(VPFCoverage coverage, VPFTile tile, VPFPrimitiveData primitiveData)
        {
            VPFBufferedRecordData textTable = this.createPrimitiveTable(coverage, tile, VPFConstants.TEXT_PRIMITIVE_TABLE);

            if (textTable == null || textTable.getNumRecords() == 0)
            {
                return;
            }

            int numText = textTable.getNumRecords();

            VPFPrimitiveData.BasicPrimitiveInfo[] textInfo = new VPFPrimitiveData.BasicPrimitiveInfo[numText];
            VecBufferSequence     coords  = (VecBufferSequence)textTable.getRecordData("shape_line").getBackingData();
            CompoundStringBuilder strings = (CompoundStringBuilder)textTable.getRecordData("string").getBackingData();

            foreach (VPFRecord row in textTable)
            {
                int id = row.getId();

                textInfo[VPFBufferedRecordData.indexFromId(id)] = new VPFPrimitiveData.BasicPrimitiveInfo(
                    VPFBoundingBox.fromVecBuffer(coords.subBuffer(id)));
            }

            primitiveData.setPrimitiveInfo(VPFConstants.TEXT_PRIMITIVE_TABLE, textInfo);
            primitiveData.setPrimitiveCoords(VPFConstants.TEXT_PRIMITIVE_TABLE, coords);
            primitiveData.setPrimitiveStrings(VPFConstants.TEXT_PRIMITIVE_TABLE, strings);
        }
Exemplo n.º 2
0
        protected bool buildNodePrimitives(VPFBufferedRecordData table, String name, VPFPrimitiveData primitiveData)
        {
            int numNodes = table.getNumRecords();

            VPFPrimitiveData.BasicPrimitiveInfo[] nodeInfo = new VPFPrimitiveData.BasicPrimitiveInfo[numNodes];
            VecBufferSequence coords = (VecBufferSequence)table.getRecordData("coordinate").getBackingData();

            foreach (VPFRecord row in table)
            {
                int id = row.getId();

                nodeInfo[VPFBufferedRecordData.indexFromId(id)] = new VPFPrimitiveData.BasicPrimitiveInfo(
                    VPFBoundingBox.fromVecBuffer(coords.subBuffer(id)));
            }

            primitiveData.setPrimitiveInfo(name, nodeInfo);
            primitiveData.setPrimitiveCoords(name, coords);
            return(true);
        }