00001 /**************************************************************************** 00002 00003 This file is part of the GLC-lib library. 00004 Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net) 00005 Version 2.0.0 Beta 1, packaged on April 2010. 00006 00007 http://glc-lib.sourceforge.net 00008 00009 GLC-lib is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; either version 2 of the License, or 00012 (at your option) any later version. 00013 00014 GLC-lib is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with GLC-lib; if not, write to the Free Software 00021 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00022 00023 *****************************************************************************/ 00025 00026 #include "glc_polylines.h" 00027 00028 GLC_Polylines::GLC_Polylines() 00029 : GLC_Geometry("Polyline", true) 00030 { 00031 00032 } 00033 00034 GLC_Polylines::GLC_Polylines(const GLC_Polylines& polyline) 00035 : GLC_Geometry(polyline) 00036 { 00037 00038 } 00039 00040 GLC_Polylines::~GLC_Polylines() 00041 { 00042 00043 } 00044 00046 // Get Functions 00048 const GLC_BoundingBox& GLC_Polylines::boundingBox() 00049 { 00050 if (NULL == GLC_Geometry::m_pBoundingBox) 00051 { 00052 GLC_Geometry::m_pBoundingBox= new GLC_BoundingBox(); 00053 if (! m_WireData.isEmpty()) 00054 { 00055 GLC_Geometry::m_pBoundingBox->combine(m_WireData.boundingBox()); 00056 } 00057 } 00058 return *GLC_Geometry::m_pBoundingBox; 00059 } 00060 00061 GLC_Geometry* GLC_Polylines::clone() const 00062 { 00063 return new GLC_Polylines(*this); 00064 } 00065 00067 // Set Functions 00069 GLC_Polylines& GLC_Polylines::operator=(const GLC_Polylines& polyline) 00070 { 00071 if (this != &polyline) 00072 { 00073 GLC_Geometry::operator=(polyline); 00074 } 00075 return *this; 00076 } 00077 00079 // OpenGL Functions 00081 void GLC_Polylines::glDraw(const GLC_RenderProperties& renderProperties) 00082 { 00083 if (!GLC_Geometry::m_WireData.isEmpty()) 00084 { 00085 GLC_Geometry::m_WireData.glDraw(renderProperties); 00086 } 00087 } 00088