Part: implement wrapper class around Interface_Static
This commit is contained in:
@@ -72,6 +72,7 @@
|
||||
#include <Mod/Part/App/ProgressIndicator.h>
|
||||
#include <Mod/Part/App/ImportIges.h>
|
||||
#include <Mod/Part/App/ImportStep.h>
|
||||
#include <Mod/Part/App/Interface.h>
|
||||
#include <Mod/Part/App/encodeFilename.h>
|
||||
#include <Mod/Part/App/TopoShape.h>
|
||||
#include <Mod/Part/App/TopoShapePy.h>
|
||||
@@ -355,7 +356,7 @@ private:
|
||||
if (file.hasExtension("stp") || file.hasExtension("step")) {
|
||||
//Interface_Static::SetCVal("write.step.schema", "AP214IS");
|
||||
STEPCAFControl_Writer writer;
|
||||
Interface_Static::SetIVal("write.step.assembly",1);
|
||||
Part::Interface::writeStepAssembly(Part::Interface::Assembly::On);
|
||||
// writer.SetColorMode(Standard_False);
|
||||
writer.Transfer(hDoc, STEPControl_AsIs);
|
||||
|
||||
@@ -379,9 +380,9 @@ private:
|
||||
IGESControl_Controller::Init();
|
||||
IGESCAFControl_Writer writer;
|
||||
IGESData_GlobalSection header = writer.Model()->GlobalSection();
|
||||
header.SetAuthorName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.author")));
|
||||
header.SetCompanyName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.company")));
|
||||
header.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product")));
|
||||
header.SetAuthorName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderAuthor()));
|
||||
header.SetCompanyName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderCompany()));
|
||||
header.SetSendName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderProduct()));
|
||||
writer.Model()->SetGlobalSection(header);
|
||||
writer.Transfer(hDoc);
|
||||
Standard_Boolean ret = writer.Write(name8bit.c_str());
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#include <Mod/Part/App/ProgressIndicator.h>
|
||||
#include <Mod/Part/App/ImportIges.h>
|
||||
#include <Mod/Part/App/ImportStep.h>
|
||||
#include <Mod/Part/App/Interface.h>
|
||||
|
||||
#include <App/DocumentObject.h>
|
||||
#include <App/DocumentObjectGroup.h>
|
||||
@@ -117,7 +118,7 @@ ExportOCAF::ExportOCAF(Handle(TDocStd_Document) h, bool explicitPlacement)
|
||||
if (keepExplicitPlacement) {
|
||||
// rootLabel = aShapeTool->NewShape();
|
||||
// TDataStd_Name::Set(rootLabel, "ASSEMBLY");
|
||||
Interface_Static::SetIVal("write.step.assembly",2);
|
||||
Part::Interface::writeStepAssembly(Part::Interface::Assembly::Auto);
|
||||
}
|
||||
else {
|
||||
rootLabel = TDF_TagSource::NewChild(pDoc->Main());
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
#include <Mod/Part/App/ProgressIndicator.h>
|
||||
#include <Mod/Part/App/ImportIges.h>
|
||||
#include <Mod/Part/App/ImportStep.h>
|
||||
#include <Mod/Part/App/Interface.h>
|
||||
|
||||
#include <App/DocumentObject.h>
|
||||
#include <App/DocumentObjectGroup.h>
|
||||
@@ -925,7 +926,7 @@ ExportOCAF2::ExportOCAF2(Handle(TDocStd_Document) h, GetShapeColorsFunc func)
|
||||
aShapeTool = XCAFDoc_DocumentTool::ShapeTool(pDoc->Main());
|
||||
aColorTool = XCAFDoc_DocumentTool::ColorTool(pDoc->Main());
|
||||
|
||||
Interface_Static::SetIVal("write.step.assembly",2);
|
||||
Part::Interface::writeStepAssembly(Part::Interface::Assembly::Auto);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
#include <Mod/Part/App/encodeFilename.h>
|
||||
#include <Mod/Part/App/ImportIges.h>
|
||||
#include <Mod/Part/App/ImportStep.h>
|
||||
#include <Mod/Part/App/Interface.h>
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
#include <Mod/Part/App/ProgressIndicator.h>
|
||||
|
||||
@@ -629,13 +630,13 @@ private:
|
||||
Base::FileInfo file(Utf8Name.c_str());
|
||||
if (file.hasExtension("stp") || file.hasExtension("step")) {
|
||||
ParameterGrp::handle hGrp_stp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part/STEP");
|
||||
std::string scheme = hGrp_stp->GetASCII("Scheme", Interface_Static::CVal("write.step.schema"));
|
||||
std::string scheme = hGrp_stp->GetASCII("Scheme", Part::Interface::writeStepScheme());
|
||||
std::list<std::string> supported = Part::supportedSTEPSchemes();
|
||||
if (std::find(supported.begin(), supported.end(), scheme) != supported.end())
|
||||
Interface_Static::SetCVal("write.step.schema", scheme.c_str());
|
||||
Part::Interface::writeStepScheme(scheme.c_str());
|
||||
|
||||
STEPCAFControl_Writer writer;
|
||||
Interface_Static::SetIVal("write.step.assembly",1);
|
||||
Part::Interface::writeStepAssembly(Part::Interface::Assembly::On);
|
||||
// writer.SetColorMode(Standard_False);
|
||||
writer.Transfer(hDoc, STEPControl_AsIs);
|
||||
|
||||
@@ -661,9 +662,9 @@ private:
|
||||
IGESControl_Controller::Init();
|
||||
IGESCAFControl_Writer writer;
|
||||
IGESData_GlobalSection header = writer.Model()->GlobalSection();
|
||||
header.SetAuthorName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.author")));
|
||||
header.SetCompanyName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.company")));
|
||||
header.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product")));
|
||||
header.SetAuthorName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderAuthor()));
|
||||
header.SetCompanyName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderCompany()));
|
||||
header.SetSendName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderProduct()));
|
||||
writer.Model()->SetGlobalSection(header);
|
||||
writer.Transfer(hDoc);
|
||||
Standard_Boolean ret = writer.Write((const char*)name8bit.c_str());
|
||||
|
||||
Reference in New Issue
Block a user