Ejemplo n.º 1
0
    def btn_z_view(self, index):
        self.clear_glow()

        if index == 'clear':
            messenger.send('dim_action_clear', [Z_AXIS])
            action = ActionAxis(ACTION_CLEAR, Z_AXIS)
            actionManager.addAction(action)

        if index == 'view front':
            z = photocube.cube.cubeService.coordinate.get_z()

            if z is not None:
                messenger.send('dim_move_to_axis', [Z_AXIS, X_AXIS])
                action = ActionAxis(ACTION_MOVE, Z_AXIS, X_AXIS)
                actionManager.addAction(action)

        if index == 'view in':
            z = photocube.cube.cubeService.coordinate.get_z()

            if z is not None:
                messenger.send('dim_move_to_axis', [Z_AXIS, Y_AXIS])
                action = ActionAxis(ACTION_MOVE, Z_AXIS, Y_AXIS)
                actionManager.addAction(action)

        if index == "swap with front":
            messenger.send('z_dim_action_swap', [X_AXIS])
            action = ActionAxis(ACTION_SWAP, Z_AXIS, X_AXIS)
            actionManager.addAction(action)

        if index == "swap with in":
            messenger.send('z_dim_action_swap', [Y_AXIS])
            action = ActionAxis(ACTION_SWAP, Z_AXIS, Y_AXIS)
            actionManager.addAction(action)
Ejemplo n.º 2
0
    def btn_x_view(self, index):
        self.clear_glow()

        if index == 'view up':
            x = photocube.cube.cubeService.coordinate.get_x()
            if x is not None:
                messenger.send('dim_move_to_axis', [X_AXIS, Z_AXIS])
                action = ActionAxis(ACTION_MOVE, X_AXIS, Z_AXIS)
                actionManager.addAction(action)

        if index == 'view in':
            x = photocube.cube.cubeService.coordinate.get_x()
            if x is not None:
                messenger.send('dim_move_to_axis', [X_AXIS, Y_AXIS])
                action = ActionAxis(ACTION_MOVE, X_AXIS, Y_AXIS)
                actionManager.addAction(action)

        if index == "swap with up":
            messenger.send('x_dim_action_swap', [Z_AXIS])
            # create action for the swap.
            action = ActionAxis(ACTION_SWAP, X_AXIS, Z_AXIS)
            actionManager.addAction(action)

        if index == "swap with in":
            messenger.send('x_dim_action_swap', [Y_AXIS])
            # create action for the swap.
            action = ActionAxis(ACTION_SWAP, X_AXIS, Y_AXIS)
            actionManager.addAction(action)

        if index is 'clear':
            messenger.send('dim_action_clear', [X_AXIS])
            action = ActionAxis(ACTION_CLEAR, X_AXIS)
            actionManager.addAction(action)
Ejemplo n.º 3
0
 def constuct_cube(self, Ids):
     tagset = objectCubeService.get_tagset_by_id( int(Ids[0]) )
     # Get the hirarchy from the tagset.
     dim = tagset.getDimension( int( Ids[1] ))
     
     axis = ''
     if self.dimension.get() == 'front':
         axis = X_AXIS
     elif self.dimension.get() == 'up':
         axis = Z_AXIS
     elif self.dimension.get() == 'in':
         axis = Y_AXIS
     action = ActionHierachy(ACTION_SET, tagset.id, dim.id, axis)
     actionManager.addAction(action)
     messenger.send('dim_view_hierarchy', [axis, dim])
