代码拉取完成,页面将自动刷新
#include "SceneGraphEdit.h"
#include "Driver.h"
#include <QtWidgets/QApplication>
#include <QThread>
#include <fstream>
#include "QtGuiApplication.h"
#include "GLwindow.h"
#include "Simulation.h"
#include "Display/Render.h"
using namespace Physika;
GravityCuda* gravity = nullptr;
PlaneForceCuda* externalForce = nullptr;
SlipPointCPU* slipPoint = nullptr;
VelocityDampingCuda* damping = nullptr;
LearningNode* learningNode = nullptr;
ExportLearnData* exportLearnDataPtr = nullptr;
Render* femForce = nullptr;
Render* pdmForce = nullptr;
Render* deltaForce = nullptr;
Render* surfaceFEM = nullptr;
Render* surfacePDM = nullptr;
Render* pointPDM = nullptr;
SimData* simDataFEM = nullptr;
SimData* simDataPDM = nullptr;
std::string* materialFile = nullptr;
//learning
DataSet<float>* dataSetPtr = nullptr;
int main(int argc, char *argv[])
{
//SceneGraph* sceneGraph = getSceneGraphByCode();
//SceneGraph* sceneGraph = getDemoPDMH2PDMH();
//SceneGraph* sceneGraph = getDemoFEMH2PDMH();
//SceneGraph* sceneGraph = getDemoFEMH2PDMN();
//SceneGraph* sceneGraph = getDemoFEMH2PDMHA();
//SceneGraph* sceneGraph = getDemoFEMH2PDMNA();
//SceneGraph* sceneGraph = exportCubeLearnData();
//SceneGraph* sceneGraph = exportAnisoCubeLearnData();
//SceneGraph* sceneGraph = exportCubePDMLinear();
//SceneGraph* sceneGraph = exportFlowerStvkData();
//SceneGraph* sceneGraph = DifferentPoissonRatio();
//SceneGraph* sceneGraph = DifferentNonlinearity();
//SceneGraph* sceneGraph = DifferentAnisotropy();
//SceneGraph* sceneGraph = FEMLinear2PDMLinearHomo();
//SceneGraph* sceneGraph = FEMNeoN2PDMModel();
//SceneGraph* sceneGraph = SpringBed();
//SceneGraph* sceneGraph = wrinkleCloth();
//SceneGraph* sceneGraph = armadillo();
//SceneGraph* sceneGraph = flower();
//SceneGraph* sceneGraph = convergeTest();
//SceneGraph* sceneGraph = turtle();
//SceneGraph* sceneGraph = spring();
//SceneGraph* sceneGraph = hand();
//SceneGraph* sceneGraph = twistCube();
//SceneGraph* sceneGraph = clothBend();
//SceneGraph* sceneGraph = nonlinearPoisson();
//SceneGraph* sceneGraph = cylinder();
//SceneGraph* sceneGraph = differentBasis();
//SceneGraph* sceneGraph = differentBasisCompress();
//SceneGraph* sceneGraph = NeohookeanTurtle();
SceneGraph* sceneGraph = NeohookeanBar();
//SceneGraph* sceneGraph = StvkBunny();
//SceneGraph* sceneGraph = MultiBodyCollision();
//SceneGraph* sceneGraph = Fracture();
//SceneGraph* sceneGraph = FractureBar();
QApplication a(argc, argv);
Simulation simulation;
QtGuiApplication control;
GLwindow window;
window.resize(800, 600);
window.move(0, 0);
control.move(900, 0);
Camera *camera = window.getCamera();
camera->setPosition(glm::vec3(0, 0, 20));
camera->setFocusPosition(glm::vec3(0, 0, 0));
camera->setNearClip(0.01f);
camera->setFarClip(1.0e3f);
Driver::setDt(1.0f);//0.04
//Driver::setDt(100.0f);
Driver::setCamera(camera);
Driver::setSceneGraph(sceneGraph);
QThread thread;
simulation.moveToThread(&thread);
QObject::connect(&thread, SIGNAL(started()), &simulation, SLOT(start()));
QObject::connect(&simulation, SIGNAL(updateWindow()), &window, SLOT(updateWindow()));
QObject::connect(&simulation, SIGNAL(finished()), &thread, SLOT(quit()));
QObject::connect(&simulation, SIGNAL(finished()), &window, SLOT(close()));
thread.start();
window.show();
control.show();
//enter into qt event loop
a.exec();
//release resource;
delete sceneGraph;
if (dataSetPtr != nullptr)delete dataSetPtr;
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。