2023-07-07 18:03:18 -07:00
|
|
|
from enum import Enum
|
2023-05-04 00:58:06 -07:00
|
|
|
from typing import Any, Dict, List, Type, TypeVar, Union
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
import attr
|
|
|
|
|
2023-07-07 18:03:18 -07:00
|
|
|
from ..models.camera_drag_interaction_type import CameraDragInteractionType
|
|
|
|
from ..models.modeling_cmd_id import ModelingCmdId
|
|
|
|
from ..models.path_segment import PathSegment
|
2023-05-23 14:24:13 -07:00
|
|
|
from ..models.point2d import Point2d
|
2023-07-07 18:03:18 -07:00
|
|
|
from ..models.point3d import Point3d
|
2023-04-27 13:59:37 -07:00
|
|
|
from ..types import UNSET, Unset
|
2023-05-23 14:24:13 -07:00
|
|
|
from .extrude import Extrude
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
|
2023-07-07 18:03:18 -07:00
|
|
|
class StartPath(str, Enum):
|
|
|
|
"""Start a path.""" # noqa: E501
|
2023-04-27 13:59:37 -07:00
|
|
|
|
2023-07-07 18:03:18 -07:00
|
|
|
START_PATH = "StartPath"
|
|
|
|
|
|
|
|
def __str__(self) -> str:
|
|
|
|
return str(self.value)
|
|
|
|
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
B = TypeVar("B", bound="MovePathPen")
|
2023-07-07 18:03:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class MovePathPen:
|
|
|
|
path: Union[Unset, ModelingCmdId] = UNSET
|
|
|
|
to: Union[Unset, Point3d] = UNSET
|
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.path, Unset):
|
|
|
|
path = self.path
|
|
|
|
if not isinstance(self.to, Unset):
|
|
|
|
to = self.to
|
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if path is not UNSET:
|
|
|
|
field_dict["path"] = path
|
|
|
|
if to is not UNSET:
|
|
|
|
field_dict["to"] = to
|
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
2023-07-07 19:22:51 -07:00
|
|
|
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
|
2023-07-07 18:03:18 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_path = d.pop("path", UNSET)
|
|
|
|
path: Union[Unset, ModelingCmdId]
|
|
|
|
if isinstance(_path, Unset):
|
|
|
|
path = UNSET
|
|
|
|
else:
|
|
|
|
path = ModelingCmdId(_path)
|
|
|
|
|
|
|
|
_to = d.pop("to", UNSET)
|
|
|
|
to: Union[Unset, Point3d]
|
|
|
|
if isinstance(_to, Unset):
|
|
|
|
to = UNSET
|
|
|
|
else:
|
|
|
|
to = Point3d(_to)
|
|
|
|
|
|
|
|
move_path_pen = cls(
|
|
|
|
path=path,
|
|
|
|
to=to,
|
|
|
|
)
|
|
|
|
|
|
|
|
move_path_pen.additional_properties = d
|
|
|
|
return move_path_pen
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
|
|
|
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
|
|
|
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
|
|
|
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
|
|
|
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
B = TypeVar("B", bound="ExtendPath")
|
2023-07-07 18:03:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class ExtendPath:
|
|
|
|
path: Union[Unset, ModelingCmdId] = UNSET
|
|
|
|
segment: Union[Unset, PathSegment] = UNSET
|
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.path, Unset):
|
|
|
|
path = self.path
|
|
|
|
if not isinstance(self.segment, Unset):
|
|
|
|
segment = self.segment
|
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if path is not UNSET:
|
|
|
|
field_dict["path"] = path
|
|
|
|
if segment is not UNSET:
|
|
|
|
field_dict["segment"] = segment
|
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
2023-07-07 19:22:51 -07:00
|
|
|
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
|
2023-07-07 18:03:18 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_path = d.pop("path", UNSET)
|
|
|
|
path: Union[Unset, ModelingCmdId]
|
|
|
|
if isinstance(_path, Unset):
|
|
|
|
path = UNSET
|
|
|
|
else:
|
|
|
|
path = ModelingCmdId(_path)
|
|
|
|
|
|
|
|
_segment = d.pop("segment", UNSET)
|
|
|
|
segment: Union[Unset, PathSegment]
|
|
|
|
if isinstance(_segment, Unset):
|
|
|
|
segment = UNSET
|
|
|
|
else:
|
|
|
|
segment = _segment # type: ignore[arg-type]
|
|
|
|
|
|
|
|
extend_path = cls(
|
|
|
|
path=path,
|
|
|
|
segment=segment,
|
|
|
|
)
|
|
|
|
|
|
|
|
extend_path.additional_properties = d
|
|
|
|
return extend_path
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
|
|
|
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
|
|
|
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
|
|
|
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
|
|
|
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
P = TypeVar("P", bound="ClosePath")
|
2023-05-23 14:24:13 -07:00
|
|
|
|
2023-05-04 00:58:06 -07:00
|
|
|
|
2023-05-23 14:24:13 -07:00
|
|
|
@attr.s(auto_attribs=True)
|
2023-07-07 18:03:18 -07:00
|
|
|
class ClosePath:
|
|
|
|
path_id: Union[Unset, str] = UNSET
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
2023-07-07 18:03:18 -07:00
|
|
|
path_id = self.path_id
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
2023-07-07 18:03:18 -07:00
|
|
|
if path_id is not UNSET:
|
|
|
|
field_dict["path_id"] = path_id
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
2023-07-07 19:22:51 -07:00
|
|
|
def from_dict(cls: Type[P], src_dict: Dict[str, Any]) -> P:
|
2023-04-27 13:59:37 -07:00
|
|
|
d = src_dict.copy()
|
2023-07-07 18:03:18 -07:00
|
|
|
path_id = d.pop("path_id", UNSET)
|
|
|
|
|
|
|
|
close_path = cls(
|
|
|
|
path_id=path_id,
|
|
|
|
)
|
|
|
|
|
|
|
|
close_path.additional_properties = d
|
|
|
|
return close_path
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
|
|
|
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
|
|
|
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
|
|
|
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
|
|
|
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
J = TypeVar("J", bound="CameraDragStart")
|
2023-07-07 18:03:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class CameraDragStart:
|
|
|
|
interaction: Union[Unset, CameraDragInteractionType] = UNSET
|
|
|
|
window: Union[Unset, Point2d] = UNSET
|
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.interaction, Unset):
|
|
|
|
interaction = self.interaction
|
|
|
|
if not isinstance(self.window, Unset):
|
|
|
|
window = self.window
|
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if interaction is not UNSET:
|
|
|
|
field_dict["interaction"] = interaction
|
|
|
|
if window is not UNSET:
|
|
|
|
field_dict["window"] = window
|
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
2023-07-07 19:22:51 -07:00
|
|
|
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
|
2023-07-07 18:03:18 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_interaction = d.pop("interaction", UNSET)
|
|
|
|
interaction: Union[Unset, CameraDragInteractionType]
|
|
|
|
if isinstance(_interaction, Unset):
|
|
|
|
interaction = UNSET
|
|
|
|
else:
|
|
|
|
interaction = _interaction # type: ignore[arg-type]
|
|
|
|
|
|
|
|
_window = d.pop("window", UNSET)
|
|
|
|
window: Union[Unset, Point2d]
|
|
|
|
if isinstance(_window, Unset):
|
|
|
|
window = UNSET
|
|
|
|
else:
|
|
|
|
window = Point2d(_window)
|
|
|
|
|
|
|
|
camera_drag_start = cls(
|
|
|
|
interaction=interaction,
|
|
|
|
window=window,
|
|
|
|
)
|
|
|
|
|
|
|
|
camera_drag_start.additional_properties = d
|
|
|
|
return camera_drag_start
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
|
|
|
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
|
|
|
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
|
|
|
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
|
|
|
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
T = TypeVar("T", bound="CameraDragMove")
|
2023-07-07 18:03:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class CameraDragMove:
|
|
|
|
interaction: Union[Unset, CameraDragInteractionType] = UNSET
|
|
|
|
sequence: Union[Unset, int] = UNSET
|
|
|
|
window: Union[Unset, Point2d] = UNSET
|
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.interaction, Unset):
|
|
|
|
interaction = self.interaction
|
|
|
|
sequence = self.sequence
|
|
|
|
if not isinstance(self.window, Unset):
|
|
|
|
window = self.window
|
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if interaction is not UNSET:
|
|
|
|
field_dict["interaction"] = interaction
|
|
|
|
if sequence is not UNSET:
|
|
|
|
field_dict["sequence"] = sequence
|
|
|
|
if window is not UNSET:
|
|
|
|
field_dict["window"] = window
|
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
2023-07-07 19:22:51 -07:00
|
|
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
2023-07-07 18:03:18 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_interaction = d.pop("interaction", UNSET)
|
|
|
|
interaction: Union[Unset, CameraDragInteractionType]
|
|
|
|
if isinstance(_interaction, Unset):
|
|
|
|
interaction = UNSET
|
|
|
|
else:
|
|
|
|
interaction = _interaction # type: ignore[arg-type]
|
|
|
|
|
|
|
|
sequence = d.pop("sequence", UNSET)
|
|
|
|
|
|
|
|
_window = d.pop("window", UNSET)
|
|
|
|
window: Union[Unset, Point2d]
|
|
|
|
if isinstance(_window, Unset):
|
|
|
|
window = UNSET
|
|
|
|
else:
|
|
|
|
window = Point2d(_window)
|
|
|
|
|
|
|
|
camera_drag_move = cls(
|
|
|
|
interaction=interaction,
|
|
|
|
sequence=sequence,
|
|
|
|
window=window,
|
|
|
|
)
|
|
|
|
|
|
|
|
camera_drag_move.additional_properties = d
|
|
|
|
return camera_drag_move
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
|
|
|
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
|
|
|
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
|
|
|
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
|
|
|
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
V = TypeVar("V", bound="CameraDragEnd")
|
2023-07-07 18:03:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class CameraDragEnd:
|
|
|
|
interaction: Union[Unset, CameraDragInteractionType] = UNSET
|
|
|
|
window: Union[Unset, Point2d] = UNSET
|
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.interaction, Unset):
|
|
|
|
interaction = self.interaction
|
|
|
|
if not isinstance(self.window, Unset):
|
|
|
|
window = self.window
|
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if interaction is not UNSET:
|
|
|
|
field_dict["interaction"] = interaction
|
|
|
|
if window is not UNSET:
|
|
|
|
field_dict["window"] = window
|
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
2023-07-07 19:22:51 -07:00
|
|
|
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
|
2023-07-07 18:03:18 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_interaction = d.pop("interaction", UNSET)
|
|
|
|
interaction: Union[Unset, CameraDragInteractionType]
|
|
|
|
if isinstance(_interaction, Unset):
|
|
|
|
interaction = UNSET
|
|
|
|
else:
|
|
|
|
interaction = _interaction # type: ignore[arg-type]
|
|
|
|
|
|
|
|
_window = d.pop("window", UNSET)
|
|
|
|
window: Union[Unset, Point2d]
|
|
|
|
if isinstance(_window, Unset):
|
|
|
|
window = UNSET
|
2023-05-23 14:24:13 -07:00
|
|
|
else:
|
2023-07-07 18:03:18 -07:00
|
|
|
window = Point2d(_window)
|
2023-05-23 14:24:13 -07:00
|
|
|
|
2023-07-07 18:03:18 -07:00
|
|
|
camera_drag_end = cls(
|
|
|
|
interaction=interaction,
|
|
|
|
window=window,
|
2023-04-27 13:59:37 -07:00
|
|
|
)
|
|
|
|
|
2023-07-07 18:03:18 -07:00
|
|
|
camera_drag_end.additional_properties = d
|
|
|
|
return camera_drag_end
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
|
|
|
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
|
|
|
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
|
|
|
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-05-23 14:24:13 -07:00
|
|
|
|
|
|
|
|
2023-07-07 18:03:18 -07:00
|
|
|
ModelingCmd = Union[
|
|
|
|
StartPath,
|
|
|
|
MovePathPen,
|
|
|
|
ExtendPath,
|
|
|
|
Extrude,
|
|
|
|
ClosePath,
|
|
|
|
CameraDragStart,
|
|
|
|
CameraDragMove,
|
|
|
|
CameraDragEnd,
|
|
|
|
]
|