Part: Add deprecation warning for import/export
This commit is contained in:
committed by
Chris Hennes
parent
061e185e7f
commit
f0a9b5ea01
@@ -155,6 +155,7 @@ using namespace Gui::DockWnd;
|
||||
using namespace std;
|
||||
namespace sp = std::placeholders;
|
||||
|
||||
FC_LOG_LEVEL_INIT("Gui")
|
||||
|
||||
Application* Application::Instance = nullptr;
|
||||
|
||||
@@ -892,6 +893,10 @@ void Application::exportTo(const char* FileName, const char* DocName, const char
|
||||
string unicodepath = Base::Tools::escapedUnicodeFromUtf8(File.filePath().c_str());
|
||||
unicodepath = Base::Tools::escapeEncodeFilename(unicodepath);
|
||||
|
||||
if (strcmp(Module, "Part") == 0) {
|
||||
FC_WARN("Exporting with 'Part' is deprecated, use 'ImportGui' instead");
|
||||
}
|
||||
|
||||
if (Module) {
|
||||
try {
|
||||
std::vector<App::DocumentObject*> sel =
|
||||
|
||||
@@ -111,6 +111,8 @@
|
||||
# include "FT2FC.h"
|
||||
#endif
|
||||
|
||||
FC_LOG_LEVEL_INIT("Part")
|
||||
|
||||
extern const char* BRepBuilderAPI_FaceErrorText(BRepBuilderAPI_FaceError fe);
|
||||
|
||||
namespace Part {
|
||||
@@ -784,6 +786,7 @@ private:
|
||||
pcDoc->recompute();
|
||||
}
|
||||
else {
|
||||
FC_WARN("Importing BREP via 'Part' is deprecated. Use 'ImportGui' instead.");
|
||||
TopoShape shape;
|
||||
shape.read(EncodedName.c_str());
|
||||
|
||||
|
||||
@@ -40,17 +40,20 @@
|
||||
# include <XSControl_WorkSession.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <App/Document.h>
|
||||
#include <Base/Sequencer.h>
|
||||
|
||||
#include "ImportIges.h"
|
||||
#include "PartFeature.h"
|
||||
|
||||
FC_LOG_LEVEL_INIT("Part")
|
||||
|
||||
using namespace Part;
|
||||
|
||||
int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName)
|
||||
{
|
||||
FC_WARN("Importing IGES via 'Part' is deprecated. Use 'ImportGui' instead.");
|
||||
try {
|
||||
Base::FileInfo fi(FileName);
|
||||
// read iges file
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "ShapeMapHasher.h"
|
||||
#include "PartFeature.h"
|
||||
|
||||
FC_LOG_LEVEL_INIT("Part")
|
||||
|
||||
namespace Part {
|
||||
bool ReadColors (const Handle(XSControl_WorkSession) &WS, std::map<int, Quantity_Color>& hash_col);
|
||||
@@ -68,6 +69,8 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name)
|
||||
TopoDS_Shape aShape;
|
||||
Base::FileInfo fi(Name);
|
||||
|
||||
FC_WARN("Importing STEP via 'Part' is deprecated. Use 'ImportGui' instead.");
|
||||
|
||||
if (!fi.exists()) {
|
||||
std::stringstream str;
|
||||
str << "File '" << Name << "' does not exist!";
|
||||
|
||||
Reference in New Issue
Block a user