Skip to content

Commit

Permalink
Merge branch 'main' into start_wb_fem_examples_update
Browse files Browse the repository at this point in the history
  • Loading branch information
FEA-eng authored Mar 14, 2024
2 parents 63e39fe + 5264d6c commit aa552f2
Show file tree
Hide file tree
Showing 1,025 changed files with 9,402 additions and 116,559 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/PROBLEM_REPORT.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Report a Problem
description: Have you found something that does not work well, is too hard to do or is missing altogether? Please create a Problem Report.
title: "Replace with a concise issue title"
labels: ["needs triage"]
body:
- type: checkboxes
Expand Down Expand Up @@ -35,6 +34,7 @@ body:
- Addon Manager
- Arch
- Assembly
- CAM/Path
- Core
- Draft
- Expressions
Expand All @@ -44,7 +44,6 @@ body:
- OpenSCAD
- Part
- PartDesign
- Path
- Project Tools & Websites
- Sketcher
- Spreadsheet
Expand Down
7 changes: 5 additions & 2 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Core:
Addon Manager:
- 'src/Mod/AddonManager/**/*'

Materials:
- 'src/Mod/Material/**/*'

WB Arch:
- 'src/Mod/Arch/**/*'

Expand Down Expand Up @@ -40,8 +43,8 @@ WB Part:
WB PartDesign:
- 'src/Mod/PartDesign/**/*'

WB Path:
- 'src/Mod/Path/**/*'
WB CAM:
- 'src/Mod/CAM/**/*'

WB Points:
- 'src/Mod/Points/**/*'
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "src/3rdParty/OndselSolver"]
path = src/3rdParty/OndselSolver
url = https://github.com/Ondsel-Development/OndselSolver.git
[submodule "tests/lib"]
path = tests/lib
url = https://github.com/google/googletest
10 changes: 9 additions & 1 deletion src/App/MappedElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# include <unordered_set>
#endif

#include "DocumentObject.h"
#include "MappedElement.h"

using namespace Data;
Expand Down Expand Up @@ -161,4 +162,11 @@ bool ElementNameComparator::operator()(const MappedName& leftName,
}
}
return leftName.size() < rightName.size();
}
}

HistoryItem::HistoryItem(App::DocumentObject *obj, const Data::MappedName &name)
:obj(obj),tag(0),element(name)
{
if(obj)
tag = obj->getID();
}
9 changes: 9 additions & 0 deletions src/App/MappedElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ struct AppExport MappedElement
}
};

struct AppExport HistoryItem {
App::DocumentObject *obj;
long tag;
Data::MappedName element;
Data::IndexedName index;
std::vector<Data::MappedName> intermediates;
HistoryItem(App::DocumentObject *obj, const Data::MappedName &name);
};

