|
@@ -11,7 +11,7 @@
|
|
|
#include "ga_api.hxx"
|
|
|
#include "at_str.hxx"
|
|
|
#include "at_int.hxx"
|
|
|
-
|
|
|
+#include "../Rabbitmq/sendLogMsg/logmsg.h"
|
|
|
|
|
|
|
|
|
// Global variables to control the demonstration of advanced meshing functionalities
|
|
@@ -38,18 +38,12 @@ cmdMainProcess::cmdMainProcess()
|
|
|
szmp_iso_point_t_ = nullptr;
|
|
|
SampleUtils_ = NULL;//new DPMvolClass();
|
|
|
object = NULL;
|
|
|
-
|
|
|
- sm = NULL;
|
|
|
}
|
|
|
|
|
|
cmdMainProcess::~cmdMainProcess()
|
|
|
{
|
|
|
if(object)
|
|
|
object = NULL;
|
|
|
- if(sm){
|
|
|
- delete sm;
|
|
|
- sm = NULL;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -263,12 +257,12 @@ bool cmdMainProcess::CreateProcess_(string pathGeo)
|
|
|
bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
{
|
|
|
Q_UNUSED(pathParam);
|
|
|
- sm = new stateMachine("sendClient");
|
|
|
+
|
|
|
// Note that 3DPM-Hexa does not respect the input surface mesh //3dpm-hexa不遵循曲面网格
|
|
|
// If USE_HEXA is set to 1,
|
|
|
// then both APPLY_PERIODICITY and USE_LOCAL_PHYSICAL_SIZE are set to 0
|
|
|
//iniACIS();
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log","1.--read cad surf parameter"));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log","1.--read cad surf parameter"));
|
|
|
//1.--read cad surf parameter
|
|
|
//Get ENTITY_LIST;
|
|
|
ENTITY_LIST Whole_ents;
|
|
@@ -285,7 +279,8 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str = "Read all entity body count is ";
|
|
|
msg_str.append(to_string(readRowEnt.count()));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
+
|
|
|
//printf("Read all entity body count is %d;\n", readRowEnt.count());
|
|
|
for (ENTITY *entC = readRowEnt.first(); entC != 0; entC = readRowEnt.next())
|
|
|
{
|
|
@@ -298,7 +293,8 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("Body's count is ");
|
|
|
msg_str.append(to_string(ent.count()));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
+
|
|
|
//--获取边的信息
|
|
|
ENTITY_LIST EdgeEnt = geo->GetEdges();
|
|
|
const char *name = "entity_index";
|
|
@@ -311,7 +307,8 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
ATTRIB_GEN_INTEGER* pId = NULL;
|
|
|
outcome result = api_find_named_attribute(EdgeEnt[kk], name, reinterpret_cast<ATTRIB_GEN_NAME*&>(pId));
|
|
|
printf("find result : %d\n", result.ok());
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
+
|
|
|
if (pId && (result.ok() == TRUE))
|
|
|
{
|
|
|
/* const char*name = pId->value();
|
|
@@ -350,7 +347,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("Whole_ents after unite is : ");
|
|
|
msg_str.append(to_string(testEnt.count()));
|
|
|
msg_str.append(",then use stitch function");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
if (testEnt.count()==1)
|
|
|
{
|
|
|
//exit_on_bad_outcome(api_n_body_unite(ent, false));
|
|
@@ -367,7 +364,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("Whole_ents after attach is : ");
|
|
|
msg_str.append(to_string(testEnt.count()));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
/*for (int kk = 0; kk < ent.count(); kk++)
|
|
|
{
|
|
|
printf("kk%d is %d; ", kk, is_BODY(ent[kk]));
|
|
@@ -385,7 +382,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("geomStitch count is ");
|
|
|
msg_str.append(to_string(Whole_ents.count()));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
}
|
|
|
//--
|
|
|
|
|
@@ -405,8 +402,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("Load Geometry OK!Whole_ents is : ");
|
|
|
msg_str.append(to_string(Whole_ents.count()));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
-
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
ENTITY_LIST ents;
|
|
|
ents = Whole_ents;
|
|
|
|
|
@@ -419,8 +415,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("face count : ");
|
|
|
msg_str.append(to_string(face_list.count()));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
-
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
ENTITY_LIST edge_list;
|
|
|
api_get_edges(Whole_ents[0], edge_list);
|
|
|
printf("edge count is : %d\n", edge_list.count());
|
|
@@ -429,7 +424,8 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("edge count is: ");
|
|
|
msg_str.append(to_string(edge_list.count()));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
+
|
|
|
//api_ct_get_all_cells(face_list[0], cells);
|
|
|
|
|
|
api_ct_get_all_cells(ents, cells);
|
|
@@ -439,8 +435,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("Cells count is: ");
|
|
|
msg_str.append(to_string(cells.count()));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
-
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
//const char*cpName = ((ATTRIB_GEN_STRING *)tNAME)->value();
|
|
|
//--test end
|
|
|
|
|
@@ -448,7 +443,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("2.--read cad surf parameter");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
QString dDir=QDir::currentPath();
|
|
|
printf("path:%s\n",dDir.toLatin1().data());
|
|
|
//--
|
|
@@ -456,7 +451,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("path:");
|
|
|
msg_str.append(dDir.toLatin1().data());
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
ADIParam_.useDefaultParam();
|
|
|
CRWriteFile* crw = new CRWriteFile();
|
|
|
|
|
@@ -470,26 +465,27 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("3.--create surf.0");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
Createcadsurf(ents, cadsurf_);
|
|
|
//4.--Set parameters and create mesh
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("4.--Set parameters and create mesh");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
cadsurfParams_ = setADIParamTo3dpm(ADIParam_);
|
|
|
//-4.1-size map for vol
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("4.1-size map for vol");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
+
|
|
|
CreateLocalSizeMap();
|
|
|
|
|
|
//5.--output surfmesh with cleaner or not
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("5.--output surfmesh with cleaner or not");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
if(!OutPutSurfMesh(cadsurf_, surfMesh_, &cadsurfParams_))return 1;
|
|
|
|
|
|
//-5.1-for vol
|
|
@@ -499,7 +495,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("style=");
|
|
|
msg_str.append(to_string(ADIParam_.style));
|
|
|
msg_str.append(";");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
if(ADIParam_.style)
|
|
|
{
|
|
|
createVol(ADIParam_.style, cells);
|
|
@@ -510,7 +506,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("6. Save the surface mesh to .mesh (optional)");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
QString appPath = dDir+"\\Data\\";//qy 2023-03-24修改路径
|
|
|
QDateTime data = QDateTime::currentDateTime();
|
|
|
QString strName;
|
|
@@ -539,12 +535,12 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("Successfully wrote SurfMesh to .mesh format");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
//-6.1Deletesome Clean up MeshGems Sizemaps
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("6.1Deletesome Clean up MeshGems Sizemaps");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
if (szmp_iso_face_t_)
|
|
|
meshgems_sizemap_delete(szmp_iso_face_t_);
|
|
|
if (szmp_iso_edge_t_)
|
|
@@ -555,7 +551,7 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
//--
|
|
|
msg_str.clear();
|
|
|
msg_str.append("7. Termination");
|
|
|
- sm->sendClient->sendMsg(object->ToJson("log",msg_str));
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
//closeACIS();
|
|
|
if(crw!=NULL)
|
|
|
{
|