public class TLcdDGNModelListDecoder extends Object implements ILcdDGNModelDecoder
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.TLcdDGNModelDecoder
Constructor and Description |
---|
TLcdDGNModelListDecoder()
Creates a new TLcdDGNModelListDecoder which will delegate the decoding to
TLcdDGNModelDecoder . |
TLcdDGNModelListDecoder(ILcdDGNModelDecoder aDGNModelDecoder)
Constructor which delegates the decoding to the given DGN model decoder.
|
Modifier and Type | Method and Description |
---|---|
void |
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 |
addTagSet(String aTagSetName)
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.
|
boolean |
canDecodeSource(String aSourceName)
Checks whether this model decoder can decode the specified data source.
|
void |
clearAttributeEntitySelection()
Clears the set of DGN database attributes that is decoded.
|
void |
clearLevelNameSelection()
Clears the list of names of DGN levels that are to be included into all
decoded models.
|
void |
clearLevelSelection()
Clears the list of DGN levels that is included into decoded models.
|
void |
clearTagSetSelection()
Clears the set of DGN tag sets that is decoded.
|
void |
clearUserAttributeTypeSelection()
Clears the set of DGN MSLINK attributes that is decoded.
|
ILcdModel |
decode(String aSourceName)
Returns a
TLcd2DBoundsIndexedModelList whose elements are
of type TLcd2DBoundsIndexedModel . |
String |
getDatabaseURL() |
ILcdModelReference |
getDefaultModelReference() |
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
int |
getElementClassSelection()
Gets the the bitmask specifying list of element classes that is included
into decoded models.
|
ILcdModelReferenceDecoder |
getModelReferenceDecoder() |
boolean |
isUseFloat() |
void |
resetAttributeEntitySelection()
Resets the set of DGN database attributes that is decoded.
|
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.
|
void |
resetLevelSelection()
Resets the list of DGN levels that is included into decoded models.
|
void |
resetTagSetSelection()
Resets the set of DGN tag sets that is decoded.
|
void |
resetUserAttributeTypeSelection()
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public TLcdDGNModelListDecoder()
TLcdDGNModelDecoder
.public TLcdDGNModelListDecoder(ILcdDGNModelDecoder aDGNModelDecoder)
aDGNModelDecoder
- the DGN model decoder to usepublic void setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
ILcdDGNModelDecoder
setModelReferenceDecoder
in interface ILcdDGNModelDecoder
public ILcdModelReferenceDecoder getModelReferenceDecoder()
getModelReferenceDecoder
in interface ILcdDGNModelDecoder
public void setDefaultModelReference(ILcdModelReference aDefaultModelReference)
ILcdDGNModelDecoder
setDefaultModelReference
in interface ILcdDGNModelDecoder
public ILcdModelReference getDefaultModelReference()
getDefaultModelReference
in interface ILcdDGNModelDecoder
public void setDatabaseURL(String aDatabaseURL)
ILcdDGNModelDecoder
setDatabaseURL
in interface ILcdDGNModelDecoder
public String getDatabaseURL()
getDatabaseURL
in interface ILcdDGNModelDecoder
public void setUseFloat(boolean aUseFloat)
ILcdDGNModelDecoder
setUseFloat
in interface ILcdDGNModelDecoder
public boolean isUseFloat()
isUseFloat
in interface ILcdDGNModelDecoder
public void resetLevelSelection()
ILcdDGNModelDecoder
resetLevelSelection
in interface ILcdDGNModelDecoder
public void clearLevelSelection()
ILcdDGNModelDecoder
clearLevelSelection
in interface ILcdDGNModelDecoder
ILcdDGNModelDecoder.resetLevelSelection()
,
ILcdDGNModelDecoder.addLevel(int)
public void setLevelSelection(int[] aLevels)
ILcdDGNModelDecoder
setLevelSelection
in interface ILcdDGNModelDecoder
aLevels
- the levels to be included in the decoded models.
They can be listed in any order, and duplicate numbers are allowed.public void addLevel(int aLevel)
ILcdDGNModelDecoder
addLevel
in interface ILcdDGNModelDecoder
aLevel
- the level to be included in the decoded models.public void clearLevelNameSelection()
ILcdDGNModelDecoder
clearLevelNameSelection
in interface ILcdDGNModelDecoder
ILcdDGNModelDecoder.clearLevelSelection()
,
ILcdDGNModelDecoder.addLevelName(String)
public void setLevelNameSelection(String[] aLevelNames)
ILcdDGNModelDecoder
setLevelNameSelection
in interface ILcdDGNModelDecoder
aLevelNames
- the names of levels to be included in the decoded models.
They can be listed in any order, and duplicate names are allowed.public void addLevelName(String aLevelName)
ILcdDGNModelDecoder
addLevelName
in interface ILcdDGNModelDecoder
aLevelName
- the name of the level to be included in the decoded models.public void resetElementClassSelection()
ILcdDGNModelDecoder
resetElementClassSelection
in interface ILcdDGNModelDecoder
public void setElementClassSelection(int aElementClasses)
ILcdDGNModelDecoder
setElementClassSelection
in interface ILcdDGNModelDecoder
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:
public int getElementClassSelection()
ILcdDGNModelDecoder
getElementClassSelection
in interface ILcdDGNModelDecoder
public void setElementClassSelection(int[] aElementClasses)
ILcdDGNModelDecoder
setElementClassSelection
in interface ILcdDGNModelDecoder
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
ILcdDGNModelDecoder.setElementClassSelection(int)
public void addElementClass(int aElementClass)
ILcdDGNModelDecoder
addElementClass
in interface ILcdDGNModelDecoder
aElementClass
- the element class to be included in the decoded models.
The available DGN element classes are
public void resetUserAttributeTypeSelection()
ILcdDGNModelDecoder
resetUserAttributeTypeSelection
in interface ILcdDGNModelDecoder
ILcdDGNModelDecoder.clearUserAttributeTypeSelection()
public void clearUserAttributeTypeSelection()
ILcdDGNModelDecoder
public void setUserAttributeTypeSelection(String[] aTypes)
ILcdDGNModelDecoder
Note that the attribute entities to be decoded have to be specified as
well, using the addAttributeEntity
method.
setUserAttributeTypeSelection
in interface ILcdDGNModelDecoder
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
public void setUserAttributeTypeSelection(int[] aTypes)
ILcdDGNModelDecoder
setUserAttributeTypeSelection
in interface ILcdDGNModelDecoder
aTypes
- a list of MSLINK attribute types, specified as integers
(unsigned shorts, e.g. 0x5e62, which corresponds to 'ODB'
in radix 50).ILcdDGNUserAttribute
public void addUserAttributeType(String aType)
ILcdDGNModelDecoder
addUserAttributeType
in interface ILcdDGNModelDecoder
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
ILcdDGNModelDecoder.addUserAttributeType(int)
public void addUserAttributeType(int aType)
ILcdDGNModelDecoder
Note that the attribute entities to be decoded have to be specified as
well, using the addAttributeEntity
method.
addUserAttributeType
in interface ILcdDGNModelDecoder
aType
- an MSLINK attribute type specified as an integer
(an unsigned short, e.g. 0x5e62, which corresponds to 'ODB'
in radix 50).ILcdDGNModelDecoder.addUserAttributeType(java.lang.String)
,
ILcdDGNUserAttribute
public void resetAttributeEntitySelection()
ILcdDGNModelDecoder
resetAttributeEntitySelection
in interface ILcdDGNModelDecoder
ILcdDGNModelDecoder.clearAttributeEntitySelection()
public void clearAttributeEntitySelection()
ILcdDGNModelDecoder
clearAttributeEntitySelection
in interface ILcdDGNModelDecoder
ILcdDGNModelDecoder.resetAttributeEntitySelection()
,
ILcdDGNModelDecoder.addAttributeEntity(int)
public void setAttributeEntitySelection(int[] aEntities)
ILcdDGNModelDecoder
setAttributeEntitySelection
in interface ILcdDGNModelDecoder
aEntities
- a list of entity numbers of database attributes (user or non-user).public void addAttributeEntity(int aEntity)
ILcdDGNModelDecoder
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.
addAttributeEntity
in interface ILcdDGNModelDecoder
aEntity
- an entity number of an database attribute (user or non-user).public void resetTagSetSelection()
ILcdDGNModelDecoder
resetTagSetSelection
in interface ILcdDGNModelDecoder
ILcdDGNModelDecoder.clearTagSetSelection()
public void clearTagSetSelection()
ILcdDGNModelDecoder
clearTagSetSelection
in interface ILcdDGNModelDecoder
ILcdDGNModelDecoder.resetTagSetSelection()
,
ILcdDGNModelDecoder.addTagSet(java.lang.String)
public void setTagSetSelection(String[] aTagSetNames)
ILcdDGNModelDecoder
setTagSetSelection
in interface ILcdDGNModelDecoder
aTagSetNames
- a list of tag set names.public void addTagSet(String aTagSetName)
ILcdDGNModelDecoder
addTagSet
in interface ILcdDGNModelDecoder
aTagSetName
- a tag set name.public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
ILcdModelDecoder
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.
canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the data source to be verified; typically a file name or a URL.true
if this decoder can likely decode the data specified by the source name, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
TLcd2DBoundsIndexedModelList
whose elements are
of type TLcd2DBoundsIndexedModel
. Each model in the list corresponds
to a single DGN level.decode
in interface ILcdModelDecoder
aSourceName
- the name of the file to decodeIOException
InterruptedIOException
- When the thread on which this method is called is interrupted: it is recommended to stop the decoding
and throw an InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.ILcdModelDecoder.canDecodeSource(String)