glc_arrow.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021  *****************************************************************************/
00023 
00024 #ifndef GLC_ARROW_H_
00025 #define GLC_ARROW_H_
00026 
00027 #include <QColor>
00028 #include "../maths/glc_vector3d.h"
00029 #include "glc_geometry.h"
00030 
00031 #include "../glc_config.h"
00032 
00035 
00038 
00039 class GLC_LIB_EXPORT GLC_Arrow : public GLC_Geometry
00040 {
00042 
00044 
00045 public:
00047         GLC_Arrow(const GLC_Point3d& startPoint, const GLC_Point3d& endPoint, const GLC_Vector3d& viewDir);
00048 
00050         GLC_Arrow(const GLC_Arrow& arrow);
00051 
00053         virtual ~GLC_Arrow();
00055 
00056 
00058 
00059 public:
00061         const GLC_BoundingBox& boundingBox();
00062 
00064         inline GLC_Point3d startPoint() const
00065         {return m_StartPoint;}
00066 
00068         inline GLC_Point3d endPoint() const
00069         {return m_EndPoint;}
00070 
00072         inline double headLenght() const
00073         {return m_HeadLenght;}
00074 
00076         inline double headAngle() const
00077         {return m_HeadAngle;}
00078 
00080         inline GLC_Vector3d viewDir() const
00081         {return m_ViewDir;}
00082 
00084         virtual GLC_Geometry* clone() const;
00085 
00087 
00088 
00090 
00091 public:
00093         GLC_Arrow& operator=(const GLC_Arrow& arrow);
00094 
00096         void setStartPoint(const GLC_Point3d& startPoint);
00097 
00099         void setEndPoint(const GLC_Point3d& endPoint);
00100 
00102         void setHeadLength(double headLenght);
00103 
00105         void setHeadAngle(double headAngle);
00106 
00108         void setViewDir(const GLC_Vector3d& viewDir);
00109 
00111 
00113 
00115 
00116 private:
00117 
00119 
00121         virtual void glDraw(const GLC_RenderProperties&);
00122 
00123 
00125 
00127 
00129 
00130 private:
00132         void createWire();
00133 
00135 
00137 // Private members
00139 private:
00141         GLC_Point3d m_StartPoint;
00142 
00144         GLC_Point3d m_EndPoint;
00145 
00147         double m_HeadLenght;
00148 
00150         double m_HeadAngle;
00151 
00153         GLC_Vector3d m_ViewDir;
00154 };
00155 
00156 #endif /* GLC_ARROW_H_ */

SourceForge.net Logo

©2005-2011 Laurent Ribon