Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Final fix for hierarchical STEP exporter
  • Loading branch information
Jean-Marie Verdun authored and yorikvanhavre committed Jul 11, 2017
1 parent 1b36dc2 commit 8ab063a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
18 changes: 2 additions & 16 deletions src/Mod/Import/App/ImportOCAF.cpp
Expand Up @@ -512,20 +512,6 @@ void ExportOCAF::createNode(App::Part* part, int& root_id, std::vector <TDF_Labe
root_id=hierarchical_label.size();
}

void ExportOCAF::ComputeDoc(int labels)
{
puts("Recomputing the Doc");
// XCAFDoc_DocumentTool::ShapeTool(labels)->ComputeShapes(labels);
puts(" ========================================================= ");
// XCAFDoc_DocumentTool::ShapeTool(labels)->Dump(std::cerr,true);
puts(" ========================================================= ");
aShapeTool->Dump(std::cerr);
}





int ExportOCAF::saveShape(Part::Feature* part, const std::vector<App::Color>& colors, std::vector <TDF_Label>& hierarchical_label,std::vector <TopLoc_Location>& hierarchical_loc)
{
const TopoDS_Shape& shape = part->Shape.getValue();
Expand Down Expand Up @@ -584,8 +570,8 @@ int ExportOCAF::saveShape(Part::Feature* part, const std::vector<App::Color>& co
if (face_index.find(index) != face_index.end()) {
face_index.erase(index);

//TDF_Label faceLabel = aShapeTool->AddSubShape(shapeLabel, xp.Current());
TDF_Label faceLabel= TDF_TagSource::NewChild(shapeLabel);
TDF_Label faceLabel = aShapeTool->AddSubShape(shapeLabel, xp.Current());
// TDF_Label faceLabel= TDF_TagSource::NewChild(shapeLabel);
aShapeTool->SetShape(faceLabel, xp.Current());

const App::Color& color = colors[index-1];
Expand Down
1 change: 0 additions & 1 deletion src/Mod/Import/App/ImportOCAF.h
Expand Up @@ -79,7 +79,6 @@ class ImportExport ExportOCAF
{
public:
void createNode(App::Part* part, int& root_it, std::vector <TDF_Label>& hierarchical_label,std::vector <TopLoc_Location>& hierarchical_loc);
void ComputeDoc(int labels);
ExportOCAF(Handle(TDocStd_Document) h, bool explicitPlacement);
int saveShape(Part::Feature* part, const std::vector<App::Color>&, std::vector <TDF_Label>& hierarchical_label,std::vector <TopLoc_Location>& hierarchical_loc);
void push_node(int root, int node, std::vector <TDF_Label>& hierarchical_label,std::vector <TopLoc_Location>& hierarchical_loc);
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Import/Gui/AppImportGuiPy.cpp
Expand Up @@ -490,6 +490,7 @@ class Module : public Py::ExtensionModule<Module>
hApp->NewDocument(TCollection_ExtendedString("MDTV-CAF"), hDoc);

bool keepExplicitPlacement = list.size() > 1;
keepExplicitPlacement = Standard_True;
Import::ExportOCAF ocaf(hDoc, keepExplicitPlacement);

// That stuff is exporting a list of selected oject into FreeCAD Tree
Expand All @@ -502,7 +503,6 @@ class Module : public Py::ExtensionModule<Module>
std::vector <TDF_Label> hierarchical_label;
std::vector <TopLoc_Location> hierarchical_loc;
label=export_app_object(obj,ocaf,label, hierarchical_label, hierarchical_loc);
ocaf.ComputeDoc(label);
}
}

Expand Down

0 comments on commit 8ab063a

Please sign in to comment.