struct AppExport ElementNameComparator {
/** Comparison function to make topo name more stable
*
Expand Down
6 changes: 3 additions & 3 deletions src/App/ProjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class DocumentMetadata
metadata.uuid = propMap.at("Uid");
}

void readProperty(DOMNode* propNode, std::map<std::string, std::string>& propMap)
static void readProperty(DOMNode* propNode, std::map<std::string, std::string>& propMap)
{
DOMNode* nameAttr = propNode->getAttributes()->getNamedItem(XStr("name").unicodeForm());
if (nameAttr) {
Expand Down Expand Up @@ -530,7 +530,7 @@ std::string ProjectFile::extractInputFile(const std::string& name)
return {};
}

void ProjectFile::readInputFile(const std::string& name, std::stringstream& str)
void ProjectFile::readInputFile(const std::string& name, std::ostream& str)
{
Base::FileInfo fi(extractInputFile(name));
if (fi.exists()) {
Expand All @@ -543,7 +543,7 @@ void ProjectFile::readInputFile(const std::string& name, std::stringstream& str)

// Read the given input file from the zip directly into the given stream (not using a temporary
// file)
void ProjectFile::readInputFileDirect(const std::string& name, std::stringstream& str)
void ProjectFile::readInputFileDirect(const std::string& name, std::ostream& str)
{
zipios::ZipFile project(stdFile);
std::unique_ptr<std::istream> istr(project.getInputStream(name));
Expand Down
4 changes: 2 additions & 2 deletions src/App/ProjectFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ class AppExport ProjectFile
/**
* Extracts, via a temporary file the content of an input file of @a name.
*/
void readInputFile(const std::string& name, std::stringstream& str);
void readInputFile(const std::string& name, std::ostream& str);
/**
* Directly extracts the content of an input file of @a name.
*/
void readInputFileDirect(const std::string& name, std::stringstream& str);
void readInputFileDirect(const std::string& name, std::ostream& str);
/**
* Replaces the input file @a name with the content of the given @a stream.
* The method returns the file name of the newly created project file.
Expand Down
23 changes: 20 additions & 3 deletions src/Base/FileInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,26 @@ bool FileInfo::isDir() const

unsigned int FileInfo::size() const
{
// not implemented
assert(0);
return 0;
unsigned int bytes {};
if (exists()) {

#if defined(FC_OS_WIN32)
std::wstring wstr = toStdWString();
struct _stat st;
if (_wstat(wstr.c_str(), &st) == 0) {
bytes = st.st_size;
}

#elif defined(FC_OS_LINUX) || defined(FC_OS_CYGWIN) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
struct stat st
{
};
if (stat(FileName.c_str(), &st) == 0) {
bytes = st.st_size;
}
#endif
}
return bytes;
}

TimeInfo FileInfo::lastModified() const
Expand Down
32 changes: 0 additions & 32 deletions src/Gui/DlgExpressionInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path,
#endif
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_TranslucentBackground, true);

qApp->installEventFilter(this);
}
else {
ui->expression->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
Expand All @@ -109,7 +107,6 @@ DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path,

DlgExpressionInput::~DlgExpressionInput()
{
qApp->removeEventFilter(this);
delete ui;
}

Expand Down Expand Up @@ -282,34 +279,5 @@ void DlgExpressionInput::show()
ui->expression->selectAll();
}

void DlgExpressionInput::showEvent(QShowEvent* ev)
{
QDialog::showEvent(ev);
}

bool DlgExpressionInput::eventFilter(QObject *obj, QEvent *ev)
{
// if the user clicks on a widget different to this
if (ev->type() == QEvent::MouseButtonPress && obj != this) {
// Since the widget has a transparent background we cannot rely
// on the size of the widget. Instead, it must be checked if the
// cursor is on this or an underlying widget or outside.
if (!underMouse()) {
// if the expression fields context-menu is open do not close the dialog
auto menu = qobject_cast<QMenu*>(obj);
if (menu && menu->parentWidget() == ui->expression) {
return false;
}
bool on = ui->expression->completerActive();
// Do this only if the completer is not shown
if (!on) {
qApp->removeEventFilter(this);
reject();
}
}
}
return false;
}


#include "moc_DlgExpressionInput.cpp"
3 changes: 0 additions & 3 deletions src/Gui/DlgExpressionInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,10 @@ class GuiExport DlgExpressionInput : public QDialog
QPoint expressionPosition() const;
void setExpressionInputSize(int width, int height);

bool eventFilter(QObject *obj, QEvent *event) override;

public Q_SLOTS:
void show();

protected:
void showEvent(QShowEvent*) override;
void mouseReleaseEvent(QMouseEvent*) override;
void mousePressEvent(QMouseEvent*) override;

Expand Down
6 changes: 3 additions & 3 deletions src/Gui/DlgKeyboard.ui
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<string/>
</property>
<property name="text">
<string>Multi-key sequence delay: </string>
<string>Multi-key sequence delay:</string>
</property>
</widget>
</item>
Expand All @@ -153,9 +153,9 @@
</size>
</property>
<property name="toolTip">
<string>Time in milliseconds to wait for the next key stroke of the current key sequence.
<string>Time in milliseconds to wait for the next keystroke of the current key sequence.
For example, pressing 'F' twice in less than the time delay setting here will be
be treated as shorctcut key sequence 'F, F'.</string>
treated as shortcut key sequence 'F, F'.</string>
</property>
<property name="maximum">
<number>10000</number>
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/DlgLocationPos.ui
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
</item>
<item>
<property name="text">
<string>5 m </string>
<string>5 m</string>
</property>
</item>
</widget>
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/NotificationArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ bool NotificationArea::confirmationRequired(Base::LogStyle level)

void NotificationArea::showConfirmationDialog(const QString& notifiername, const QString& message)
{
auto confirmMsg = QObject::tr("Notifier: ") + notifiername + QStringLiteral("\n\n") + message
auto confirmMsg = QObject::tr("Notifier:") + QStringLiteral(" ") + notifiername + QStringLiteral("\n\n") + message
+ QStringLiteral("\n\n")
+ QObject::tr("Do you want to skip confirmation of further critical message notifications "
"while loading the file?");
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/PreferencePages/DlgSettings3DView.ui
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ lower right corner within opened files</string>
<item row="0" column="2">
<widget class="QLabel" name="labelCoordSize">
<property name="text">
<string>Relative size : </string>
<string>Relative size:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/PreferencePages/DlgSettingsPythonConsole.ui
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ horizontal space in Python console</string>
<item row="3" column="0">
<widget class="QLabel" name="labelProfilerInterval">
<property name="text">
<string>Python profiler interval (milliseconds): </string>
<string>Python profiler interval (milliseconds):</string>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/QuantitySpinBox_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ExpressionLabel : public QLabel
private:

const QString genericExpressionEditorTooltip = tr("Enter an expression... (=)");
const QString expressionEditorTooltipPrefix = tr("Expression: ");
const QString expressionEditorTooltipPrefix = tr("Expression:") + QLatin1String(" ");
};

#endif // QUANTITYSPINBOX_P_H
6 changes: 3 additions & 3 deletions src/Gui/SoDatumLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ void SoDatumLabel::generateDistancePrimitives(SoAction * action, const SbVec3f&
// Primitive Shape is only for text as this should only be selectable
SoPrimitiveVertex pv;

this->beginShape(action, QUADS);
this->beginShape(action, TRIANGLE_STRIP);

pv.setNormal( SbVec3f(0.f, 0.f, 1.f) );

Expand Down Expand Up @@ -616,7 +616,7 @@ void SoDatumLabel::generateDiameterPrimitives(SoAction * action, const SbVec3f&
// Primitive Shape is only for text as this should only be selectable
SoPrimitiveVertex pv;

this->beginShape(action, QUADS);
this->beginShape(action, TRIANGLE_STRIP);

pv.setNormal( SbVec3f(0.f, 0.f, 1.f) );

Expand Down Expand Up @@ -653,7 +653,7 @@ void SoDatumLabel::generateAnglePrimitives(SoAction * action, const SbVec3f& p0)
// Primitive Shape is only for text as this should only be selectable
SoPrimitiveVertex pv;

this->beginShape(action, QUADS);
this->beginShape(action, TRIANGLE_STRIP);

pv.setNormal( SbVec3f(0.f, 0.f, 1.f) );

Expand Down
47 changes: 23 additions & 24 deletions src/Gui/Tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5356,38 +5356,37 @@ void DocumentObjectItem::testStatus(bool resetStatus, QIcon& icon1, QIcon& icon2
icon.addPixmap(pxOff, QIcon::Normal, QIcon::Off);

icon = object()->mergeColorfulOverlayIcons(icon);
}

if (isVisibilityIconEnabled()) {
static QPixmap pxVisible, pxInvisible;
if (pxVisible.isNull()) {
pxVisible = BitmapFactory().pixmap("TreeItemVisible");
}
if (pxInvisible.isNull()) {
pxInvisible = BitmapFactory().pixmap("TreeItemInvisible");
}
if (isVisibilityIconEnabled()) {
static QPixmap pxVisible, pxInvisible;
if (pxVisible.isNull()) {
pxVisible = BitmapFactory().pixmap("TreeItemVisible");
}
if (pxInvisible.isNull()) {
pxInvisible = BitmapFactory().pixmap("TreeItemInvisible");
}

// Prepend the visibility pixmap to the final icon pixmaps and use these as the icon.
QIcon new_icon;
for (auto state: {QIcon::On, QIcon::Off}) {
QPixmap px_org = icon.pixmap(0xFFFF, 0xFFFF, QIcon::Normal, state);
// Prepend the visibility pixmap to the final icon pixmaps and use these as the icon.
QIcon new_icon;
for (auto state: {QIcon::On, QIcon::Off}) {

Check warning on line 5371 in src/Gui/Tree.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Missing space around colon in range-based for loop [whitespace/forcolon] [2]
QPixmap px_org = icon.pixmap(0xFFFF, 0xFFFF, QIcon::Normal, state);

QPixmap px(2*px_org.width(), px_org.height());
px.fill(Qt::transparent);
QPixmap px(2*px_org.width(), px_org.height());
px.fill(Qt::transparent);

QPainter pt;
pt.begin(&px);
pt.setPen(Qt::NoPen);
pt.drawPixmap(0, 0, px_org.width(), px_org.height(), (currentStatus & 1) ? pxVisible : pxInvisible);
pt.drawPixmap(px_org.width(), 0, px_org.width(), px_org.height(), px_org);
pt.end();
QPainter pt;
pt.begin(&px);
pt.setPen(Qt::NoPen);
pt.drawPixmap(0, 0, px_org.width(), px_org.height(), (currentStatus & 1) ? pxVisible : pxInvisible);
pt.drawPixmap(px_org.width(), 0, px_org.width(), px_org.height(), px_org);
pt.end();

new_icon.addPixmap(px, QIcon::Normal, state);
new_icon.addPixmap(px, QIcon::Normal, state);
}
icon = new_icon;
}
icon = new_icon;
}


_Timing(2, setIcon);
this->setIcon(0, icon);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Main/MainGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int main( int argc, char ** argv )
App::Application::Config()["SplashInfoColor" ] = "#8aadf4"; // light blue
App::Application::Config()["SplashInfoPosition" ] = "6,75";

QGuiApplication::setDesktopFileName(QStringLiteral("org.freecad.FreeCAD.desktop"));
QGuiApplication::setDesktopFileName(QStringLiteral("org.freecad.FreeCAD"));

try {
// Init phase ===========================================================
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/AddonManager/Addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"openscad": "OpenSCAD",
"part": "Part",
"partdesign": "PartDesign",
"path": "Path",
"cam": "CAM",
"plot": "Plot",
"points": "Points",
"robot": "Robot",
Expand Down
Loading

0 comments on commit aa552f2

Please sign in to comment.