]> OCCT Git - occt-copy.git/commitdiff
XCAFDimTolObjects_ GeomToleranceObject, DatumObject, DimensionObject has been extende...
authoribs <ibs@opencascade.com>
Tue, 15 Dec 2015 15:49:27 +0000 (18:49 +0300)
committergka <gka@opencascade.com>
Thu, 14 Jan 2016 13:13:50 +0000 (16:13 +0300)
drivers for BinMXCAFDoc_GeomToleranceDriver and BinMXCAFDoc_DimensionDriver attributes are added

16 files changed:
src/BinMXCAFDoc/BinMXCAFDoc.cxx
src/BinMXCAFDoc/BinMXCAFDoc.hxx
src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.cxx [new file with mode: 0644]
src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.hxx [new file with mode: 0644]
src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.cxx [new file with mode: 0644]
src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.hxx [new file with mode: 0644]
src/BinMXCAFDoc/FILES
src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx
src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx
src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx
src/XCAFDoc/XCAFDoc_Datum.cxx
src/XCAFDoc/XCAFDoc_Dimension.cxx
src/XCAFDoc/XCAFDoc_GeomTolerance.cxx

index 6e119856674b86f423b8bf232c511bb7eab0d92d..cc90e7219cea56d0bc7c7ae21b6ed43997334b3c 100644 (file)
@@ -22,6 +22,8 @@
 #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>
@@ -59,6 +61,8 @@ void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable,
   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));
 
index d0eca56625142e94582647d3a5ca845a25cc53e1..571748edb364464a9e8f1e4506b9aff69e178a0a 100644 (file)
@@ -29,6 +29,8 @@ class BinMXCAFDoc_GraphNodeDriver;
 class BinMXCAFDoc_LocationDriver;
 class BinMXCAFDoc_VolumeDriver;
 class BinMXCAFDoc_DatumDriver;
+class BinMXCAFDoc_GeomToleranceDriver;
+class BinMXCAFDoc_DimensionDriver;
 class BinMXCAFDoc_DimTolDriver;
 class BinMXCAFDoc_MaterialDriver;
 class BinMXCAFDoc_ColorToolDriver;
@@ -71,6 +73,8 @@ friend class BinMXCAFDoc_GraphNodeDriver;
 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;
diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.cxx
new file mode 100644 (file)
index 0000000..160abcc
--- /dev/null
@@ -0,0 +1,68 @@
+// 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);
+}
diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.hxx b/src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.hxx
new file mode 100644 (file)
index 0000000..3be43ad
--- /dev/null
@@ -0,0 +1,56 @@
+// 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
diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.cxx
new file mode 100644 (file)
index 0000000..59bb73e
--- /dev/null
@@ -0,0 +1,68 @@
+// 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);
+}
diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.hxx b/src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.hxx
new file mode 100644 (file)
index 0000000..0c01139
--- /dev/null
@@ -0,0 +1,56 @@
+// 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
index 83d4887e366a43d8ea5bfa588cd4c7b1ad2ec37d..99b3cedc5e8cd3a19713aa30fe29876d0f6f9754 100644 (file)
@@ -10,12 +10,16 @@ BinMXCAFDoc_ColorToolDriver.cxx
 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
index 883c096b1b7d45b24d56520444367e534ab44817..884444db4d4fcad2bb3a6a22301d05dcea6c268c 100644 (file)
@@ -26,6 +26,7 @@ XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject()
   myIsDTarget = Standard_False;
   myHasPlane = Standard_False;
   myHasPnt = Standard_False;
+  myHasPnt2 = Standard_False;
 }
 
 //=======================================================================
@@ -45,8 +46,10 @@ XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDi
   myDTargetType = theObj->myDTargetType;
   myPlane = theObj->myPlane;
   myPnt= theObj->myPnt;
+  myPnt2= theObj->myPnt2;
   myHasPlane = theObj->myHasPlane;
   myHasPnt = theObj->myHasPnt;
+  myHasPnt2 = theObj->myHasPnt2;
 }
 
 //=======================================================================
index 189b15071e971a864c106e810d31333771f141d1..2eeecc6dd091ce5740187ae6519a7107a5e635fa 100644 (file)
@@ -107,10 +107,20 @@ public:
 
   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: 
@@ -129,9 +139,10 @@ 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
index 93648e751f9667bd01584173e3ece609736ffd76..78b2eea3cef752e30a8f77fc55505a048abe3e83 100644 (file)
@@ -27,6 +27,7 @@ IMPLEMENT_STANDARD_RTTIEXT(XCAFDimTolObjects_DimensionObject,Standard_Transient)
 XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject()
 {
   myHasPlane = Standard_False;
+  myHasPnt2 = Standard_False;
 }
 
 //=======================================================================
