com.partnersoft.formats.dxf
Interface DxfStructure

All Known Implementing Classes:
DxfAttrib, DxfConfigurableStructure, DxfEndSec, DxfEntity, DxfEof, DxfInsert, DxfLWPolyline, DxfPolyline, DxfSection, DxfSeqEnd, DxfVertex

public interface DxfStructure

Any data structure or marker in a DXF file. DXFStructures are composed of a sequence of DXFGroups.

The term DxfStructure is not ideal, but unfortunately DXF has its own terminology, where there are "entities", "objects", or, alternately, "graphical objects" and "non-graphical objects". Add to this "object data" and the "objects section". Thus, the most abstract type for these data items cannot reasonably be called DXFObject.

In fact, the specification doesn't really have a term for this abstraction; the idea of a data item composed of a list of groups. There are many examples of the subclasses but none of what the generalization might be.

Our DxfStructure has the following behavior:

Early DXF specifications seemed to have the design goal that the order of groups within a structure was not important, and where no two groups with the same code appear. Later ones have changed this; consider e.g. the addition of LWPOLYLINE where repeating groups with codes 10, 20, and optionally 30 describe the x, y, and z of each vertex, and where the order of these in the LWPOLYLINE entity define the order they are in the polyline itself.

Copyright 2006 Partner Software, Inc.

Version:
$Id: DxfStructure.java 2328 2010-01-06 15:38:22Z paul $
Author:
Paul Reavis

Method Summary
 java.util.List<DxfGroup> getGroups(DxfVersion version)
          Get the internal state as DXFGroups.
 java.lang.String getType()
          The type name of this structure.
 void setGroups(java.util.List<DxfGroup> groups)
          Set the internal state based on the given groups.
 

Method Detail

getType

java.lang.String getType()
The type name of this structure. Generally this will be the same for all instances of the same implementing Java class, so a typical example might be:
 \/**
  * Type name of this structure. Always returns "POINT".
  * \@return "POINT"
  *\/
 public String getType() {
     return "POINT";
 }
 

Returns:
type name of structure as defined in AutoCAD DXF specification

setGroups

void setGroups(java.util.List<DxfGroup> groups)
Set the internal state based on the given groups.

Parameters:
groups - list of groups containing data for this structure

getGroups

java.util.List<DxfGroup> getGroups(DxfVersion version)
Get the internal state as DXFGroups.

Returns:
list of groups containing the state data for this structure