Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
314f1216
Commit
314f1216
authored
11 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Add parsing of GenericAttributes
parent
9bf84da4
master
107-opengl-view
109-aabb-tree
dev
dev_cpp_code_conversion
dev_embedded_geodb
dev_relgeom_fix
test-environment
3.17.3
3.17.2
3.17.1
3.17.0
3.16.0
archive/dev_visitor_rework
archive/dev_gui_features
archive/dev_gui_features_zip_loading
archive/dev_citygml3
2 merge requests
!11
CityDoctor Release Version 3.16.0
,
!10
CityGML 3.0. Support
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/CityObject.java
+10
-1
...e/hft/stuttgart/citydoctor2/datastructure/CityObject.java
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/GenericAttribute.java
+72
-0
...stuttgart/citydoctor2/datastructure/GenericAttribute.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/tree/GenericAttributeNode.java
+27
-0
.../stuttgart/citydoctor2/gui/tree/GenericAttributeNode.java
with
109 additions
and
1 deletion
+109
-1
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/CityObject.java
+
10
-
1
View file @
314f1216
...
...
@@ -45,7 +45,7 @@ public abstract class CityObject extends GmlElement {
private
static
final
long
serialVersionUID
=
651712070755024188L
;
private
final
List
<
Geometry
>
geometryList
=
new
ArrayList
<>();
private
final
List
<
GenericAttribute
>
genericAttributeList
=
new
ArrayList
<>();
/**
* Recreates the CityGML4j geometry in this object. The CityGML4j geometry is
* deleted from the data structure as was mapped to the city doctor data
...
...
@@ -77,6 +77,7 @@ public abstract class CityObject extends GmlElement {
geom
.
setParent
(
this
);
}
public
List
<
Geometry
>
getGeometries
()
{
return
geometryList
;
}
...
...
@@ -101,6 +102,14 @@ public abstract class CityObject extends GmlElement {
return
highestLodGeometry
;
}
public
void
addGenericAttribute
(
GenericAttribute
genericAttribute
)
{
genericAttributeList
.
add
(
genericAttribute
);
}
public
List
<
GenericAttribute
>
getGenericAttributes
()
{
return
genericAttributeList
;
}
public
abstract
FeatureType
getFeatureType
();
@Override
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/GenericAttribute.java
0 → 100644
+
72
-
0
View file @
314f1216
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.core.AbstractGenericAttributeProperty
;
import
org.citygml4j.core.model.generics.*
;
public
class
GenericAttribute
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
GenericAttribute
.
class
);
private
final
AbstractGenericAttributeProperty
original
;
private
String
type
;
private
String
name
;
private
String
value
;
public
GenericAttribute
(
AbstractGenericAttributeProperty
attributeProperty
)
{
original
=
attributeProperty
;
if
(
attributeProperty
.
getObject
()
==
null
)
{
logger
.
warn
(
"GenericAttribute {} is null"
,
attributeProperty
);
return
;
}
name
=
attributeProperty
.
getObject
().
getName
();
if
(
attributeProperty
.
getObject
()
instanceof
StringAttribute
sa
)
{
type
=
"StringAttribute"
;
value
=
sa
.
getValue
();
}
else
if
(
attributeProperty
.
getObject
()
instanceof
IntAttribute
ia
)
{
type
=
"IntAttribute"
;
value
=
ia
.
getValue
().
toString
();
}
else
if
(
attributeProperty
.
getObject
()
instanceof
DoubleAttribute
da
)
{
type
=
"DoubleAttribute"
;
value
=
da
.
getValue
().
toString
();
}
else
if
(
attributeProperty
.
getObject
()
instanceof
DateAttribute
date
)
{
type
=
"DateAttribute"
;
value
=
date
.
getValue
().
toString
();
}
else
if
(
attributeProperty
.
getObject
()
instanceof
UriAttribute
ua
)
{
type
=
"UriAttribute"
;
value
=
ua
.
getValue
();
}
else
if
(
attributeProperty
.
getObject
()
instanceof
MeasureAttribute
ma
)
{
type
=
"MeasureAttribute"
;
value
=
ma
.
getValue
().
toString
();
}
else
if
(
attributeProperty
.
getObject
()
instanceof
CodeAttribute
ca
)
{
type
=
"CodeAttribute"
;
value
=
ca
.
getValue
().
toString
();
}
else
{
logger
.
warn
(
"GenericAttribute {} is of unknown type {}"
,
attributeProperty
,
attributeProperty
.
getObject
());
value
=
attributeProperty
.
getObject
().
getValue
().
toString
();
type
=
"Unknown type"
;
}
}
public
AbstractGenericAttributeProperty
getOriginal
()
{
return
original
;
}
public
String
getName
()
{
return
name
;
}
public
String
getValue
()
{
return
value
;
}
@Override
public
String
toString
()
{
return
String
.
format
(
"%s: [ %s = %s ]"
,
type
,
name
,
value
);
}
}
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/tree/GenericAttributeNode.java
0 → 100644
+
27
-
0
View file @
314f1216
package
de.hft.stuttgart.citydoctor2.gui.tree
;
import
de.hft.stuttgart.citydoctor2.datastructure.GenericAttribute
;
import
de.hft.stuttgart.citydoctor2.gui.Renderer
;
public
class
GenericAttributeNode
extends
Renderable
{
private
final
GenericAttribute
gen
;
public
GenericAttributeNode
(
GenericAttribute
gen
)
{
this
.
gen
=
gen
;
}
@Override
public
void
refreshTextColor
()
{
}
@Override
public
String
getText
()
{
return
gen
.
toString
();
}
@Override
public
void
visit
(
Renderer
renderer
)
{
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets