Commit 675a3482 authored by Jakob Weiss's avatar Jakob Weiss
Browse files

Feature: Processor instance names

Instance names to (re-)name processor instances individually for UI and discrimination of different instances

# Conflicts:
#	core/pipeline/abstractprocessor.h
parent a1a66467
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ namespace campvis {
        switch (role) {
            case Qt::DisplayRole:
                if (column == COLUMN_NAME)
                    return QVariant(QString::fromStdString(_processor->getName()));
                    return QVariant(QString::fromStdString(_processor->getInstanceName()));
                else
                    return QVariant();
            case Qt::CheckStateRole:
+1 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ namespace campvis {
    }

    void AbstractProcessor::init() {
        _instanceName = this->getName();
        initAllProperties();
    }

@@ -134,7 +135,6 @@ namespace campvis {
        _clockExecutionTime = value;
    }


    void AbstractProcessor::process(DataContainer& data) {
        if (hasInvalidShader()) {
            updateShader();
+25 −1
Original line number Diff line number Diff line
@@ -149,6 +149,28 @@ namespace campvis {
         */
        virtual ProcessorState getProcessorState() const = 0;

        /**
         * Gets the name of the instance, to be used to disambiguate several instances of the same
         * processor.
         * \return _instanceName
         */
        std::string getInstanceName() const {
            return _instanceName;
        };

        /**
         * Sets the name of the instance.
         */
        void setInstanceName(const std::string& name) {
            _instanceName = name;
            s_instanceNameChanged.emitSignal();
        }

        /**
         * Signals when the instance name has changed. Useful for updating the GUI
         */
        sigslot::signal0 s_instanceNameChanged;

        /**
         * Registers \a prop as property with the provided invalidation level. Registered properties 
         * can be accessed from the outside, e.g. via getProperty(), and will automatically invalidate
@@ -380,6 +402,8 @@ namespace campvis {
        tbb::atomic<int> _level;            ///< current invalidation level
        tbb::concurrent_queue<int> _queuedInvalidations;

        std::string _instanceName; ///< instance name displayed in the GUI

        static const std::string loggerCat_;
    };