Skip to content

Commit

Permalink
V1.70 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulBasic committed Oct 24, 2020
1 parent 2fd3785 commit 21a93c6
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 13 deletions.
66 changes: 64 additions & 2 deletions J3DGUI/QT3DReconstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ bool QT3DReconstruction::openView(QString fileName)
// // export the scene
// viewer.Export(MAKE_PATH_SAFE(OPT::strOutputFileName), OPT::strExportType.IsEmpty()?LPCTSTR(NULL):OPT::strExportType.c_str(), OPT::bLosslessTexture);
//}

//置子窗口
delete this->ui.widget;
this->ui.widget = new mvsviewer(1, this->ui.centralWidget);
Expand Down Expand Up @@ -480,4 +480,66 @@ void QT3DReconstruction::FinalizeViewer()
void QT3DReconstruction::on_action_fullauto_triggered()
{
dlgfa.exec();
}
}

void QT3DReconstruction::on_action_2_triggered()
{
QString fileName = QFileDialog::getOpenFileName(NULL, "ViewJ3D", ".", "J3D Model Format(*.J3D);;Stanford Polygon File Format(*.ply);;Alias Wavefront Object(*.obj);;All Files(*.*)");
if (fileName == "")
{
QMessageBox::information(NULL, u8"失败", u8"打开J3D文件失败,请检查路径是否正确 ", QMessageBox::Ok, QMessageBox::Ok);
return;

}

openViewCompatibility(fileName);
}

