Commit Graph

85 Commits

Author SHA1 Message Date
bgbsww
5a1275ad60 Toponaming: Fix ctrl selection issues by looking up element names and setting up detail path 2024-09-02 18:28:11 +02:00
bgbsww
608c80b5a3 Toponaming: Remove remaining FC_USE_TNP_FIX defines 2024-08-31 13:21:10 -05:00
bgbsww
19e450a667 Refactor all element name pairs into clearer struct names - renames 2024-07-20 16:32:12 -04:00
bgbsww
e07d940f5b Toponaming: Process mapped names during selection 2024-07-15 10:45:43 -05:00
bgbsww
8675aa87b4 Toponaming: Check for selection mapped element name 2024-06-22 17:10:54 -05:00
bgbsww
c0c0f5dac5 Only adjust found element names 2024-06-20 16:10:39 -05:00
bgbsww
2d9e9efdd3 Toponaming: fix secondElementSelection and SelectionView 2024-06-16 22:15:11 -05:00
PaddleStroke
0f08a05b7f Core: Fix GreedySelection: clicking on empty space was clearing selection while greedyselection was active. Fixes #12884 2024-05-06 18:32:00 +02:00
luzpaz
65cdbe3e89 Fix various typos throughout the codebase (#13029)
* Fix various typos throughout the codebase

* [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>
2024-03-18 16:54:30 -05:00
wmayer
c1552fb590 Gui: Enable SoModelMatrixElement
The element type SoModelMatrixElement must be enabled for the node types SoHighlightElementAction and SoSelectionElementAction.
Otherwise an assert() will fail and causes a crash in debug mode.
2024-03-04 11:24:39 +01:00
André Caldas
89dbab9b0e Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.

The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).

Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".

The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
2023-12-11 17:37:58 +01:00
wmayer
6132d8ee63 Gui: remove code duplication of printing preselection 2023-11-20 21:44:05 -06:00
Paddle
ec305a93e0 Status bar message : reduce number of decimals to use system preference. 2023-11-20 11:02:00 -06:00
wmayer
c0128c1401 Gui: issue #9205: Default settings make it hard to select objects in the 3D window 2023-11-06 10:58:20 -06:00
Paddle
346d0d7231 Core: Selection : Add possibility to set the style of selection between normal and greedy 2023-09-19 00:08:39 +02:00
wmayer
35136bb3c2 Gui: do not call back() on an empty container
Calling back() on an empty container is undefined behaviour: https://en.cppreference.com/w/cpp/container/vector/back
2023-08-29 00:52:33 +02:00
Edoardo Morandi
512770f27c fix: downcasting of SoNode that can cause UB (#9285)
A SoNode* is not necessarily a SoFCSelectionRoot*, and when this
assumption breaks the code causes UB (the comment related to one of the
chunks explicitly says that it is safe, but unfortunately it is not).

Instead of storing `SoFCSelectionRoot*` and blindly cast a generic
`SoNode*` to that, we can do the opposite. In this way it is obviously
necessary to use a dynamic cast when trying to reach for
`SoFCSelectionRoot` specific features, but in this way the abstraction
should be sound.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2023-08-28 11:06:06 -05:00
wmayer
6beace8da6 Gui: modernize C++: use default member init 2023-08-23 19:51:44 +02:00
wmayer
888a33917d Gui: modernize C++: use equals default 2023-08-20 18:12:43 +02:00
wmayer
fa8978ce99 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
dbad96d43e modernize C++: use using 2023-08-06 23:17:10 +02:00
luzpaz
055447a702 Fix various typos 2023-07-01 10:08:21 +00:00
Pesc0
c65f049d20 [Toponaming] create ElementMap class (#9175)
* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
2023-06-15 09:05:24 -05:00
marioalexis
ff1b4eff05 Gui: Replace C cast 2022-09-18 11:06:51 -05:00
berniev
ae53c9b0a4 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
berniev
3d1f70765a Gui: redundant void 2 2022-08-08 10:21:44 +02:00
berniev
2db561561e Gui: use empty 2022-08-06 16:35:45 +02:00
Uwe
d5b227e6a6 [Gui] remove more superfluous nullptr checks 2022-07-18 03:34:22 +02:00
Uwe
bb2b49fb1f [Gui] remove superfluous nullptr checks 2022-07-18 03:17:42 +02:00
andrea
7886d3cbf4 Remove unused code into GUI 2022-07-17 03:53:11 +02:00
wmayer
0b2c73cf32 Gui: clean-up Selection API
Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
2022-04-09 17:03:43 +02:00
Chris Hennes
5df3dbae6f Gui: PR6497 move return statement to new line 2022-03-29 12:33:50 -05:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
99191c6679 [Gui] So headers: remove unused includes
- also sort out some headers to be used in precompiled headers
- also move a boost header to precompiled headers
2022-03-16 02:01:32 +01:00
Uwe
8a0e6dd587 [Gui] compilation fixes for non-PCH
the recent commits were done with PCH, this is the final commit of today's header work for PCH
2022-02-19 06:22:08 +01:00
Uwe
c104c83f37 [Gui] remove some more unused headers 2022-02-19 04:31:27 +01:00
wmayer
b7bf4d40b6 Gui: [skip ci] Fix coverity warning
Coverity warnings fixed:

CID 316550 (#1 of 1): Uninitialized scalar variable (UNINIT)
13. uninit_use_in_call: Using uninitialized value sel. Field sel.pResolvedObject is uninitialized when calling push_back
2021-02-21 16:00:01 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
45e0673645 LGTM: [skip ci] fix: Declaration hides parameter
A local variable hides a parameter. This may be confusing. Consider renaming one of them.
2020-07-27 10:57:34 +02:00
wmayer
6426161ed8 PVS: V572 It is odd that the object which was created using 'new' operator is immediately cast to another type 2020-07-18 10:59:28 +02:00
luz.paz
ef37cc3930 Fix typos [skip-ci]
Found via codespell v1.18.0.dev0  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-06-29 20:52:23 +02:00
wmayer
515250485e Gui: [skip ci] fix unicode handling when showing units in status bar 2020-06-04 16:27:58 +02:00
wmayer
0d4f196c60 Gui: let each coordinate use its own unit to avoid that the displayed values can become very huge 2020-05-30 17:16:32 +02:00
wmayer
c374a6faa9 Gui: implement a static function schemaTranslatePoint to avoid code duplication 2020-05-30 16:46:35 +02:00
0penBrain
01e21f2f11 [FC] Status bar preselection coordinates are aware of user unit setting ; fixes #4148 2020-05-30 12:29:58 +02:00
wmayer
08b54bb5a0 [skip ci] line width must be explicitly set in NaviCube and SoFCSelectionRoot to avoid that an inappropriate value is used when set from somewhere else 2019-11-10 11:13:10 +01:00
wmayer
6d515aa60c fix build failure on Windows due to conflicting define of GDI API 2019-10-08 14:49:56 +02:00
Zheng, Lei
bb3baefdb5 Gui: refactor bounding box selection style
Previously, box style selection is rendered using customized
SoBoxSelectionRenderAction, which does not support selection context,
i.e. it does not work with Link.

This patch implements context aware bound box rendering inside
SoFCSelectionRoot, SoFCSelection and SoFCPathAnnotation (for always on
top rendering). The box rendering in SoBoxSelectionRenderAction is
disabled on construction. Box style selection can be enabled for
individual object through property SelectionStyle (moved from
ViewProviderGeometryObject to ViewProviderDocumentObject), or globally
through Parameter BaseApp/Preferences/View/ShowSelectionBoundingBox.

In addition, the parameter BaseApp/Preferences/View/UseNewSelection is
used to override selection model reported from
ViewProvider::useNewSelectionModel(). The reason being that, the same
parameter is already used to toggle selection model inside
SoFCSelection. This avoids inconsistency of selection model choice
between view provider and the SoFCSelection node inside. Note that if
the parameter 'UseNewSelection' is set to false, those view providers
that choose old selection model will not work with Link.
2019-10-08 09:56:09 +02:00
luz.paz
fb32601746 Fix various (doxy) typos and whitespace issues
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml`
2019-10-03 07:57:13 +02:00
wmayer
9fa56345cf core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00