Commit Graph

25 Commits

Author SHA1 Message Date
Zheng, Lei
65889b6c80 App: Fix Origin::extensionGetSubObject() 2022-05-16 11:27:35 +02:00
Zheng, Lei
6340dcdd63 App: fix Origin getSubObject() 2022-05-14 14:02:21 +02:00
wmayer
749361d2f3 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
Uwe
3a88639e19 [App] remove unused code and some header sorting 2022-02-28 00:17:16 +01:00
luz paz
bfdffb50be App: Fix header uniformity, trailing whitespace, and doxygen headers 2020-11-19 13:38:37 +01:00
wmayer
9801519409 App: [skip ci] correctly mapping of sub-feature name to role name of an Origin feature 2020-06-06 15:46:48 +02:00
wmayer
1521b256bc App: [skip ci] implement the private class OriginExtension to simulate a geometric group behaviour 2020-06-05 18:24:17 +02:00
wmayer
229e8dd375 App: implement the private class OriginExtension to simulate a geometric group behaviour 2020-06-05 18:17:40 +02:00
luz.paz
4f308dc03c src/App: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/App` files
2019-12-25 11:38:43 +01:00
Zheng, Lei
4eadbd038d App/Gui: add ObjectStatus::NoAutoExpand
Used by App::Origin to disable selection auto expanding in tree view.
2019-10-08 10:23:57 +02:00
luz.paz
7b7797f4f3 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
Zheng, Lei
ff1d1cd341 App: add New APIs for future Link function
DocumentObject:

* getSubObject(): the most important API for Link to work with
  hierarchies. The function is a inspired from and replaces the
  getPySubObjects(). It returns a child object following a dot separated
  subname reference, and can optionally return accumulated
  transformation, and/or a python object of the refered
  sub-object/element. The default implementation here is to look for
  link type property, and search for the referenced object. This patch also
  include other specialized implementation of this API, such as
  (GeoFeature)GroupExtension (through extensionGetSubObject()),
  PartDesign::Body, and so on. A link type object is expected to
  call the linked object's getSubObject() for resolving.

* getSubObjectList(): helper function to return a list of object
  referenced in the given subname.

* getSubObjects(): return a list of subname references of all children
  objects. The purpose of this function is similar to
  ViewProvider::claimChildren().  Container type object is expected to
  implement this function.  The reason it returns subname references
  instead of just object is to allow the container to skip hierarchies.
  For example, the Assembly3 container uses this to skip the constraint
  and element group.

* getLinkedObject(), obtain the linked object, and optionally with the
  accumulated transformation. It is expected to return a linked object
  or the object itself if it is not a link. In case there are multiple
  levels of linking involved, this function allows the caller to retrieve
  the linked object recursively.

* hasChildElement(), set/isElementVisible(), controls the children
  visibility for a group type object. Because the child object may be
  claimed by other objects, it is essential to have independent control
  of children visibilities. These APIs are designed to abstract how
  group manages the child visibility. For performance reason, these
  function are meant to control only the immediate child object.

* resolve(), helper function to parse subname reference and resolve the
  final object, and optionally the immediate parent of the final object,
  the final object reference name (for calling `set/isElementVisible()`),
  and the subname reference if there is one.

* touch(), add optional argument 'noRecompute' for better backward
  compatibility with the NoRecompute flag. By default, touch() causes
  recompute unless noRecompute is true

* signalChanged/signalBeforeChange, two new signal for tracking changes
  of a specific object.

* getViewProviderNameOverride(), return a string of the view provider
  type of this object. This allows Python class to override the view
  provider of an object. This feature will be used by ViewProviderLink
  which is designed to work with any object that has LinkBaseExtension.

* canLinkProperties(), will be used by Gui::PropertyView to display
  linked object properties together with the object's own properties.

* redirectSubname(), will be used by Gui::Tree to allow an object to
  redirect selection to some other object when (pre)selected in the tree
  view.

* Visibility, new property serve as the same purpose as view provider
  property of the same name. It is added here so that App namespace
  code can check for visibility without Gui module. This is useful,
  for example, when constructing a compound shape of a container that
  respects the children visibility.

* (has)hasHiddenMarker(), return or check for a special sub-element
  name used as marker for overriding sub-object visibility. Will be
  used by Gui::ViewProvider, it is put here for the same reason as
  adding Visibility property.

* getID(), return object internal identifier. Each object is now
  assigned an integer identifier that is unique within its containing
  document.

Document:

* ShowHidden, new property to tell tree view whether to show hidden
  object items.

* signalTouchedObject, new signal triggered when manually touch an
  object when calling its touch() function

* getObjectByID(), get object by its identifier

* addObject() is modified to allow overriding view provider

* has/getLinksTo(), helper function to obtain links to a given object.

Application:

* checkLinkDepth(), helper function to check recursive depth for link
  traversal. The depth is checked against the total object count of
  all opened documents. The count (_objCount) is internally updated
  whenever object is added or removed.

* has/getLinksTo(), same as Document::has/getLinksTo() but return links
  from all opened documents.

GroupExtension/OriginGroupExtension/DatumFeature/DatumCS/Part::Feature:
implement sepcialized getSubObject/getSubObjects().
2019-08-17 14:52:08 +02:00
wmayer
09737f2db3 rename method from remObject to removeObject to be more readable 2017-09-13 18:57:38 +02:00
wmayer
4b400fd986 rename status bit 'Delete' to 'Remove' as it fits better for its purpose, add new bit 'Destroy' 2017-09-13 15:47:48 +02:00
Stefan Tröger
eb601df236 Fix undo/redo while checking link integrity 2017-06-19 15:37:09 +02:00
wmayer
1673ab801e use specialized exception classes 2017-04-28 18:49:11 +02:00
wmayer
d03a8fd386 + fix various gcc & clang warnings 2016-04-24 16:21:19 +02:00
DeepSOIC
6b5554fb03 PartDesign: reverse XZ plane to match legacy orientations
discussion in forum thread "ZX plane in PartDesign Next (instead of XZ)"
http://forum.freecadweb.org/viewtopic.php?f=8&t=15319
2016-04-19 21:36:31 +03:00
sgrogan
393ba05726 Win build fixes 2016-04-12 18:12:21 +02:00
Alexander Golubev
2c2d155ee9 OriginGroup: add new abstraction layer between the Part and the GeoFeatureGroup 2016-04-12 18:12:18 +02:00
Alexander Golubev
797d6d3a11 App/Origin: big refactoring
- Rebase App::Origin on App::DocumentObject
 - Keep all control over the Origin structure inside the Origin and it's
   ViewProvider
 - Add OriginFeature class as common base for App::Plane and App::Line
 - Rebase App::Plane and App::Line on top of newly created class and
   move to the file.
 - Change Origin's ViewProvider API associated with temporary display
 - Lots of associated changes to files
 - Several minor fixes
 - Lots of new bugs
2016-04-12 18:12:18 +02:00
Alexander Golubev
c6797b6c29 Revert "part deletion handling"
This reverts commit 6ab2002021ac1df26ebe77f488f5cd94e1df0b26.
2016-04-12 18:12:17 +02:00
Stefan Tröger
07b7d9ff08 part deletion handling
-remove everxthing that belongs to a part on deletion
-disallow to delete the origin by the user and only remove it when Part is being deleted
2016-04-12 18:12:13 +02:00
Stefan Tröger
0e8b78d2fb make bodies, origins, planes and lines unmovable 2016-04-12 18:12:06 +02:00
Stefan Tröger
3f5caa2181 group coordinate planes and lines 2016-04-12 18:12:05 +02:00