| 
									
										
										
										
											2019-11-19 17:43:03 +02:00
										 |  |  | /**************************************************************************** | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Copyright (C) 2019 The Qt Company Ltd. | 
					
						
							|  |  |  | ** Contact: https://www.qt.io/licensing/
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator. | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Commercial License Usage | 
					
						
							|  |  |  | ** Licensees holding valid commercial Qt licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the commercial license agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and The Qt Company. For licensing terms | 
					
						
							|  |  |  | ** and conditions see https://www.qt.io/terms-conditions. For further
 | 
					
						
							|  |  |  | ** information use the contact form at https://www.qt.io/contact-us.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** GNU General Public License Usage | 
					
						
							|  |  |  | ** Alternatively, this file may be used under the terms of the GNU | 
					
						
							|  |  |  | ** General Public License version 3 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT | 
					
						
							|  |  |  | ** included in the packaging of this file. Please review the following | 
					
						
							|  |  |  | ** information to ensure the GNU General Public License requirements will | 
					
						
							|  |  |  | ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import QtQuick 2.0 | 
					
						
							| 
									
										
										
										
											2020-02-25 14:37:45 +02:00
										 |  |  | import QtQuick3D 1.15 | 
					
						
							| 
									
										
										
										
											2019-11-19 17:43:03 +02:00
										 |  |  | import SelectionBoxGeometry 1.0 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Node { | 
					
						
							|  |  |  |     id: selectionBox | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     property View3D view3D | 
					
						
							|  |  |  |     property Node targetNode: null | 
					
						
							| 
									
										
										
										
											2019-11-22 16:53:36 +02:00
										 |  |  |     property alias model: selectionBoxModel | 
					
						
							| 
									
										
										
										
											2019-11-26 17:56:00 +02:00
										 |  |  |     property alias geometryName: selectionBoxGeometry.name | 
					
						
							| 
									
										
										
										
											2019-11-19 17:43:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     SelectionBoxGeometry { | 
					
						
							|  |  |  |         id: selectionBoxGeometry | 
					
						
							|  |  |  |         name: "Selection Box of 3D Edit View" | 
					
						
							|  |  |  |         view3D: selectionBox.view3D | 
					
						
							|  |  |  |         targetNode: selectionBox.targetNode | 
					
						
							|  |  |  |         rootNode: selectionBox | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Model { | 
					
						
							|  |  |  |         id: selectionBoxModel | 
					
						
							|  |  |  |         geometry: selectionBoxGeometry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         scale: selectionBox.targetNode ? selectionBox.targetNode.scale : Qt.vector3d(1, 1, 1) | 
					
						
							| 
									
										
										
										
											2020-02-25 14:37:45 +02:00
										 |  |  |         rotation: selectionBox.targetNode ? selectionBox.targetNode.rotation : Qt.quaternion(1, 0, 0, 0) | 
					
						
							| 
									
										
										
										
											2019-11-19 17:43:03 +02:00
										 |  |  |         position: selectionBox.targetNode ? selectionBox.targetNode.position : Qt.vector3d(0, 0, 0) | 
					
						
							|  |  |  |         pivot: selectionBox.targetNode ? selectionBox.targetNode.pivot : Qt.vector3d(0, 0, 0) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-21 17:37:09 +02:00
										 |  |  |         visible: selectionBox.targetNode && !selectionBoxGeometry.isEmpty | 
					
						
							| 
									
										
										
										
											2019-11-19 17:43:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         materials: [ | 
					
						
							|  |  |  |             DefaultMaterial { | 
					
						
							| 
									
										
										
										
											2019-11-26 11:25:12 +02:00
										 |  |  |                 emissiveColor: "#fff600" | 
					
						
							| 
									
										
										
										
											2019-11-19 17:43:03 +02:00
										 |  |  |                 lighting: DefaultMaterial.NoLighting | 
					
						
							| 
									
										
										
										
											2020-03-10 15:57:41 +02:00
										 |  |  |                 cullMode: Material.NoCulling | 
					
						
							| 
									
										
										
										
											2019-11-19 17:43:03 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |