mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0030115: Implementation of import from XCAF to VRML.
This commit is contained in:
@@ -371,8 +371,32 @@ void VrmlAPI_Writer::write_v2(const TopoDS_Shape& aShape,const Standard_CString
|
||||
aConv.AddShape(aShape);
|
||||
aConv.Convert(anExtFace, anExtEdge);
|
||||
|
||||
filebuf aFoc;
|
||||
ostream outStream (&aFoc);
|
||||
if (aFoc.open (aFile, ios::out))
|
||||
outStream << aScene;
|
||||
std::ofstream anOutStream;
|
||||
OSD_OpenStream(anOutStream, aFile, std::ios::out);
|
||||
if (!anOutStream.fail())
|
||||
{
|
||||
anOutStream << aScene;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteDoc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void VrmlAPI_Writer::WriteDoc(
|
||||
const Handle(TDocStd_Document) &theDoc,
|
||||
const Standard_CString theFile,
|
||||
const Standard_Real theScale) const
|
||||
{
|
||||
VrmlData_Scene aScene;
|
||||
VrmlData_ShapeConvert aConv(aScene, theScale);
|
||||
aConv.ConvertDocument(theDoc);
|
||||
|
||||
std::ofstream anOutStream;
|
||||
OSD_OpenStream(anOutStream, theFile, std::ios::out);
|
||||
if (!anOutStream.fail())
|
||||
{
|
||||
anOutStream << aScene;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,8 @@
|
||||
#include <Quantity_HArray1OfColor.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
|
||||
class VrmlConverter_Drawer;
|
||||
class VrmlConverter_Projector;
|
||||
class Vrml_Material;
|
||||
@@ -103,7 +105,15 @@ public:
|
||||
|
||||
//! Converts the shape aShape to
|
||||
//! VRML format of the passed version and writes it to the file identified by aFile.
|
||||
Standard_EXPORT void Write (const TopoDS_Shape& aShape, const Standard_CString aFile, const Standard_Integer aVersion = 2) const;
|
||||
Standard_EXPORT void Write (const TopoDS_Shape& aShape, const Standard_CString aFile,
|
||||
const Standard_Integer aVersion = 2) const;
|
||||
|
||||
//! Converts the document to VRML format of the passed version
|
||||
//! and writes it to the file identified by aFile.
|
||||
Standard_EXPORT void WriteDoc(
|
||||
const Handle(TDocStd_Document) &theDoc,
|
||||
const Standard_CString theFile,
|
||||
const Standard_Real theScale) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
Reference in New Issue
Block a user