mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
XCAFDimTolObjects_ GeomToleranceObject, DatumObject, DimensionObject has been extended with point: GetPoint2, SetPoint2, HasPoint2 methods have been implemented
drivers for BinMXCAFDoc_GeomToleranceDriver and BinMXCAFDoc_DimensionDriver attributes are added
This commit is contained in:
@@ -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));
|
||||
|
||||
|
@@ -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;
|
||||
|
68
src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.cxx
Normal file
68
src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.cxx
Normal file
@@ -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);
|
||||
}
|
56
src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.hxx
Normal file
56
src/BinMXCAFDoc/BinMXCAFDoc_DimensionDriver.hxx
Normal file
@@ -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
|
68
src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.cxx
Normal file
68
src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.cxx
Normal file
@@ -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);
|
||||
}
|
56
src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.hxx
Normal file
56
src/BinMXCAFDoc/BinMXCAFDoc_GeomToleranceDriver.hxx
Normal file
@@ -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
|
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -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))
|
||||
{
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user