Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Integration 3D Interactive presentation widget problem



  • Hello,
    I am working on software to develop control and data acquisition systems (SCADA) called WinCC OA.
    this latter does not give the possibility to import 3d objects and animated objects, but it does give the possibility to create API.

    0_1556095410382_Capture.PNG

    For my case it is an EWO (External Widget Object), you will find attached the template I generated, it is developed in C++ using the Qt platform.

    [0_1556095847641__TEMPLATE_.cxx](Uploading 100%)
    [0_1556095858235__TEMPLATE_.hxx](Uploading 100%)
    [0_1556095865858__TEMPLATE_.pro](Uploading 100%)
    [0_1556095874300_README](Uploading 100%)
    [0_1556095883126_VersInfo.rc](Uploading 100%)

    honestly to develop an interactive 3d simulator purely in Qt respecting the generated template I can't even get started.

    here is a video to give an idea about the 3d simulator I want to make
    https://www.youtube.com/watch?v=yu-M6Omk1ps

    I thought about developing the simulator using a 3d engine , I start to develop it using unity (3d metro station visualization where I control camera position from buttons, I can make on/off the elevator ...etc).

    I managed to do but my problem is the integration, how to integrate this simulator into WinCC OA, i.e. the presentation I made under unity will be a widget in the new software, and I can control elevator, escalators .. etc from this last software.

    Help please

    Best Regards

    Anes



  • This is the header of the template

    #ifndef _TEMPLATE__H
    #define _TEMPLATE__H

    #include <BaseExternWidget.hxx>
    #include <QPen>
    #include <QBrush>

    //--------------------------------------------------------------------------------
    // this is the real widget (an ordinary Qt widget), which can also use Q_PROPERTY

    class MyWidget : public QWidget
    {
    Q_OBJECT

    // TODO example properties
    Q_PROPERTY( QStringList values READ getValues WRITE setValues DESIGNABLE false )
    Q_PROPERTY( QPen pen READ getPen WRITE setPen DESIGNABLE false )
    Q_PROPERTY( QBrush brush READ getBrush WRITE setBrush DESIGNABLE false )

    public:
    MyWidget(QWidget *parent);

    // TODO example of a string list property
    QStringList getValues() const { return values; }
    void setValues(const QStringList &list) { values = list; }
    
    // a QPen property used on a line drawn inside this widget
    const QPen &getPen() const { return pen; }
    void setPen(const QPen &p) { pen = p; update(); }
    
    // a QBrush property used as the background of this widget
    QBrush getBrush() const;
    void setBrush(const QBrush &brush);
    

    signals:
    // TODO example of a 2 signals this widget emits
    void clicked1();
    void clicked2();

    protected:
    virtual void paintEvent(QPaintEvent *event);

    private:
    // TODO example of a string list property
    QStringList values;
    QPen pen;
    };

    //--------------------------------------------------------------------------------
    // this is the EWO interface class

    class EWO_EXPORT TEMPLATE : public BaseExternWidget
    {
    Q_OBJECT

    public:
    TEMPLATE(QWidget *parent);

    virtual QWidget *widget() const;
    
    virtual QStringList signalList() const;
    
    virtual bool methodInterface(const QString &name, QVariant::Type &retVal,
                                 QList<QVariant::Type> &args) const;
    
    virtual QStringList methodList() const;
    

    public slots:
    virtual QVariant invokeMethod(const QString &name, QList<QVariant> &values, QString &error);

    private slots:
    // TODO the slots you need to redirect to the generic "signal" signal
    void clicked1();
    void clicked2();

    private:
    MyWidget *baseWidget;
    };

    #endif


Log in to reply