00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 #ifndef __FK_OPERATION_HEADER__
00073 #define __FK_OPERATION_HEADER__
00074
00075 #include <vector>
00076 #include <FK/DrawCache.h>
00077 #include <FK/History.H>
00078
00079 #ifdef __FK_OPERATION_CODE__
00080 static const int MAKEV = 1;
00081 static const int DELV = 2;
00082 static const int MOVEV = 3;
00083 static const int MAKEE1 = 4;
00084 static const int MAKEE2 = 5;
00085 static const int MAKEE3 = 6;
00086 static const int DELE1 = 7;
00087 static const int DELE2 = 8;
00088 static const int DELE3 = 9;
00089 static const int MAKEL = 10;
00090 static const int DELL = 11;
00091 static const int SEPL = 12;
00092 static const int UNITL = 13;
00093 static const int SEPE = 14;
00094 static const int UNITE = 15;
00095 static const int NEGATE = 16;
00096
00097 #endif
00098
00100
00135 class fk_Operation : public fk_DrawCache {
00136
00137 private:
00138 fk_History history;
00139 bool historyMode;
00140 bool tesselateMode;
00141
00142 fk_Loop * SetLoop(fk_Half *, bool,
00143 fk_Loop * = NULL, int = FK_UNDEFINED);
00144 void UndefVNorm(fk_Vertex *);
00145
00146 fk_Vertex * MakeVertex(const fk_Vector, int);
00147 bool DeleteVertex(fk_Vertex *);
00148 bool MoveVertex(fk_Vertex *, fk_Vector);
00149
00150 fk_Edge * MakeEdge1(fk_Vertex *, fk_Vertex *,
00151 int = FK_UNDEFINED,
00152 int = FK_UNDEFINED,
00153 int = FK_UNDEFINED);
00154 fk_Edge * MakeEdge2(fk_Vertex *, fk_Vertex *,
00155 fk_Half *, fk_Half *, bool, bool,
00156 int = FK_UNDEFINED,
00157 int = FK_UNDEFINED,
00158 int = FK_UNDEFINED);
00159 fk_Edge * MakeEdge3(fk_Vertex *, fk_Vertex *,
00160 fk_Half *, fk_Half *,
00161 fk_Half *, fk_Half *, bool, bool,
00162 int = FK_UNDEFINED,
00163 int = FK_UNDEFINED,
00164 int = FK_UNDEFINED);
00165
00166 bool DeleteEdge1(fk_Edge *);
00167 bool DeleteEdge2(fk_Half *);
00168 bool DeleteEdge3(fk_Edge *);
00169
00170 fk_Loop * MakeLoop(fk_Half *, int = FK_UNDEFINED);
00171 bool DeleteLoop(fk_Loop *);
00172
00173 fk_Edge * SeparateLoop(fk_Half *, fk_Half *, fk_Half *, fk_Half *,
00174 bool, bool,
00175 int = FK_UNDEFINED,
00176 int = FK_UNDEFINED,
00177 int = FK_UNDEFINED,
00178 int = FK_UNDEFINED);
00179
00180 bool UniteLoop(fk_Edge *, fk_Half *);
00181 fk_Vertex * SeparateEdge(fk_Edge *, bool, bool, bool, bool,
00182 fk_Vector *,
00183 int = FK_UNDEFINED,
00184 int = FK_UNDEFINED,
00185 int = FK_UNDEFINED,
00186 int = FK_UNDEFINED);
00187
00188 bool UniteEdge(fk_Vertex *);
00189 void NegateBody(void);
00190
00191
00192 void UndoCom(fk_Command *);
00193 void RedoCom(fk_Command *);
00194
00195 void DeleteAllTesselateData(void);
00196 public:
00198 fk_Operation(fk_DataBase * = (fk_DataBase *)NULL);
00199
00201 ~fk_Operation();
00202
00204
00205
00207
00219 fk_Vertex * makeVertex(const fk_Vector P);
00220
00222
00235 bool deleteVertex(fk_Vertex *V);
00236
00238
00252 bool moveVertex(fk_Vertex *V, fk_Vector P);
00253
00255
00296 fk_Edge * makeEdge(fk_Vertex *V_1, fk_Vertex *V_2,
00297 fk_Half *H_11 = (fk_Half *)NULL,
00298 fk_Half *H_12 = (fk_Half *)NULL,
00299 fk_Half *H_21 = (fk_Half *)NULL,
00300 fk_Half *H_22 = (fk_Half *)NULL);
00301
00303
00316 bool deleteEdge(fk_Edge *E);
00317
00319
00335 fk_Loop * makeLoop(fk_Half *H);
00336
00338
00352 bool deleteLoop(fk_Loop *L);
00353
00355
00377 fk_Edge * separateLoop(fk_Half *H1, fk_Half *H2);
00378
00380
00395 bool uniteLoop(fk_Edge *E);
00396
00398
00411 fk_Vertex * separateEdge(fk_Edge *E);
00412
00414
00429 bool uniteEdge(fk_Vertex *V);
00430
00432
00447 void negateBody(void);
00448
00449
00450
00452
00453
00455
00470 void setHistoryMode(bool mode);
00471
00473
00481 bool getHistoryMode(void);
00482
00484
00494 void setHistoryMark(void);
00495
00497
00546 bool undoHistory(void);
00547
00549
00559 bool redoHistory(void);
00560
00561
00563
00564
00566
00577 void setTesselateMode(bool mode);
00578
00580
00590 bool getTesselateMode(void);
00591
00592
00593 #ifndef FK_DOXYGEN_USER_PROCESS
00594 void PrintHistorySize(void);
00595 #endif
00596 };
00597
00598
00599 #endif // !__FK_OPERATION_HEADER__