GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_3dwidget.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  *****************************************************************************/
23 
24 #include "glc_3dwidget.h"
25 
26 
28 : QObject()
29 , m_Uid(glc::GLC_Gen3DWidgetID())
30 , m_pWidgetManagerHandle(pWidgetManagerHandle)
31 , m_InstanceIdList()
32 {
33 
34 }
35 
37 : QObject()
38 , m_Uid(glc::GLC_Gen3DWidgetID())
39 , m_pWidgetManagerHandle(widget.m_pWidgetManagerHandle)
40 , m_InstanceIdList()
41 {
42  // Copy the 3Dview instance of the widget
43  const int size= widget.m_InstanceIdList.size();
44  for (int i= 0; i < size; ++i)
45  {
46  GLC_3DViewInstance newInstance(widget.m_pWidgetManagerHandle->instanceHandle(widget.m_InstanceIdList.at(i))->deepCopy());
47  GLC_uint newId= newInstance.id();
48  m_InstanceIdList.append(newId);
50  }
51 }
52 
54 {
56 }
57 
58 bool GLC_3DWidget::operator==(const GLC_3DWidget& widget) const
59 {
60  return this == &widget;
61 }
62 
64 {
65  if (this != &widget)
66  {
68 
69  m_Uid= widget.m_Uid;
72 
73  // Copy the 3Dview instance of the widget
74  const int size= widget.m_InstanceIdList.size();
75  for (int i= 0; i < size; ++i)
76  {
77  GLC_3DViewInstance newInstance(widget.m_pWidgetManagerHandle->instanceHandle(widget.m_InstanceIdList.at(i))->deepCopy());
78  GLC_uint newId= newInstance.id();
79  m_InstanceIdList.append(newId);
81  }
82  }
83  return *this;
84 }
85 
87 {
88  if (NULL != m_pWidgetManagerHandle)
89  {
92  }
93  m_pWidgetManagerHandle= pWidgetManagerHandle;
94 
96 }
97 
98 void GLC_3DWidget::setVisible(bool visible)
99 {
100  if (NULL != m_pWidgetManagerHandle)
101  {
102  const int instanceCount= m_InstanceIdList.size();
103  for (int i= 0; i < instanceCount; ++i)
104  {
105  m_pWidgetManagerHandle->instanceHandle(m_InstanceIdList.at(i))->setVisibility(visible);
106  }
107  resetViewState();
108  }
109 }
111 // Interaction Functions
114 {
115  return glc::IgnoreEvent;
116 }
117 
119 {
120  return glc::IgnoreEvent;
121 }
122 
124 {
125  return glc::IgnoreEvent;
126 }
127 
129 {
130  return glc::IgnoreEvent;
131 }
132 
134 {
135  return glc::IgnoreEvent;
136 }
137 
139 {
140  return glc::IgnoreEvent;
141 }
142 
143 
145 // Protected services functions
148 {
150  const GLC_uint instanceId= instance.id();
151  m_InstanceIdList.append(instanceId);
152 }
153 
155 {
156  if (NULL != m_pWidgetManagerHandle)
157  {
158  const int size= m_InstanceIdList.size();
159  for (int i= 0; i < size; ++i)
160  {
162  }
163  }
164 }
165 
166 void GLC_3DWidget::set3DViewInstanceVisibility(int index, bool visibility)
167 {
169 }
170 
171 

©2005-2013 Laurent Ribon