Class TLcdDGNModelDecoder
- All Implemented Interfaces:
ILcdDGNModelDecoder,ILcdInputStreamFactoryCapable,ILcdModelDecoder
Input files
| File | Required | Entry point | Description |
|---|---|---|---|
| *.dgn | x | x | Design file (V7 or V8) containing vector data |
Model reference
The model reference is obtained from anILcdModelReferenceDecoder. The default reference decoder set on this
model decoder is based on all model reference decoders annotated with the LcdService annotation, and can handle
- EPSG references (
<filename>.epsg): seeTLcdEPSGModelReferenceDecoderfor more info. - WKT references (
<filename>.prj): seeTLcdWKTModelReferenceDecoderfor more info. - Luciad encoded model references (
<filename>.ref): seeTLcdModelReferenceDecoderfor more info.
Supported file transfer protocols
- This model decoder supports currently only supports reading data from files.
Model structure
- This model decoder creates a model per DGN file.
- All models returned by this model decoder implement
ILcd2DBoundsIndexedModel. - The models are expose any DGN tags through its data model. See further for more details.
Model descriptor
- All models returned by this model decoder have a
TLcdDGNModelDescriptor. Among other information, the descriptor contains the DGN symbology. - The type name of the model descriptor is the display name of this decoder.
- The model descriptor returned by this model decoder is a
TLcdDataModelDescriptor. Its data model exposes the DGN tags in a uniform way.
Model elements
- Decoded models contain elements that all implement
ILcdDGNShape. - All elements are
ILcdDataObjects. If the element has any tags associated with it, the data object is a "TagSet" with property "Tags" that is a list of "AbstractTag" entities.
| DGN element type | DGN element name | Decoded object |
|---|---|---|
| 1 | LIBRARY_CELL | |
| 2 | CELL | |
| 3 | LINE | |
| 4 | LINE_STRING | |
| 5 | GROUP_DATA | |
| 6 | SHAPE | |
| 7 | TEXT_NODE | |
| 9 | DESIGN_SETTINGS | |
| 10 | LEVEL_SYMBOLOGY | |
| 11 | CURVE | |
| 12 | COMPLEX_CHAIN | |
| 14 | COMPLEX_SHAPE | |
| 15 | ELLIPSE | |
| 16 | ARC | |
| 17 | TEXT | |
| 18 | 3D_SURFACE | |
| 19 | SOLID | |
| 33 | DIMENSION (note) | |
| 34 | SHARED_CELL_DEFINITION | |
| 35 | SHARED_CELL_INSTANCE | |
| 36 | CELL_MULTI_LINE | |
| 37 | TAG_DATA |
| DGN element type | DGN element name |
|---|---|
| 8 | DIGITIZER_SETUP |
| 13 | CONIC |
| 20 | SUBFIGURE |
| 21 | B_SPLINE_CURVE |
| 22 | POINT_STRING |
| 23 | CONE |
| 24 | B_SPLINE_SURFACE |
| 25 | B_SPLINE_BOUNDARY |
| 26 | B_SPLINE_KNOT |
| 27 | B_SPLINE_WEIGHT |
| 28 | B_SPLINE |
| 33 | DIMENSION |
| 66 | APPLICATION |
| 87 | RASTER_HEADER |
| 88 | RASTER_DATA |
Useful settings
- By default, all element levels are decoded. You can restrict the decoding to the levels you are interested in, using the following methods:
- If you have restricted the levels to be decoded, you can still specify additional levels based on their names, using the following methods:
- By default, all element classes are decoded. You can restrict the decoding to the classes you are interested in, using the following methods:
- By default, no MSLINK attributes are decoded. You can control the decoding of MSLINK attributes based on the database types you are interested in, using the following methods: In addition, you will need to specify the entity numbers you are interested in, as described in the following paragraph.
- By default, no database attributes (either MSLINK or DMRS) are decoded. You can control the decoding of database attributes based on the database entity numbers you are interested in, using the following methods:
- By default, no tag attributes are decoded. You can control the decoding of tag attributes based on the tag set names, using the following methods: All decoded element attributes can have a String containing a URL assigned to them, for the convenience of the application that uses the decoder:
- The implementation was highly modified in version 10.1. The pre-10.1 implementation
is still available and can be activated using system property
dgn.decoder.legacy=true.
Sample code
ILcdModelDecoder decoder =
new TLcdDGNNativeModelDecoder(new TLcdEPSGModelReferenceDecoder(),
new TLcdGeodeticReference(new TLcdGeodeticDatum()));
ILcdModel model = decoder.decode("vectordata.dgn");
Performance tips
- By default, attributes are not decoded, potentially saving some memory and some processing time.
Thread safety
- The decoding of models is not thread-safe.
- The decoded models are thread-safe for read access.
Supported versions and specifications
- DGN V7
- DGN V8
Known limitations
- The current implementation does not support splines, 3D surfaces, and rasters.
- The current implementation will bypass the ILcdInputStreamFactory if the source is
a regular file that can be read locally. If the source cannot be read locally (e.g. it
is a URL) the source is copied to a local temp file before decoding, using the
ILcdInputStreamFactory.
Note that you can force the decoder to always use the input stream factory
using system property
dgn.decoder.alwaysuseinputstream=true. - The current implementation does not support user-defined fonts.
- The symbology of the model elements corresponds to the first DGN view.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTLcdDGNModelDecoder.TLcdDGNModelDecoder(ILcdModelReference aDefaultModelReference) Creates a newTLcdDGNModelDecoder.TLcdDGNModelDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder) Creates a newTLcdDGNModelDecoder.TLcdDGNModelDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder, ILcdModelReference aDefaultModelReference) Creates a newTLcdDGNModelDecoder. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttributeEntity(int aEntity) Adds an attribute entity number to the set of numbers that is decoded.voidaddElementClass(int aElementClass) Adds an element class to the list of element classes that is included into decoded models.voidaddLevel(int aLevel) Adds a level to the list of DGN levels that is included into all decoded models.voidaddLevelName(String aLevelName) 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.voidAdds a tag set name to the set of names that is decoded.voidaddUserAttributeType(int aType) Adds a DGN MSLINK attribute type to the set of types that is decoded.voidaddUserAttributeType(String aType) Adds a DGN MSLINK attribute type to the set of types that is decoded.booleancanDecodeSource(String aSourceAsString) Checks whether this model decoder can decode the specified data source.voidClears the set of DGN database attributes that is decoded.voidClears the list of names of DGN levels that are to be included into all decoded models.voidClears the list of DGN levels that is included into decoded models.voidClears the set of DGN tag sets that is decoded.voidClears the set of DGN MSLINK attributes that is decoded.voidclearUserDefinedFont(int aFontIndex) Creates a new model from the given data source.int[]Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.intGets the the bitmask specifying list of element classes that is included into decoded models.Returns the input stream factory that is used.String[]longDeprecated.the returned value is limited to the first 64 levels.Deprecated.int[]String[]int[]booleanisLevelSelected(int aLevel) booleanvoidResets the set of DGN database attributes that is decoded.voidResets 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.voidResets the list of DGN levels that is included into decoded models.voidResets the set of DGN tag sets that is decoded.voidResets the set of DGN MSLINK attributes that is decoded.voidsetAttributeEntitySelection(int[] aEntities) Sets the set of DGN database attributes that is decoded.voidsetDatabaseURL(String aDatabaseURL) Sets the default database URL that is assigned to all decoded attributes.voidsetDefaultModelReference(ILcdModelReference aDefaultModelReference) Sets the default model reference for decoded models, in case the model reference decoder doesn't provide one.voidsetElementClassSelection(int aElementClasses) Sets the list of element classes that is included into decoded models.voidsetElementClassSelection(int[] aElementClasses) Sets the list of element classes that is included into decoded models.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.voidsetLevelNameSelection(String[] aLevelNames) Sets the list of names of DGN levels that are to be included into all decoded models, in addition to the numeric level selection.voidsetLevelSelection(int[] aLevels) Sets the list of DGN levels that is included into all decoded models.voidsetLevelSelection(long aLevels) Deprecated.this method is limited to the first 64 levels.voidsetModelReference(ILcdModelReference aDefaultModelReference) Deprecated.voidsetModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder) Sets the model reference decoder that will be used for creating model references for decoded models.voidsetTagSetSelection(String[] aTagSetNames) Sets the set of DGN tag attributes that is decoded.voidsetUseFloat(boolean aUseFloat) Specifies whether to use memory-conserving floating point data structures for the decoded models.voidsetUserAttributeTypeSelection(int[] aTypes) Sets the set of DGN MSLINK attributes that is decoded.voidsetUserAttributeTypeSelection(String[] aTypes) Sets the set of DGN MSLINK attributes that is decoded.voidsetUserDefinedFont(int aFontIndex, String aFontFileName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdDGNModelDecoder
public TLcdDGNModelDecoder()Creates a newTLcdDGNModelDecoder. -
TLcdDGNModelDecoder
Creates a newTLcdDGNModelDecoder.- Parameters:
aModelReferenceDecoder- the model reference decoder that can assign references to decoded models.
-
TLcdDGNModelDecoder
Creates a newTLcdDGNModelDecoder.- Parameters:
aDefaultModelReference- the model reference that decoded models will get if the model reference decoder can't decode one.
-
TLcdDGNModelDecoder
public TLcdDGNModelDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder, ILcdModelReference aDefaultModelReference) Creates a newTLcdDGNModelDecoder.- Parameters:
aModelReferenceDecoder- the model reference decoder that can assign references to decoded models.aDefaultModelReference- the model reference that decoded models will get if the model reference decoder can't decode one.
-
-
Method Details
-
clearUserDefinedFont
public void clearUserDefinedFont(int aFontIndex) -
setUserDefinedFont
- Throws:
IOException
-
setInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableSets the input stream factory to be used.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableReturns the input stream factory that is used.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the input stream factory that is used.
-
setModelReferenceDecoder
Description copied from interface:ILcdDGNModelDecoderSets the model reference decoder that will be used for creating model references for decoded models.- Specified by:
setModelReferenceDecoderin interfaceILcdDGNModelDecoder
-
getModelReferenceDecoder
- Specified by:
getModelReferenceDecoderin interfaceILcdDGNModelDecoder
-
setDefaultModelReference
Description copied from interface:ILcdDGNModelDecoderSets the default model reference for decoded models, in case the model reference decoder doesn't provide one.- Specified by:
setDefaultModelReferencein interfaceILcdDGNModelDecoder
-
getDefaultModelReference
- Specified by:
getDefaultModelReferencein interfaceILcdDGNModelDecoder
-
setModelReference
Deprecated. -
getModelReference
Deprecated. -
setDatabaseURL
Description copied from interface:ILcdDGNModelDecoderSets the default database URL that is assigned to all decoded attributes. The URL can then be used by the application.- Specified by:
setDatabaseURLin interfaceILcdDGNModelDecoder
-
getDatabaseURL
- Specified by:
getDatabaseURLin interfaceILcdDGNModelDecoder
-
setUseFloat
public void setUseFloat(boolean aUseFloat) Description copied from interface:ILcdDGNModelDecoderSpecifies whether to use memory-conserving floating point data structures for the decoded models.- Specified by:
setUseFloatin interfaceILcdDGNModelDecoder
-
isUseFloat
public boolean isUseFloat()- Specified by:
isUseFloatin interfaceILcdDGNModelDecoder
-
resetLevelSelection
public void resetLevelSelection()Description copied from interface:ILcdDGNModelDecoderResets 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:
resetLevelSelectionin interfaceILcdDGNModelDecoder
-
clearLevelSelection
public void clearLevelSelection()Description copied from interface:ILcdDGNModelDecoderClears 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:
clearLevelSelectionin interfaceILcdDGNModelDecoder- See Also:
-
setLevelSelection
public void setLevelSelection(long aLevels) Deprecated.this method is limited to the first 64 levels. Starting with DGN version 8, this is no longer sufficient. UsesetLevelSelection(long)oraddLevel(int)instead. -
getLevelSelection
public long getLevelSelection()Deprecated.the returned value is limited to the first 64 levels. Starting with DGN version 8, this is no longer sufficient. UseisLevelSelected(int)orgetSelectedLevels()instead. -
setLevelSelection
public void setLevelSelection(int[] aLevels) Description copied from interface:ILcdDGNModelDecoderSets the list of DGN levels that is included into all decoded models. Level 0 is always included, irrespective of the selection setting.- Specified by:
setLevelSelectionin interfaceILcdDGNModelDecoder- 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:ILcdDGNModelDecoderAdds a level to the list of DGN levels that is included into all decoded models.- Specified by:
addLevelin interfaceILcdDGNModelDecoder- Parameters:
aLevel- the level to be included in the decoded models.
-
clearLevelNameSelection
public void clearLevelNameSelection()Description copied from interface:ILcdDGNModelDecoderClears 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:
clearLevelNameSelectionin interfaceILcdDGNModelDecoder- See Also:
-
setLevelNameSelection
Description copied from interface:ILcdDGNModelDecoderSets 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:
setLevelNameSelectionin interfaceILcdDGNModelDecoder- 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.
-
getLevelNameSelection
-
addLevelName
Description copied from interface:ILcdDGNModelDecoderAdds 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:
addLevelNamein interfaceILcdDGNModelDecoder- Parameters:
aLevelName- the name of the level to be included in the decoded models.
-
resetElementClassSelection
public void resetElementClassSelection()Description copied from interface:ILcdDGNModelDecoderResets 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:
resetElementClassSelectionin interfaceILcdDGNModelDecoder
-
setElementClassSelection
public void setElementClassSelection(int aElementClasses) Description copied from interface:ILcdDGNModelDecoderSets 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:
setElementClassSelectionin interfaceILcdDGNModelDecoder- 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:ILcdDGNModelDecoderGets the the bitmask specifying list of element classes that is included into decoded models.- Specified by:
getElementClassSelectionin interfaceILcdDGNModelDecoder
-
setElementClassSelection
public void setElementClassSelection(int[] aElementClasses) Description copied from interface:ILcdDGNModelDecoderSets 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:
setElementClassSelectionin interfaceILcdDGNModelDecoder- 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:ILcdDGNModelDecoderAdds 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:
addElementClassin interfaceILcdDGNModelDecoder- 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:ILcdDGNModelDecoderResets 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:
resetUserAttributeTypeSelectionin interfaceILcdDGNModelDecoder- See Also:
-
clearUserAttributeTypeSelection
public void clearUserAttributeTypeSelection()Description copied from interface:ILcdDGNModelDecoderClears 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:
clearUserAttributeTypeSelectionin interfaceILcdDGNModelDecoder- See Also:
-
setUserAttributeTypeSelection
Description copied from interface:ILcdDGNModelDecoderSets 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
addAttributeEntitymethod.- Specified by:
setUserAttributeTypeSelectionin interfaceILcdDGNModelDecoder- 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:ILcdDGNModelDecoderSets 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:
setUserAttributeTypeSelectionin interfaceILcdDGNModelDecoder- 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:
-
getUserAttributeTypeSelection
public int[] getUserAttributeTypeSelection() -
addUserAttributeType
Description copied from interface:ILcdDGNModelDecoderAdds a DGN MSLINK attribute type to the set of types that is decoded.- Specified by:
addUserAttributeTypein interfaceILcdDGNModelDecoder- 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:ILcdDGNModelDecoderAdds 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
addAttributeEntitymethod.- Specified by:
addUserAttributeTypein interfaceILcdDGNModelDecoder- 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:ILcdDGNModelDecoderResets 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:
resetAttributeEntitySelectionin interfaceILcdDGNModelDecoder- See Also:
-
clearAttributeEntitySelection
public void clearAttributeEntitySelection()Description copied from interface:ILcdDGNModelDecoderClears 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:
clearAttributeEntitySelectionin interfaceILcdDGNModelDecoder- See Also:
-
setAttributeEntitySelection
public void setAttributeEntitySelection(int[] aEntities) Description copied from interface:ILcdDGNModelDecoderSets 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:
setAttributeEntitySelectionin interfaceILcdDGNModelDecoder- Parameters:
aEntities- a list of entity numbers of database attributes (user or non-user).
-
getAttributeEntitySelection
public int[] getAttributeEntitySelection() -
addAttributeEntity
public void addAttributeEntity(int aEntity) Description copied from interface:ILcdDGNModelDecoderAdds 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
addUserAttributeTypemethod.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:
addAttributeEntityin interfaceILcdDGNModelDecoder- Parameters:
aEntity- an entity number of an database attribute (user or non-user).
-
resetTagSetSelection
public void resetTagSetSelection()Description copied from interface:ILcdDGNModelDecoderResets 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:
resetTagSetSelectionin interfaceILcdDGNModelDecoder- See Also:
-
clearTagSetSelection
public void clearTagSetSelection()Description copied from interface:ILcdDGNModelDecoderClears 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:
clearTagSetSelectionin interfaceILcdDGNModelDecoder- See Also:
-
setTagSetSelection
Description copied from interface:ILcdDGNModelDecoderSets 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:
setTagSetSelectionin interfaceILcdDGNModelDecoder- Parameters:
aTagSetNames- a list of tag set names.
-
getTagSetSelection
-
addTagSet
Description copied from interface:ILcdDGNModelDecoderAdds 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:
addTagSetin interfaceILcdDGNModelDecoder- Parameters:
aTagSetName- a tag set name.
-
getDefaultExtension
-
getSelectedLevels
public int[] getSelectedLevels() -
isLevelSelected
public boolean isLevelSelected(int aLevel) -
getDisplayName
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- "DGN".
-
canDecodeSource
Description copied from interface:ILcdModelDecoderChecks whether this model decoder can decode the specified data source. It is acceptable for this method to returntruefor a source name whiledecodethrows 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:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aSourceAsString- the data source to be verified; typically a file name or a URL.- Returns:
trueif the file extension is <defaultExtension> or <defaultExtension>.gz, <code>false</code> otherwise (<defaultExtension> is the String returned by getDefaultExtension).- See Also:
-
decode
Description copied from interface:ILcdModelDecoderCreates a new model from the given data source.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
nullis allowed, implementors are advised to throw an error instead. - Throws:
IOException- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.public ILcdModel decode( String aSourceName ) throws IOException { try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) { // Perform decoding ... } catch (RuntimeException e) { throw new IOException(e); } }- See Also:
-