初步实现场景切换
This commit is contained in:
@ -17,25 +17,25 @@
|
||||
#include <Qt3DRender/QSceneLoader>
|
||||
#include <Qt3DExtras/QCylinderMesh>
|
||||
|
||||
class View3D : public QWidget
|
||||
class View3DBase : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit View3D(const QString& baseModelPath,
|
||||
explicit View3DBase(const QString& baseModelPath,
|
||||
const QString& armModelPath,
|
||||
QWidget* parent = nullptr);
|
||||
void setViewCenter(float x, float y, float z);
|
||||
void setDistance(float distance);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
bool eventFilter(QObject* obj, QEvent* event) override;
|
||||
|
||||
private:
|
||||
void initScene();
|
||||
void initCamera();
|
||||
void updateCameraPosition();
|
||||
void createAxes();
|
||||
|
||||
private:
|
||||
QString m_baseModelPath;
|
||||
QString m_armModelPath;
|
||||
|
||||
@ -67,8 +67,43 @@ private:
|
||||
Qt3DCore::QTransform* m_baseRootTransform = nullptr;
|
||||
Qt3DCore::QTransform* m_armRootTransform = nullptr;
|
||||
|
||||
public Q_SLOTS:
|
||||
virtual void setLoc(std::vector<double> loc) = 0;
|
||||
};
|
||||
|
||||
class View3DPlantPhenotype : public View3DBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
View3DPlantPhenotype(const QString& baseModelPath,
|
||||
const QString& armModelPath,
|
||||
QWidget* parent = nullptr);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
|
||||
public Q_SLOTS:
|
||||
void setLoc(std::vector<double> loc);
|
||||
};
|
||||
|
||||
class View3DLinearStage : public View3DBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
View3DLinearStage(const QString& baseModelPath,
|
||||
const QString& armModelPath,
|
||||
QWidget* parent = nullptr);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
|
||||
public Q_SLOTS:
|
||||
void setLoc(std::vector<double> loc);
|
||||
};
|
||||
#endif // VIEW3D_H
|
||||
|
||||
Reference in New Issue
Block a user