Ejemplo n.º 4
0
    def btn_dimensions(self, index):
        self.clear_glow()
        tagset = photocube.objectcube.objectCubeService.get_tagset_by_id(
            self.selected_tagset_id)

        if index == 'view front':
            action = ActionTagset(ACTION_SET, tagset.id, X_AXIS)
            actionManager.addAction(action)
            messenger.send('dim_view_tagset', [X_AXIS, tagset])

        if index == 'view in':
            action = ActionTagset(ACTION_SET, tagset.id, Y_AXIS)
            actionManager.addAction(action)
            messenger.send('dim_view_tagset', [Y_AXIS, tagset])

        if index == 'view up':
            action = ActionTagset(ACTION_SET, tagset.id, Z_AXIS)
            actionManager.addAction(action)
            messenger.send('dim_view_tagset', [Z_AXIS, tagset])

        if index == 'add dimension filter':
            dim_filter = ObjectCubePython.DimensionFilter(
                tagset.getDefaultDimension().getRoot(), tagset.id)
            filterManager.add_filter(dim_filter, True)

            # add action
            action = ActionFilter(ACTION_DIMENSIONFILTER,
                                  ACTION_ADD,
                                  tagsetId=tagset.id)
            actionManager.addAction(action)

            # reload filters menu.
            self.reload_filter2()

        if index == 'add tag filter':
            photocube.dialogs.dialogService.open_add_tagfilter(tagset)

        if index == 'add range filter':
            if tagset.typeId == 3:
                photocube.dialogs.dialogService.open_add_date_range(tagset)

            elif tagset.typeId == 4:
                photocube.dialogs.dialogService.open_add_time_range(tagset)

            else:
                photocube.dialogs.dialogService.open_add_numerical_range(
                    tagset)

        if index == 'edit':
            photocube.dialogs.dialogService.openCreateNewTagsetDialog(tagset)
Ejemplo n.º 5
0
    def btn_hierarchy(self, index):
        # Get the tagset that the hir belongs to.
        tagset = photocube.objectcube.objectCubeService.get_tagset_by_id(
            self.selected_tagset_id)
        print 'selected_hierarchy_id: ' + str(self.selected_hierarchy_id)
        # Get the hirarchy from the tagset.
        dim = tagset.getDimension(int(self.selected_hierarchy_id))
        print 'Dimension click'
        if index == 'view front':
            print 'DimId: ' + str(dim.id)
            print 'TagSetId: ' + str(tagset.id)
            print index + ': Begin'
            print 'ACTION_SET'
            print ACTION_SET
            print 'X_AXIS'
            print X_AXIS
            action = ActionHierachy(ACTION_SET, tagset.id, dim.id, X_AXIS)
            actionManager.addAction(action)
            print 'action'
            print action
            messenger.send('dim_view_hierarchy', [X_AXIS, dim])
            print index + ': End'

        elif index == 'view in':
            action = ActionHierachy(ACTION_SET, tagset.id, dim.id, Y_AXIS)
            actionManager.addAction(action)
            messenger.send('dim_view_hierarchy', [Y_AXIS, dim])

        elif index == 'view up':
            action = ActionHierachy(ACTION_SET, tagset.id, dim.id, Z_AXIS)
            actionManager.addAction(action)
            messenger.send('dim_view_hierarchy', [Z_AXIS, dim])

        elif index == 'add dimension filter':
            dim_filter = ObjectCubePython.DimensionFilter(
                dim.getRoot(), tagset.id)
            filterManager.add_filter(dim_filter, True)

            # add action
            action = ActionFilter(ACTION_DIMENSIONFILTER,
                                  ACTION_ADD,
                                  tagsetId=tagset.id,
                                  hirarchyId=int(self.selected_hierarchy_id))
            actionManager.addAction(action)
            self.reload_filter2()

        else:
            raise Exception('btn_hierarchy: unknown index: ' + index)
Ejemplo n.º 6
0
    def btn_y_view(self, index):
        """
        This function is called when we select buttons
        in the view y context menu.
        """
        self.clear_glow()

        if index == 'clear':
            messenger.send('dim_action_clear', [Y_AXIS])
            action = ActionAxis(ACTION_CLEAR, Y_AXIS)
            actionManager.addAction(action)

        if index == 'view front':
            y = photocube.cube.cubeService.coordinate.get_y()

            if y is not None:
                messenger.send('dim_move_to_axis', [Y_AXIS, X_AXIS])
                action = ActionAxis(ACTION_MOVE, Y_AXIS, X_AXIS)
                actionManager.addAction(action)

        if index == 'view up':
            y = photocube.cube.cubeService.coordinate.get_y()

            if y is not None:
                messenger.send('dim_move_to_axis', [Y_AXIS, Z_AXIS])
                action = ActionAxis(ACTION_MOVE, Y_AXIS, Z_AXIS)
                actionManager.addAction(action)

        if index == "swap with front":
            messenger.send('y_dim_action_swap', [X_AXIS])
            action = ActionAxis(ACTION_SWAP, Y_AXIS, X_AXIS)
            actionManager.addAction(action)

        if index == "swap with up":
            messenger.send('y_dim_action_swap', [Z_AXIS])
            action = ActionAxis(ACTION_SWAP, Y_AXIS, Z_AXIS)
            actionManager.addAction(action)