Final fix for hierarchical STEP exporter
This commit is contained in:
committed by
Yorik van Havre
parent
1b36dc2437
commit
8ab063aaa5
@@ -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();
|
||||
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -490,6 +490,7 @@ private:
|
||||
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
|
||||
@@ -502,7 +503,6 @@ private:
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user