00001
00002
00003
00004 #ifndef NICE_H
00005 #define NICE_H 1
00006
00007 #include "meshmorph.h"
00008
00009 typedef std::map<double,int,ltd> map_di;
00010 typedef std::map<double,int,ltd>::iterator di_it;
00011 typedef __gnu_cxx::hash_map<Vertex*,int,v_hash,eqv>::iterator vhm_it;
00012
00013 struct face_grp
00014 {
00015 vec_fp crossed_faces;
00016 vec_fp edge_faces;
00017 face_grp (void) :crossed_faces(),edge_faces() { }
00018 };
00019
00020 class Nice
00021 {
00022 private:
00023 hmap_v nonnice;
00024
00025
00026 static Nice * only_one;
00027 Nice (void);
00028 Nice (Nice const &);
00029 Nice & operator = (Nice const &);
00030 ~Nice (void);
00031 public:
00032 static Nice & instance (void);
00033 int getNonniceCount (bool);
00034 int getVertexNiceVal (Vertex const * const) const;
00035 bool findExtraPoint (Vertex const * const,
00036 vector3 &,
00037 fp_cit const &) const;
00038 bool updateVertexNiceness (Vertex * const);
00039 bool setVertexNiceness (Vertex * const,vec_op &);
00040 bool getCrossedObjFromVertToExtra (Vertex const * const,
00041 vector3 const &,
00042 vec_op &) const;
00043 bool getCrossedObjFromExtraToLimit (vector3 const &,
00044 vector3 const &,
00045 vec_op &) const;
00046 bool vertexIsNice (Vertex const * const) const;
00047 bool getPointOutsideObject (Vertex const * const,
00048 vector3 &,
00049 vec_op &) const;
00050 void getCrossedObjects (Vertex const * const,
00051 vec_op &) const;
00052 void getVertAdjFaceRay (vector3 &,
00053 vector3 &,
00054 fp_cit const &) const;
00055 void getPenetratedObjs (vec_fp &,
00056 vec_fp &,
00057 vec_op &) const;
00058 void getObjectsFromEdgeHits (vec_op & edge_hits,
00059 vec_op & objs) const;
00060 void findOddObjects (vec_op &,vec_op &) const;
00061 void getRaysToWorldLimit (vector3 const &,double [6][3]) const;
00062 void setVertexNiceVal (int const &,Vertex * const);
00063 void findNonniceVertices (void);
00064 face_grp findIntFacesAlongRay (Vertex const * const,
00065 vector3 const &,
00066 vector3 const &) const;
00071 vhm_cit beginNice (void) const
00072 {
00073 return nonnice.begin();
00074 }
00075
00080 vhm_cit endNice (void) const
00081 {
00082 return nonnice.end();
00083 }
00084 };
00085
00086 #endif