Package com.luciad.format.dgn
Interface ILcdDGNModelDecoder
- All Superinterfaces:
ILcdModelDecoder
- All Known Implementing Classes:
TLcdDGNModelDecoder
,TLcdDGNModelListDecoder
This interface provides common methods for decoders of the
Since a DGN file itself doesn't specify a model reference, the corresponding
model reference is retrieved with the help of the
DGN
file format.
Input files
File | Required | Entry point | Description |
---|---|---|---|
*.dgn | x | x | Design file containing vector data |
modelReferenceDecoder
or as the
defaultModelReference
of this decoder. By default, the model
reference decoder and the default model reference are unset
(i.e. null
).
Supported file transfer protocols
- The supported file transfer protocols are specified by the implementations of this interface.
Model structure
- This model decoder creates a model per DGN file.
- All models returned by this model decoder implement
ILcd2DBoundsIndexedModel
.
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.
Model elements
- Decoded models contain elements that all implement
ILcdDGNShape
. - The supported elements are specified by the implementations of this interface.
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:
Performance tips
- By default, attributes are not decoded, potentially saving some memory and some processing time.
- By default, decoded coordinates are stored as doubles. You can reduce the memory usage of the decoded models by storing coordinates in arrays of floats, using the following methods:
Thread safety
- The decoding of models with one decoder is not thread-safe, unless specified otherwise by the implementation of this interface.
- It is possible to use multiple decoders concurrently.
- The decoded models are thread-safe for read access.
Serialization
- The decoded models and their contents implement
Serializable
and can be serialized. - Only de-serialization from data from the same release version is supported.
Supported versions and specifications
- The supported versions are specified by the implementations of this interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttributeEntity
(int aEntity) Adds an attribute entity number to the set of numbers that is decoded.void
addElementClass
(int aElementClass) Adds an element class to the list of element classes that is included into decoded models.void
addLevel
(int aLevel) Adds a level to the list of DGN levels that is included into all decoded models.void
addLevelName
(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.void
Adds a tag set name to the set of names that is decoded.void
addUserAttributeType
(int aType) Adds a DGN MSLINK attribute type to the set of types that is decoded.void
addUserAttributeType
(String aType) Adds a DGN MSLINK attribute type to the set of types that is decoded.void
Clears the set of DGN database attributes that is decoded.void
Clears the list of names of DGN levels that are to be included into all decoded models.void
Clears the list of DGN levels that is included into decoded models.void
Clears the set of DGN tag sets that is decoded.void
Clears the set of DGN MSLINK attributes that is decoded.int
Gets the the bitmask specifying list of element classes that is included into decoded models.boolean
void
Resets the set of DGN database attributes that is decoded.void
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.void
Resets the list of DGN levels that is included into decoded models.void
Resets the set of DGN tag sets that is decoded.void
Resets the set of DGN MSLINK attributes that is decoded.void
setAttributeEntitySelection
(int[] aEntities) Sets the set of DGN database attributes that is decoded.void
setDatabaseURL
(String aDatabaseURL) Sets the default database URL that is assigned to all decoded attributes.void
setDefaultModelReference
(ILcdModelReference aDefaultModelReference) Sets the default model reference for decoded models, in case the model reference decoder doesn't provide one.void
setElementClassSelection
(int aElementClasses) Sets the list of element classes that is included into decoded models.void
setElementClassSelection
(int[] aElementClasses) Sets the list of element classes that is included into decoded models.void
setLevelNameSelection
(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.void
setLevelSelection
(int[] aLevels) Sets the list of DGN levels that is included into all decoded models.void
setModelReferenceDecoder
(ILcdModelReferenceDecoder aModelReferenceDecoder) Sets the model reference decoder that will be used for creating model references for decoded models.void
setTagSetSelection
(String[] aTagSetNames) Sets the set of DGN tag attributes that is decoded.void
setUseFloat
(boolean aUseFloat) Specifies whether to use memory-conserving floating point data structures for the decoded models.void
setUserAttributeTypeSelection
(int[] aTypes) Sets the set of DGN MSLINK attributes that is decoded.void
setUserAttributeTypeSelection
(String[] aTypes) Sets the set of DGN MSLINK attributes that is decoded.Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, canDecodeSource, decode, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources, getDisplayName
-
Method Details
-
setModelReferenceDecoder
Sets the model reference decoder that will be used for creating model references for decoded models. -
getModelReferenceDecoder
ILcdModelReferenceDecoder getModelReferenceDecoder() -
setDefaultModelReference
Sets the default model reference for decoded models, in case the model reference decoder doesn't provide one. -
getDefaultModelReference
ILcdModelReference getDefaultModelReference() -
setDatabaseURL
Sets the default database URL that is assigned to all decoded attributes. The URL can then be used by the application. -
getDatabaseURL
String getDatabaseURL() -
setUseFloat
void setUseFloat(boolean aUseFloat) Specifies whether to use memory-conserving floating point data structures for the decoded models. -
isUseFloat
boolean isUseFloat() -
resetLevelSelection
void resetLevelSelection()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. -
clearLevelSelection
void clearLevelSelection()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.- See Also:
-
setLevelSelection
void setLevelSelection(int[] aLevels) Sets the list of DGN levels that is included into all decoded models. Level 0 is always included, irrespective of the selection setting.- Parameters:
aLevels
- the levels to be included in the decoded models. They can be listed in any order, and duplicate numbers are allowed.
-
addLevel
void addLevel(int aLevel) Adds a level to the list of DGN levels that is included into all decoded models.- Parameters:
aLevel
- the level to be included in the decoded models.
-
clearLevelNameSelection
void clearLevelNameSelection()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.- See Also:
-
setLevelNameSelection
Sets the list of names of DGN levels that are to be included into all decoded models, in addition to the numeric level selection.- 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
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.- Parameters:
aLevelName
- the name of the level to be included in the decoded models.
-
resetElementClassSelection
void resetElementClassSelection()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. -
setElementClassSelection
void setElementClassSelection(int aElementClasses) 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.- 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
int getElementClassSelection()Gets the the bitmask specifying list of element classes that is included into decoded models. -
setElementClassSelection
void setElementClassSelection(int[] aElementClasses) 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.- 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
void addElementClass(int aElementClass) 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.- 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
void resetUserAttributeTypeSelection()Resets the set of DGN MSLINK attributes that is decoded. All MSLINK attributes will now be included in the models when decoding DGN files.- See Also:
-
clearUserAttributeTypeSelection
void clearUserAttributeTypeSelection()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.- See Also:
-
setUserAttributeTypeSelection
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.- 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
void setUserAttributeTypeSelection(int[] aTypes) 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.- 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
Adds a DGN MSLINK attribute type to the set of types that is decoded.- 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
void addUserAttributeType(int aType) 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.- 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
void resetAttributeEntitySelection()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.- See Also:
-
clearAttributeEntitySelection
void clearAttributeEntitySelection()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.- See Also:
-
setAttributeEntitySelection
void setAttributeEntitySelection(int[] aEntities) 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.- Parameters:
aEntities
- a list of entity numbers of database attributes (user or non-user).
-
addAttributeEntity
void addAttributeEntity(int aEntity) 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.
- Parameters:
aEntity
- an entity number of an database attribute (user or non-user).
-
resetTagSetSelection
void resetTagSetSelection()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.- See Also:
-
clearTagSetSelection
void clearTagSetSelection()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.- See Also:
-
setTagSetSelection
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.- Parameters:
aTagSetNames
- a list of tag set names.
-
addTagSet
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.- Parameters:
aTagSetName
- a tag set name.
-