drivers for BinMXCAFDoc_GeomToleranceDriver and BinMXCAFDoc_DimensionDriver attributes are added
#include <BinMXCAFDoc_ColorDriver.hxx>
#include <BinMXCAFDoc_ColorToolDriver.hxx>
#include <BinMXCAFDoc_DatumDriver.hxx>
+#include <BinMXCAFDoc_GeomToleranceDriver.hxx>
+#include <BinMXCAFDoc_DimensionDriver.hxx>
#include <BinMXCAFDoc_DimTolDriver.hxx>
#include <BinMXCAFDoc_DimTolToolDriver.hxx>
#include <BinMXCAFDoc_DocumentToolDriver.hxx>
theDriverTable->AddDriver( aLocationDriver);
theDriverTable->AddDriver( new BinMXCAFDoc_VolumeDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_DatumDriver (theMsgDrv));
+ theDriverTable->AddDriver( new BinMXCAFDoc_GeomToleranceDriver (theMsgDrv));
+ theDriverTable->AddDriver( new BinMXCAFDoc_DimensionDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_DimTolDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_MaterialDriver (theMsgDrv));
class BinMXCAFDoc_LocationDriver;
class BinMXCAFDoc_VolumeDriver;
class BinMXCAFDoc_DatumDriver;
+class BinMXCAFDoc_GeomToleranceDriver;
+class BinMXCAFDoc_DimensionDriver;
class BinMXCAFDoc_DimTolDriver;
class BinMXCAFDoc_MaterialDriver;
class BinMXCAFDoc_ColorToolDriver;
friend class BinMXCAFDoc_LocationDriver;
friend class BinMXCAFDoc_VolumeDriver;
friend class BinMXCAFDoc_DatumDriver;
+friend class BinMXCAFDoc_GeomToleranceDriver;
+friend class BinMXCAFDoc_DimensionDriver;
friend class BinMXCAFDoc_DimTolDriver;
friend class BinMXCAFDoc_MaterialDriver;
friend class BinMXCAFDoc_ColorToolDriver;
--- /dev/null
+// Created on:
+// Created by:
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#include <BinMXCAFDoc_DimensionDriver.hxx>
+#include <BinObjMgt_Persistent.hxx>
+#include <CDM_MessageDriver.hxx>
+#include <Standard_Type.hxx>
+#include <TCollection_HAsciiString.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TColStd_HArray1OfReal.hxx>
+#include <TDF_Attribute.hxx>
+#include <XCAFDoc_Dimension.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_DimensionDriver,BinMDF_ADriver)
+
+//=======================================================================
+//function : Constructor
+//purpose :
+//=======================================================================
+BinMXCAFDoc_DimensionDriver::BinMXCAFDoc_DimensionDriver (const Handle(CDM_MessageDriver)& theMsgDriver)
+: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Dimension)->Name())
+{
+}
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+Handle(TDF_Attribute) BinMXCAFDoc_DimensionDriver::NewEmpty() const
+{
+ return new XCAFDoc_Dimension();
+}
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+Standard_Boolean BinMXCAFDoc_DimensionDriver::Paste (const BinObjMgt_Persistent& /*theSource*/,
+ const Handle(TDF_Attribute)& /*theTarget*/,
+ BinObjMgt_RRelocationTable& /*theRelocTable*/) const
+{
+ //Handle(XCAFDoc_Dimension) anAtt = Handle(XCAFDoc_Dimension)::DownCast(theTarget);
+ return Standard_True;
+}
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+void BinMXCAFDoc_DimensionDriver::Paste (const Handle(TDF_Attribute)& /*theSource*/,
+ BinObjMgt_Persistent& /*theTarget*/,
+ BinObjMgt_SRelocationTable& /*theRelocTable*/) const
+{
+ //Handle(XCAFDoc_Dimension) anAtt = Handle(XCAFDoc_Dimension)::DownCast(theSource);
+}
--- /dev/null
+// Created on:
+// Created by:
+// Copyright (c) 20015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _BinMXCAFDoc_DimensionDriver_HeaderFile
+#define _BinMXCAFDoc_DimensionDriver_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_Type.hxx>
+
+#include <BinMDF_ADriver.hxx>
+#include <Standard_Boolean.hxx>
+#include <BinObjMgt_RRelocationTable.hxx>
+#include <BinObjMgt_SRelocationTable.hxx>
+
+class CDM_MessageDriver;
+class TDF_Attribute;
+class BinObjMgt_Persistent;
+
+class BinMXCAFDoc_DimensionDriver;
+DEFINE_STANDARD_HANDLE(BinMXCAFDoc_DimensionDriver, BinMDF_ADriver)
+
+class BinMXCAFDoc_DimensionDriver : public BinMDF_ADriver
+{
+
+public:
+
+
+ Standard_EXPORT BinMXCAFDoc_DimensionDriver (const Handle(CDM_MessageDriver)& theMsgDriver);
+
+ Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
+
+ Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
+ const Handle(TDF_Attribute)& theTarget,
+ BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
+
+ Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& theSource,
+ BinObjMgt_Persistent& theTarget,
+ BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
+
+ DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_DimensionDriver,BinMDF_ADriver)
+
+};
+
+#endif // _BinMXCAFDoc_DimensionDriver_HeaderFile
--- /dev/null
+// Created on:
+// Created by:
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#include <BinMXCAFDoc_GeomToleranceDriver.hxx>
+#include <BinObjMgt_Persistent.hxx>
+#include <CDM_MessageDriver.hxx>
+#include <Standard_Type.hxx>
+#include <TCollection_HAsciiString.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TColStd_HArray1OfReal.hxx>
+#include <TDF_Attribute.hxx>
+#include <XCAFDoc_GeomTolerance.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_GeomToleranceDriver,BinMDF_ADriver)
+
+//=======================================================================
+//function : Constructor
+//purpose :
+//=======================================================================
+BinMXCAFDoc_GeomToleranceDriver::BinMXCAFDoc_GeomToleranceDriver (const Handle(CDM_MessageDriver)& theMsgDriver)
+: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_GeomTolerance)->Name())
+{
+}
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+Handle(TDF_Attribute) BinMXCAFDoc_GeomToleranceDriver::NewEmpty() const
+{
+ return new XCAFDoc_GeomTolerance();
+}
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+Standard_Boolean BinMXCAFDoc_GeomToleranceDriver::Paste (const BinObjMgt_Persistent& /*theSource*/,
+ const Handle(TDF_Attribute)& /*theTarget*/,
+ BinObjMgt_RRelocationTable& /*theRelocTable*/) const
+{
+ //Handle(XCAFDoc_GeomTolerance) anAtt = Handle(XCAFDoc_GeomTolerance)::DownCast(theTarget);
+ return Standard_True;
+}
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+void BinMXCAFDoc_GeomToleranceDriver::Paste (const Handle(TDF_Attribute)& /*theSource*/,
+ BinObjMgt_Persistent& /*theTarget*/,
+ BinObjMgt_SRelocationTable& /*theRelocTable*/) const
+{
+ //Handle(XCAFDoc_GeomTolerance) anAtt = Handle(XCAFDoc_GeomTolerance)::DownCast(theSource);
+}
--- /dev/null
+// Created on:
+// Created by:
+// Copyright (c) 20015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _BinMXCAFDoc_GeomToleranceDriver_HeaderFile
+#define _BinMXCAFDoc_GeomToleranceDriver_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_Type.hxx>
+
+#include <BinMDF_ADriver.hxx>
+#include <Standard_Boolean.hxx>
+#include <BinObjMgt_RRelocationTable.hxx>
+#include <BinObjMgt_SRelocationTable.hxx>
+
+class CDM_MessageDriver;
+class TDF_Attribute;
+class BinObjMgt_Persistent;
+
+class BinMXCAFDoc_GeomToleranceDriver;
+DEFINE_STANDARD_HANDLE(BinMXCAFDoc_GeomToleranceDriver, BinMDF_ADriver)
+
+class BinMXCAFDoc_GeomToleranceDriver : public BinMDF_ADriver
+{
+
+public:
+
+
+ Standard_EXPORT BinMXCAFDoc_GeomToleranceDriver (const Handle(CDM_MessageDriver)& theMsgDriver);
+
+ Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
+
+ Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
+ const Handle(TDF_Attribute)& theTarget,
+ BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
+
+ Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& theSource,
+ BinObjMgt_Persistent& theTarget,
+ BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
+
+ DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_GeomToleranceDriver,BinMDF_ADriver)
+
+};
+
+#endif // _BinMXCAFDoc_GeomToleranceDriver_HeaderFile
BinMXCAFDoc_ColorToolDriver.hxx
BinMXCAFDoc_DatumDriver.cxx
BinMXCAFDoc_DatumDriver.hxx
+BinMXCAFDoc_DimensionDriver.cxx
+BinMXCAFDoc_DimensionDriver.hxx
BinMXCAFDoc_DimTolDriver.cxx
BinMXCAFDoc_DimTolDriver.hxx
BinMXCAFDoc_DimTolToolDriver.cxx
BinMXCAFDoc_DimTolToolDriver.hxx
BinMXCAFDoc_DocumentToolDriver.cxx
BinMXCAFDoc_DocumentToolDriver.hxx
+BinMXCAFDoc_GeomToleranceDriver.cxx
+BinMXCAFDoc_GeomToleranceDriver.hxx
BinMXCAFDoc_GraphNodeDriver.cxx
BinMXCAFDoc_GraphNodeDriver.hxx
BinMXCAFDoc_LayerToolDriver.cxx
myIsDTarget = Standard_False;
myHasPlane = Standard_False;
myHasPnt = Standard_False;
+ myHasPnt2 = Standard_False;
}
//=======================================================================
myDTargetType = theObj->myDTargetType;
myPlane = theObj->myPlane;
myPnt= theObj->myPnt;
+ myPnt2= theObj->myPnt2;
myHasPlane = theObj->myHasPlane;
myHasPnt = theObj->myHasPnt;
+ myHasPnt2 = theObj->myHasPnt2;
}
//=======================================================================
const gp_Pnt& GetPoint() const { return myPnt; }
+ void SetPoint2 (const gp_Pnt& thePnt)
+ {
+ myPnt2 = thePnt;
+ myHasPnt2 = Standard_True;
+ }
+
+ const gp_Pnt& GetPoint2() const { return myPnt2; }
+
Standard_Boolean HasPlane() const { return myHasPlane; }
Standard_Boolean HasPoint() const { return myHasPnt; }
+ Standard_Boolean HasPoint2() const { return myHasPnt2; }
+
DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_DatumObject,Standard_Transient)
private:
Standard_Integer myDatumTargetNumber;
gp_Ax2 myPlane;
gp_Pnt myPnt;
+ gp_Pnt myPnt2;
Standard_Boolean myHasPlane;
Standard_Boolean myHasPnt;
-
+ Standard_Boolean myHasPnt2;
};
#endif // _XCAFDimTolObjects_DatumObject_HeaderFile
XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject()
{
myHasPlane = Standard_False;
+ myHasPnt2 = Standard_False;
}
//=======================================================================
myPath = theObj->myPath;
myDir = theObj->myDir;
myPnts = theObj->myPnts;
+ myPnt2= theObj->myPnt2;
myHasPlane = theObj->myHasPlane;
myPlane = theObj->myPlane;
+ myHasPnt2 = theObj->myHasPnt2;
}
//=======================================================================
Standard_EXPORT void SetPoints (const Handle(TColgp_HArray1OfPnt)& thePnts);
+ void SetPoint2 (const gp_Pnt& thePnt)
+ {
+ myPnt2 = thePnt;
+ myHasPnt2 = Standard_True;
+ }
+
+ const gp_Pnt& GetPoint2() const { return myPnt2; }
+
void SetPlane (const gp_Ax2& thePlane)
{
myPlane = thePlane;
Standard_Boolean HasPoints() const { !myPnts.IsNull() && myPnts->Length() > 0; }
+ Standard_Boolean HasPoint2() const { return myHasPnt2; }
+
DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_DimensionObject,Standard_Transient)
private:
TopoDS_Edge myPath;
gp_Dir myDir;
Handle(TColgp_HArray1OfPnt) myPnts;
+ gp_Pnt myPnt2;
gp_Ax2 myPlane;
Standard_Boolean myHasPlane;
+ Standard_Boolean myHasPnt2;
};
myHasAxis = Standard_False;
myHasPlane = Standard_False;
myHasPnt = Standard_False;
+ myHasPnt2 = Standard_False;
}
//=======================================================================
myHasAxis = theObj->myHasAxis;
myPlane = theObj->myPlane;
myPnt= theObj->myPnt;
+ myPnt2= theObj->myPnt2;
myHasPlane = theObj->myHasPlane;
myHasPnt = theObj->myHasPnt;
+ myHasPnt2 = theObj->myHasPnt2;
}
//=======================================================================
const gp_Pnt& GetPoint() const { return myPnt; }
+ void SetPoint2 (const gp_Pnt& thePnt)
+ {
+ myPnt2 = thePnt;
+ myHasPnt2 = Standard_True;
+ }
+
+ const gp_Pnt& GetPoint2() const { return myPnt2; }
+
Standard_Boolean HasPlane() const { return myHasPlane; }
Standard_Boolean HasPoint() const { return myHasPnt; }
+
+ Standard_Boolean HasPoint2() const { return myHasPnt2; }
DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_GeomToleranceObject,Standard_Transient)
Standard_Boolean myHasAxis;
gp_Ax2 myPlane;
gp_Pnt myPnt;
+ gp_Pnt myPnt2;
Standard_Boolean myHasPlane;
Standard_Boolean myHasPnt;
+ Standard_Boolean myHasPnt2;
};
ChildLab_PlaneN,
ChildLab_PlaneRef,
ChildLab_Pnt,
+ ChildLab_Pnt2,
};
//=======================================================================
Label().FindChild(ChildLab_Pnt).AddAttribute(aLoc);
}
+
+ if (theObject->HasPoint2())
+ {
+ Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
+ gp_Pnt aPnt2 = theObject->GetPoint2();
+
+ Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
+ for (Standard_Integer i = 1; i <= 3; i++)
+ aLocArr->SetValue(i, aPnt2.Coord(i));
+ aLoc->ChangeArray(aLocArr);
+
+ Label().FindChild(ChildLab_Pnt2).AddAttribute(aLoc);
+ }
}
//=======================================================================
anObj->SetPoint(aP);
}
+ Handle(TDataStd_RealArray) aPnt2;
+ if(Label().FindChild(ChildLab_Pnt2).FindAttribute(TDataStd_RealArray::GetID(), aPnt2) && aPnt2->Length() == 3 )
+ {
+ gp_Pnt aP (aPnt2->Value(aPnt2->Lower()), aPnt2->Value(aPnt2->Lower()+1), aPnt2->Value(aPnt2->Lower()+2));
+ anObj->SetPoint2(aP);
+ }
+
Handle(TDataStd_Integer) aIsDTarget;
if(Label().FindChild(ChildLab_IsDTarget).FindAttribute(TDataStd_Integer::GetID(), aIsDTarget))
{
ChildLab_PlaneLoc,
ChildLab_PlaneN,
ChildLab_PlaneRef,
+ ChildLab_Pnt2,
};
//=======================================================================
Label().FindChild(ChildLab_PlaneN).AddAttribute(aN);
Label().FindChild(ChildLab_PlaneRef).AddAttribute(aR);
}
+
+ if (theObject->HasPoint2())
+ {
+ Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
+ gp_Pnt aPnt2 = theObject->GetPoint2();
+
+ Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
+ for (Standard_Integer i = 1; i <= 3; i++)
+ aLocArr->SetValue(i, aPnt2.Coord(i));
+ aLoc->ChangeArray(aLocArr);
+
+ Label().FindChild(ChildLab_Pnt2).AddAttribute(aLoc);
+ }
}
//=======================================================================
anObj->SetPlane(anAx);
}
+ Handle(TDataStd_RealArray) aPnt2;
+ if(Label().FindChild(ChildLab_Pnt2).FindAttribute(TDataStd_RealArray::GetID(), aPnt2) && aPnt2->Length() == 3 )
+ {
+ gp_Pnt aP(aPnt2->Value(aPnt2->Lower()), aPnt2->Value(aPnt2->Lower()+1), aPnt2->Value(aPnt2->Lower()+2));
+ anObj->SetPoint2(aP);
+ }
+
return anObj;
}
ChildLab_PlaneN,
ChildLab_PlaneRef,
ChildLab_Pnt,
+ ChildLab_Pnt2,
};
//=======================================================================
Label().FindChild(ChildLab_Pnt).AddAttribute(aLoc);
}
+
+ if (theObject->HasPoint2())
+ {
+ Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
+ gp_Pnt aPnt2 = theObject->GetPoint2();
+
+ Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
+ for (Standard_Integer i = 1; i <= 3; i++)
+ aLocArr->SetValue(i, aPnt2.Coord(i));
+ aLoc->ChangeArray(aLocArr);
+
+ Label().FindChild(ChildLab_Pnt2).AddAttribute(aLoc);
+ }
}
//=======================================================================
gp_Pnt aP(aLoc->Value(aPnt->Lower()), aPnt->Value(aPnt->Lower()+1), aPnt->Value(aPnt->Lower()+2));
anObj->SetPoint(aP);
}
+
+ Handle(TDataStd_RealArray) aPnt2;
+ if(Label().FindChild(ChildLab_Pnt2).FindAttribute(TDataStd_RealArray::GetID(), aPnt2) && aPnt2->Length() == 3 )
+ {
+ gp_Pnt aP(aPnt2->Value(aPnt2->Lower()), aPnt2->Value(aPnt2->Lower()+1), aPnt2->Value(aPnt2->Lower()+2));
+ anObj->SetPoint2(aP);
+ }
+
return anObj;
}