Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

HighlightBox.h

Go to the documentation of this file.
00001 // Copyright NVIDIA Corporation 2002-2004
00002 // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
00003 // *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
00004 // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
00005 // AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
00006 // BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
00007 // WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
00008 // BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
00009 // ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
00010 // BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 
00011 
00012 #pragma once
00013 
00015 #include "nvsgcommon.h"
00016 
00017 #include "nvsg/HighlightObject.h"
00018 #include "nvmath/BoundingSphere.h"
00019 
00020 namespace nvsg 
00021 {
00023   class HighlightBox : public HighlightObject
00024   {
00025     public:
00027 
00028       NVSG_API static const HighlightBox * create( float width = 2.0f                                    
00029                                                  , nvmath::Vec3f color = nvmath::Vec3f(1.0f, 0.0f, 0.0f) 
00030                                                  );
00031 
00033 
00034       NVSG_API static const HighlightBox * createFromBase( const HighlightObject &rhs                           
00035                                                          , float width = 2.0f                                   
00036                                                          , nvmath::Vec3f color = nvmath::Vec3f(1.0f,0.0f,0.0f)  
00037                                                          );
00038 
00040 
00041       NVSG_API virtual const HighlightBox * clone( void ) const;
00042 
00044 
00046       NVSG_API virtual bool isBoundingSphereValid( void ) const;
00047 
00049 
00052       NVSG_API virtual const nvmath::Sphere3f & getBoundingSphere( void ) const;
00053 
00055       NVSG_API void setVertices(nvmath::Vec3f* vertices);
00056       
00058       NVSG_API const nvmath::Vec3f* getVertices() const;
00059 
00061       NVSG_API float getLineWidth() const;
00062 
00064       NVSG_API const nvmath::Vec3f & getColor() const;
00065 
00066     protected:
00068       NVSG_API HighlightBox( float width, nvmath::Vec3f color );
00069 
00071       NVSG_API HighlightBox( const HighlightObject &rhs, float width, nvmath::Vec3f color );
00072 
00074       NVSG_API HighlightBox( const HighlightBox &rhs );
00075 
00076     protected:
00077       nvmath::Vec3f m_vertices[8];             
00078       float m_lineWidth;               
00079       nvmath::Vec3f m_color;                   
00080       nvmath::BoundingSphere m_boundingSphere; 
00081 
00082     private:
00083       HighlightBox( void );   //  private default constructor to prevent usage
00084   };
00085 
00086   inline const nvmath::Vec3f* HighlightBox::getVertices() const
00087   {
00088     __TRACE();
00089     return m_vertices;
00090   }
00091 
00092   inline float HighlightBox::getLineWidth() const 
00093   { 
00094     __TRACE();
00095     return m_lineWidth; 
00096   }       
00097 
00098   inline const nvmath::Vec3f & HighlightBox::getColor() const
00099   {
00100     __TRACE();
00101     return m_color;
00102   }
00103 
00104   inline bool HighlightBox::isBoundingSphereValid( void ) const
00105   {
00106     return( m_boundingSphere.isValid() );
00107   }
00108 
00109   inline const nvmath::Sphere3f & HighlightBox::getBoundingSphere( void ) const
00110   {
00111     __ASSERT( m_boundingSphere.isValid() );
00112     return( m_boundingSphere.getSphere() );
00113   }
00114 
00115 }

Generated on Tue Mar 1 13:19:17 2005 for NVSGSDK by NVIDIA