1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0027835: Application Framework, BinXCAF - handle correctly faces with NULL surface within BinTools_ShapeSet

BinTools_ShapeSet::AddGeometry() now writes NULL surface with 0 index.
myWithTriangles is ignored for TopoDS_Face with NULL surface so that
triangulation-only faces are not lost with defaults.

Added Draw Harness command StoreTriangulation defining
WithTriangulation flag for BinXCAF/BinOcaf storage drivers.
This commit is contained in:
kgv
2016-09-03 19:21:58 +03:00
committed by bugmaster
parent e5d7e24960
commit f1fb0901d6
7 changed files with 167 additions and 33 deletions

View File

@@ -15,6 +15,7 @@
#include <DDocStd.hxx>
#include <BinDrivers_DocumentStorageDriver.hxx>
#include <DDF.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
@@ -404,6 +405,42 @@ static Standard_Integer DDocStd_Propagate (Draw_Interpretor& di,Standard_Integer
return 1;
}
//=======================================================================
//function : DDocStd_StoreTriangulation
//purpose :
//=======================================================================
static Standard_Integer DDocStd_StoreTriangulation (Draw_Interpretor& theDi,
Standard_Integer theNbArgs,
const char** theArgVec)
{
const Handle(TDocStd_Application)& anApp = DDocStd::GetApplication();
Handle(BinDrivers_DocumentStorageDriver) aDriverXCaf = Handle(BinDrivers_DocumentStorageDriver)::DownCast(anApp->WriterFromFormat ("BinXCAF"));
Handle(BinDrivers_DocumentStorageDriver) aDriverOcaf = Handle(BinDrivers_DocumentStorageDriver)::DownCast(anApp->WriterFromFormat ("BinOcaf"));
if (aDriverXCaf.IsNull()
|| aDriverOcaf.IsNull())
{
std::cout << "Error: BinXCAF or BinOcaf storage formats are not registered\n";
return 1;
}
if (theNbArgs == 1)
{
theDi << (aDriverXCaf->IsWithTriangles() ? "1" : "0");
return 0;
}
else if (theNbArgs != 2)
{
std::cout << "Syntax error: wrong number of arguments\n";
return 1;
}
const Standard_Boolean toEnable = (Draw::Atoi (theArgVec[1]) != 0);
aDriverXCaf->SetWithTriangles (anApp->MessageDriver(), toEnable);
aDriverOcaf->SetWithTriangles (anApp->MessageDriver(), toEnable);
return 0;
}
//=======================================================================
//function : DocumentCommands
//purpose :
@@ -435,6 +472,11 @@ void DDocStd::DocumentCommands(Draw_Interpretor& theCommands)
"DumpDocument (DOC)",
__FILE__, DDocStd_DumpDocument, g);
theCommands.Add ("StoreTriangulation",
"StoreTriangulation [toStore={0|1}]"
"\nSetup BinXCAF/BinOcaf storage drivers to write triangulation",
__FILE__, DDocStd_StoreTriangulation, g);
// XREF
theCommands.Add("Copy","Copy DOC entry XDOC xentry",