81 QVector3D from3DTo2DLabelPosition(
const QVector3D &sourcePos, Qt3DRender::QCamera *sourceCamera, Qt3DRender::QCamera *destCamera );
86 void onAxisSettingsChanged( );
90 void onCameraUpdate( );
91 void onAxisViewportSizeUpdate(
int val = 0 );
94 void onTouchedByRay(
const Qt3DRender::QAbstractRayCaster::Hits &hits );
97 void onAxisHorizPositionChanged( Qt::AnchorPoint pos );
98 void onAxisVertPositionChanged( Qt::AnchorPoint pos );
99 void onCameraViewChange(
float pitch,
float yaw );
101 void onCameraViewChangeHome() { onCameraViewChange( 45.0f, 45.0f ); }
102 void onCameraViewChangeTop() { onCameraViewChange( 0.0f, 90.0f ); }
103 void onCameraViewChangeNorth() { onCameraViewChange( 90.0f, 180.0f ); }
104 void onCameraViewChangeEast() { onCameraViewChange( 90.0f, 90.0f ); }
105 void onCameraViewChangeSouth() { onCameraViewChange( 90.0f, 0.0f ); }
106 void onCameraViewChangeWest() { onCameraViewChange( 90.0f, -90.0f ); }
107 void onCameraViewChangeBottom() { onCameraViewChange( 180.0f, 0.0f ); }
111 void createAxisScene();
112 void createAxis( Qt::Axis axis );
114 void setEnableCube(
bool show );
115 void setEnableAxis(
bool show );
116 void updateAxisLabelPosition();
117 void updateAxisLabelText( Qt3DExtras::QText2DEntity *textEntity,
const QString &text );
118 QFont createFont(
int pointSize );
120 Qt3DRender::QViewport *constructAxisScene( Qt3DCore::QEntity *parent3DScene );
121 void constructLabelsScene( Qt3DCore::QEntity *parent3DScene );
123 Qt3DExtras::QText2DEntity *addCubeText(
const QString &text,
float textHeight,
float textWidth,
const QFont &font,
const QMatrix4x4 &rotation,
const QVector3D &translation );
126 void init3DObjectPicking( );
127 bool eventFilter( QObject *watched, QEvent *event )
override;
128 void createKeyboardShortCut();
131 void displayMenuAt(
const QPoint &position );
138 float mCylinderLength = 40.0f;
141 Qt3DRender::QViewport *mViewport =
nullptr;
143 Qt3DCore::QEntity *mAxisSceneEntity =
nullptr;
144 Qt3DRender::QLayer *mAxisObjectLayer =
nullptr;
145 Qt3DRender::QCamera *mAxisCamera =
nullptr;
147 Qt3DCore::QEntity *mAxisRoot =
nullptr;
148 Qt3DCore::QEntity *mCubeRoot =
nullptr;
149 QList<Qt3DExtras::QText2DEntity *> mCubeLabels;
151 Qt3DExtras::QText2DEntity *mTextX =
nullptr;
152 Qt3DExtras::QText2DEntity *mTextY =
nullptr;
153 Qt3DExtras::QText2DEntity *mTextZ =
nullptr;
154 QVector3D mTextCoordX;
155 QVector3D mTextCoordY;
156 QVector3D mTextCoordZ;
157 Qt3DCore::QTransform *mTextTransformX =
nullptr;
158 Qt3DCore::QTransform *mTextTransformY =
nullptr;
159 Qt3DCore::QTransform *mTextTransformZ =
nullptr;
161 QVector3D mPreviousVector;
162 double mAxisScaleFactor = 1.0;
164 Qt3DRender::QCamera *mTwoDLabelCamera =
nullptr;
165 Qt3DCore::QEntity *mTwoDLabelSceneEntity =
nullptr;
168 Qt3DRender::QScreenRayCaster *mScreenRayCaster =
nullptr;
169 bool mIsDragging =
false;
170 bool mHasClicked =
false;
171 QPoint mLastClickedPos;
172 Qt::MouseButton mLastClickedButton;
173 QCursor mPreviousCursor = Qt::ArrowCursor;
174 Qt3DRender::QPickingSettings::PickMethod mDefaultPickingMethod;
175 QMenu *mMenu =
nullptr;