|
@@ -515,114 +515,114 @@ Spa3dpm::Parameters cmdMainProcess::setADIParamTo3dpm(const DPM_ADIParam &p)
|
|
|
Spa3dpm::Parameters cadsurfParams;
|
|
|
//cadsurfParams.SetParam("global_physical_size", "0.01"); // default: ModelDiagonal/100
|
|
|
//cadsurfParams.SetParam("element_order", "quadratic");
|
|
|
- if (!p.surfParam.SurfStyle.isEmpty())
|
|
|
+ if (!p.surfParam_.SurfStyle.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("element_generation", p.surfParam.SurfStyle.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
+ cadsurfParams.SetParam("element_generation", p.surfParam_.SurfStyle.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
}
|
|
|
- if (!p.surfParam.max_size.isEmpty())
|
|
|
+ if (!p.surfParam_.max_size.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("max_size", p.surfParam.max_size.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
+ cadsurfParams.SetParam("max_size", p.surfParam_.max_size.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
}
|
|
|
- if (!p.surfParam.min_size.isEmpty())
|
|
|
+ if (!p.surfParam_.min_size.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("min_size", p.surfParam.min_size.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
+ cadsurfParams.SetParam("min_size", p.surfParam_.min_size.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
}
|
|
|
- if (!p.surfParam.Global_physical_size.isEmpty())
|
|
|
+ if (!p.surfParam_.Global_physical_size.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("global_physical_size", p.surfParam.Global_physical_size.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
+ cadsurfParams.SetParam("global_physical_size", p.surfParam_.Global_physical_size.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
}
|
|
|
- if (!p.surfParam.gradation.isEmpty())
|
|
|
+ if (!p.surfParam_.gradation.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("gradation", p.surfParam.gradation.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
+ cadsurfParams.SetParam("gradation", p.surfParam_.gradation.toLatin1().data());//"full_quad");//"quad_dominant");
|
|
|
}
|
|
|
|
|
|
//optim
|
|
|
- if (!p.surfParam.element_order.isEmpty())
|
|
|
+ if (!p.surfParam_.element_order.isEmpty())
|
|
|
{
|
|
|
//"full_quad");//"quad_dominant");
|
|
|
- if (p.surfParam.element_order=="quadratic" )
|
|
|
+ if (p.surfParam_.element_order=="quadratic" )
|
|
|
{
|
|
|
- cadsurfParams.SetParam("element_order", p.surfParam.element_order.toLatin1().data());
|
|
|
- if (!p.surfParam.scaled_jacobian_threshold_value.isEmpty())
|
|
|
+ cadsurfParams.SetParam("element_order", p.surfParam_.element_order.toLatin1().data());
|
|
|
+ if (!p.surfParam_.scaled_jacobian_threshold_value.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("scaled_jacobian_threshold_value", p.surfParam.scaled_jacobian_threshold_value.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("scaled_jacobian_threshold_value", p.surfParam_.scaled_jacobian_threshold_value.toLatin1().data());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- if (!p.surfParam.remove_duplicate_cad_faces.isEmpty()&& p.surfParam.remove_duplicate_cad_faces=="no")
|
|
|
+ if (!p.surfParam_.remove_duplicate_cad_faces.isEmpty()&& p.surfParam_.remove_duplicate_cad_faces=="no")
|
|
|
{
|
|
|
- cadsurfParams.SetParam("remove_duplicate_cad_faces", p.surfParam.remove_duplicate_cad_faces.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("remove_duplicate_cad_faces", p.surfParam_.remove_duplicate_cad_faces.toLatin1().data());
|
|
|
}
|
|
|
- if (!p.surfParam.correct_surface_intersections.isEmpty())
|
|
|
+ if (!p.surfParam_.correct_surface_intersections.isEmpty())
|
|
|
{
|
|
|
- if (p.surfParam.correct_surface_intersections=="no"&& p.surfParam.optimisation=="yes")
|
|
|
+ if (p.surfParam_.correct_surface_intersections=="no"&& p.surfParam_.optimisation=="yes")
|
|
|
{
|
|
|
- cadsurfParams.SetParam("correct_surface_intersections", p.surfParam.correct_surface_intersections.toLatin1().data());
|
|
|
- cadsurfParams.SetParam("optimisation", p.surfParam.optimisation.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("correct_surface_intersections", p.surfParam_.correct_surface_intersections.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("optimisation", p.surfParam_.optimisation.toLatin1().data());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//more setting
|
|
|
- if (!p.surfParam.debug.isEmpty())
|
|
|
+ if (!p.surfParam_.debug.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("debug", p.surfParam.debug.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("debug", p.surfParam_.debug.toLatin1().data());
|
|
|
}
|
|
|
- if (!p.surfParam.closed_geometry.isEmpty())
|
|
|
+ if (!p.surfParam_.closed_geometry.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("closed_geometry", p.surfParam.closed_geometry.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("closed_geometry", p.surfParam_.closed_geometry.toLatin1().data());
|
|
|
}
|
|
|
- if (!p.surfParam.anisotropic_ratio.isEmpty())
|
|
|
+ if (!p.surfParam_.anisotropic_ratio.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("anisotropic_ratio", p.surfParam.anisotropic_ratio.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("anisotropic_ratio", p.surfParam_.anisotropic_ratio.toLatin1().data());
|
|
|
}
|
|
|
|
|
|
- if (!p.surfParam.bad_surface_element_aspect_ratio.isEmpty())
|
|
|
+ if (!p.surfParam_.bad_surface_element_aspect_ratio.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("bad_surface_element_aspect_ratio", p.surfParam.bad_surface_element_aspect_ratio.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("bad_surface_element_aspect_ratio", p.surfParam_.bad_surface_element_aspect_ratio.toLatin1().data());
|
|
|
}
|
|
|
|
|
|
- if (!p.surfParam.chordal_error.isEmpty())
|
|
|
+ if (!p.surfParam_.chordal_error.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("chordal_error", p.surfParam.chordal_error.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("chordal_error", p.surfParam_.chordal_error.toLatin1().data());
|
|
|
}
|
|
|
- if (!p.surfParam.closed_geometry.isEmpty())
|
|
|
+ if (!p.surfParam_.closed_geometry.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("closed_geometry", p.surfParam.closed_geometry.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("closed_geometry", p.surfParam_.closed_geometry.toLatin1().data());
|
|
|
}
|
|
|
- if (!p.surfParam.discard_input_topology.isEmpty())
|
|
|
+ if (!p.surfParam_.discard_input_topology.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("discard_input_topology", p.surfParam.discard_input_topology.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("discard_input_topology", p.surfParam_.discard_input_topology.toLatin1().data());
|
|
|
}
|
|
|
- if (!p.surfParam.create_tag_on_collision.isEmpty())
|
|
|
+ if (!p.surfParam_.create_tag_on_collision.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("create_tag_on_collision", p.surfParam.create_tag_on_collision.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("create_tag_on_collision", p.surfParam_.create_tag_on_collision.toLatin1().data());
|
|
|
}
|
|
|
- if (!p.surfParam.chordal_error.isEmpty())
|
|
|
+ if (!p.surfParam_.chordal_error.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("chordal_error", ADIParam_.surfParam.chordal_error.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("chordal_error", ADIParam_.surfParam_.chordal_error.toLatin1().data());
|
|
|
printf("chordal_error set\n");
|
|
|
}
|
|
|
- if (!p.surfParam.geometric_approximation_angle.isEmpty())
|
|
|
+ if (!p.surfParam_.geometric_approximation_angle.isEmpty())
|
|
|
{
|
|
|
- cadsurfParams.SetParam("geometric_approximation_angle", ADIParam_.surfParam.geometric_approximation_angle.toLatin1().data());
|
|
|
+ cadsurfParams.SetParam("geometric_approximation_angle", ADIParam_.surfParam_.geometric_approximation_angle.toLatin1().data());
|
|
|
printf("geometric_approximation_angle set\n");
|
|
|
}
|
|
|
//--mg
|
|
|
- if (!p.surfParam.physical_size_mode.isEmpty()&& p.surfParam.physical_size_mode=="local"){
|
|
|
+ if (!p.surfParam_.physical_size_mode.isEmpty()&& p.surfParam_.physical_size_mode=="local"){
|
|
|
USE_LOCAL_PHYSICAL_SIZE = 1;
|
|
|
printf("print the physical_size_mode");
|
|
|
- //}else{ //if (p.surfParam.physical_size_mode=="global"){
|
|
|
- }else if (!p.surfParam.physical_size_mode.isEmpty()){
|
|
|
- cadsurfParams.SetParam("physical_size_mode", p.surfParam.physical_size_mode.toLatin1().data());
|
|
|
+ //}else{ //if (p.surfParam_.physical_size_mode=="global"){
|
|
|
+ }else if (!p.surfParam_.physical_size_mode.isEmpty()){
|
|
|
+ cadsurfParams.SetParam("physical_size_mode", p.surfParam_.physical_size_mode.toLatin1().data());
|
|
|
}
|
|
|
- if (!p.surfParam.geometric_size_mode.isEmpty() && p.surfParam.geometric_size_mode == "local") {
|
|
|
+ if (!p.surfParam_.geometric_size_mode.isEmpty() && p.surfParam_.geometric_size_mode == "local") {
|
|
|
USE_LOCAL_PHYSICAL_SIZE = 2;
|
|
|
printf("print the geometric_size_mode");
|
|
|
- //}else {//if (p.surfParam.geometric_size_mode == "global") {
|
|
|
- }else if (!p.surfParam.geometric_size_mode.isEmpty()) {
|
|
|
- cadsurfParams.SetParam("geometric_size_mode", p.surfParam.geometric_size_mode.toLatin1().data());
|
|
|
- printf("*** geometric_size_mode: %s\n", p.surfParam.geometric_size_mode.toLatin1().data());
|
|
|
+ //}else {//if (p.surfParam_.geometric_size_mode == "global") {
|
|
|
+ }else if (!p.surfParam_.geometric_size_mode.isEmpty()) {
|
|
|
+ cadsurfParams.SetParam("geometric_size_mode", p.surfParam_.geometric_size_mode.toLatin1().data());
|
|
|
+ printf("*** geometric_size_mode: %s\n", p.surfParam_.geometric_size_mode.toLatin1().data());
|
|
|
}
|
|
|
return cadsurfParams;
|
|
|
}
|
|
@@ -775,25 +775,25 @@ void cmdMainProcess::CreateLocalSizeMap()
|
|
|
{
|
|
|
|
|
|
// Apply physical size functions, sizemaps应用物理尺寸函数、尺寸映射
|
|
|
- //if (!ADIParam_.surfParam.physical_size_mode.isEmpty())
|
|
|
+ //if (!ADIParam_.surfParam_.physical_size_mode.isEmpty())
|
|
|
//{
|
|
|
- cadsurfParams_.SetParam("physical_size_mode", ADIParam_.surfParam.physical_size_mode.toLatin1().data());
|
|
|
+ cadsurfParams_.SetParam("physical_size_mode", ADIParam_.surfParam_.physical_size_mode.toLatin1().data());
|
|
|
//}
|
|
|
// default: "none"; when use_local_physical_size需要設置為 "local"
|
|
|
// Create a sizemap associated with faces创建与面关联的尺寸映射
|
|
|
SampleUtils_ = new DPMvolClass();
|
|
|
- if (ADIParam_.surfParam.Global_physical_size.isEmpty())
|
|
|
+ if (ADIParam_.surfParam_.Global_physical_size.isEmpty())
|
|
|
{
|
|
|
printf("error : global_physical_size is empty!\n");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- SampleUtils_->setGlobelSize(ADIParam_.surfParam.Global_physical_size.toDouble());
|
|
|
+ SampleUtils_->setGlobelSize(ADIParam_.surfParam_.Global_physical_size.toDouble());
|
|
|
// Get pointer to native MeshGems cad_t object
|
|
|
meshgems_cad_t *mg_cad = cadsurf_.GetMeshgemsCadPtr();
|
|
|
- if (!ADIParam_.surfParam.physicalSizeFaceId.isEmpty())
|
|
|
+ if (!ADIParam_.surfParam_.physicalSizeFaceId.isEmpty())
|
|
|
{
|
|
|
- SampleUtils_->SetLocalSizeData(2, ADIParam_.surfParam.physicalSizeFaceId);//"1,10;2,4;");
|
|
|
+ SampleUtils_->SetLocalSizeData(2, ADIParam_.surfParam_.physicalSizeFaceId);//"1,10;2,4;");
|
|
|
szmp_iso_face_t_ = meshgems_sizemap_new(mg_cad, meshgems_sizemap_type_iso_cad_face, SampleUtils_->size_iso_face, SampleUtils_);
|
|
|
if (!szmp_iso_face_t_) sys_error(MESHGEMS_STATUS_NOMEM);
|
|
|
#ifdef ADI_DEBUG_PRINT
|
|
@@ -803,9 +803,9 @@ void cmdMainProcess::CreateLocalSizeMap()
|
|
|
|
|
|
|
|
|
// Create a sizemap associated with edges
|
|
|
- if (!ADIParam_.surfParam.physicalSizeEdgeId.isEmpty())
|
|
|
+ if (!ADIParam_.surfParam_.physicalSizeEdgeId.isEmpty())
|
|
|
{
|
|
|
- SampleUtils_->SetLocalSizeData(1, ADIParam_.surfParam.physicalSizeEdgeId);
|
|
|
+ SampleUtils_->SetLocalSizeData(1, ADIParam_.surfParam_.physicalSizeEdgeId);
|
|
|
szmp_iso_edge_t_ = meshgems_sizemap_new(mg_cad, meshgems_sizemap_type_iso_cad_edge, SampleUtils_->size_iso_edge, SampleUtils_); //SampleUtils_.size_iso_edge, 0);
|
|
|
if (!szmp_iso_edge_t_) sys_error(MESHGEMS_STATUS_NOMEM);
|
|
|
#ifdef ADI_DEBUG_PRINT
|
|
@@ -813,9 +813,9 @@ void cmdMainProcess::CreateLocalSizeMap()
|
|
|
#endif
|
|
|
}
|
|
|
// Create a sizemap associated with point
|
|
|
- if (!ADIParam_.surfParam.physicalSizePointId.isEmpty())
|
|
|
+ if (!ADIParam_.surfParam_.physicalSizePointId.isEmpty())
|
|
|
{
|
|
|
- SampleUtils_->SetLocalSizeData(0, ADIParam_.surfParam.physicalSizePointId);
|
|
|
+ SampleUtils_->SetLocalSizeData(0, ADIParam_.surfParam_.physicalSizePointId);
|
|
|
szmp_iso_point_t_ = meshgems_sizemap_new(mg_cad, meshgems_sizemap_type_iso_cad_point, SampleUtils_->size_iso_point, SampleUtils_);
|
|
|
if (!szmp_iso_point_t_) sys_error(MESHGEMS_STATUS_NOMEM);
|
|
|
printf("Sizemap point ok \n");
|
|
@@ -840,26 +840,26 @@ void cmdMainProcess::CreateLocalSizeMap()
|
|
|
|
|
|
|
|
|
// Apply physical size functions, sizemaps
|
|
|
- //if (!ADIParam_.surfParam.physical_size_mode.isEmpty())
|
|
|
+ //if (!ADIParam_.surfParam_.physical_size_mode.isEmpty())
|
|
|
//{
|
|
|
- cadsurfParams_.SetParam("geometric_size_mode", ADIParam_.surfParam.geometric_size_mode.toLatin1().data());
|
|
|
+ cadsurfParams_.SetParam("geometric_size_mode", ADIParam_.surfParam_.geometric_size_mode.toLatin1().data());
|
|
|
//}
|
|
|
// default: "none"; when use_local_physical_size需要設置為 "local"
|
|
|
// Create a sizemap associated with faces
|
|
|
|
|
|
|
|
|
SampleUtils_ = new DPMvolClass();
|
|
|
- if (ADIParam_.surfParam.Global_physical_size.isEmpty())
|
|
|
+ if (ADIParam_.surfParam_.Global_physical_size.isEmpty())
|
|
|
{
|
|
|
printf("error : global_physical_size is empty!");
|
|
|
return;
|
|
|
}
|
|
|
- SampleUtils_->setGlobelSize(ADIParam_.surfParam.Global_physical_size.toDouble());
|
|
|
+ SampleUtils_->setGlobelSize(ADIParam_.surfParam_.Global_physical_size.toDouble());
|
|
|
// Get pointer to native MeshGems cad_t object
|
|
|
meshgems_cad_t *mg_cad = cadsurf_.GetMeshgemsCadPtr();
|
|
|
- if (!ADIParam_.surfParam.geometricSizeFaceId.isEmpty())
|
|
|
+ if (!ADIParam_.surfParam_.geometricSizeFaceId.isEmpty())
|
|
|
{
|
|
|
- SampleUtils_->SetLocalSizeData(2, ADIParam_.surfParam.geometricSizeFaceId);//"1,10;2,4;");
|
|
|
+ SampleUtils_->SetLocalSizeData(2, ADIParam_.surfParam_.geometricSizeFaceId);//"1,10;2,4;");
|
|
|
szmp_iso_face_t_ = meshgems_sizemap_new(mg_cad, meshgems_sizemap_type_iso_cad_face, SampleUtils_->size_iso_face, SampleUtils_);
|
|
|
if (!szmp_iso_face_t_) sys_error(MESHGEMS_STATUS_NOMEM);
|
|
|
#ifdef ADI_DEBUG_PRINT
|
|
@@ -869,9 +869,9 @@ void cmdMainProcess::CreateLocalSizeMap()
|
|
|
|
|
|
|
|
|
// Create a sizemap associated with edges
|
|
|
- if (!ADIParam_.surfParam.geometricSizeEdgeId.isEmpty())
|
|
|
+ if (!ADIParam_.surfParam_.geometricSizeEdgeId.isEmpty())
|
|
|
{
|
|
|
- SampleUtils_->SetLocalSizeData(1, ADIParam_.surfParam.geometricSizeEdgeId);
|
|
|
+ SampleUtils_->SetLocalSizeData(1, ADIParam_.surfParam_.geometricSizeEdgeId);
|
|
|
szmp_iso_edge_t_ = meshgems_sizemap_new(mg_cad, meshgems_sizemap_type_iso_cad_edge, SampleUtils_->size_iso_edge, SampleUtils_); //SampleUtils_.size_iso_edge, 0);
|
|
|
if (!szmp_iso_edge_t_) sys_error(MESHGEMS_STATUS_NOMEM);
|
|
|
#ifdef ADI_DEBUG_PRINT
|
|
@@ -879,9 +879,9 @@ void cmdMainProcess::CreateLocalSizeMap()
|
|
|
#endif
|
|
|
}
|
|
|
// Create a sizemap associated with point创建与点关联的尺寸映射
|
|
|
- if (!ADIParam_.surfParam.geometricSizePointId.isEmpty())
|
|
|
+ if (!ADIParam_.surfParam_.geometricSizePointId.isEmpty())
|
|
|
{
|
|
|
- SampleUtils_->SetLocalSizeData(0, ADIParam_.surfParam.geometricSizePointId);
|
|
|
+ SampleUtils_->SetLocalSizeData(0, ADIParam_.surfParam_.geometricSizePointId);
|
|
|
szmp_iso_point_t_ = meshgems_sizemap_new(mg_cad, meshgems_sizemap_type_iso_cad_point, SampleUtils_->size_iso_point, SampleUtils_);
|
|
|
if (!szmp_iso_point_t_) sys_error(MESHGEMS_STATUS_NOMEM);
|
|
|
printf("Sizemap point ok \n");
|