karbon
vbooleancmd.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
00053 virtual bool visit( VObject& )
00054 {
00055 return false;
00056 }
00057
00058
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
|