00001
00016 #ifndef __OCT_GEN_H__
00017 #define __OCT_GEN_H__
00018
00019 #include <cad/cad_model.h>
00020 #include <generator/gen_help.h>
00021 #include <octree/index_oct.h>
00022
00023 #include <node_index.h>
00024 #include <exception.h>
00025
00026
00032 class WrongModelException : Exception {
00033 public:
00037 WrongModelException() : Exception("Wrong CadModel") {}
00038 };
00039
00040
00048 class OctGen {
00049 public:
00054 OctGen(CadModel* model);
00055
00063 void add(NodeIndex p, Color color)
00064 throw (NotEnoughMemoryException*);
00065
00078 void addQuadrilateral(NodeIndex pA, NodeIndex pB, NodeIndex pC,
00079 NodeIndex pD, Color color)
00080 throw (NotEnoughMemoryException*);
00081
00093 void addTriangle(NodeIndex pA, NodeIndex pB, NodeIndex pC,
00094 Color color)
00095 throw (NotEnoughMemoryException*);
00096
00102 CadModel* getCadModel();
00103
00104 #ifndef CLASSIC_MODE
00105
00114 Color getColor(NodeIndex p);
00115 #endif
00116
00122 GenHelp* getGenHelp();
00123
00128 IndexOct* getGenTree();
00129
00140 IndexOct* getOctree(Hight maxTreeHight)
00141 throw (NotEnoughMemoryException*, WrongModelException*);
00142
00143 private:
00154 void addLine(NodeIndex start, NodeIndex end, Color color)
00155 throw (NotEnoughMemoryException*);
00156
00166 void addObject(CadObject* object, Color color)
00167 throw (NotEnoughMemoryException*);
00168
00177 void checkModel() throw (WrongModelException*);
00178
00189 Color nextPointColor(NodeIndex p);
00190
00191 #ifndef CLASSIC_MODE
00192
00204 Color testRayColor(NodeIndex p);
00205 #else
00206
00207 void generateClassic(NodeIndex idx);
00208
00222 Color testRayColor(NodeIndex p, bool &isAtBorder);
00223 #endif
00224
00228 CadModel* cadModel;
00229
00233 GenHelp* genHelp;
00234
00238 IndexOct* octree;
00239 };
00240
00241 #endif // ! __OCT_GEN_H__