2 Qanava - Graph drawing library for QT
3 Copyright (C) 2006 Benoit AUTHEMAN
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //-----------------------------------------------------------------------------
21 // This file is a part of the Qanava software.
24 // \author Benoit Autheman (benoit@libqanava.org)
25 // \date 2004 December 05
26 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 namespace qan
{ // ::qan
43 //! Defines the necessary methods to build a grid on a virtual canvas (draw lines, text, manage resizing, etc.).
45 Grid geometry is added dynamically using virtual methods addLine(), addRectangle() and addText() implemented
46 in a concrete grid for a particular graphic subsystem (for exemple QT GraphView and GridCheckBoardItem).
48 \sa GridCheckBoardItem
53 /*! \name Grid Constructor and Destructor *///-------------------------
57 //! Grid constructor with eventual layout initialization.
65 Grid( const Grid
& g
);
67 //---------------------------------------------------------------------
71 /*! \name Layout and Size Management *///-----------------------------
75 //! Resize the grid (ie, take care of resizing the specified horizontal and vertical lines, and notify the grid layout of the resize).
76 virtual void resize( QSizeF s
) { }
78 //---------------------------------------------------------------------
82 /*! \name Grid Construction Management *///---------------------------
86 //! Add a grid line on the canvas with specific line settings.
87 virtual void addLine( QLineF l
, float w
= 1, bool dash
= false, bool dot
= false ) = 0;
89 //! Add a grid rectangle on the canvas with specific size and color settings.
90 virtual void addRectangle( QRectF r
, QColor c
) = 0;
92 //! Add a grid text label on the canvas.
93 virtual void addText( const QString
& text
, QPointF p
, bool bold
= false ) = 0;
95 //! Add an horizontal line to the grid canvas (horizontal lines are automatically resized when the grid canvas is resized).
96 virtual void addHorizontalLine( QLineF l
, int w
= 1, bool dash
= false, bool dot
= false ) = 0;
98 //! Add a vertical line to the grid canvas (vertical lines are automatically resized when the grid canvas is resized).
99 virtual void addVerticalLine( QLineF l
, int w
= 1, bool dash
= false, bool dot
= false ) = 0;
101 //---------------------------------------------------------------------
104 //-----------------------------------------------------------------------------