Skip to content

Commit 20dd0bd

Browse files
authored
Merge pull request #75 from Ludwigstrasse/Development_Hananiah
Development hananiah
2 parents 9a53ebe + 6ec5cc5 commit 20dd0bd

832 files changed

Lines changed: 5325 additions & 359 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Alice

Submodule Alice updated from fc5f514 to fe6137f

Designer/Data/FunctionAreaConfig.xml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
workbench="workbench.assembly"
2121
defaultTab="tab_asm_home"/>
2222

23+
<ribbon id="sd.drawing"
24+
label="SD - Drawing"
25+
workbench="workbench.drawing"
26+
defaultTab="tab_drawing_home"/>
27+
2328
<ribbon id="sd.home"
2429
label="SD - Home"
2530
workbench="workbench.home"
@@ -529,6 +534,25 @@
529534
</tab>
530535

531536
</layout>
537+
538+
539+
<!-- ===================== Drawing environment ===================== -->
540+
<layout ribbon="sd.drawing">
541+
542+
<tab id="tab_drawing_home" label="Drawing" order="10">
543+
<group id="grp_drawing_data" label="Data" order="10">
544+
<control type="large-button" commandRef="file.new" row="0" column="0" rowSpan="3"/>
545+
<control type="large-button" commandRef="file.open" row="0" column="1" rowSpan="3"/>
546+
</group>
547+
548+
<group id="grp_drawing_view" label="View" order="20">
549+
<control type="small-button" commandRef="view.front" row="0" column="0"/>
550+
<control type="small-button" commandRef="view.right" row="1" column="0"/>
551+
<control type="small-button" commandRef="view.top" row="2" column="0"/>
552+
<control type="small-button" commandRef="view.trimetric" row="0" column="1"/>
553+
</group>
554+
</tab>
555+
</layout>
532556
<!-- ===================== Sketch environment ===================== -->
533557
<layout ribbon="sd.sketch">
534558

@@ -585,10 +609,6 @@
585609
<control type="small-button" commandRef="datum.geometry.cs" row="2" column="0" />
586610
</group>
587611

588-
<group id="grp_sketch_construction_mode" label="Construction Mode" order="45">
589-
<control type="large-button" commandRef="sketch.constructionMode" row="0" column="0" rowSpan="3" />
590-
</group>
591-
592612
<group id="grp_sketch_sketching" label="Sketching" order="50">
593613
<SplitButton type="small-button" commandRef="sketch.line" row="0" column="0">
594614
<SubMenu type="command" commandRef="sketch.line" />
@@ -649,12 +669,15 @@
649669
<control type="small-button" commandRef="sketch.modify.offset" row="0" column="3" />
650670
<control type="small-button" commandRef="sketch.thicken" row="1" column="3" />
651671
<control type="small-button" commandRef="sketch.project" row="2" column="3" />
652-
672+
653673
<control type="small-button" commandRef="sketch.construction.centerline" row="0" column="4"/>
654674
<control type="small-button" commandRef="sketch.construction.point" row="1" column="4" />
655675
<control type="small-button" commandRef="sketch.constrcution.cs" row="2" column="4" />
656-
657-
<control type="large-button" commandRef="sketch.palette" row="0" column="5" rowSpan="3" />
676+
677+
<LauncherMenu>
678+
<SubMenu type="command" commandRef="sketch.constructionMode" />
679+
<SubMenu type="command" commandRef="sketch.palette" />
680+
</LauncherMenu>
658681
</group>
659682

660683
<group id="grp_sketch_editing" label="Editing" order="60">

Designer/Data/IconLibraryConfig.xml

Lines changed: 261 additions & 94 deletions
Large diffs are not rendered by default.

Designer/Data/TitleBarConfig.xml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
id="app"
5858
commandRef="ui.appMenu"
5959
order="5"
60-
iconRef="app"
60+
iconRef="app_wordmark"
61+
iconSize="100,28"
62+
fixedSize="110,30"
6163
tooltip="SolidDesigner"/>
6264

6365
<!-- QAT: new/open/save/undo/redo/regenerate/windows/dropdown -->
@@ -153,7 +155,9 @@
153155
id="app"
154156
commandRef="ui.appMenu"
155157
order="5"
156-
iconRef="app"
158+
iconRef="app_wordmark"
159+
iconSize="100,28"
160+
fixedSize="110,30"
157161
tooltip="SolidDesigner"/>
158162

159163
<control type="command-button"
@@ -242,7 +246,9 @@
242246
id="app"
243247
commandRef="ui.appMenu"
244248
order="5"
245-
icon=":/TitleBar/brand/app.svg"
249+
iconRef="app_wordmark"
250+
iconSize="100,28"
251+
fixedSize="110,30"
246252
tooltip="SolidDesigner"/>
247253

248254
<control type="command-button"
@@ -323,7 +329,9 @@
323329
<control type="brand-button"
324330
id="app"
325331
commandRef="ui.appMenu"
326-
iconRef="app"
332+
iconRef="app_wordmark"
333+
iconSize="100,28"
334+
fixedSize="110,30"
327335
order="5"
328336
tooltip="SolidDesigner"/>
329337

