]> sigrok.org Git - pulseview.git/commitdiff
RowItemOwner: Added depth() method
authorJoel Holdsworth <redacted>
Sun, 16 Nov 2014 19:47:13 +0000 (19:47 +0000)
committerJoel Holdsworth <redacted>
Wed, 19 Nov 2014 10:23:31 +0000 (10:23 +0000)
pv/view/rowitemowner.h
pv/view/tracegroup.cpp
pv/view/tracegroup.h
pv/view/view.cpp
pv/view/view.h

index c2d38134e2080027d4b12bafa8faea4874851513..0fda9aa27b1778dbabfdf6c3d797fd3e4206065a 100644 (file)
@@ -65,6 +65,11 @@ public:
 
        virtual int owner_v_offset() const = 0;
 
 
        virtual int owner_v_offset() const = 0;
 
+       /**
+        * Returns the number of nested parents that this row item owner has.
+        */
+       virtual unsigned int depth() const = 0;
+
        /**
         * Returns a list of row items owned by this object.
         */
        /**
         * Returns a list of row items owned by this object.
         */
index 05a72dda021633fa4479dc6e292a390dc2ca3771..3058cec5158ba90e1979a82ba3dd9d790b43ef56 100644 (file)
@@ -155,6 +155,11 @@ int TraceGroup::owner_v_offset() const
        return _owner ? layout_v_offset() + _owner->owner_v_offset() : 0;
 }
 
        return _owner ? layout_v_offset() + _owner->owner_v_offset() : 0;
 }
 
+unsigned int TraceGroup::depth() const
+{
+       return _owner ? _owner->depth() + 1 : 0;
+}
+
 void TraceGroup::on_ungroup()
 {
        const vector< shared_ptr<RowItem> > items(
 void TraceGroup::on_ungroup()
 {
        const vector< shared_ptr<RowItem> > items(
index 218f42b11d3df54d548f1c3e4cf41f49d2bdf411..a950eac91451ba188ab0bd898430b4d83ebdef2e 100644 (file)
@@ -110,6 +110,11 @@ public:
         */
        int owner_v_offset() const;
 
         */
        int owner_v_offset() const;
 
+       /**
+        * Returns the number of nested parents that this row item owner has.
+        */
+       unsigned int depth() const;
+
 public:
        void appearance_changed(bool label, bool content);
 
 public:
        void appearance_changed(bool label, bool content);
 
index d8925c1aaa2acc1f2d3f0b4bc5a39bf3d420d3c0..ba095fb808d083a98397740554de5bc3a4096c0e 100644 (file)
@@ -186,6 +186,11 @@ int View::owner_v_offset() const
        return -_v_offset;
 }
 
        return -_v_offset;
 }
 
+unsigned int View::depth() const
+{
+       return 0;
+}
+
 void View::zoom(double steps)
 {
        zoom(steps, _viewport->width() / 2);
 void View::zoom(double steps)
 {
        zoom(steps, _viewport->width() / 2);
index 71a38f11888b0034ce3c916a6a19d5939107459d..2f7462978943a84362ff295f95a29011bef6599d 100644 (file)
@@ -99,6 +99,11 @@ public:
        double offset() const;
        int owner_v_offset() const;
 
        double offset() const;
        int owner_v_offset() const;
 
+       /**
+        * Returns the number of nested parents that this row item owner has.
+        */
+       unsigned int depth() const;
+
        void zoom(double steps);
        void zoom(double steps, int offset);
 
        void zoom(double steps);
        void zoom(double steps, int offset);