Se rendre au contenu
CTech Digital
  • Accueil
  • Services Odoo
  • Services d'IA
  • Contactez-nous
  • 0
  • Nederlands (BE) English (UK) Français
CTech Digital
  • 0
    • Accueil
    • Services Odoo
    • Services d'IA
    • Contactez-nous
  • Nederlands (BE) English (UK) Français

Observer pattern in CTrack

  • Tous les blogs
  • Daily blog
  • Observer pattern in CTrack
  • 12 novembre 2025 par
    CTech Metrology, Luc Wens

    In short

    The observer pattern works through an ObserverManager where views can register. ObserverSubject derivates will push change events on the ObserverManager, which will then notify Observer of these changes. Read all about it here.

    There are 2 important aspects of the observer pattern

    • The changes are more fine-grained then simply broadcasting a redraw command
    • Sequence of changes can be processed in batch before redrawing the Observer, increasing the performance and allowing for consolidation techniques.

    Essential is that Oberserver override the RedrawView , which redraws after a small change, and RebuildView , which does a complete reconstruction of the view internal representation.

    If having been away from this subject for some time, read the articles inside the CTrack solution under Doc/Oberserver Pattern:

    • ObserverPattern.md : general overview of the pattern
    • CNodeView_Architecture.md : specific for CTrack
    • ObserverPattern_Migration_Plan.md : work plan

    In the first phase changes to Nodes will be handled through NodeObserverView derivation. As the Observer pattern can handle a range of categories of changes, later we can also apply this pattern for other changes such as:

    • state changes 
    • connection changes
    • buffering changes
    • cursor updates

    Overview of Observer views

    The current observers are:

    • CView3DFrame
    • CViewDRO

      • CViewDOR3D
    • CViewPose
    • CBCGPMyRibbonBar
    • CBCGPPropBar
    • CNodeGridCtrl

      • CNodeTreePropertyCtrl

        • Live / Database Alignment / Projects
    • CChartWindow2D
    • AIS_TrajectoryColorScale
    • CDDataFeatureViewer


    CBCGPPropBar

    This is the property window that shows things like the radius of a circle.

    Currently it is updated through CNodeTreePropertyCtrl, which establishes a bad direct link between two observers and is very wrong. 

    So we need to start with this one, implement Redraw and Rebuild, an tackle all the changes, from which rename, delete, setselected and color or the most important ones.

    The CNodeTreePropertyCtrl layer has to go. Currently it houses the next functions for updating the property window under selection:

    • PropertyWindow_Set
    • PropertyWindow_Get
    • OnSetFocus
    • OnLButtonDown
    • OnViewData
    • OnAlignShowPoints


    CNodeGridCtrl


    in Daily blog
    # CTrack
    Open3D
    Droits d'auteur © CTech Solutions
    Nederlands (BE) | English (UK) | Français
    Généré par Odoo - Le #1 Open Source eCommerce