@@ -405,7 +413,9 @@
405413
<control type="brand-button"
406414
id="app"
407415
commandRef="ui.appMenu"
408-
iconRef="app"
416+
iconRef="app_wordmark"
417+
iconSize="100,28"
418+
fixedSize="110,30"
409419
order="5"
410420
tooltip="SolidDesigner"/>
411421

@@ -485,7 +495,9 @@
485495
<control type="brand-button"
486496
id="app"
487497
commandRef="ui.appMenu"
488-
iconRef="app"
498+
iconRef="app_wordmark"
499+
iconSize="100,28"
500+
fixedSize="110,30"
489501
order="5"
490502
tooltip="SolidDesigner"/>
491503

@@ -567,7 +579,9 @@
567579
<control type="brand-button"
568580
id="app"
569581
commandRef="ui.appMenu"
570-
iconRef="app"
582+
iconRef="app_wordmark"
583+
iconSize="100,28"
584+
fixedSize="110,30"
571585
order="5"
572586
tooltip="SolidDesigner"/>
573587

Designer/Data/WorkBenchConfig.xml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@
5353
</LayoutProfiles>
5454
</Workbench>
5555

56+
<Workbench id="workbench.sketch" displayName="Sketch" uiContext="ctx.sketch">
57+
<AppliesTo>
58+
<DocumentType id="doc.sketch"/>
59+
</AppliesTo>
60+
61+
<DockPanels>
62+
<Panel id="panel.modeltree"/>
63+
<Panel id="panel.properties"/>
64+
<Panel id="panel.codeEditor"/>
65+
</DockPanels>
66+
67+
<InitialViews>
68+
<ViewKind id="view.sketch2d"/>
69+
</InitialViews>
70+
71+
<LayoutProfiles>
72+
<Layout id="default" isDefault="true"/>
73+
</LayoutProfiles>
74+
</Workbench>
75+
5676
<Workbench id="workbench.assembly" displayName="Assembly" uiContext="ctx.assembly">
5777
<AppliesTo>
5878
<DocumentType id="doc.assembly"/>
@@ -71,7 +91,7 @@
7191
<Panel id="panel.properties"/>
7292
</DockPanels>
7393
<InitialViews>
74-
<ViewKind id="view.asm3d"/>
94+
<ViewKind id="view.model3d"/>
7595
</InitialViews>
7696
<LayoutProfiles>
7797
<Layout id="default" isDefault="true"/>
@@ -88,7 +108,7 @@
88108
<Panel id="panel.codeEditor"/>
89109
</DockPanels>
90110
<InitialViews>
91-
<ViewKind id="view.drawing"/>
111+
<ViewKind id="view.drawing.sheet"/>
92112
</InitialViews>
93113
<LayoutProfiles>
94114
<Layout id="default" isDefault="true"/>
@@ -104,7 +124,7 @@
104124
<Panel id="panel.properties"/>
105125
</DockPanels>
106126
<InitialViews>
107-
<ViewKind id="view.bim"/>
127+
<ViewKind id="view.bim.plan"/>
108128
</InitialViews>
109129
<LayoutProfiles>
110130
<Layout id="default" isDefault="true"/>

