00001 // Filename: mesherEdge.h 00002 // Created by: drose (15Sep97) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef MESHEREDGE_H 00020 #define MESHEREDGE_H 00021 00022 #include <pandabase.h> 00023 00024 #include "mesherConfig.h" 00025 #include "builderBucket.h" 00026 00027 #include "plist.h" 00028 #include <math.h> 00029 00030 00031 template <class PrimType> 00032 class MesherStrip; 00033 00034 template <class PrimType> 00035 class MesherEdge { 00036 public: 00037 typedef PrimType Prim; 00038 typedef TYPENAME PrimType::Vertex Vertex; 00039 typedef MesherStrip<PrimType> Strip; 00040 00041 INLINE MesherEdge(const Vertex *a, const Vertex *b); 00042 INLINE MesherEdge(const MesherEdge ©); 00043 00044 void remove(Strip *strip); 00045 void change_strip(Strip *from, Strip *to); 00046 00047 INLINE bool contains_vertex(const Vertex *v) const; 00048 00049 INLINE bool matches(const MesherEdge &other) const; 00050 00051 INLINE MesherEdge *common_ptr(); 00052 00053 INLINE bool operator == (const MesherEdge &other) const; 00054 INLINE bool operator != (const MesherEdge &other) const; 00055 INLINE bool operator < (const MesherEdge &other) const; 00056 00057 INLINE float compute_length(const BuilderBucket &bucket) const; 00058 INLINE Vertexf compute_box(const BuilderBucket &bucket) const; 00059 00060 ostream &output(ostream &out) const; 00061 00062 const Vertex *_a, *_b; 00063 00064 typedef plist<Strip *> Strips; 00065 Strips _strips; 00066 MesherEdge *_opposite; 00067 }; 00068 00069 template <class PrimType> 00070 INLINE ostream &operator << (ostream &out, 00071 const MesherEdge<PrimType> &edge) { 00072 return edge.output(out); 00073 } 00074 00075 #include "mesherEdge.I" 00076 00077 #endif