karbon

vbooleancmd.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001, The Karbon Developers
00003    Copyright (C) 2002, The Karbon Developers
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef __VBOOLEANCMD_H__
00022 #define __VBOOLEANCMD_H__
00023 
00024 
00025 #include <qvaluelist.h>
00026 
00027 #include "vcommand.h"
00028 
00029 class VSubpath;
00030 class VSegment;
00031 class VSelection;
00032 
00033 
00034 class VBooleanCmd : public VCommand
00035 {
00036 public:
00037     enum VBooleanType
00038     {
00039         intersect,
00040         shape_union,
00041         shape_xor,
00042         substract
00043     };
00044 
00045     VBooleanCmd( VDocument* doc, VBooleanType type = intersect );
00046     virtual ~VBooleanCmd();
00047 
00048     virtual void execute();
00049     virtual void unexecute();
00050 
00051 
00052     // We can only visit object pairs.
00053     virtual bool visit( VObject& /*object*/ )
00054     {
00055         return false;
00056     }
00057 
00058     // A pair visit() function.
00059     bool visit( VObject& object1, VObject& object2 );
00060 
00061 
00062     virtual void visitVSubpath( VSubpath& path );
00063 
00064 protected:
00065     typedef QValueList<double> VParamList;
00066 
00067     void recursiveSubdivision(
00068         const VSegment& segment1, double t0_1, double t1_1,
00069         const VSegment& segment2, double t0_2, double t1_2,
00070         VParamList& params1, VParamList& params2 );
00071 
00072 
00073     VSelection* m_selection;
00074 
00075     VBooleanType m_type;
00076 
00077     VSubpath* m_path1;
00078     VSubpath* m_path2;
00079 };
00080 
00081 #endif
00082 
KDE Home | KDE Accessibility Home | Description of Access Keys