Part: Add deprecation warning for import/export

This commit is contained in:
Pieter Hijma
2025-09-11 12:55:19 +02:00
committed by Chris Hennes
parent cde481536e
commit deadbb5793
4 changed files with 14 additions and 0 deletions

View File

@@ -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());

View File

@@ -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

View 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!";