Part: Make 3rd party libraries into PCH
This commit is contained in:
committed by
abdullahtahiriyo
parent
43bdef67d6
commit
a56658489b
@@ -42,12 +42,13 @@
|
||||
# include <Standard_Version.hxx>
|
||||
# include <gp_GTrsf.hxx>
|
||||
# include <gp_Trsf.hxx>
|
||||
#endif
|
||||
|
||||
#if OCC_VERSION_HEX >= 0x060800
|
||||
#include <OSD_OpenFile.hxx>
|
||||
# include <OSD_OpenFile.hxx>
|
||||
#endif
|
||||
|
||||
#endif // _PreComp_
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Writer.h>
|
||||
#include <Base/Reader.h>
|
||||
@@ -95,7 +96,7 @@ void PropertyPartShape::setValue(const TopoDS_Shape& sh)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
const TopoDS_Shape& PropertyPartShape::getValue(void)const
|
||||
const TopoDS_Shape& PropertyPartShape::getValue(void)const
|
||||
{
|
||||
return _Shape.getShape();
|
||||
}
|
||||
@@ -245,12 +246,12 @@ void PropertyPartShape::Save (Base::Writer &writer) const
|
||||
if(!writer.isForceXML()) {
|
||||
//See SaveDocFile(), RestoreDocFile()
|
||||
if (writer.getMode("BinaryBrep")) {
|
||||
writer.Stream() << writer.ind() << "<Part file=\""
|
||||
writer.Stream() << writer.ind() << "<Part file=\""
|
||||
<< writer.addFile("PartShape.bin", this)
|
||||
<< "\"/>" << std::endl;
|
||||
}
|
||||
else {
|
||||
writer.Stream() << writer.ind() << "<Part file=\""
|
||||
writer.Stream() << writer.ind() << "<Part file=\""
|
||||
<< writer.addFile("PartShape.brp", this)
|
||||
<< "\"/>" << std::endl;
|
||||
}
|
||||
@@ -278,7 +279,7 @@ static void BRepTools_Write(const TopoDS_Shape& Sh, Standard_OStream& S) {
|
||||
SS.Write(S);
|
||||
SS.Write(Sh,S);
|
||||
}
|
||||
static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh,
|
||||
static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh,
|
||||
const Standard_CString File)
|
||||
{
|
||||
ofstream os;
|
||||
@@ -292,11 +293,11 @@ static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh,
|
||||
Standard_Boolean isGood = (os.good() && !os.eof());
|
||||
if(!isGood)
|
||||
return isGood;
|
||||
|
||||
|
||||
BRepTools_ShapeSet SS(Standard_False);
|
||||
// SS.SetProgress(PR);
|
||||
SS.Add(Sh);
|
||||
|
||||
|
||||
os << "DBRep_DrawableShape\n"; // for easy Draw read
|
||||
SS.Write(os);
|
||||
isGood = os.good();
|
||||
@@ -341,7 +342,7 @@ void PropertyPartShape::SaveDocFile (Base::Writer &writer) const
|
||||
App::PropertyContainer* father = this->getContainer();
|
||||
if (father && father->isDerivedFrom(App::DocumentObject::getClassTypeId())) {
|
||||
App::DocumentObject* obj = static_cast<App::DocumentObject*>(father);
|
||||
Base::Console().Error("Shape of '%s' cannot be written to BRep file '%s'\n",
|
||||
Base::Console().Error("Shape of '%s' cannot be written to BRep file '%s'\n",
|
||||
obj->Label.getValue(),fi.filePath().c_str());
|
||||
}
|
||||
else {
|
||||
@@ -355,7 +356,7 @@ void PropertyPartShape::SaveDocFile (Base::Writer &writer) const
|
||||
|
||||
Base::ifstream file(fi, std::ios::in | std::ios::binary);
|
||||
if (file) {
|
||||
//unsigned long ulSize = 0;
|
||||
//unsigned long ulSize = 0;
|
||||
std::streambuf* buf = file.rdbuf();
|
||||
//if (buf) {
|
||||
// unsigned long ulCurr;
|
||||
@@ -399,7 +400,7 @@ void PropertyPartShape::RestoreDocFile(Base::Reader &reader)
|
||||
|
||||
// read in the ASCII file and write back to the file stream
|
||||
Base::ofstream file(fi, std::ios::out | std::ios::binary);
|
||||
unsigned long ulSize = 0;
|
||||
unsigned long ulSize = 0;
|
||||
if (reader) {
|
||||
std::streambuf* buf = file.rdbuf();
|
||||
reader >> buf;
|
||||
@@ -420,7 +421,7 @@ void PropertyPartShape::RestoreDocFile(Base::Reader &reader)
|
||||
App::PropertyContainer* father = this->getContainer();
|
||||
if (father && father->isDerivedFrom(App::DocumentObject::getClassTypeId())) {
|
||||
App::DocumentObject* obj = static_cast<App::DocumentObject*>(father);
|
||||
Base::Console().Error("BRep file '%s' with shape of '%s' seems to be empty\n",
|
||||
Base::Console().Error("BRep file '%s' with shape of '%s' seems to be empty\n",
|
||||
fi.filePath().c_str(),obj->Label.getValue());
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user