00001 // Filename: builderNormalVisualizer.h 00002 // Created by: drose (08Sep99) 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 BUILDERNORMALVISUALIZER_H 00020 #define BUILDERNORMALVISUALIZER_H 00021 00022 #include <pandabase.h> 00023 00024 #include "mesherConfig.h" 00025 00026 #ifdef SUPPORT_SHOW_NORMALS 00027 00028 #include "builderBucket.h" 00029 #include "builderAttrib.h" 00030 #include "builderVertex.h" 00031 #include "builderPrim.h" 00032 00033 #include "pvector.h" 00034 00035 /////////////////////////////////////////////////////////////////// 00036 // Class : BuilderNormalVisualizer 00037 // Description : A useful class for collecting information about 00038 // vertices and their associated normals as geometry is 00039 // built, so that its normals may be visualized via 00040 // renderable geometry. This is activated by the 00041 // _show_normals flag in the BuilderProperties. 00042 //////////////////////////////////////////////////////////////////// 00043 class EXPCL_PANDAEGG BuilderNormalVisualizer { 00044 public: 00045 INLINE BuilderNormalVisualizer(BuilderBucket &bucket); 00046 00047 void add_prim(const BuilderPrim &prim); 00048 void add_prim(const BuilderPrimI &prim); 00049 00050 void show_normals(GeomNode *node); 00051 00052 private: 00053 void add_normal(const BuilderV ¢er, const BuilderN &normal); 00054 00055 BuilderBucket &_bucket; 00056 00057 BuilderV _net_vertex; 00058 int _num_vertices; 00059 pvector<BuilderPrim> _lines; 00060 }; 00061 00062 #include "builderNormalVisualizer.I" 00063 00064 #endif // SUPPORT_SHOW_NORMALS 00065 00066 #endif