1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0027455: Implementation of connection points

Add Import/Export connection points.
Make some improvements in STEP reading in collections shapes, to which dimension is attached.
Update tests.
This commit is contained in:
ika
2016-04-25 09:51:57 +03:00
committed by bugmaster
parent 8e509b0ba1
commit b7b2f85ac1
23 changed files with 1212 additions and 258 deletions

View File

@@ -27,6 +27,8 @@ XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject()
{
myHasPlane = Standard_False;
myHasPntText = Standard_False;
myHasPoint1 = Standard_False;
myHasPoint2 = Standard_False;
}
//=======================================================================
@@ -47,7 +49,10 @@ XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject(const Handl
myModifiers = theObj->myModifiers;
myPath = theObj->myPath;
myDir = theObj->myDir;
myPnts = theObj->myPnts;
myHasPoint1 = theObj->myHasPoint1;
myPnt1 = theObj->myPnt1;
myHasPoint2 = theObj->myHasPoint2;
myPnt2 = theObj->myPnt2;
myPntText= theObj->myPntText;
myHasPlane = theObj->myHasPlane;
myPlane = theObj->myPlane;
@@ -425,24 +430,6 @@ Standard_Boolean XCAFDimTolObjects_DimensionObject::SetDirection (const gp_Dir&
return Standard_True;
}
//=======================================================================
//function : GetPoints
//purpose :
//=======================================================================
Handle(TColgp_HArray1OfPnt) XCAFDimTolObjects_DimensionObject::GetPoints () const
{
return myPnts;
}
//=======================================================================
//function : SetPoints
//purpose :
//=======================================================================
void XCAFDimTolObjects_DimensionObject::SetPoints (const Handle(TColgp_HArray1OfPnt)& thePnts)
{
myPnts = thePnts;
}
//=======================================================================
//function : RemoveDescription
//purpose :

View File

@@ -117,8 +117,6 @@ public:
Standard_EXPORT Standard_Boolean SetDirection (const gp_Dir& theDir);
Standard_EXPORT Handle(TColgp_HArray1OfPnt) GetPoints() const;
Standard_EXPORT void SetPoints (const Handle(TColgp_HArray1OfPnt)& thePnts);
Standard_EXPORT void SetPointTextAttach (const gp_Pnt& thePntText)
{
@@ -143,7 +141,36 @@ public:
Standard_EXPORT Standard_Boolean HasPlane() const { return myHasPlane; }
Standard_EXPORT Standard_Boolean HasPoints() const { return (!myPnts.IsNull() && myPnts->Length() > 0); }
//! Returns true, if connection point exists (for dimesional_size),
//! if connection point for first shape exists (for dimensional_location)
Standard_EXPORT Standard_Boolean HasPoint() const { return myHasPoint1; }
// Returns true, if connection point for second shape exists (for dimensional_location only)
Standard_EXPORT Standard_Boolean HasPoint2() const { return myHasPoint2; }
//! Set connection point (for dimesional_size),
//! Set connection point for first shape (for dimensional_location)
Standard_EXPORT void SetPoint(const gp_Pnt thePnt) {
myPnt1 = thePnt;
myHasPoint1 = Standard_True;
}
// Set connection point for second shape(for dimensional_location only)
Standard_EXPORT void SetPoint2(const gp_Pnt thePnt) {
myPnt2 = thePnt;
myHasPoint2 = Standard_True;
}
//! Get connection point (for dimesional_size),
//! Get connection point for first shape (for dimensional_location)
Standard_EXPORT gp_Pnt GetPoint() const {
return myPnt1;
}
// Get connection point for second shape(for dimensional_location only)
Standard_EXPORT gp_Pnt GetPoint2() const {
return myPnt2;
}
//! Set graphical presentation for object
Standard_EXPORT void SetPresentation(const TopoDS_Shape& thePresentation,
@@ -218,7 +245,8 @@ private:
XCAFDimTolObjects_DimensionModifiersSequence myModifiers;
TopoDS_Edge myPath;
gp_Dir myDir;
Handle(TColgp_HArray1OfPnt) myPnts;
gp_Pnt myPnt1, myPnt2;
Standard_Boolean myHasPoint1, myHasPoint2;
gp_Ax2 myPlane;
Standard_Boolean myHasPlane;
Standard_Boolean myHasPntText;