def data(self) -> Iterator[VPoint]: """Yield the digitization of all table data.""" for row in range(self.rowCount()): links = self.item(row, 1).text() color = self.item(row, 3).text() x = float(self.item(row, 4).text()) y = float(self.item(row, 5).text()) # p_type = (type: str, angle: float) p_type = self.item(row, 2).text().split(':') if p_type[0] == 'R': type_int = 0 angle = 0. else: angle = float(p_type[1]) type_int = 1 if p_type[0] == 'P' else 2 vpoint = VPoint(links, type_int, angle, color, x, y, color_qt) vpoint.move(*self.currentPosition(row)) yield vpoint
def item_data(self, row: int) -> VPoint: """Return data of VPoint.""" links = self.item(row, 1).text() color = self.item(row, 3).text() x = float(self.item(row, 4).text()) y = float(self.item(row, 5).text()) # p_type = (type: str, angle: float) p_type = self.item(row, 2).text().split(':') if p_type[0] == 'R': j_type = VJoint.R angle = 0. else: angle = float(p_type[1]) j_type = VJoint.P if p_type[0] == 'P' else VJoint.RP vpoint = VPoint([ link for link in links.replace(" ", '').split(',') if link ], j_type, angle, color, x, y, color_rgb) vpoint.move(*self.current_position(row)) return vpoint
def data(self) -> VPoint: """Yield the digitization of all table data.""" for row in range(self.rowCount()): Links = self.item(row, 1).text() color = self.item(row, 3).text() x = float(self.item(row, 4).text()) y = float(self.item(row, 5).text()) ''' Type = (type:str, angle:float) ''' Type = self.item(row, 2).text().split(':') if Type[0] == 'R': Type = 0 angle = 0. elif Type[0] == 'P' or Type[0] == 'RP': angle = float(Type[1]) Type = {'P': 1, 'RP': 2}[Type[0]] vpoint = VPoint(Links, Type, angle, color, x, y, colorQt) vpoint.move(*self.currentPosition(row)) yield vpoint