drawingcursor.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Guido Tack, 2006
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef GECODE_GIST_QT_DRAWINGCURSOR_HH
#define GECODE_GIST_QT_DRAWINGCURSOR_HH
#include <gecode/gist/nodecursor.hh>
#include <gecode/gist/layoutcursor.hh>
#include <QtGui>
namespace Gecode { namespace Gist {
class DrawingCursor : public NodeCursor<VisualNode> {
private:
QPainter& painter;
QRect clippingRect;
BestNode* curBest;
double x, y;
bool copies;
bool isClipped(void);
public:
static const QColor red;
static const QColor green;
static const QColor blue;
static const QColor orange;
static const QColor white;
static const QColor lightRed;
static const QColor lightGreen;
static const QColor lightBlue;
DrawingCursor(VisualNode* root,
const VisualNode::NodeAllocator& na,
BestNode* curBest0,
QPainter& painter0,
const QRect& clippingRect0, bool showCopies);
void moveUpwards(void);
bool mayMoveDownwards(void);
void moveDownwards(void);
void moveSidewards(void);
void processCurrentNode(void);
};
}}
#include <gecode/gist/drawingcursor.hpp>
#endif
// STATISTICS: gist-any
Gecode::Gist::BestNode
Static reference to the currently best space.
Definition spacenode.hh:80
Gecode::Gist::DrawingCursor::red
static const QColor red
The color for failed nodes.
Definition drawingcursor.hh:61
Gecode::Gist::DrawingCursor::moveDownwards
void moveDownwards(void)
Move cursor to child.
Definition drawingcursor.hpp:65
Gecode::Gist::DrawingCursor::processCurrentNode
void processCurrentNode(void)
Draw the node.
Definition drawingcursor.cpp:79
Gecode::Gist::DrawingCursor::blue
static const QColor blue
The color for choice nodes.
Definition drawingcursor.hh:65
Gecode::Gist::DrawingCursor::green
static const QColor green
The color for solved nodes.
Definition drawingcursor.hh:63
Gecode::Gist::DrawingCursor::mayMoveDownwards
bool mayMoveDownwards(void)
Test if cursor may move to child.
Definition drawingcursor.hpp:57
Gecode::Gist::DrawingCursor::white
static const QColor white
White color.
Definition drawingcursor.hh:69
Gecode::Gist::DrawingCursor::lightBlue
static const QColor lightBlue
The color for expanded choice nodes.
Definition drawingcursor.hh:76
Gecode::Gist::DrawingCursor::moveUpwards
void moveUpwards(void)
Move cursor to parent.
Definition drawingcursor.hpp:37
Gecode::Gist::DrawingCursor::DrawingCursor
DrawingCursor(VisualNode *root, const VisualNode::NodeAllocator &na, BestNode *curBest0, QPainter &painter0, const QRect &clippingRect0, bool showCopies)
Constructor.
Definition drawingcursor.cpp:65
Gecode::Gist::DrawingCursor::moveSidewards
void moveSidewards(void)
Move cursor to sibling.
Definition drawingcursor.hpp:72
Gecode::Gist::DrawingCursor::lightRed
static const QColor lightRed
The color for expanded failed nodes.
Definition drawingcursor.hh:72
Gecode::Gist::DrawingCursor::lightGreen
static const QColor lightGreen
The color for expanded solved nodes.
Definition drawingcursor.hh:74
Gecode::Gist::DrawingCursor::orange
static const QColor orange
The color for the best solution.
Definition drawingcursor.hh:67
Gecode::Gist::NodeCursor< VisualNode >::na
const VisualNode::NodeAllocator & na
Definition nodecursor.hh:53
Gecode::Gist::NodeCursor< VisualNode >::NodeCursor
NodeCursor(VisualNode *theNode, const typename VisualNode::NodeAllocator &na)
Definition nodecursor.hpp:38
Gecode::Gist::Node::NodeAllocator
NodeAllocatorBase< VisualNode > NodeAllocator
Definition node.hh:143
Gecode::Gist::VisualNode
Node class that supports visual layout
Definition visualnode.hh:125
drawingcursor.hpp
layoutcursor.hh
Gecode::Gist
The Gecode Interactive Search Tool.
Gecode
Gecode toplevel namespace
nodecursor.hh