Class TLcdDGNModelListDecoder

java.lang.Object
com.luciad.format.dgn.TLcdDGNModelListDecoder
All Implemented Interfaces:
ILcdDGNModelDecoder, ILcdModelDecoder

public class TLcdDGNModelListDecoder extends Object implements ILcdDGNModelDecoder
This ILcdModelDecoder handles Intergraph Standard File Formats (ISFF, with the extension DGN). Internally, the actual decoding is delegated to either a TLcdDGNModelDecoder or to a user-specified ILcdDGNModelDecoder. The elements of the internally decoded DGN model are returned as a TLcd2DBoundsIndexedModelList. The descriptor of the model list is the same as the descriptor of the internally decoded model. Each component of the model list is a TLcd2DBoundsIndexedModel containing only the elements of a particular DGN level. The descriptors of the list components are copies of the internal DGN model's descriptor, except that the display names are replaced by the name of the corresponding DGN level.
Since:
9.0
See Also:
  • Constructor Details

    • TLcdDGNModelListDecoder

      public TLcdDGNModelListDecoder()
      Creates a new TLcdDGNModelListDecoder which will delegate the decoding to TLcdDGNModelDecoder.
    • TLcdDGNModelListDecoder

      public TLcdDGNModelListDecoder(ILcdDGNModelDecoder aDGNModelDecoder)
      Constructor which delegates the decoding to the given DGN model decoder.
      Parameters:
      aDGNModelDecoder - the DGN model decoder to use
  • Method Details

    • setModelReferenceDecoder

      public void setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the model reference decoder that will be used for creating model references for decoded models.
      Specified by:
      setModelReferenceDecoder in interface ILcdDGNModelDecoder
    • getModelReferenceDecoder

      public ILcdModelReferenceDecoder getModelReferenceDecoder()
      Specified by:
      getModelReferenceDecoder in interface ILcdDGNModelDecoder
    • setDefaultModelReference

      public void setDefaultModelReference(ILcdModelReference aDefaultModelReference)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the default model reference for decoded models, in case the model reference decoder doesn't provide one.
      Specified by:
      setDefaultModelReference in interface ILcdDGNModelDecoder
    • getDefaultModelReference

      public ILcdModelReference getDefaultModelReference()
      Specified by:
      getDefaultModelReference in interface ILcdDGNModelDecoder
    • setDatabaseURL

      public void setDatabaseURL(String aDatabaseURL)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the default database URL that is assigned to all decoded attributes. The URL can then be used by the application.
      Specified by:
      setDatabaseURL in interface ILcdDGNModelDecoder
    • getDatabaseURL

      public String getDatabaseURL()
      Specified by:
      getDatabaseURL in interface ILcdDGNModelDecoder
    • setUseFloat

      public void setUseFloat(boolean aUseFloat)
      Description copied from interface: ILcdDGNModelDecoder
      Specifies whether to use memory-conserving floating point data structures for the decoded models.
      Specified by:
      setUseFloat in interface ILcdDGNModelDecoder
    • isUseFloat

      public boolean isUseFloat()
      Specified by:
      isUseFloat in interface ILcdDGNModelDecoder
    • resetLevelSelection

      public void resetLevelSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Resets the list of DGN levels that is included into decoded models. As a result, all DGN levels will be included in the models when decoding DGN files.
      Specified by:
      resetLevelSelection in interface ILcdDGNModelDecoder
    • clearLevelSelection

      public void clearLevelSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Clears the list of DGN levels that is included into decoded models. As a result, only level 0 will be included in the models when decoding DGN files.
      Specified by:
      clearLevelSelection in interface ILcdDGNModelDecoder
      See Also:
    • setLevelSelection

      public void setLevelSelection(int[] aLevels)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the list of DGN levels that is included into all decoded models. Level 0 is always included, irrespective of the selection setting.
      Specified by:
      setLevelSelection in interface ILcdDGNModelDecoder
      Parameters:
      aLevels - the levels to be included in the decoded models. They can be listed in any order, and duplicate numbers are allowed.
    • addLevel

      public void addLevel(int aLevel)
      Description copied from interface: ILcdDGNModelDecoder
      Adds a level to the list of DGN levels that is included into all decoded models.
      Specified by:
      addLevel in interface ILcdDGNModelDecoder
      Parameters:
      aLevel - the level to be included in the decoded models.
    • clearLevelNameSelection

      public void clearLevelNameSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Clears the list of names of DGN levels that are to be included into all decoded models. As a result, only levels specified in the numeric level selection will be included.
      Specified by:
      clearLevelNameSelection in interface ILcdDGNModelDecoder
      See Also:
    • setLevelNameSelection

      public void setLevelNameSelection(String[] aLevelNames)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the list of names of DGN levels that are to be included into all decoded models, in addition to the numeric level selection.
      Specified by:
      setLevelNameSelection in interface ILcdDGNModelDecoder
      Parameters:
      aLevelNames - the names of levels to be included in the decoded models. They can be listed in any order, and duplicate names are allowed.
    • addLevelName

      public void addLevelName(String aLevelName)
      Description copied from interface: ILcdDGNModelDecoder
      Adds a name of a DGN level to the list of names of DGN levels that are to be included into all decoded models, in addition to the numeric level selection.
      Specified by:
      addLevelName in interface ILcdDGNModelDecoder
      Parameters:
      aLevelName - the name of the level to be included in the decoded models.
    • resetElementClassSelection

      public void resetElementClassSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Resets the list of DGN element classes that is included into decoded models; As a result, all DGN element classes will be included in the models when decoding DGN files.
      Specified by:
      resetElementClassSelection in interface ILcdDGNModelDecoder
    • setElementClassSelection

      public void setElementClassSelection(int aElementClasses)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the list of element classes that is included into decoded models. This property allows to exclude certain classes from the decoded models, e.g. construction elements.
      Specified by:
      setElementClassSelection in interface ILcdDGNModelDecoder
      Parameters:
      aElementClasses - a bitmask, specifying the element classes to be included in the decoded models. It is a logical OR of 1-bits that are shifted left by the following constants:
      • TLcdDGNDisplayInfo.CLASS_PRIMARY
      • TLcdDGNDisplayInfo.CLASS_PATTERN
      • TLcdDGNDisplayInfo.CLASS_CONSTRUCTION
      • TLcdDGNDisplayInfo.CLASS_DIMENSION
      • TLcdDGNDisplayInfo.CLASS_PRIMARY_RULE
      • TLcdDGNDisplayInfo.CLASS_LINEAR_PATTERN
      • TLcdDGNDisplayInfo.CLASS_CONSTRUCTION_RULE
    • getElementClassSelection

      public int getElementClassSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Gets the the bitmask specifying list of element classes that is included into decoded models.
      Specified by:
      getElementClassSelection in interface ILcdDGNModelDecoder
    • setElementClassSelection

      public void setElementClassSelection(int[] aElementClasses)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the list of element classes that is included into decoded models. This property allows to exclude certain classes from the decoded models, e.g. construction elements.
      Specified by:
      setElementClassSelection in interface ILcdDGNModelDecoder
      Parameters:
      aElementClasses - the element classes to be included in the decoded models. They can be listed in any order, and duplicate entries are allowed.

      The available DGN element classes are

      • TLcdDGNDisplayInfo.CLASS_PRIMARY
      • TLcdDGNDisplayInfo.CLASS_PATTERN
      • TLcdDGNDisplayInfo.CLASS_CONSTRUCTION
      • TLcdDGNDisplayInfo.CLASS_DIMENSION
      • TLcdDGNDisplayInfo.CLASS_PRIMARY_RULE
      • TLcdDGNDisplayInfo.CLASS_LINEAR_PATTERN
      • TLcdDGNDisplayInfo.CLASS_CONSTRUCTION_RULE
      See Also:
    • addElementClass

      public void addElementClass(int aElementClass)
      Description copied from interface: ILcdDGNModelDecoder
      Adds an element class to the list of element classes that is included into decoded models. This property allows to exclude certain classes from the decoded models, e.g. construction elements.
      Specified by:
      addElementClass in interface ILcdDGNModelDecoder
      Parameters:
      aElementClass - the element class to be included in the decoded models.

      The available DGN element classes are

      • TLcdDGNDisplayInfo.CLASS_PRIMARY
      • TLcdDGNDisplayInfo.CLASS_PATTERN
      • TLcdDGNDisplayInfo.CLASS_CONSTRUCTION
      • TLcdDGNDisplayInfo.CLASS_DIMENSION
      • TLcdDGNDisplayInfo.CLASS_PRIMARY_RULE
      • TLcdDGNDisplayInfo.CLASS_LINEAR_PATTERN
      • TLcdDGNDisplayInfo.CLASS_CONSTRUCTION_RULE
    • resetUserAttributeTypeSelection

      public void resetUserAttributeTypeSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Resets the set of DGN MSLINK attributes that is decoded. All MSLINK attributes will now be included in the models when decoding DGN files.
      Specified by:
      resetUserAttributeTypeSelection in interface ILcdDGNModelDecoder
      See Also:
    • clearUserAttributeTypeSelection

      public void clearUserAttributeTypeSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Clears the set of DGN MSLINK attributes that is decoded. None of the MSLINK attributes will now be included in the models when decoding DGN files.
      Specified by:
      clearUserAttributeTypeSelection in interface ILcdDGNModelDecoder
      See Also:
    • setUserAttributeTypeSelection

      public void setUserAttributeTypeSelection(String[] aTypes)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the set of DGN MSLINK attributes that is decoded. Only MSLINK attributes with the specified types will now be included in the models when decoding DGN files.

      Note that the attribute entities to be decoded have to be specified as well, using the addAttributeEntity method.

      Specified by:
      setUserAttributeTypeSelection in interface ILcdDGNModelDecoder
      Parameters:
      aTypes - a list of MSLINK attribute types, specified as numbers in RAD50 format (strings of length 3, e.g. "ODB"). Note that RAD50 is actually radix 40, with the following 40 digits: <space> A...Z $ . 0...9
    • setUserAttributeTypeSelection

      public void setUserAttributeTypeSelection(int[] aTypes)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the set of DGN MSLINK attributes that is decoded. Only MSLINK attributes with the specified types will now be included in the models when decoding DGN files.
      Specified by:
      setUserAttributeTypeSelection in interface ILcdDGNModelDecoder
      Parameters:
      aTypes - a list of MSLINK attribute types, specified as integers (unsigned shorts, e.g. 0x5e62, which corresponds to 'ODB' in radix 50).
      See Also:
    • addUserAttributeType

      public void addUserAttributeType(String aType)
      Description copied from interface: ILcdDGNModelDecoder
      Adds a DGN MSLINK attribute type to the set of types that is decoded.
      Specified by:
      addUserAttributeType in interface ILcdDGNModelDecoder
      Parameters:
      aType - an MSLINK attribute type specified as a number in RAD50 format (a string of length 3, e.g. "ODB"). Note that RAD50 is actually radix 40, with the following 40 digits: <space> A...Z $ . 0...9
      See Also:
    • addUserAttributeType

      public void addUserAttributeType(int aType)
      Description copied from interface: ILcdDGNModelDecoder
      Adds a DGN MSLINK attribute type to the set of types that is decoded. Only MSLINK attributes that have types in this set are decoded.

      Note that the attribute entities to be decoded have to be specified as well, using the addAttributeEntity method.

      Specified by:
      addUserAttributeType in interface ILcdDGNModelDecoder
      Parameters:
      aType - an MSLINK attribute type specified as an integer (an unsigned short, e.g. 0x5e62, which corresponds to 'ODB' in radix 50).
      See Also:
    • resetAttributeEntitySelection

      public void resetAttributeEntitySelection()
      Description copied from interface: ILcdDGNModelDecoder
      Resets the set of DGN database attributes that is decoded. All DGN database attributes will now be included in the models when decoding DGN files.
      Specified by:
      resetAttributeEntitySelection in interface ILcdDGNModelDecoder
      See Also:
    • clearAttributeEntitySelection

      public void clearAttributeEntitySelection()
      Description copied from interface: ILcdDGNModelDecoder
      Clears the set of DGN database attributes that is decoded. None of the DGN database attributes will now be included in the models when decoding DGN files.
      Specified by:
      clearAttributeEntitySelection in interface ILcdDGNModelDecoder
      See Also:
    • setAttributeEntitySelection

      public void setAttributeEntitySelection(int[] aEntities)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the set of DGN database attributes that is decoded. Only DGN database attributes with the specified entity numbers will now be included in the models when decoding DGN files.
      Specified by:
      setAttributeEntitySelection in interface ILcdDGNModelDecoder
      Parameters:
      aEntities - a list of entity numbers of database attributes (user or non-user).
    • addAttributeEntity

      public void addAttributeEntity(int aEntity)
      Description copied from interface: ILcdDGNModelDecoder
      Adds an attribute entity number to the set of numbers that is decoded. Only attributes that have entity numbers in this set are decoded.

      Note that, for decoding user attributes, the user attribute types to be decoded have to be specified as well, using the addUserAttributeType method.

      Also note that the fill color, which is also stored as an element attribute, is an exception: it is always decoded as part of the display info.

      Specified by:
      addAttributeEntity in interface ILcdDGNModelDecoder
      Parameters:
      aEntity - an entity number of an database attribute (user or non-user).
    • resetTagSetSelection

      public void resetTagSetSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Resets the set of DGN tag sets that is decoded. All tag sets and their attributes will now be included in the models when decoding DGN files.
      Specified by:
      resetTagSetSelection in interface ILcdDGNModelDecoder
      See Also:
    • clearTagSetSelection

      public void clearTagSetSelection()
      Description copied from interface: ILcdDGNModelDecoder
      Clears the set of DGN tag sets that is decoded. None of the tag sets will now be included in the models when decoding DGN files.
      Specified by:
      clearTagSetSelection in interface ILcdDGNModelDecoder
      See Also:
    • setTagSetSelection

      public void setTagSetSelection(String[] aTagSetNames)
      Description copied from interface: ILcdDGNModelDecoder
      Sets the set of DGN tag attributes that is decoded. Only the specified tag sets and their attributes will now be included in the models when decoding DGN files.
      Specified by:
      setTagSetSelection in interface ILcdDGNModelDecoder
      Parameters:
      aTagSetNames - a list of tag set names.
    • addTagSet

      public void addTagSet(String aTagSetName)
      Description copied from interface: ILcdDGNModelDecoder
      Adds a tag set name to the set of names that is decoded. Only the specified tag sets and their attributes will now be included in the models when decoding DGN files.
      Specified by:
      addTagSet in interface ILcdDGNModelDecoder
      Parameters:
      aTagSetName - a tag set name.
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Description copied from interface: ILcdModelDecoder
      Checks whether this model decoder can decode the specified data source. It is acceptable for this method to return true for a source name while decode throws an exception for that same source name.

      For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.

      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be verified; typically a file name or a URL.
      Returns:
      true if this decoder can likely decode the data specified by the source name, false otherwise.
      See Also:
    • decode

      public ILcdModel decode(String aSourceName) throws IOException
      Returns a TLcd2DBoundsIndexedModelList whose elements are of type TLcd2DBoundsIndexedModel. Each model in the list corresponds to a single DGN level.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSourceName - the name of the file to decode
      Returns:
      a list of submodels
      Throws:
      IOException
      See Also: