diff --git a/src/czml3/properties.py b/src/czml3/properties.py index 983ef23..09d8c93 100644 --- a/src/czml3/properties.py +++ b/src/czml3/properties.py @@ -75,14 +75,10 @@ class Material(BaseCZMLObject): default=None ) """A material that fills the surface with a checkerboard pattern. See `here `__ for it's definition.""" - polylineOutline: ( - None | PolylineMaterial | PolylineOutline | TimeIntervalCollection - ) = Field(default=None) # NOTE: Not in documentation - """See `here `__ for it's definition.""" -class PolylineOutline(BaseCZMLObject): - """A definition of how a surface is colored or shaded. +class PolylineOutlineMaterial(BaseCZMLObject): + """A material that fills the surface of a line with an outlined color. See `here `__ for it's definition. """ @@ -95,20 +91,8 @@ class PolylineOutline(BaseCZMLObject): """The width of the outline.""" -class PolylineOutlineMaterial(BaseCZMLObject): - """A definition of the material wrapper for a polyline outline. - - See `here `__ for it's definition. - """ - - polylineOutline: None | PolylineOutline | TimeIntervalCollection = Field( - default=None - ) - """See `here `__ for it's definition.""" - - -class PolylineGlow(BaseCZMLObject): - """A definition of how a glowing polyline appears. +class PolylineGlowMaterial(BaseCZMLObject): + """A material that fills the surface of a line with a glowing color. See `here `__ for it's definition. """ @@ -121,38 +105,18 @@ class PolylineGlow(BaseCZMLObject): """The strength of the tapering effect. 1.0 and higher means no tapering.""" -class PolylineGlowMaterial(BaseCZMLObject): - """A material that fills the surface of a line with a glowing color. - - See `here `__ for it's definition. - """ - - polylineGlow: None | PolylineGlow | TimeIntervalCollection = Field(default=None) - """See `here `__ for it's definition.""" - - -class PolylineArrow(BaseCZMLObject): - """A definition of how a polyline arrow appears. - - See `here `__ for it's definition. - """ - - color: None | Color | str | TimeIntervalCollection = Field(default=None) - """The color of the surface. See `here `__ for it's definition.""" - - class PolylineArrowMaterial(BaseCZMLObject): """A material that fills the surface of a line with an arrow. See `here `__ for it's definition. """ - polylineArrow: None | PolylineArrow | TimeIntervalCollection = Field(default=None) - """See `here `__ for it's definition.""" + color: None | Color | str | TimeIntervalCollection = Field(default=None) + """The color of the surface. See `here `__ for it's definition.""" -class PolylineDash(BaseCZMLObject): - """A definition of how a polyline should be dashed with two colors. +class PolylineDashMaterial(BaseCZMLObject): + """A material that provides a how a polyline should be dashed. See `here `__ for it's definition. """ @@ -167,16 +131,6 @@ class PolylineDash(BaseCZMLObject): """A 16-bit bitfield representing which portions along a single dashLength are the dash (1) and which are the gap (0). The default value, 255 (0000000011111111), indicates 50% gap followed by 50% dash.""" -class PolylineDashMaterial(BaseCZMLObject): - """A material that provides a how a polyline should be dashed. - - See `here `__ for it's definition. - """ - - polylineDash: None | PolylineDash | TimeIntervalCollection = Field(default=None) - """See `here `__ for it's definition.""" - - class PolylineMaterial(BaseCZMLObject): """A definition of how a surface is colored or shaded. @@ -809,31 +763,17 @@ class Polyline(BaseCZMLObject): """The width of the polyline.""" granularity: None | float | TimeIntervalCollection = Field(default=None) """The sampling distance, in radians.""" - material: ( - None - | PolylineMaterial - | PolylineDashMaterial - | PolylineArrowMaterial - | PolylineGlowMaterial - | PolylineOutlineMaterial - | str - | TimeIntervalCollection - ) = Field(default=None) + material: None | PolylineMaterial | str | TimeIntervalCollection = Field( + default=None + ) """The material to use to draw the polyline. See `here `__ for it's definition.""" followSurface: None | bool | TimeIntervalCollection = Field(default=None) """Whether or not the positions are connected as great arcs (the default) or as straight lines. This property has been superseded by `arcType`, which should be used instead.""" shadows: None | ShadowMode | TimeIntervalCollection = Field(default=None) """Whether or not the polyline casts or receives shadows. See `here `__ for it's definition.""" - depthFailMaterial: ( - None - | PolylineMaterial - | PolylineDashMaterial - | PolylineArrowMaterial - | PolylineGlowMaterial - | PolylineOutlineMaterial - | str - | TimeIntervalCollection - ) = Field(default=None) + depthFailMaterial: None | PolylineMaterial | str | TimeIntervalCollection = Field( + default=None + ) """The material to use to draw the polyline when it is below the terrain. See `here `__ for it's definition.""" distanceDisplayCondition: ( None | DistanceDisplayCondition | TimeIntervalCollection diff --git a/tests/test_packet.py b/tests/test_packet.py index 347957f..50f8712 100644 --- a/tests/test_packet.py +++ b/tests/test_packet.py @@ -24,14 +24,10 @@ Point, Polygon, Polyline, - PolylineArrow, PolylineArrowMaterial, - PolylineDash, PolylineDashMaterial, - PolylineGlow, PolylineGlowMaterial, PolylineMaterial, - PolylineOutline, PolylineOutlineMaterial, Position, PositionList, @@ -406,8 +402,8 @@ def test_packet_polyline_outline(): positions=PositionList( cartographicDegrees=[-75, 43, 500000, -125, 43, 500000] ), - material=PolylineOutlineMaterial( - polylineOutline=PolylineOutline( + material=PolylineMaterial( + polylineOutline=PolylineOutlineMaterial( color=Color(rgba=[255, 0, 0, 255]), outlineColor=Color(rgba=[255, 0, 0, 255]), outlineWidth=2, @@ -456,8 +452,8 @@ def test_packet_polyline_glow(): positions=PositionList( cartographicDegrees=[-75, 43, 500000, -125, 43, 500000] ), - material=PolylineGlowMaterial( - polylineGlow=PolylineGlow( + material=PolylineMaterial( + polylineGlow=PolylineGlowMaterial( color=Color(rgba=[255, 0, 0, 255]), glowPower=0.2, taperPower=0.5, @@ -503,8 +499,8 @@ def test_packet_polyline_arrow(): positions=PositionList( cartographicDegrees=[-75, 43, 500000, -125, 43, 500000] ), - material=PolylineArrowMaterial( - polylineArrow=PolylineArrow(color=Color(rgba=[255, 0, 0, 255])) + material=PolylineMaterial( + polylineArrow=PolylineArrowMaterial(color=Color(rgba=[255, 0, 0, 255])) ), ), ) @@ -546,8 +542,8 @@ def test_packet_polyline_dashed(): positions=PositionList( cartographicDegrees=[-75, 43, 500000, -125, 43, 500000] ), - material=PolylineDashMaterial( - polylineDash=PolylineDash(color=Color(rgba=[255, 0, 0, 255])) + material=PolylineMaterial( + polylineDash=PolylineDashMaterial(color=Color(rgba=[255, 0, 0, 255])) ), ), ) diff --git a/tests/test_properties.py b/tests/test_properties.py index 0d8ca54..976895e 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -37,14 +37,10 @@ Point, Polygon, Polyline, - PolylineArrow, PolylineArrowMaterial, - PolylineDash, PolylineDashMaterial, - PolylineGlow, PolylineGlowMaterial, PolylineMaterial, - PolylineOutline, PolylineOutlineMaterial, Position, PositionList, @@ -266,8 +262,8 @@ def test_arrowmaterial_color(): } } }""" - pamat = PolylineArrowMaterial( - polylineArrow=PolylineArrow(color=Color(rgba=[200, 100, 30, 255])), + pamat = PolylineMaterial( + polylineArrow=PolylineArrowMaterial(color=Color(rgba=[200, 100, 30, 255])), ) assert str(pamat) == expected_result @@ -296,8 +292,8 @@ def test_dashmaterial_colors(): "dashPattern": 255 } }""" - dashmat = PolylineDashMaterial( - polylineDash=PolylineDash( + dashmat = PolylineMaterial( + polylineDash=PolylineDashMaterial( color=Color(rgba=[200, 100, 30, 255]), gapColor=Color(rgba=[100, 200, 0, 255]), dashLength=16, @@ -323,8 +319,8 @@ def test_glowmaterial_color(): "taperPower": 0.3 } }""" - glowmat = PolylineGlowMaterial( - polylineGlow=PolylineGlow( + glowmat = PolylineMaterial( + polylineGlow=PolylineGlowMaterial( color=Color(rgba=[200, 100, 30, 255]), glowPower=0.7, taperPower=0.3 ) ) @@ -353,8 +349,8 @@ def test_outline_material_colors(): "outlineWidth": 3.0 } }""" - omat = PolylineOutlineMaterial( - polylineOutline=PolylineOutline( + omat = PolylineMaterial( + polylineOutline=PolylineOutlineMaterial( color=Color(rgba=[200, 100, 30, 255]), outlineColor=Color(rgba=[100, 200, 0, 255]), outlineWidth=3,