@@ -48,8 +49,10 @@ XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject(const Handl
   myPath = theObj->myPath;
   myDir = theObj->myDir;
   myPnts = theObj->myPnts;
+  myPnt2= theObj->myPnt2;
   myHasPlane = theObj->myHasPlane;
   myPlane = theObj->myPlane;
+  myHasPnt2 = theObj->myHasPnt2;
 }
 
 //=======================================================================
index bdd2ebfac26d0766b8e583adc02fe09a7bc8b8b4..e65fee84a25b28209d43dbc531b98942f2dc6aa0 100644 (file)
@@ -117,6 +117,14 @@ public:
   
   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;
@@ -129,6 +137,8 @@ public:
 
   Standard_Boolean HasPoints() const { !myPnts.IsNull() && myPnts->Length() > 0; }
 
+  Standard_Boolean HasPoint2() const { return myHasPnt2; }
+
   DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_DimensionObject,Standard_Transient)
 
 private: 
@@ -145,8 +155,10 @@ private:
   TopoDS_Edge myPath;
   gp_Dir myDir;
   Handle(TColgp_HArray1OfPnt) myPnts;
+  gp_Pnt myPnt2;
   gp_Ax2 myPlane;
   Standard_Boolean myHasPlane;
+  Standard_Boolean myHasPnt2;
 
 };
 
index ed68daa2f0d3fe48c2081d27a98931612a491545..91e7a08e778a4536d29884bf8673b5af7749e831 100644 (file)
@@ -25,6 +25,7 @@ XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject()
   myHasAxis = Standard_False;
   myHasPlane = Standard_False;
   myHasPnt = Standard_False;
+  myHasPnt2 = Standard_False;
 }
 
 //=======================================================================
@@ -46,8 +47,10 @@ XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject(con
   myHasAxis = theObj->myHasAxis;
   myPlane = theObj->myPlane;
   myPnt= theObj->myPnt;
+  myPnt2= theObj->myPnt2;
   myHasPlane = theObj->myHasPlane;
   myHasPnt = theObj->myHasPnt;
+  myHasPnt2 = theObj->myHasPnt2;
 }
 
 //=======================================================================
index 8baaa71a8147fa1db8152afbf88fce932eacd5fb..42ce2c1848df713b29104f6c655aa4fd804800fc 100644 (file)
@@ -100,9 +100,19 @@ public:
 
   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)
 
@@ -120,8 +130,10 @@ private:
   Standard_Boolean myHasAxis;
   gp_Ax2 myPlane;
   gp_Pnt myPnt;
+  gp_Pnt myPnt2;
   Standard_Boolean myHasPlane;
   Standard_Boolean myHasPnt;
+  Standard_Boolean myHasPnt2;
 
 };
 
index 90609317daf53fa8063ab81bbcfc44a62c57b668..755a92711d49540d7c0a16be4bb26db4b41b16ff 100644 (file)
@@ -52,6 +52,7 @@ enum ChildLab
   ChildLab_PlaneN,
   ChildLab_PlaneRef,
   ChildLab_Pnt,
+  ChildLab_Pnt2,
 };
 
 //=======================================================================
@@ -325,6 +326,19 @@ void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theOb
 
     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);
+  }
 }
 
 //=======================================================================
@@ -388,6 +402,13 @@ Handle(XCAFDimTolObjects_DatumObject) XCAFDoc_Datum::GetObject() const
     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))
   {
index fe88fb0c152501cdc5e5951b65272abbbf88f5fc..2c52517ff4e545c19ff7d2a9341c5ae23cdda9bd 100644 (file)
@@ -45,6 +45,7 @@ enum ChildLab
   ChildLab_PlaneLoc,
   ChildLab_PlaneN,
   ChildLab_PlaneRef,
+  ChildLab_Pnt2,
 };
 
 //=======================================================================
@@ -215,6 +216,19 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec
     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);
+  }
 }
 
 //=======================================================================
@@ -309,6 +323,13 @@ Handle(XCAFDimTolObjects_DimensionObject) XCAFDoc_Dimension::GetObject()  const
     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;
 }
 
index 78b224143acdabb43bd294d869bc7499c67c0927..7c15323eb559c43a2aa25afcff49874d9a8d8fc7 100644 (file)
@@ -42,6 +42,7 @@ enum ChildLab
   ChildLab_PlaneN,
   ChildLab_PlaneRef,
   ChildLab_Pnt,
+  ChildLab_Pnt2,
 };
 
 //=======================================================================
@@ -219,6 +220,19 @@ void XCAFDoc_GeomTolerance::SetObject (const Handle(XCAFDimTolObjects_GeomTolera
 
     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);
+  }
 }
 
 //=======================================================================
@@ -313,6 +327,14 @@ Handle(XCAFDimTolObjects_GeomToleranceObject) XCAFDoc_GeomTolerance::GetObject()
     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;
 }