Reply to topic

Patched Marble to provide access to AbstractPresenter inst.

jalvarez
Registered Member
Posts
3
Karma
0
Since previous attempts at making a custom InputHandler failed, I've decided to just patch marble to give the information I needed, namely the AbstractPresenter instance of MarbleWidget. With this my InputHandler can be instantiated and works as expected.

Patch below:

Index: src/lib/marble/MarbleWidget.cpp
===================================================================
--- src/lib/marble/MarbleWidget.cpp (revision 2038)
+++ src/lib/marble/MarbleWidget.cpp (revision 2039)
@@ -284,12 +284,20 @@
m_widget->setAttribute( Qt::WA_NoSystemBackground, isOn );
}

-// ----------------------------------------------------------------
-
-
-MarbleModel *MarbleWidget::model()
-{
- return &d->m_model;
+// ----------------------------------------------------------------
+
+
+MarbleAbstractPresenter* MarbleWidget::ae_abstractPresenter(){
+ return &(d->m_presenter);
+}
+
+const MarbleAbstractPresenter* MarbleWidget::ae_abstractPresenter() const {
+ return &(d->m_presenter);
+}
+
+MarbleModel *MarbleWidget::model()
+{
+ return &d->m_model;
}

const MarbleModel *MarbleWidget::model() const
Index: src/lib/marble/MarbleWidget.h
===================================================================
--- src/lib/marble/MarbleWidget.h (revision 2038)
+++ src/lib/marble/MarbleWidget.h (revision 2039)
@@ -44,12 +44,13 @@
class GeoSceneDocument;
class LayerInterface;
class MarbleModel;
+class MarbleAbstractPresenter;
class TextureLayer;
class TileCoordsPyramid;
class TileCreator;
@@ -160,12 +161,19 @@
~MarbleWidget() override;

/// @name Access to helper objects
- //@{
-
- /**
- * @brief Return the model that this view shows.
- */
- MarbleModel *model();
+ //@{
+
+ /**
+ * @brief Return internal MarbleAbstractPresenter instance.
+ */
+ MarbleAbstractPresenter * ae_abstractPresenter();
+ const MarbleAbstractPresenter * ae_abstractPresenter() const;
+
+ /**
+ * @brief Return the model that this view shows.
+ */
+ MarbleModel *model();
const MarbleModel *model() const;

ViewportParams *viewport();


Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Majestic-12 [Bot], Sylvanticus, TristanDee