Skip to content

Commit

Permalink
OCC: corr. OCAF
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit128 committed Dec 16, 2024
1 parent 0962c89 commit b6d489a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Cassiopee/OCC/OCC/Atomic/printOCAF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
#include "TDocStd_Document.hxx"
#include "TDataStd_Name.hxx"
#include "TDF_ChildIterator.hxx"
#include <iostream>

// recursive iteration through labels
void iterateLabels(const TDF_Label& label)
{
// print label entry
TCollection_AsciiString es;
TDF_Tool::Entry(label, es); // retourne l'entry de la label (3:0:3 indiquant sa position dans la hierarchie)
cout << "Info: Label entry: " << es.ToCString() << endl;
std::cout << "Info: Label entry: " << es.ToCString() << std::endl;

// Print the label string attributes
Handle(TDataStd_Name) nameAttr;
Expand Down Expand Up @@ -115,7 +116,7 @@ PyObject* K_OCC::printShapeOCAF(PyObject* self, PyObject* args)

TCollection_AsciiString es;
TDF_Tool::Entry(label, es); // retourne l'entry de la label (3:0:3 indiquant sa position dans la hierarchie)
cout << "Info: Label entry: " << es.ToCString() << endl;
std::cout << "Info: Label entry: " << es.ToCString() << std::endl;

Handle(TDataStd_Name) NAME = new TDataStd_Name();
if (label.FindAttribute(TDataStd_Name::GetID(), NAME)) // retourne tous les attributs de type string
Expand Down
10 changes: 6 additions & 4 deletions Cassiopee/OCC/OCC/Atomic/readCAD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ PyObject* K_OCC::readCAD(PyObject* self, PyObject* args)

TopoDS_Shape* shp = new TopoDS_Shape();

Handle(TDocStd_Document) doc = NULL;
TDocStd_Document* doc = NULL;

if (strcmp(fileFmt, "fmt_iges") == 0)
{
Expand All @@ -62,7 +62,8 @@ PyObject* K_OCC::readCAD(PyObject* self, PyObject* args)
IGESCAFControl_Reader reader2;
reader2.ReadFile(fileName);
doc = new TDocStd_Document("MDTV-Standard");
reader2.Transfer(doc);
Handle(TDocStd_Document) doc2 = doc;
reader2.Transfer(doc2);
}
else if (strcmp(fileFmt, "fmt_step") == 0)
{
Expand All @@ -76,7 +77,8 @@ PyObject* K_OCC::readCAD(PyObject* self, PyObject* args)
STEPCAFControl_Reader reader2;
reader2.ReadFile(fileName);
doc = new TDocStd_Document("MDTV-Standard");
reader2.Transfer(doc);
Handle(TDocStd_Document) doc2 = doc;
reader2.Transfer(doc2);
}

// Extract surfaces
Expand Down Expand Up @@ -179,4 +181,4 @@ PyObject* K_OCC::getFileAndFormat(PyObject* self, PyObject* args)
#endif

return Py_BuildValue("ss", packet[3], packet[4]);
}
}

0 comments on commit b6d489a

Please sign in to comment.