def _iconSizeChanged(self):
        current = 0.0
        spin_box = self.sender()
        if spin_box == self._ui._doubleSpinBoxNormalArrow:
            mode = self._ui._sceneviewer3d.getMode(ViewMode.PLANE_NORMAL)
            glyph = mode.getGlyph()
            current = getGlyphSize(glyph)
            base_size = self._ui._doubleSpinBoxNormalArrow.value()
            new = [base_size, base_size / 4, base_size / 4]
        elif spin_box == self._ui._doubleSpinBoxRotationCentre:
            mode = self._ui._sceneviewer3d.getMode(ViewMode.PLANE_ROTATION)
            glyph = mode.getGlyph()
            current = getGlyphSize(glyph)
            base_size = self._ui._doubleSpinBoxRotationCentre.value()
            new = [base_size, base_size, base_size]
        elif spin_box == self._ui._doubleSpinBoxSegmentationPoint:
            glyph = self._segmentation_point_glyph
            current = getGlyphSize(glyph)
            base_size = self._ui._doubleSpinBoxSegmentationPoint.value()
            new = [base_size, base_size, base_size]

        if current != new:
            c = CommandSetGlyphSize(current, new, glyph)
            c.setSetGlyphSizeMethod(setGlyphSize)
            c.setSpinBox(spin_box)

            self._model.getUndoRedoStack().push(c)
Ejemplo n.º 2
0
    def pointSizeChanged(self, value):
        glyph = self._scene.getGraphic(POINT_CLOUD_GRAPHIC_NAME)
        current = getGlyphSize(glyph)
        new = [value, value, value]

        if current != new:
            c = CommandSetGlyphSize(current, new, [glyph, self._scene.getGraphic(POINT_CLOUD_ON_PLANE_GRAPHIC_NAME)])
            c.setSetGlyphSizeMethod(setGlyphSize)
            c.setSpinBox(self._widget._ui._doubleSpinBoxPointSize)

            self._undo_redo_stack.push(c)