Commit Graph

507 Commits

Author SHA1 Message Date
Chris
ed229cd7df Import: Export tip when body is selected (#24678) 2025-10-20 10:59:18 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
f620d68c19 Removed outdated UTF8 declaration [ Other ] (#24528)
* Removed outdated UTF8 declaration

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-13 18:34:43 +02:00
Markus Reitböck
db1dc05b5f Import: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-23 22:39:35 +02:00
Markus Reitböck
c003f7915b fix duplicate include guards in precompiled headers 2025-09-23 00:51:00 +02:00
Markus Reitböck
496b31b087 do not use precompiled header for setting global compiler definitions and to disable compiler warnings
only 4 of these warnings are still relevant, CMake shall be used to disable them

Compiler definitions:

  NOMINMAX:
    * is already globally defined in SetGlobalCompilerAndLinkerSettings.cmake

  WIN32_LEAN_AND_MEAN:
    * use CMake target_compile_options on relevant targets

Warnings that still occur:

  C4251, C4273, C4275: all related to dllimport / export
    * use CMake target_compile_options on relevant targets

  C4661: no suitable definition provied for explicit template instantiation request
    * triggered in Mesh because of Vector3D in Base - not all functions are defined in header
    * use CMake target_compile_options on relevant targets

Warnings that are Currently not triggered (fix code if they appear again):

  C4005: macro redefinition

  C4244: argument conversion, possible loss of data

  C4267: conversion from size_t to type, possible loss of data

  C4305: truncation from type1 to type2
    * only occurrence disabled in Reader.cpp

  C4522: multiple assignment operator specified

  C5208: unnamed class in typedef name

Obsolete Compiler warnings:

  C4181: not mentioned in Microsoft docs anymore

  C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
    * throw(optional_type_list)  deprecated in C++17

  C4482: nonstandard extension used: enum 'enumeration' used in qualified name
    * not generated for compilers that support C++11

  C4503: 'identifier': decorated name length exceeded, name was truncated
    * obsolete since Visual Studio 2017

  C4786: not mentioned in Microsoft docs anymore
2025-09-11 20:21:04 -05:00
wmayer
ac51455a0a CMake: Replace include_directories with target_include_directories 2025-09-08 19:04:34 +02:00
Chris Hennes
b699349e9b Merge pull request #23521 from z0r0/python-interface-bindings-final
Core: Python interface bindings cleanup
2025-09-08 10:58:15 -05:00
tetektoza
527f18adcd Tests: Correct testcases after scene graph reordering in Clarify Select 2025-09-05 10:42:02 +02:00
Ian 'z0r0' Abreu
78ec52f1a8 updating docblock locations. 2025-09-02 08:28:47 -04:00
Ian 'z0r0' Abreu
b1c551026e reverting author metadata 2025-09-02 08:25:37 -04:00
Ian 'z0r0' Abreu
b0b9f8fc35 Adding license documentation to interface class docblocks. 2025-09-01 21:50:59 -04:00
Ian 'z0r0' Abreu
ca435629b8 Finalizing Python interface bindings for Import, Measure, Mesh, Points. 2025-08-31 15:34:03 -04:00
Yorik van Havre
512a22d39b Merge pull request #22251 from furgo16/dxf-new-import-ui-and-more
Redesign DXF import UI, add Part primitives and Draft object import modes
2025-07-28 17:49:25 +02:00
Ian 'z0r0' Abreu
66ada8e10a fixing unnecessary list import 2025-07-28 08:59:52 -05:00
PaddleStroke
a897057ebb Import: Fix export crash when hidden object in Part. (#14567) 2025-07-18 11:20:04 -05:00
Furgo
df52665ae5 Import: DXF, fix typo in individual shapes import mode 2025-07-14 10:18:04 +02:00
Furgo
cf548d0b8e Import: DXF, deduplicate Part primitives creation
Create helpers that can be reused when importing entities as top-level
geometry and as part of blocks
2025-07-14 10:18:04 +02:00
Furgo
d1e131863b Import: DXF, first working version of dimensions import 2025-07-14 10:18:04 +02:00
Furgo
9f9104e182 Import: DXF, make ellipses parametric 2025-07-14 10:18:04 +02:00
Furgo
a295f9dd5c Import: DXF, first working version of Draft objects import 2025-07-14 10:18:04 +02:00
Furgo
5951d759f8 Import: DXF, first working version for import as Part primitives 2025-07-14 10:18:04 +02:00
Furgo
293ebf801c Import: DXF, add dedicated import dialog 2025-07-14 10:18:04 +02:00
Furgo
37cd1a657a Import: DXF importer, refactor preferences UI 2025-07-14 10:18:04 +02:00
Furgo
ef9378bd5b Import: improve DXF C++ importer support for BLOCK and INSERT entities (#22045)
* Import: DXF importer, block and inserts overhaul

Implement support for blocks as definitions and inserts
as instances.

A BLOCK definition becomes a hidden master object in a
_BlockDefinitions group (currently a Part::Compound).
An INSERT becomes a visible App::Link that points to
that master definition.

* Import: DXF parser/importer add debug print statements

* Import: DXF importer, various improvements

- Add more code comments
- Correctly increase object count
- Improve readability of anonymous block checks

* Import: DXF (all) report anonymous blocks separately

* Import: DXF importer (App + GUI) add nested inserts support

* Import: DXF importer (GUI) fix preserving colors for inserts

* Import: DXF importer, make primitives naming more specific

* Import: DXF parser/importer remove debug print statements

* Import: DXF parser, work around DXF color index 7

* Import: DXF importer GUI, temporary debug print to show layer color data

* Import: DXF importer, fix nested inserts hierarchy

* Import: DXF importer, prefix and suffix underscores to names

To work around mangling from FreeCAD's unique name generator.

* Import: DXF importer, implement flattening blocks on import

* Revert "Import: DXF importer GUI, temporary debug print to show layer color data"

This reverts commit b6ece395c9d2b8a1e0796d6f7b0d58842a2f3686.

* Import: DXF importer, fix imported text orientation

The DXF file provides the text rotation angle in degrees.
The used rotZ function expects the angle in radians,
thus the conversion needs to be made.

Fixes: #21548

* Import: DXF importer, honour the preference to not import layouts

* Import: DXF importer, move unreferenced blocks to separate group

This provides better classification, but it has a performance hit:
we import all blocks as before, we sort them and we reparent them
to the correct group. The reparentipart with Grou.setValues()
appears to be an expensive call. Probably because internally the
FreeCAD dependency graph is modified.

* Import: DXF importer, count compound children in the report

* Import: DXF importer, cleanup defined blocks group if empty
2025-07-12 13:38:13 +02:00
Furgo
41709fa338 Import: DXF parser, correctly pass line no. and handle 2025-06-25 07:41:03 +02:00
Furgo
318f205708 Import: DXF backend/frontend, report more unsupported features info
Now for unsupported features we report on line numbers and on the entity
handle, in case that unsupported feature is a DXF entity. To avoid
flooding the output, only a maximum of 5 instances are reported with
details. The rest simply add up to the global count and are ellipsized
in the report.

Report output is now in sentence case.
2025-06-25 07:41:03 +02:00
Furgo
89d2937afd Import: DXF parser, fix macOS linker issue 2025-06-25 07:41:03 +02:00
Furgo
3f606177e3 Import: DXF parser, remove original unsupported features count and warning 2025-06-25 07:41:03 +02:00
Furgo
789ca45280 Import: DXF importer, add code comments to C++ to Python stats passing function 2025-06-25 07:41:03 +02:00
Furgo
9eaecf6803 Import: DXF parser, add entities in paperspace count 2025-06-25 07:41:03 +02:00
Furgo
d77cdf999b Import: DXF parser, add DXF block count 2025-06-25 07:41:03 +02:00
Furgo
f84ed59a43 Import: DXF backend, frontent; add time measurement 2025-06-25 07:41:03 +02:00
Furgo
ceb72924c2 Import: DXF parser, disable now redundant unsupported entities reporting 2025-06-25 07:41:03 +02:00
Furgo
e8ce264507 Import: DXF parser/imported improve unsupported features count
Classify unsupported features by type, and report on
the breakdown.
2025-06-25 07:41:03 +02:00
Furgo
ea40128ea4 Import: DXF parser/importer, improve scale reporting
Report additional information about user scaling
value, scaling info source and resulting scale,
including units.
2025-06-25 07:41:03 +02:00
Furgo
78b720fd35 Import: DXF importer, add Python bindings 2025-06-25 07:41:03 +02:00
Furgo
72ca1478e8 Import: DXF importer, populate stats reporting structure 2025-06-25 07:41:03 +02:00
Furgo
76a0d9ffe3 Import: DXF parser, add stats reporting structure 2025-06-25 07:41:03 +02:00
Furgo
e044ddab6d DXF: do not ignore the setting that controls importing paper layouts 2025-06-23 14:06:02 +02:00
Furgo
272505d22b Import: DXF, handle non-standard 8859_1 encoding (#21905)
* Import: improve DXF importer exception handling

* Import: DXF, pinpoint erroneous header section when reading

* Import: tackle 8859_1 non-standard encoding name
2025-06-16 18:02:56 +02:00
theo-vt
1a0a68ae69 PartDesign: Fix hole centered on point edge case (#21257)
* Light refactor of getTopoShape function

* Fix hole edge case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Refactor simplifyCompound()

* Use Base::Flags<GetShapeOption>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Shorten enum name and move it from class scope to namespace scope

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-05-29 22:37:54 +02:00
Chris Hennes
f5ab6295ba UI: Remove qPixmapFromMimeSource pixmap function
This function dates back to Qt3, and was removed in Qt4. Modern Qt no
longer uses this ui file entry, and in some circumstances the uic
complains about its presence.
2025-05-15 00:56:30 +02:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
9683cf1e4f Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
015cf36c38 Import: use contains() instead of count() where possible 2025-05-03 22:19:51 +02:00
Kacper Donat
77e40b9747 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Pieter Hijma
5ba9037885 [Doc] Fix unassociated doc strings
Before this commit, these doc strings were unassociated, which means
that the can appear at random places.  They are now associated with
their namespace an class.
2025-04-11 00:47:54 +02:00
Kacper Donat
9d97d1c895 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Benjamin Nauck
cf156ad897 Import: Add #include <limits> where used 2025-03-31 23:51:31 +02:00
Kevin Martin
801a507328 Correct non-gui DXF C++ importer to not generate pending python exceptions (#20328)
* Add a test case for DXF import

* Test gui flag rather than look for import error to make gui decision

The new code is cleaner and faster and avoids any exception stuff

* Properly avoid trying to use Layer's View object in non-GUI

The code was trying to avoid this but had a Python None object rather than a null C++ pointer and so tried setting a property on None. This left an unhandled exception state which acted as a booby trap that caused the later failure of some unrelated code.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* De-lint, remove wong "unsupported" message
Hidden layers have been supported for a while but still generated an import note about this being unsupported.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-31 11:20:37 -05:00