Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/builder/mesherFanMaker.h

Go to the documentation of this file.
00001 // Filename: mesherFanMaker.h
00002 // Created by:  drose (21Sep97)
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 MESHERFANMAKER_H
00020 #define MESHERFANMAKER_H
00021 
00022 #ifdef SUPPORT_FANS
00023 
00024 #include <pandabase.h>
00025 
00026 #include "mesherConfig.h"
00027 #include "builderAttrib.h"
00028 #include "builderVertex.h"
00029 #include "builderBucket.h"
00030 #include "mesherEdge.h"
00031 #include "mesherStrip.h"
00032 
00033 #include "plist.h"
00034 #include "pvector.h"
00035 
00036 
00037 template <class PrimType>
00038 class MesherTempl;
00039 
00040 template <class PrimType>
00041 class MesherFanMaker {
00042 public:
00043   typedef PrimType Prim;
00044   typedef TYPENAME PrimType::Vertex Vertex;
00045   typedef TYPENAME PrimType::DAttrib FAttrib;
00046   typedef MesherEdge<PrimType> Edge;
00047   typedef MesherStrip<PrimType> Strip;
00048   typedef MesherTempl<PrimType> Mesher;
00049 
00050   typedef plist<const Edge *> Edges;
00051   typedef plist<Strip *> Strips;
00052 
00053   MesherFanMaker() {}
00054   MesherFanMaker(const Vertex *vertex, Strip *tri, Mesher *mesher);
00055 
00056   INLINE bool operator < (const MesherFanMaker &other) const;
00057   INLINE bool operator != (const MesherFanMaker &other) const;
00058   INLINE bool operator == (const MesherFanMaker &other) const;
00059 
00060   INLINE bool is_empty() const;
00061   INLINE bool is_valid() const;
00062   INLINE bool is_coplanar_with(const MesherFanMaker &other) const;
00063 
00064   bool join(MesherFanMaker &other);
00065   float compute_angle() const;
00066 
00067   int build(pvector<Prim> &unrolled_tris);
00068   int unroll(TYPENAME Strips::iterator strip_begin, TYPENAME Strips::iterator strip_end,
00069              TYPENAME Edges::iterator edge_begin, TYPENAME Edges::iterator edge_end,
00070              pvector<Prim> &unrolled_tris);
00071 
00072   ostream &output(ostream &out) const;
00073 
00074 
00075   const Vertex *_vertex;
00076   Edges _edges;
00077   Strips _strips;
00078   int _planar;
00079   BuilderBucket *_bucket;
00080   Mesher *_mesher;
00081 };
00082 
00083 template <class PrimType>
00084 ostream &operator << (ostream &out, const MesherFanMaker<PrimType> &fe) {
00085   return fe.output(out);
00086 }
00087 
00088 #include "mesherFanMaker.I"
00089 
00090 #endif // SUPPORT_FANS
00091 
00092 #endif

Generated on Fri May 2 00:34:48 2003 for Panda by doxygen1.3