mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 20:51:23 -07:00
NEW:update the content of the project page
Change-Id: Idb7f8a2564c78a1f062580f6b388ee033238cedf
This commit is contained in:
parent
4cb8b1e125
commit
a86d94f2c9
11 changed files with 586 additions and 10 deletions
|
|
@ -110,6 +110,7 @@ const std::string BBS_SEAM_PAINTING_VERSION = "BambuStudio:SeamPaintingV
|
|||
const std::string BBS_MM_PAINTING_VERSION = "BambuStudio:MmPaintingVersion";
|
||||
const std::string BBL_MODEL_ID_TAG = "model_id";
|
||||
const std::string BBL_MODEL_NAME_TAG = "Title";
|
||||
const std::string BBL_ORIGIN_TAG = "Origin";
|
||||
const std::string BBL_DESIGNER_TAG = "Designer";
|
||||
const std::string BBL_DESIGNER_USER_ID_TAG = "DesignerUserId";
|
||||
const std::string BBL_DESIGNER_COVER_FILE_TAG = "DesignerCover";
|
||||
|
|
@ -121,6 +122,12 @@ const std::string BBL_MODIFICATION_TAG = "ModificationDate";
|
|||
const std::string BBL_CREATION_DATE_TAG = "CreationDate";
|
||||
const std::string BBL_APPLICATION_TAG = "Application";
|
||||
|
||||
const std::string BBL_PROFILE_TITLE_TAG = "ProfileTitle";
|
||||
const std::string BBL_PROFILE_COVER_TAG = "ProfileCover";
|
||||
const std::string BBL_PROFILE_DESCRIPTION_TAG = "ProfileDescription";
|
||||
const std::string BBL_PROFILE_USER_ID_TAG = "ProfileUserId";
|
||||
const std::string BBL_PROFILE_USER_NAME_TAG = "ProfileUserName";
|
||||
|
||||
const std::string MODEL_FOLDER = "3D/";
|
||||
const std::string MODEL_EXTENSION = ".model";
|
||||
const std::string MODEL_FILE = "3D/3dmodel.model"; // << this is the only format of the string which works with CURA
|
||||
|
|
@ -847,7 +854,12 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
std::string m_designer_cover;
|
||||
ModelInfo model_info;
|
||||
BBLProject project_info;
|
||||
|
||||
std::string m_profile_title;
|
||||
std::string m_profile_cover;
|
||||
std::string m_Profile_description;
|
||||
std::string m_profile_user_id;
|
||||
std::string m_profile_user_name;
|
||||
|
||||
XML_Parser m_xml_parser;
|
||||
// Error code returned by the application side of the parser. In that case the expat may not reliably deliver the error state
|
||||
// after returning from XML_Parse() function, thus we keep the error state here.
|
||||
|
|
@ -1379,6 +1391,14 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
m_model->design_info->Designer = m_designer;
|
||||
}
|
||||
|
||||
m_model->profile_info = std::make_shared<ModelProfileInfo>();
|
||||
m_model->profile_info->ProfileTile = m_profile_title;
|
||||
m_model->profile_info->ProfileCover = m_profile_cover;
|
||||
m_model->profile_info->ProfileDescription = m_Profile_description;
|
||||
m_model->profile_info->ProfileUserId = m_profile_user_id;
|
||||
m_model->profile_info->ProfileUserName = m_profile_user_name;
|
||||
|
||||
|
||||
m_model->model_info = std::make_shared<ModelInfo>();
|
||||
m_model->model_info->load(model_info);
|
||||
|
||||
|
|
@ -3189,6 +3209,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
} else if (m_curr_metadata_name == BBL_MODEL_NAME_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found model name = " << m_curr_characters;
|
||||
model_info.model_name = xml_unescape(m_curr_characters);
|
||||
} else if (m_curr_metadata_name == BBL_ORIGIN_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found model name = " << m_curr_characters;
|
||||
model_info.origin = xml_unescape(m_curr_characters);
|
||||
} else if (m_curr_metadata_name == BBL_DESIGNER_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found designer = " << m_curr_characters;
|
||||
m_designer = xml_unescape(m_curr_characters);
|
||||
|
|
@ -3210,6 +3233,21 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
} else if (m_curr_metadata_name == BBL_REGION_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found region = " << m_curr_characters;
|
||||
m_contry_code = xml_unescape(m_curr_characters);
|
||||
} else if (m_curr_metadata_name == BBL_PROFILE_TITLE_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found profile_title = " << m_curr_characters;
|
||||
m_profile_title = xml_unescape(m_curr_characters);
|
||||
} else if (m_curr_metadata_name == BBL_PROFILE_COVER_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found profile_cover = " << m_curr_characters;
|
||||
m_profile_cover = xml_unescape(m_curr_characters);
|
||||
} else if (m_curr_metadata_name == BBL_PROFILE_DESCRIPTION_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found profile_description = " << m_curr_characters;
|
||||
m_Profile_description = xml_unescape(m_curr_characters);
|
||||
} else if (m_curr_metadata_name == BBL_PROFILE_USER_ID_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found profile_user_id = " << m_curr_characters;
|
||||
m_profile_user_id = xml_unescape(m_curr_characters);
|
||||
}else if (m_curr_metadata_name == BBL_PROFILE_USER_NAME_TAG) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, load_3mf found profile_user_name = " << m_curr_characters;
|
||||
m_profile_user_name = xml_unescape(m_curr_characters);
|
||||
} else if (m_curr_metadata_name == BBL_CREATION_DATE_TAG) {
|
||||
;
|
||||
} else if (m_curr_metadata_name == BBL_MODIFICATION_TAG) {
|
||||
|
|
@ -5427,6 +5465,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
stream << " xmlns:p=\"http://schemas.microsoft.com/3dmanufacturing/production/2015/06\" requiredextensions=\"p\"";
|
||||
stream << ">\n";
|
||||
|
||||
std::string origin;
|
||||
std::string name;
|
||||
std::string user_name;
|
||||
std::string user_id;
|
||||
|
|
@ -5455,6 +5494,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
description = model.model_info->description;
|
||||
copyright = model.model_info->copyright;
|
||||
name = model.model_info->model_name;
|
||||
origin = model.model_info->origin;
|
||||
BOOST_LOG_TRIVIAL(trace) << "design_info, save_3mf found designer_cover = " << design_cover;
|
||||
}
|
||||
// remember to use metadata_item_map to store metadata info
|
||||
|
|
@ -5466,6 +5506,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
}
|
||||
|
||||
metadata_item_map[BBL_MODEL_NAME_TAG] = xml_escape(name);
|
||||
metadata_item_map[BBL_ORIGIN_TAG] = xml_escape(origin);
|
||||
metadata_item_map[BBL_DESIGNER_TAG] = xml_escape(user_name);
|
||||
metadata_item_map[BBL_DESIGNER_USER_ID_TAG] = user_id;
|
||||
metadata_item_map[BBL_DESIGNER_COVER_FILE_TAG] = xml_escape(design_cover);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ Model& Model::assign_copy(const Model &rhs)
|
|||
// BBS: for design info
|
||||
this->design_info = rhs.design_info;
|
||||
this->model_info = rhs.model_info;
|
||||
this->profile_info = rhs.profile_info;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
|
@ -104,6 +105,8 @@ Model& Model::assign_copy(Model &&rhs)
|
|||
rhs.design_info.reset();
|
||||
this->model_info = rhs.model_info;
|
||||
rhs.model_info.reset();
|
||||
this->profile_info = rhs.profile_info;
|
||||
rhs.profile_info.reset();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -868,8 +871,10 @@ void Model::load_from(Model& model)
|
|||
next_object_backup_id = model.next_object_backup_id;
|
||||
design_info = model.design_info;
|
||||
model_info = model.model_info;
|
||||
profile_info = model.profile_info;
|
||||
model.design_info.reset();
|
||||
model.model_info.reset();
|
||||
model.profile_info.reset();
|
||||
}
|
||||
|
||||
// BBS: backup
|
||||
|
|
|
|||
|
|
@ -1257,6 +1257,17 @@ struct GlobalSpeedMap
|
|||
Polygon bed_poly;
|
||||
};
|
||||
|
||||
/* Profile data */
|
||||
class ModelProfileInfo
|
||||
{
|
||||
public:
|
||||
std::string ProfileTile;
|
||||
std::string ProfileCover;
|
||||
std::string ProfileDescription;
|
||||
std::string ProfileUserId;
|
||||
std::string ProfileUserName;
|
||||
};
|
||||
|
||||
/* info in ModelDesignInfo can not changed after initialization */
|
||||
class ModelDesignInfo
|
||||
{
|
||||
|
|
@ -1275,6 +1286,7 @@ public:
|
|||
std::string description; // utf8 format
|
||||
std::string copyright; // utf8 format
|
||||
std::string model_name; // utf8 format
|
||||
std::string origin; // utf8 format
|
||||
|
||||
std::map<std::string, std::string> metadata_items; // other meta data items
|
||||
|
||||
|
|
@ -1284,6 +1296,7 @@ public:
|
|||
this->description = info.description;
|
||||
this->copyright = info.copyright;
|
||||
this->model_name = info.model_name;
|
||||
this->origin = info.origin;
|
||||
this->metadata_items = info.metadata_items;
|
||||
}
|
||||
};
|
||||
|
|
@ -1310,6 +1323,7 @@ public:
|
|||
// DesignInfo of Model
|
||||
std::shared_ptr<ModelDesignInfo> design_info = nullptr;
|
||||
std::shared_ptr<ModelInfo> model_info = nullptr;
|
||||
std::shared_ptr<ModelProfileInfo> profile_info = nullptr;
|
||||
|
||||
void SetDesigner(std::string designer, std::string designer_user_id) {
|
||||
if (design_info == nullptr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue