ColVisDebug.h

00001 
00002 //***************************************************************************
00003 //                              ColVisDebug
00004 //***************************************************************************
00005 //  Copyright (C):
00006 //***************************************************************************
00007 //CVSId: "@(#)$Id: ColVisDebug.h,v 1.5 2004/02/26 14:50:20 ehlgen Exp $"
00008 //***************************************************************************
00009 
00010 
00011 #ifndef ColVisDebug_H
00012 #define ColVisDebug_H
00013 #if defined(__sgi) || defined(_WIN32)
00014 #pragma once
00015 #endif
00016 
00017 //---------------------------------------------------------------------------
00018 //  Includes
00019 //---------------------------------------------------------------------------
00020 
00021 
00022 #include <map>
00023 #include <OpenSG/OSGGroup.h>
00024 #include <col_import_export.h>
00025 
00026 using osg::Pnt3f;
00027 
00028 namespace col {
00029 
00030 //---------------------------------------------------------------------------
00031 //  Forward References
00032 //---------------------------------------------------------------------------
00033 
00034 //---------------------------------------------------------------------------
00035 //   Constants
00036 //---------------------------------------------------------------------------
00037 
00038 
00039 //***************************************************************************
00040 //  VisDebug
00041 //***************************************************************************
00042 
00043 class COL_EXPORTIMPORT VisDebug
00044 {
00045 
00046 public:
00047 
00048     VisDebug( osg::NodePtr visdebug_root, bool find_root = false );
00049 
00050     virtual ~VisDebug() throw();
00051     enum colorE { WHITE=0, BLACK, RED, GREEN, BLUE, YELLOW, ORANGE,
00052                   PURPLE, MAGENTA, TURQUOISE, AUTO, MAX_COLOR };
00053     void line( const char *name, const Pnt3f base, const Pnt3f head,
00054                colorE vis_color = AUTO );
00055     void box( const char *name, const Pnt3f midpoint, const float radius,
00056               const bool solid = true, colorE vis_color = AUTO );
00057 
00058 protected:
00059 
00060     typedef std::map<std::string,osg::NodePtr> MapT;
00061 
00063     osg::NodePtr m_visdebug_root;
00064 
00065     static osg::NodePtr makeLine( const Pnt3f base, const Pnt3f head );
00066 
00067     // prohibit copy constructor (move to 'public' if you need one)
00068     explicit VisDebug( const VisDebug &source );
00069 
00070     // prohibit assignment
00071     VisDebug& operator = ( const VisDebug &source );
00072 
00073     // convert ColorE into OSG color
00074     osg::Color3f getOSGColor( colorE vis_color );
00075 
00077     MapT m_lines;
00078     MapT m_boxes;
00079 
00080 private:
00081 
00082     int m_currentAutoColor;
00083 
00084 };
00085 
00086 
00087 } // namespace col
00088 
00089 #endif /* ColVisDebug_H */
00090 

Generated on Tue Oct 16 18:12:21 2007 for CollDet by  doxygen 1.5.2