00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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 );
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 }