Examples of DXFBlockReference


Examples of org.geotools.data.dxf.header.DXFBlockReference

        _entForUpdate.add(obj);
    }

    // Use only once!
    public void updateRefBlock() {
        DXFBlockReference bro = null;
        int numInserts = 0;

        for (int i = 0; i < _entForUpdate.size(); i++) {
            bro = _entForUpdate.get(i);
            boolean isInsert = false;

            if (bro instanceof DXFInsert) {
                numInserts++;
                isInsert = true;
            }

            if (!insertsFound.containsKey(bro._blockName)) {
                insertsFound.put(bro._blockName, false);
            }

            DXFBlock b = findBlock(bro._blockName);

            if (b != null && bro.getType() != GeometryType.UNSUPPORTED) {
                double x = b._point.X();
                double y = b._point.Y();

                if (isInsert) {
                    DXFPoint entPoint = ((DXFInsert) bro)._point;
                    x = entPoint._point.getX();
                    y = entPoint._point.getY();
                }

                Vector<DXFEntity> refBlockEntities = b.theEntities;
                if (refBlockEntities != null) {
                    Iterator it = refBlockEntities.iterator();
                    while (it.hasNext()) {
                        // Create clone if blockEntity is a insert
                        DXFEntity e = ((isInsert) ? ((DXFEntity) it.next()).clone() : (DXFEntity) it.next());

                        if (isInsert) {
                            e.setBase(((DXFInsert) bro)._point.toCoordinate());
                            e.setAngle(((DXFInsert) bro)._angle);
                        }

                        e.updateGeometry();
                        theEntities.add(e);
                    }
                }
            } else {
                log.error("Can not update refblock: " + bro.getName() + " - " + bro._blockName + " at " + bro.getStartingLineNumber());
            }

            if (!isInsert) {
                theEntities.remove(bro);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.