Designer/Data/WorkBenchPreference.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
"preferredWorkbenchByDocType":
55
{
66
"doc.part": "workbench.part",
7+
"doc.sketch": "workbench.sketch",
78
"doc.assembly": "workbench.assembly",
89
"doc.drawing": "workbench.drawing",
910
"doc.none": "workbench.home"
1011
},
1112
"workbenchSwitcher":
1213
{
13-
"orderedIds": ["workbench.home","workbench.part","workbench.assembly","workbench.drawing"],
14+
"orderedIds": ["workbench.home","workbench.part","workbench.sketch","workbench.assembly","workbench.drawing"],
1415
"hiddenIds": [],
15-
"pinnedIds": ["workbench.part","workbench.assembly"],
16+
"pinnedIds": ["workbench.part","workbench.sketch","workbench.assembly"],
1617
"showIcons": true,
1718
"showText": true
1819
},
@@ -51,6 +52,7 @@
5152
"recentWorkbenches":
5253
[
5354
"workbench.part",
55+
"workbench.sketch",
5456
"workbench.assembly"
5557
]
5658
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Owner: hananiah
2+
#include "SolidFileCloseCommand.h"
3+
#include "SolidDesignerCommands.h"
4+
#include "AliceCommandParameter.h"
5+
#include "AliceCoreAppUtil.h"
6+
#include "AliceISession.h"
7+
#include "AliceIDocument.h"
8+
#include "AliceIUiApplicationFactory.h"
9+
#include "AliceIUiApplication.h"
10+
#include "AliceIMainWindow.h"
11+
#include "AliceIOperation.h"
12+
13+
using namespace alice;
14+
using namespace sdr;
15+
16+
SolidFileCloseCommand::SolidFileCloseCommand() noexcept
17+
: AppCommandBase(std::string(Cmd::FILE_CLOSE))
18+
{
19+
}
20+
21+
SolidFileCloseCommand::~SolidFileCloseCommand() = default;
22+
23+
bool SolidFileCloseCommand::IsSupported() const
24+
{
25+
ISession* session = CoreAppUtil::GetCurrentSession();
26+
if (!session)
27+
return false;
28+
IUiApplicationFactory* pAppFactory = IUiApplicationFactory::Get();
29+
if (!pAppFactory)
30+
return false;
31+
IUiApplication* pApp = pAppFactory->GetUiApplication();
32+
if (!pApp)
33+
return false;
34+
return pApp->GetMainWindow() != nullptr;
35+
}
36+
37+
bool SolidFileCloseCommand::IsVisible() const
38+
{
39+
return IsSupported();
40+
}
41+
42+
bool SolidFileCloseCommand::IsEnabled() const
43+
{
44+
if (!IsSupported())
45+
return false;
46+
ISession* session = CoreAppUtil::GetCurrentSession();
47+
return session && session->GetActiveDocument();
48+
}
49+
50+
std::string SolidFileCloseCommand::DisabledReason() const
51+
{
52+
ISession* session = CoreAppUtil::GetCurrentSession();
53+
if (!session)
54+
return "Session is not available.";
55+
if (!session->GetActiveDocument())
56+
return "There is no active document.";
57+
return {};
58+
}
59+
60+
std::unique_ptr<IOperation> SolidFileCloseCommand::Execute(const CommandParameter& /*param*/)
61+
{
62+
if (!IsSupported())
63+
return nullptr;
64+
65+
IUiApplicationFactory* pAppFactory = IUiApplicationFactory::Get();
66+
IUiApplication* pApp = pAppFactory ? pAppFactory->GetUiApplication() : nullptr;
67+
IMainWindow* pMainWindow = pApp ? pApp->GetMainWindowFw() : nullptr;
68+
if (!pMainWindow)
69+
return nullptr;
70+
71+
pMainWindow->CloseCurrentView();
72+
return nullptr;
73+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#pragma once
2+
3+
#include "BaseCommands/SolidBaseCommand.h"
4+
5+
namespace alice
6+
{
7+
struct CommandParameter;
8+
class IOperation;
9+
}
10+
11+
namespace sdr
12+
{
13+
/// \brief Implements "file.close" for the active document view.
14+
class SolidFileCloseCommand final : public AppCommandBase
15+
{
16+
public:
17+
SolidFileCloseCommand() noexcept;
18+
~SolidFileCloseCommand() override;
19+
20+
bool IsSupported() const override;
21+
bool IsVisible() const override;
22+
bool IsEnabled() const override;
23+
std::string DisabledReason() const override;
24+
25+
std::unique_ptr<alice::IOperation> Execute(const alice::CommandParameter& param) override;
26+
};
27+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#include "SolidFileExitCommand.h"
2+
#include "SolidDesignerCommands.h"
3+
#include "AliceCommandParameter.h"
4+
#include <QCoreApplication>
5+
#include "AliceIOperation.h"
6+
7+
using namespace sdr;
8+
9+
SolidFileExitCommand::SolidFileExitCommand() noexcept
10+
: AppCommandBase(std::string(Cmd::FILE_EXIT))
11+
{
12+
}
13+
14+
SolidFileExitCommand::~SolidFileExitCommand() = default;
15+
16+
bool SolidFileExitCommand::IsSupported() const
17+
{
18+
return true;
19+
}
20+
21+
bool SolidFileExitCommand::IsVisible() const
22+
{
23+
return true;
24+
}
25+
26+
bool SolidFileExitCommand::IsEnabled() const
27+
{
28+
return true;
29+
}
30+
31+
std::string SolidFileExitCommand::DisabledReason() const
32+
{
33+
return {};
34+
}
35+
36+
std::unique_ptr<alice::IOperation> SolidFileExitCommand::Execute(const alice::CommandParameter& /*param*/)
37+
{
38+
QCoreApplication::quit();
39+
return nullptr;
40+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#pragma once
2+
3+
#include "BaseCommands/SolidBaseCommand.h"
4+
5+
namespace alice { struct CommandParameter; class IOperation; }
6+
7+
namespace sdr
8+
{
9+
/// \brief Implements "file.exit".
10+
class SolidFileExitCommand final : public AppCommandBase
11+
{
12+
public:
13+
SolidFileExitCommand() noexcept;
14+
~SolidFileExitCommand() override;
15+
16+
bool IsSupported() const override;
17+
bool IsVisible() const override;
18+
bool IsEnabled() const override;
19+
std::string DisabledReason() const override;
20+
21+
std::unique_ptr<alice::IOperation> Execute(const alice::CommandParameter& param) override;
22+
};
23+
}

0 commit comments

Comments
 (0)