// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// File: GEOMALGOAPI_STEPImport.cpp
+// Created: Dec 24, 2014
+// Author: Sergey BELASH
+
#include <GeomAlgoAPI_STEPImport.h>
#include <TDF_ChildIDIterator.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Shape.hxx>
+
#include <TColStd_SequenceOfAsciiString.hxx>
return aValue;
}
-TopoDS_Shape STEPImport(const std::string& theFileName,
- const std::string& theFormatName,
- std::string& theError)
+std::shared_ptr<GeomAPI_Shape> STEPImport(const std::string& theFileName,
+ const std::string& theFormatName,
+ std::string& theError)
{
TopoDS_Shape aResShape;
Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
else {
theError = "The file contains not supported units.";
- return aResShape;
+ std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
+ aGeomShape->setImpl(new TopoDS_Shape(aResShape));
+ return aGeomShape;
}
// TODO (for other units than mm, cm, m or inch)
//else if (aLenUnits == "")
if ( !TopExp_Explorer( aResShape, TopAbs_VERTEX ).More() )
{
theError = "No geometrical data in the imported file.";
- return TopoDS_Shape();
+ std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
+ aGeomShape->setImpl(new TopoDS_Shape());
+ return aGeomShape;
}
} else {
theError = "Wrong format of the imported file. Can't import file.";
aResShape.Nullify();
}
// Return previous locale
- return aResShape;
+ std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
+ aGeomShape->setImpl(new TopoDS_Shape(aResShape));
+ return aGeomShape;
}