Assembly: Introduce 'Exploded Views'
This commit is contained in:
committed by
Yorik van Havre
parent
6a834422e7
commit
687843ff41
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "ViewProviderAssembly.h"
|
||||
#include "ViewProviderJointGroup.h"
|
||||
#include "ViewProviderViewGroup.h"
|
||||
|
||||
|
||||
namespace AssemblyGui
|
||||
@@ -48,6 +49,7 @@ PyMOD_INIT_FUNC(AssemblyGui)
|
||||
|
||||
AssemblyGui::ViewProviderAssembly ::init();
|
||||
AssemblyGui::ViewProviderJointGroup::init();
|
||||
AssemblyGui::ViewProviderViewGroup::init();
|
||||
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ SET(AssemblyGui_SRCS_Module
|
||||
ViewProviderAssembly.h
|
||||
ViewProviderJointGroup.cpp
|
||||
ViewProviderJointGroup.h
|
||||
ViewProviderViewGroup.cpp
|
||||
ViewProviderViewGroup.h
|
||||
${Assembly_QRC_SRCS}
|
||||
)
|
||||
|
||||
|
||||
@@ -13,8 +13,11 @@
|
||||
<file>icons/Assembly_ExportASMT.svg</file>
|
||||
<file>icons/Assembly_SolveAssembly.svg</file>
|
||||
<file>icons/Assembly_JointGroup.svg</file>
|
||||
<file>icons/Assembly_ExplodedView.svg</file>
|
||||
<file>icons/Assembly_ExplodedViewGroup.svg</file>
|
||||
<file>panels/TaskAssemblyCreateJoint.ui</file>
|
||||
<file>panels/TaskAssemblyInsertLink.ui</file>
|
||||
<file>panels/TaskAssemblyCreateView.ui</file>
|
||||
<file>preferences/Assembly.ui</file>
|
||||
<file>icons/Assembly_CreateJointDistance.svg</file>
|
||||
<file>icons/AssemblyWorkbench.svg</file>
|
||||
|
||||
405
src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedView.svg
Normal file
405
src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedView.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 13 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TaskAssemblyCreateView</class>
|
||||
<widget class="QWidget" name="TaskAssemblyCreateView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>376</width>
|
||||
<height>387</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Create Exploded View</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="Gui::PrefCheckBox" name="CheckBox_PartsAsSingleSolid">
|
||||
<property name="toolTip">
|
||||
<string>If checked, Parts will be selected as a single solid.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Parts as single solid</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>PartsAsSingleSolid</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Assembly</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QListWidget" name="stepList"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="btnAlignDragger">
|
||||
<property name="text">
|
||||
<string>Align dragger</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="LabelAlignDragger">
|
||||
<property name="text">
|
||||
<string>Aligning dragger:
|
||||
Select a feature.
|
||||
Press ESC to cancel.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="btnRadialExplosion">
|
||||
<property name="text">
|
||||
<string>Explode radially</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
49
src/Mod/Assembly/Gui/ViewProviderViewGroup.cpp
Normal file
49
src/Mod/Assembly/Gui/ViewProviderViewGroup.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Copyright (c) 2023 Ondsel <development@ondsel.com> *
|
||||
* *
|
||||
* This file is part of FreeCAD. *
|
||||
* *
|
||||
* FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU Lesser General Public License as *
|
||||
* published by the Free Software Foundation, either version 2.1 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* FreeCAD is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* Lesser General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Lesser General Public *
|
||||
* License along with FreeCAD. If not, see *
|
||||
* <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#endif
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
|
||||
#include "ViewProviderViewGroup.h"
|
||||
|
||||
|
||||
using namespace AssemblyGui;
|
||||
|
||||
PROPERTY_SOURCE(AssemblyGui::ViewProviderViewGroup, Gui::ViewProviderDocumentObjectGroup)
|
||||
|
||||
ViewProviderViewGroup::ViewProviderViewGroup()
|
||||
{}
|
||||
|
||||
ViewProviderViewGroup::~ViewProviderViewGroup() = default;
|
||||
|
||||
QIcon ViewProviderViewGroup::getIcon() const
|
||||
{
|
||||
return Gui::BitmapFactory().pixmap("Assembly_ExplodedViewGroup.svg");
|
||||
}
|
||||
67
src/Mod/Assembly/Gui/ViewProviderViewGroup.h
Normal file
67
src/Mod/Assembly/Gui/ViewProviderViewGroup.h
Normal file
@@ -0,0 +1,67 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Copyright (c) 2023 Ondsel <development@ondsel.com> *
|
||||
* *
|
||||
* This file is part of FreeCAD. *
|
||||
* *
|
||||
* FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU Lesser General Public License as *
|
||||
* published by the Free Software Foundation, either version 2.1 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* FreeCAD is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* Lesser General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Lesser General Public *
|
||||
* License along with FreeCAD. If not, see *
|
||||
* <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef ASSEMBLYGUI_VIEWPROVIDER_ViewProviderViewGroup_H
|
||||
#define ASSEMBLYGUI_VIEWPROVIDER_ViewProviderViewGroup_H
|
||||
|
||||
#include <Mod/Assembly/AssemblyGlobal.h>
|
||||
|
||||
#include <Gui/ViewProviderDocumentObjectGroup.h>
|
||||
|
||||
|
||||
namespace AssemblyGui
|
||||
{
|
||||
|
||||
class AssemblyGuiExport ViewProviderViewGroup: public Gui::ViewProviderDocumentObjectGroup
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(AssemblyGui::ViewProviderViewGroup);
|
||||
|
||||
public:
|
||||
ViewProviderViewGroup();
|
||||
~ViewProviderViewGroup() override;
|
||||
|
||||
/// deliver the icon shown in the tree view. Override from ViewProvider.h
|
||||
QIcon getIcon() const override;
|
||||
|
||||
// Prevent dragging of the joints and dropping things inside the joint group.
|
||||
bool canDragObjects() const override
|
||||
{
|
||||
return false;
|
||||
};
|
||||
bool canDropObjects() const override
|
||||
{
|
||||
return false;
|
||||
};
|
||||
bool canDragAndDropObject(App::DocumentObject*) const override
|
||||
{
|
||||
return false;
|
||||
};
|
||||
|
||||
// protected:
|
||||
/// get called by the container whenever a property has been changed
|
||||
// void onChanged(const App::Property* prop) override;
|
||||
};
|
||||
|
||||
} // namespace AssemblyGui
|
||||
|
||||
#endif // ASSEMBLYGUI_VIEWPROVIDER_ViewProviderViewGroup_H
|
||||
Reference in New Issue
Block a user