GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_line.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  *****************************************************************************/
22 
23 #include "glc_line.h"
24 #include "../glc_openglexception.h"
25 
27 // Constructor Destructor
29 
30 GLC_Line::GLC_Line(const GLC_Point3d & point1, const GLC_Point3d & point2)
31 : GLC_Polylines()
32 , m_Point1(point1)
33 , m_Point2(point2)
34 {
35  createWire();
36 }
37 
39 : GLC_Polylines(line)
40 , m_Point1(line.m_Point1)
41 , m_Point2(line.m_Point2)
42 {
43  createWire();
44 }
45 
47 {
48 
49 }
50 
52 // Get Functions
54 
56 {
58 }
59 
61 {
62  return new GLC_Line(*this);
63 }
64 
65 
67 // Set Functions
69 void GLC_Line::setCoordinate(const GLC_Point3d &point1, const GLC_Point3d &point2)
70 {
73  clear();
74  createWire();
75 }
76 
78 {
79  if (this != &line)
80  {
81  m_Point1= line.m_Point1;
82  m_Point2= line.m_Point2;
84  }
85  return *this;
86 }
87 
89 // OpenGL Functions
91 
92 void GLC_Line::glDraw(const GLC_RenderProperties& renderProperties)
93 {
94  GLC_Polylines::glDraw(renderProperties);
95 }
96 
97 
99 // Private services Functions
102 {
103  QList<GLC_Point3d> points;
104  points.append(m_Point1);
105  points.append(m_Point2);
107 }
108 
109 

©2005-2013 Laurent Ribon