@@ -31,6 +31,7 @@ QT3DReconstruction::QT3DReconstruction(QWidget *parent)
3131 setWindowFlags (windowFlags ()& ~Qt::WindowMaximizeButtonHint);
3232 setFixedSize (this ->width (), this ->height ());
3333 viewer = nullptr ;
34+ ViewerAva = false ;
3435}
3536
3637
@@ -122,7 +123,18 @@ void QT3DReconstruction::timerSlot()
122123 return ;
123124
124125 }
125- openView (fileName);
126+ if (ViewerAva == true )
127+ {
128+ const char * path[2 ];
129+ path[0 ] = fileName.toStdString ().c_str ();
130+ path[1 ] = NULL ;
131+ viewer->window .Drop (1 , path);
132+ }
133+ else
134+ {
135+ openViewCompatibility (fileName);
136+ }
137+
126138 }
127139 else if (temp == " densifypointcloud" ) {
128140 QString fileName = Global::densifyWorkingDir + " /DenseCloud.J3D" ;
@@ -132,7 +144,17 @@ void QT3DReconstruction::timerSlot()
132144 return ;
133145
134146 }
135- openView (fileName);
147+ if (ViewerAva == true )
148+ {
149+ const char * path[2 ];
150+ path[0 ] = fileName.toStdString ().c_str ();
151+ path[1 ] = NULL ;
152+ viewer->window .Drop (1 , path);
153+ }
154+ else
155+ {
156+ openViewCompatibility (fileName);
157+ }
136158 }
137159 else if (temp == " reconstructmesh" ) {
138160 QString fileName = Global::reconstructMeshWorkingDir + " /TIN_Mesh.J3D" ;
@@ -142,7 +164,17 @@ void QT3DReconstruction::timerSlot()
142164 return ;
143165
144166 }
145- openView (fileName);
167+ if (ViewerAva == true )
168+ {
169+ const char * path[2 ];
170+ path[0 ] = fileName.toStdString ().c_str ();
171+ path[1 ] = NULL ;
172+ viewer->window .Drop (1 , path);
173+ }
174+ else
175+ {
176+ openViewCompatibility (fileName);
177+ }
146178 }
147179 else if (temp == " texturemesh" ) {
148180 QString fileName = Global::reconstructMeshWorkingDir + " /TEXTURE_Mesh.J3D" ;
@@ -152,7 +184,17 @@ void QT3DReconstruction::timerSlot()
152184 return ;
153185
154186 }
155- openView (fileName);
187+ if (ViewerAva == true )
188+ {
189+ const char * path[2 ];
190+ path[0 ] = fileName.toStdString ().c_str ();
191+ path[1 ] = NULL ;
192+ viewer->window .Drop (1 , path);
193+ }
194+ else
195+ {
196+ openViewCompatibility (fileName);
197+ }
156198 }
157199 QMessageBox::information (NULL , u8" 完成" , u8" 任务完成! " , QMessageBox::Ok, QMessageBox::Ok);
158200 Global::tasking = false ;
@@ -274,7 +316,7 @@ void QT3DReconstruction::on_actionopen_mvs_file_triggered()
274316 return ;
275317
276318 }
277- if (viewer == nullptr )
319+ if (ViewerAva == false )
278320 {
279321 openView (fileName);
280322 return ;
@@ -322,6 +364,7 @@ bool QT3DReconstruction::openView(QString fileName)
322364
323365 viewer->window .SetVisible (true );
324366 // enter viewer loop
367+ ViewerAva = true ;
325368 viewer->Loop ();
326369 FinalizeViewer ();
327370 return true ;
0 commit comments