bool QT3DReconstruction::openViewCompatibility(QString fileName)
{
QString cmd = "J3DView.dll -k 2324 -i " + fileName;
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = true;
QFile Processcache("C:\\ProgramData\\J3DEngine\\ViewerCache.tmp");
if (!Processcache.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
{
QMessageBox::information(NULL, "失败", "打开缓存文件失败,请检查权限 ", QMessageBox::Ok, QMessageBox::Ok);
return false;
}
Processcache.write("1");
Processcache.close();
if (!CreateProcess(
NULL,
(LPSTR)cmd.toStdString().c_str(),
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL, &si, &pi))
{
QMessageBox::information(NULL, "失败", "打开文件失败,Viewer程序文件不完整 ", QMessageBox::Ok, QMessageBox::Ok);
return false;
}
time_t tm = time(NULL);
QPalette pa;
while (!Global::CheckViewerMsg()) {
pa.setColor(QPalette::WindowText, Qt::yellow);
ui.label_engine->setPalette(pa);
ui.label_engine->setText("正在打开模型文件 ");
if (time(NULL) - tm > 60) {
QMessageBox::information(NULL, "失败", "打开文件失败,请尝试用管理员身份运行软件 ", QMessageBox::Ok, QMessageBox::Ok);
WinExec("taskkill /f /im J3DView.dll", SW_HIDE);
return false;
}
}
return true;
}
void QT3DReconstruction::closeEvent(QCloseEvent *event)
{
//关闭时释放内存
this->setAttribute(Qt::WA_DeleteOnClose);
QMainWindow::closeEvent(event);
}
7 changes: 6 additions & 1 deletion J3DGUI/QT3DReconstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <boost/program_options.hpp>
#include "Scene.h"
#include <time.h>

#include <qevent.h>
using namespace VIEWER;

class QT3DReconstruction : public QMainWindow
Expand All @@ -42,6 +42,7 @@ class QT3DReconstruction : public QMainWindow
~QT3DReconstruction();

bool openView(QString fileName);
bool openViewCompatibility(QString fileName);
private slots:

void on_actionMatchFeature_triggered();
Expand Down Expand Up @@ -71,6 +72,8 @@ private slots:

void on_action_fullauto_triggered();

void on_action_2_triggered();

private:

Ui::QT3DReconstructionClass ui;
Expand All @@ -85,6 +88,8 @@ private slots:
void FinalizeViewer();
QTimer* timer;
Scene* viewer;
bool ViewerAva;
void closeEvent(QCloseEvent *event);
protected:

};
2 changes: 1 addition & 1 deletion J3DGUI/QT3DReconstruction.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2020-10-16T23:57:28. -->
<!-- Written by QtCreator 4.11.1, 2020-10-24T20:40:16. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
13 changes: 7 additions & 6 deletions J3DGUI/QT3DReconstruction.ui
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
<string>文件</string>
</property>
<addaction name="actionopen_mvs_file"/>
<addaction name="action_2"/>
<addaction name="action_addSensorWidth"/>
</widget>
<widget class="QMenu" name="menu_4">
Expand Down Expand Up @@ -189,11 +190,6 @@
<string>添加相机传感器参数</string>
</property>
</action>
<action name="action_viewPLY">
<property name="text">
<string>打开PLY文件</string>
</property>
</action>
<action name="action_reconstrctMesh">
<property name="text">
<string>三角网模型重建</string>
Expand All @@ -206,14 +202,19 @@
</action>
<action name="actionopen_mvs_file">
<property name="text">
<string>打开...</string>
<string>打开模型</string>
</property>
</action>
<action name="action_fullauto">
<property name="text">
<string>全自动工程配置</string>
</property>
</action>
<action name="action_2">
<property name="text">
<string>打开模型(兼容模式)</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down
3 changes: 2 additions & 1 deletion J3DGUI/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,11 @@ void Scene::ProcessEvents()
void Scene::Loop()
{

while (!glfwWindowShouldClose(window.GetWindow())) {
while (!glfwWindowShouldClose(window.GetWindow()) && !shouldClose) {
ProcessEvents();
Draw();
}
Release();
}


Expand Down
2 changes: 1 addition & 1 deletion J3DGUI/Scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace VIEWER {

GLuint listPointCloud;
GLuint listMesh;

bool shouldClose;
// multi-threading
static SEACAVE::EventQueue events; // internal events queue (processed by the working threads)
static SEACAVE::Thread thread; // worker thread
Expand Down
15 changes: 15 additions & 0 deletions JWL3D.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "x64", "x64", "{0855FEDF-51B
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "J3DGUI", "J3DGUI\QT3DReconstruction.vcxproj", "{34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Viewer", "Viewer\Viewer.vcxproj", "{84686931-3F00-3FD3-BD52-233F97739FF2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -71,6 +73,18 @@ Global
{34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.RelWithDebInfo|x64.Build.0 = Release|x64
{34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
{34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.RelWithDebInfo|x86.Build.0 = Release|Win32
{84686931-3F00-3FD3-BD52-233F97739FF2}.Debug|x64.ActiveCfg = Debug|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.Debug|x64.Build.0 = Debug|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.Debug|x86.ActiveCfg = Debug|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.Release|x64.ActiveCfg = Release|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.Release|x64.Build.0 = Release|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.Release|x86.ActiveCfg = Release|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{84686931-3F00-3FD3-BD52-233F97739FF2}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -79,6 +93,7 @@ Global
{876553CC-6603-4752-B10D-EDEE46B76701} = {0855FEDF-51BA-4BEE-8BE8-CBA92BE481F9}
{B2482291-0BAD-4B20-857A-D3E886D30880} = {0855FEDF-51BA-4BEE-8BE8-CBA92BE481F9}
{34E1DCE3-43FC-45FE-89AB-BE84E115FCEC} = {0855FEDF-51BA-4BEE-8BE8-CBA92BE481F9}
{84686931-3F00-3FD3-BD52-233F97739FF2} = {0855FEDF-51BA-4BEE-8BE8-CBA92BE481F9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AB89B0A3-73DD-4371-B6B4-EE9C3D69856F}
Expand Down
2 changes: 1 addition & 1 deletion Viewer/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ bool Scene::Init(int width, int height, LPCTSTR windowName, LPCTSTR fileName, LP

window.SetVisible(false);
Global::sce = (void*)this;
InstallHook();
//InstallHook();
return true;
}
bool Scene::Open(LPCTSTR fileName, LPCTSTR meshFileName)
Expand Down

0 comments on commit 21a93c6

Please sign in to comment.