Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
1 result

ControlNodeItem.h

Blame
  • ControlNodeItem.h 2.37 KiB
    /*************************************************************************
     *   Copyright (C) 2007 by Oliver Bock                                   *
     *   bock@tfh-berlin.de                                                  *
     *                                                                       *
     *   This file is part of Fidelity.                                      *
     *                                                                       *
     *   Fidelity is free software: you can redistribute it and/or modify    *
     *   it under the terms of the GNU General Public License as published   *
     *   by the Free Software Foundation, version 3 of the License.          *
     *                                                                       *
     *   Fidelity is distributed in the hope that it will be useful,         *
     *   but WITHOUT ANY WARRANTY; without even the implied warranty of      *
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the        *
     *   GNU General Public License for more details.                        *
     *                                                                       *
     *   You should have received a copy of the GNU General Public License   *
     *   along with Fidelity. If not, see <http://www.gnu.org/licenses/>.    *
     *                                                                       *
     *************************************************************************/
    
    #ifndef CONTROLNODEITEM_H
    #define CONTROLNODEITEM_H
    
    #include <QtGui>
    
    #include "ANode.h"
    
    #include "ANodeItem.h"
    
    namespace Fidelity {
    	namespace GUI {
    
    /**
     * @author Oliver Bock <bock@tfh-berlin.de>
     * 
     * This class represents a specialised ANodeItem suitable for control nodes.<br>
     * Here the type-specific properties of the control node item are configured.
     */
    class ControlNodeItem : public ANodeItem
    {
    
    public:
    	/**
    	 * Constructor
    	 */
    	ControlNodeItem(ANode* node, QGraphicsItem* parent = 0);
    
    	/**
    	 * This enumeration is required qgraphicsitem_cast to work.<br>
    	 * It's only value is returned by type().
    	 * For some reason it doesn't work in this case...
    	 */
    	enum { Type = UserType + 2 };
    
    	/**
    	 * This pure virtual method is required for RTTI (dynamic_cast) to work.<br>
    	 * For some reason qgraphicsitem_cast doesn't work in this case...
    	 * @return The numerical type of this node (provided by QGraphicsItem::UserType).
    	 */
    	int type() const { return Type; }
    };}}
    
    #endif