Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ec2b59b24 | |||
| 2e0743d626 | |||
| 25f16c700d | |||
| c12799b7c6 | |||
| 4530e0702d | |||
| e9443b22ad |
@@ -1,12 +1,22 @@
|
|||||||
"""Builtin Speckle object kit."""
|
"""Builtin Speckle object kit."""
|
||||||
|
|
||||||
from specklepy.objects.GIS.CRS import CRS
|
from specklepy.objects.GIS.CRS import CRS
|
||||||
|
from specklepy.objects.GIS.features import (
|
||||||
|
GisMultipatchFeature,
|
||||||
|
GisNonGeometricFeature,
|
||||||
|
GisPointFeature,
|
||||||
|
GisPolygonFeature,
|
||||||
|
GisPolylineFeature,
|
||||||
|
)
|
||||||
from specklepy.objects.GIS.geometry import (
|
from specklepy.objects.GIS.geometry import (
|
||||||
GisLineElement,
|
GisLineElement,
|
||||||
GisPointElement,
|
GisPointElement,
|
||||||
GisPolygonElement,
|
GisPolygonElement,
|
||||||
GisPolygonGeometry,
|
GisPolygonGeometry,
|
||||||
GisRasterElement,
|
GisRasterElement,
|
||||||
|
PolygonGeometry,
|
||||||
|
PolygonGeometry3d,
|
||||||
|
GisMultipatchGeometry,
|
||||||
)
|
)
|
||||||
from specklepy.objects.GIS.layers import RasterLayer, VectorLayer
|
from specklepy.objects.GIS.layers import RasterLayer, VectorLayer
|
||||||
|
|
||||||
@@ -14,9 +24,17 @@ __all__ = [
|
|||||||
"VectorLayer",
|
"VectorLayer",
|
||||||
"RasterLayer",
|
"RasterLayer",
|
||||||
"GisPolygonGeometry",
|
"GisPolygonGeometry",
|
||||||
|
"PolygonGeometry",
|
||||||
|
"PolygonGeometry3d",
|
||||||
|
"GisMultipatchGeometry",
|
||||||
"GisPolygonElement",
|
"GisPolygonElement",
|
||||||
"GisLineElement",
|
"GisLineElement",
|
||||||
"GisPointElement",
|
"GisPointElement",
|
||||||
"GisRasterElement",
|
"GisRasterElement",
|
||||||
"CRS",
|
"CRS",
|
||||||
|
"GisPointFeature",
|
||||||
|
"GisPolylineFeature",
|
||||||
|
"GisPolygonFeature",
|
||||||
|
"GisMultipatchFeature",
|
||||||
|
"GisNonGeometricFeature",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
from typing import List, Optional
|
||||||
|
|
||||||
|
from specklepy.objects.base import Base
|
||||||
|
from specklepy.objects.geometry import Mesh, Point, Polyline
|
||||||
|
from specklepy.objects.GIS.geometry import PolygonGeometry
|
||||||
|
|
||||||
|
|
||||||
|
class GisNonGeometricFeature(Base, speckle_type="Objects.GIS.GisNonGeometricFeature"):
|
||||||
|
"""GIS Table feature"""
|
||||||
|
|
||||||
|
attributes: Base
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
attributes: Optional[Base] = None,
|
||||||
|
) -> None:
|
||||||
|
self.attributes = attributes or Base()
|
||||||
|
|
||||||
|
|
||||||
|
class GisPointFeature(
|
||||||
|
Base,
|
||||||
|
detachable={"displayValue"},
|
||||||
|
speckle_type="Objects.GIS.GisPointFeature",
|
||||||
|
):
|
||||||
|
"""Gis Point Feature"""
|
||||||
|
|
||||||
|
attributes: Base
|
||||||
|
displayValue: List[Point]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def geometry(self) -> List[Point]:
|
||||||
|
return self.displayValue
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
attributes: Optional[Base] = None,
|
||||||
|
displayValue: Optional[List[Point]] = None,
|
||||||
|
) -> None:
|
||||||
|
self.attributes = attributes or Base()
|
||||||
|
displayValue = displayValue or []
|
||||||
|
|
||||||
|
|
||||||
|
class GisPolylineFeature(
|
||||||
|
Base,
|
||||||
|
detachable={"displayValue"},
|
||||||
|
speckle_type="Objects.GIS.GisPolylineFeature",
|
||||||
|
):
|
||||||
|
"""Gis Polyline Feature"""
|
||||||
|
|
||||||
|
attributes: Base
|
||||||
|
displayValue: List[Polyline]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def geometry(self) -> List[Polyline]:
|
||||||
|
return self.displayValue
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
attributes: Optional[Base] = None,
|
||||||
|
displayValue: Optional[List[Point]] = None,
|
||||||
|
) -> None:
|
||||||
|
self.attributes = attributes or Base()
|
||||||
|
displayValue = displayValue or []
|
||||||
|
|
||||||
|
|
||||||
|
class GisPolygonFeature(
|
||||||
|
Base,
|
||||||
|
detachable={"displayValue", "geometry"},
|
||||||
|
speckle_type="Objects.GIS.GisPolygonFeature",
|
||||||
|
):
|
||||||
|
"""Gis Polygon Feature"""
|
||||||
|
|
||||||
|
attributes: Base
|
||||||
|
displayValue: List[Mesh]
|
||||||
|
geometry: List[PolygonGeometry]
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
geometry: List[PolygonGeometry],
|
||||||
|
attributes: Optional[Base] = None,
|
||||||
|
displayValue: Optional[List[Point]] = None,
|
||||||
|
) -> None:
|
||||||
|
self.geometry = geometry
|
||||||
|
self.attributes = attributes or Base()
|
||||||
|
displayValue = displayValue or []
|
||||||
|
|
||||||
|
|
||||||
|
class GisMultipatchFeature(
|
||||||
|
Base,
|
||||||
|
detachable={"displayValue", "geometry"},
|
||||||
|
speckle_type="Objects.GIS.GisMultipatchFeature",
|
||||||
|
):
|
||||||
|
"""Gis Multipatch Feature"""
|
||||||
|
|
||||||
|
attributes: Base
|
||||||
|
displayValue: List[Mesh]
|
||||||
|
geometry: List[Base] # GisMultipatchGeometry or PolygonGeometry3d
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
geometry: List[Base],
|
||||||
|
attributes: Optional[Base] = None,
|
||||||
|
displayValue: Optional[List[Point]] = None,
|
||||||
|
) -> None:
|
||||||
|
self.geometry = geometry
|
||||||
|
self.attributes = attributes or Base()
|
||||||
|
displayValue = displayValue or []
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
from typing import List, Optional, Union
|
from typing import List, Optional, Union
|
||||||
|
|
||||||
|
from deprecated import deprecated
|
||||||
|
|
||||||
from specklepy.objects.base import Base
|
from specklepy.objects.base import Base
|
||||||
from specklepy.objects.geometry import (
|
from specklepy.objects.geometry import (
|
||||||
Arc,
|
Arc,
|
||||||
@@ -12,23 +14,69 @@ from specklepy.objects.geometry import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class GisPolygonGeometry(
|
class PolygonGeometry(Base, speckle_type="Objects.GIS.PolygonGeometry"):
|
||||||
Base, speckle_type="Objects.GIS.PolygonGeometry", detachable={"displayValue"}
|
|
||||||
):
|
|
||||||
"""GIS Polygon Geometry"""
|
"""GIS Polygon Geometry"""
|
||||||
|
|
||||||
boundary: Optional[Union[Polyline, Arc, Line, Circle, Polycurve]] = None
|
boundary: Polyline
|
||||||
voids: Optional[List[Union[Polyline, Arc, Line, Circle, Polycurve]]] = None
|
voids: List[Polyline]
|
||||||
displayValue: Optional[List[Mesh]] = None
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
units: str,
|
||||||
|
boundary: Polyline,
|
||||||
|
voids: Optional[List[Polyline]] = None,
|
||||||
|
) -> None:
|
||||||
|
super().__init__(units=units)
|
||||||
|
self.boundary = boundary
|
||||||
|
self.voids = voids or []
|
||||||
|
|
||||||
|
|
||||||
|
GisPolygonGeometry = PolygonGeometry
|
||||||
|
|
||||||
|
|
||||||
|
class PolygonGeometry3d(
|
||||||
|
PolygonGeometry,
|
||||||
|
speckle_type="Objects.GIS.PolygonGeometry3d",
|
||||||
|
):
|
||||||
|
"""GIS Polygon3d Geometry"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
units: str,
|
||||||
|
boundary: Polyline,
|
||||||
|
voids: Optional[List[Polyline]] = None,
|
||||||
|
) -> None:
|
||||||
|
super().__init__(units=units, boundary=boundary, voids=voids)
|
||||||
|
|
||||||
|
|
||||||
|
class GisMultipatchGeometry(
|
||||||
|
Base,
|
||||||
|
speckle_type="Objects.GIS.GisMultipatchGeometry",
|
||||||
|
):
|
||||||
|
"""GIS Polygon3d Geometry"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
units: str,
|
||||||
|
faces: List[int],
|
||||||
|
vertices: List[float],
|
||||||
|
colors: Optional[List[int]],
|
||||||
|
) -> None:
|
||||||
|
super().__init__(units=units)
|
||||||
|
self.faces = faces
|
||||||
|
self.vertices = vertices
|
||||||
|
self.colors = colors or []
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(version="2.20", reason="Replaced with GisPolygonFeature")
|
||||||
class GisPolygonElement(Base, speckle_type="Objects.GIS.PolygonElement"):
|
class GisPolygonElement(Base, speckle_type="Objects.GIS.PolygonElement"):
|
||||||
"""GIS Polygon element"""
|
"""GIS Polygon element"""
|
||||||
|
|
||||||
geometry: Optional[List[GisPolygonGeometry]] = None
|
geometry: Optional[List[PolygonGeometry]] = None
|
||||||
attributes: Optional[Base] = None
|
attributes: Optional[Base] = None
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(version="2.20", reason="Replaced with GisPolyineFeature")
|
||||||
class GisLineElement(Base, speckle_type="Objects.GIS.LineElement"):
|
class GisLineElement(Base, speckle_type="Objects.GIS.LineElement"):
|
||||||
"""GIS Polyline element"""
|
"""GIS Polyline element"""
|
||||||
|
|
||||||
@@ -36,6 +84,7 @@ class GisLineElement(Base, speckle_type="Objects.GIS.LineElement"):
|
|||||||
attributes: Optional[Base] = None
|
attributes: Optional[Base] = None
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(version="2.20", reason="Replaced with GisPointFeature")
|
||||||
class GisPointElement(Base, speckle_type="Objects.GIS.PointElement"):
|
class GisPointElement(Base, speckle_type="Objects.GIS.PointElement"):
|
||||||
"""GIS Point element"""
|
"""GIS Point element"""
|
||||||
|
|
||||||
@@ -68,6 +117,7 @@ class GisTopography(
|
|||||||
"""GIS Raster element with 3d Topography representation"""
|
"""GIS Raster element with 3d Topography representation"""
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(version="2.20", reason="Replaced with GisNonGeometricFeature")
|
||||||
class GisNonGeometryElement(Base, speckle_type="Objects.GIS.NonGeometryElement"):
|
class GisNonGeometryElement(Base, speckle_type="Objects.GIS.NonGeometryElement"):
|
||||||
"""GIS Table feature"""
|
"""GIS Table feature"""
|
||||||
|
|
||||||
|
|||||||
@@ -295,17 +295,33 @@ class RevitParameter(Base, speckle_type="Objects.BuiltElements.Revit.Parameter")
|
|||||||
value: Any = None
|
value: Any = None
|
||||||
applicationUnitType: Optional[str] = None # eg UnitType UT_Length
|
applicationUnitType: Optional[str] = None # eg UnitType UT_Length
|
||||||
applicationUnit: Optional[str] = None # DisplayUnitType eg DUT_MILLIMITERS
|
applicationUnit: Optional[str] = None # DisplayUnitType eg DUT_MILLIMITERS
|
||||||
applicationInternalName: Optional[
|
applicationInternalName: Optional[str] = (
|
||||||
str
|
None # BuiltInParameterName or GUID for shared parameter
|
||||||
] = None # BuiltInParameterName or GUID for shared parameter
|
)
|
||||||
isShared: bool = False
|
isShared: bool = False
|
||||||
isReadOnly: bool = False
|
isReadOnly: bool = False
|
||||||
isTypeParameter: bool = False
|
isTypeParameter: bool = False
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
version="2.20", reason="Collections namespace changed, collectionType deprecated"
|
||||||
|
)
|
||||||
class Collection(
|
class Collection(
|
||||||
Base, speckle_type="Speckle.Core.Models.Collection", detachable={"elements"}
|
Base, speckle_type="Speckle.Core.Models.Collection", detachable={"elements"}
|
||||||
):
|
):
|
||||||
name: Optional[str] = None
|
name: Optional[str] = None
|
||||||
collectionType: Optional[str] = None
|
collectionType: Optional[str] = None
|
||||||
elements: Optional[List[Base]] = None
|
elements: Optional[List[Base]] = None
|
||||||
|
|
||||||
|
|
||||||
|
class Collection( # noqa: F811
|
||||||
|
Base,
|
||||||
|
speckle_type="Speckle.Core.Models.Collections.Collection",
|
||||||
|
detachable={"elements"},
|
||||||
|
):
|
||||||
|
name: str
|
||||||
|
elements: List[Base]
|
||||||
|
|
||||||
|
def init(self, name: str, elements: Optional[List[Base]] = None):
|
||||||
|
self.name = name
|
||||||
|
self.elements = elements or []
|
||||||
|
|||||||
Reference in New Issue
Block a user