00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef EGGMESHERFANMAKER_H
00016 #define EGGMESHERFANMAKER_H
00017
00018 #include "pandabase.h"
00019
00020 #include "eggMesherEdge.h"
00021 #include "eggMesherStrip.h"
00022 #include "config_egg.h"
00023 #include "plist.h"
00024 #include "pvector.h"
00025
00026 #include "pnotify.h"
00027 #include "mathNumbers.h"
00028
00029 class EggMesher;
00030
00031
00032
00033
00034
00035
00036
00037 class EggMesherFanMaker {
00038 public:
00039 typedef plist<const EggMesherEdge *> Edges;
00040 typedef plist<EggMesherStrip *> Strips;
00041
00042 EggMesherFanMaker(int vertex, EggMesherStrip *tri,
00043 EggMesher *mesher);
00044 EggMesherFanMaker(const EggMesherFanMaker ©);
00045 void operator = (const EggMesherFanMaker ©);
00046
00047 INLINE bool operator < (const EggMesherFanMaker &other) const;
00048 INLINE bool operator != (const EggMesherFanMaker &other) const;
00049 INLINE bool operator == (const EggMesherFanMaker &other) const;
00050
00051 INLINE bool is_empty() const;
00052 INLINE bool is_valid() const;
00053 INLINE bool is_coplanar_with(const EggMesherFanMaker &other) const;
00054
00055 bool join(EggMesherFanMaker &other);
00056 double compute_angle() const;
00057
00058 int build(EggGroupNode *unrolled_tris);
00059 int unroll(Strips::iterator strip_begin, Strips::iterator strip_end,
00060 Edges::iterator edge_begin, Edges::iterator edge_end,
00061 EggGroupNode *unrolled_tris);
00062
00063 void output(ostream &out) const;
00064
00065 int _vertex;
00066 Edges _edges;
00067 Strips _strips;
00068 bool _planar;
00069 EggMesher *_mesher;
00070 };
00071
00072 INLINE ostream &operator << (ostream &out, const EggMesherFanMaker &fm);
00073
00074 #include "eggMesherFanMaker.I"
00075
00076 #endif