diff --git a/src/AIS/AIS_AngleDimension.cxx b/src/AIS/AIS_AngleDimension.cxx index 9327a58b7b..321014fca2 100755 --- a/src/AIS/AIS_AngleDimension.cxx +++ b/src/AIS/AIS_AngleDimension.cxx @@ -87,9 +87,8 @@ #include #include #include +#include #include -#include -#include #include #include #include @@ -114,6 +113,8 @@ IMPLEMENT_STANDARD_RTTIEXT (AIS_AngleDimension, AIS_Dimension) void AIS_AngleDimension::init() { + SetKindOfDimension (AIS_KOD_PLANEANGLE); + SetFlyout (15.0); // Default values of units UnitsAPI::SetLocalSystem (UnitsAPI_SI); SetUnitsQuantity ("PLANE ANGLE"); @@ -132,12 +133,10 @@ void AIS_AngleDimension::init() AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge) : AIS_Dimension(), - myIsFlyoutLines (Standard_True), - myFlyout (15.0) + myIsFlyoutLines (Standard_True) { init(); myShapesNumber = 2; - SetKindOfDimension (AIS_KOD_PLANEANGLE); myFirstShape = theFirstEdge; mySecondShape = theSecondEdge; } @@ -152,12 +151,10 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, const gp_Pln& thePlane) : AIS_Dimension(), - myIsFlyoutLines (Standard_True), - myFlyout (15.0) + myIsFlyoutLines (Standard_True) { init(); myShapesNumber = 2; - SetKindOfDimension (AIS_KOD_PLANEANGLE); myFirstShape = theFirstEdge; mySecondShape = theSecondEdge; SetWorkingPlane (thePlane); @@ -175,11 +172,9 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Edge& theFirstEdge, const Handle(Prs3d_DimensionAspect)& theDimensionAspect, const Standard_Real theExtensionSize) : AIS_Dimension (theDimensionAspect,theExtensionSize), - myIsFlyoutLines (Standard_True), - myFlyout (15.0) + myIsFlyoutLines (Standard_True) { myShapesNumber = 2; - SetKindOfDimension (AIS_KOD_PLANEANGLE); myFirstShape = theFirstEdge; mySecondShape = theSecondEdge; SetWorkingPlane (thePlane); @@ -194,12 +189,10 @@ AIS_AngleDimension::AIS_AngleDimension (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint, const gp_Pnt& theThirdPoint) : AIS_Dimension(), - myIsFlyoutLines (Standard_True), - myFlyout (15.0) + myIsFlyoutLines (Standard_True) { init(); myIsInitialized = Standard_True; - SetKindOfDimension (AIS_KOD_PLANEANGLE); myFirstPoint = theFirstPoint; myCenter = theSecondPoint; mySecondPoint = theThirdPoint; @@ -217,11 +210,9 @@ AIS_AngleDimension::AIS_AngleDimension (const gp_Pnt& theFirstPoint, const Handle(Prs3d_DimensionAspect)& theDimensionAspect, const Standard_Real theExtensionSize) : AIS_Dimension (theDimensionAspect,theExtensionSize), - myIsFlyoutLines (Standard_True), - myFlyout (15.0) + myIsFlyoutLines (Standard_True) { myIsInitialized = Standard_True; - SetKindOfDimension (AIS_KOD_PLANEANGLE); myFirstPoint = theFirstPoint; myCenter = theSecondPoint; mySecondPoint = theThirdPoint; @@ -235,12 +226,10 @@ AIS_AngleDimension::AIS_AngleDimension (const gp_Pnt& theFirstPoint, AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theCone) : AIS_Dimension(), - myIsFlyoutLines (Standard_True), - myFlyout (15.0) + myIsFlyoutLines (Standard_True) { init(); myIsInitialized = Standard_False; - SetKindOfDimension (AIS_KOD_PLANEANGLE); myFirstShape = theCone; myShapesNumber = 1; } @@ -254,12 +243,10 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, const gp_Ax1& theAxis) : AIS_Dimension(), - myIsFlyoutLines (Standard_True), - myFlyout (15.0) + myIsFlyoutLines (Standard_True) { init(); myIsInitialized = Standard_False; - SetKindOfDimension (AIS_KOD_PLANEANGLE); myFirstShape = theFirstFace; mySecondShape = theSecondFace; myShapesNumber = 2; @@ -467,26 +454,6 @@ Standard_Boolean AIS_AngleDimension::initTwoFacesAngle () return Standard_True; } -//======================================================================= -//function : SetFlyout -//purpose : -//======================================================================= - -void AIS_AngleDimension::SetFlyout (const Standard_Real theFlyout) -{ - myFlyout = theFlyout; -} - -//======================================================================= -//function : GetFlyout -//purpose : -//======================================================================= - -Standard_Real AIS_AngleDimension::GetFlyout () const -{ - return myFlyout; -} - //======================================================================= //function : countDefaultPlane //purpose : @@ -1027,3 +994,22 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* setComputed (Standard_True); } + +//======================================================================= +//function : computeFlyoutSelection +//purpose : computes selection for flyouts +//======================================================================= + +void AIS_AngleDimension::computeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, + const Handle(AIS_DimensionOwner)& theOwner) +{ + if (!myIsFlyoutLines) + return; + + gp_Pnt aFirstAttach = myCenter.Translated (gp_Vec (myCenter, myFirstPoint).Normalized() * GetFlyout()); + gp_Pnt aSecondAttach = myCenter.Translated (gp_Vec (myCenter, mySecondPoint).Normalized() * GetFlyout()); + Handle(Select3D_SensitiveGroup) aSensitiveEntity = new Select3D_SensitiveGroup (theOwner); + aSensitiveEntity->Add (new Select3D_SensitiveSegment (theOwner, myCenter, aFirstAttach)); + aSensitiveEntity->Add (new Select3D_SensitiveSegment (theOwner, myCenter, aSecondAttach)); + theSelection->Add (aSensitiveEntity); +} \ No newline at end of file diff --git a/src/AIS/AIS_AngleDimension.hxx b/src/AIS/AIS_AngleDimension.hxx index d783959482..9e1f893f6f 100644 --- a/src/AIS/AIS_AngleDimension.hxx +++ b/src/AIS/AIS_AngleDimension.hxx @@ -93,13 +93,6 @@ public: const TopoDS_Face& theSecondFace, const gp_Ax1& theAxis); - //! Sets the flyout. - Standard_EXPORT void SetFlyout (const Standard_Real theFlyout); - - //! Returns flyout value. If value > 0 the dimension is to be displayed inside the angle. - //! Otherwise it is displayed outside one. - Standard_EXPORT Standard_Real GetFlyout() const; - //! Sets first shape Standard_EXPORT void SetFirstShape (const TopoDS_Shape& theShape, const Standard_Boolean isSingleShape = Standard_False); @@ -156,6 +149,10 @@ protected: //! Fills default plane object if it is possible to count plane automatically. Standard_EXPORT virtual void countDefaultPlane (); + + //! Fills sensitive entity for flyouts and adds it to the selection + Standard_EXPORT virtual void computeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, + const Handle(AIS_DimensionOwner)& theOwner); protected: @@ -165,13 +162,6 @@ protected: //! The center of dimension arc gp_Pnt myCenter; - - //! Defines flyout lines and direction - //! Flyout direction in the working plane (stored in the base AIS_Dimension). - //! can be negative , or positive and is defined by the sign of value. - //! The direction vector is counting using the working plane. - //! value defined the size of flyout (radius of angle). - Standard_Real myFlyout; }; #endif diff --git a/src/AIS/AIS_DiameterDimension.cxx b/src/AIS/AIS_DiameterDimension.cxx index 8070b19f9f..9431bc13a9 100755 --- a/src/AIS/AIS_DiameterDimension.cxx +++ b/src/AIS/AIS_DiameterDimension.cxx @@ -71,7 +71,6 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_DiameterDimension, AIS_Dimension) AIS_DiameterDimension::AIS_DiameterDimension(const gp_Circ& theCircle) : AIS_Dimension(), - myFlyout (0.0), myCircle (theCircle) { SetKindOfDimension(AIS_KOD_DIAMETER); @@ -90,7 +89,6 @@ AIS_DiameterDimension::AIS_DiameterDimension(const gp_Circ& theCircle) AIS_DiameterDimension::AIS_DiameterDimension(const gp_Circ& theCircle, const gp_Pnt& theAttachPoint) : AIS_Dimension(), - myFlyout (0.0), myCircle (theCircle) { SetKindOfDimension(AIS_KOD_DIAMETER); @@ -119,7 +117,6 @@ AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle, const Handle(Prs3d_DimensionAspect)& theDimensionStyle, const Standard_Real theExtensionSize /*= 1.0*/) : AIS_Dimension (theExtensionSize), - myFlyout (0.0), myCircle (theCircle) { SetKindOfDimension(AIS_KOD_DIAMETER); @@ -135,8 +132,7 @@ AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle, //======================================================================= AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape) -: AIS_Dimension (), - myFlyout (0.) +: AIS_Dimension () { SetKindOfDimension(AIS_KOD_DIAMETER); SetSpecialSymbol (0x00D8); @@ -175,7 +171,6 @@ void AIS_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& gp_Dir aTargetPointsVector = gce_MakeDir (myFirstPoint, mySecondPoint); // Count a flyout direction vector. gp_Dir aFlyoutVector = aWorkingPlaneNormal.Direction()^aTargetPointsVector; - gp_Ax3 aLocalSystem (myFirstPoint, aTargetPointsVector, aFlyoutVector); // Create lines for layouts gp_Lin aLine1 (myFirstPoint, aFlyoutVector); @@ -227,23 +222,3 @@ void AIS_DiameterDimension::countDefaultPlane () // Set computed value to ResetWorkingPlane (); } - -//======================================================================= -//function : SetFlyout -//purpose : -//======================================================================= - -void AIS_DiameterDimension::SetFlyout (const Standard_Real theFlyout) -{ - myFlyout = theFlyout; -} - -//======================================================================= -//function : GetFlyout -//purpose : -//======================================================================= - -Standard_Real AIS_DiameterDimension::GetFlyout () const -{ - return myFlyout; -} diff --git a/src/AIS/AIS_DiameterDimension.hxx b/src/AIS/AIS_DiameterDimension.hxx index e2efbc14b4..c6221a702b 100644 --- a/src/AIS/AIS_DiameterDimension.hxx +++ b/src/AIS/AIS_DiameterDimension.hxx @@ -53,11 +53,6 @@ public: Standard_EXPORT AIS_DiameterDimension (const TopoDS_Shape& theShape); - - Standard_EXPORT void SetFlyout(const Standard_Real theFlyout); - - Standard_EXPORT Standard_Real GetFlyout () const; - DEFINE_STANDARD_RTTI(AIS_DiameterDimension) protected: @@ -74,12 +69,6 @@ private: // Fields - //! Defines flyout lines and direction - //! Flyout direction in the working plane (stored in the base AIS_Dimension). - //! can be negative , or positive and is defined by the sign of value. - //! The direction vector is counting using the working plane. - //! value defined the size of flyout. - Standard_Real myFlyout; gp_Circ myCircle; }; #endif diff --git a/src/AIS/AIS_Dimension.cxx b/src/AIS/AIS_Dimension.cxx index c4be69592e..e6f0e34a3b 100644 --- a/src/AIS/AIS_Dimension.cxx +++ b/src/AIS/AIS_Dimension.cxx @@ -93,6 +93,7 @@ AIS_Dimension::AIS_Dimension (const Standard_Real theExtensionSize /*= 1.0*/) myIsTextReversed (Standard_False), myTextOffset (DimensionAspect()->ArrowAspect()->Length()), myIsInitialized (Standard_False), + myFlyout (0.0), myKindOfDimension (AIS_KOD_NONE), myExtensionSize (theExtensionSize) { @@ -122,6 +123,7 @@ AIS_Dimension::AIS_Dimension (const Handle(Prs3d_DimensionAspect)& theAspect, myIsTextReversed (Standard_False), myTextOffset (DimensionAspect()->ArrowAspect()->Length()), myIsInitialized (Standard_False), + myFlyout (0.0), myKindOfDimension (AIS_KOD_NONE), myExtensionSize (theExtensionSize) { @@ -1293,6 +1295,53 @@ Standard_Real AIS_Dimension::SelToleranceForText2d() const return myGeom.mySelToleranceForText2d; } +//======================================================================= +//function : SetFlyout +//purpose : +//======================================================================= + +void AIS_Dimension::SetFlyout (const Standard_Real theFlyout) +{ + myFlyout = theFlyout; +} + +//======================================================================= +//function : GetFlyout +//purpose : +//======================================================================= + +Standard_Real AIS_Dimension::GetFlyout () const +{ + return myFlyout; +} + +//======================================================================= +//function : computeFlyoutSelection +//purpose : computes selection for flyouts +//======================================================================= + +void AIS_Dimension::computeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, + const Handle(AIS_DimensionOwner)& theOwner) +{ + //Count flyout direction + gp_Ax1 aWorkingPlaneNormal = GetWorkingPlane().Axis(); + gp_Dir aTargetPointsVector = gce_MakeDir (myFirstPoint, mySecondPoint); + // Count a flyout direction vector. + gp_Dir aFlyoutVector = aWorkingPlaneNormal.Direction()^aTargetPointsVector; + // Create lines for layouts + gp_Lin aLine1 (myFirstPoint, aFlyoutVector); + gp_Lin aLine2 (mySecondPoint, aFlyoutVector); + // Get flyout end points + gp_Pnt aFlyoutEnd1 = ElCLib::Value (ElCLib::Parameter (aLine1, myFirstPoint) + GetFlyout(), aLine1); + gp_Pnt aFlyoutEnd2 = ElCLib::Value (ElCLib::Parameter (aLine2, mySecondPoint) + GetFlyout(), aLine2); + + // Fill sensitive entity for flyouts + Handle(Select3D_SensitiveGroup) aSensitiveEntity = new Select3D_SensitiveGroup (theOwner); + aSensitiveEntity->Add (new Select3D_SensitiveSegment (theOwner, myFirstPoint, aFlyoutEnd1)); + aSensitiveEntity->Add (new Select3D_SensitiveSegment (theOwner, mySecondPoint, aFlyoutEnd2)); + theSelection->Add (aSensitiveEntity); +} + //======================================================================= //function : ComputeSelection //purpose : @@ -1306,7 +1355,7 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele return; } - Handle( Select3D_SensitiveGroup) aSensitiveForLine; + Handle(Select3D_SensitiveGroup) aSensitiveForLine; Handle(Select3D_SensitiveEntity) aSensitiveForText; Select3D_ListOfSensitive aSensitiveList; aSensitiveList.Assign (myGeom.mySensitiveSegments); @@ -1338,6 +1387,8 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele Handle(AIS_DimensionOwner) aTextOwner = new AIS_DimensionOwner (this, AIS_DDM_Text, 7); aSensitiveForText->Set (aTextOwner); } + else + computeFlyoutSelection (theSelection, anOwner); theSelection->Add (aSensitiveForLine); theSelection->Add (aSensitiveForText); diff --git a/src/AIS/AIS_Dimension.hxx b/src/AIS/AIS_Dimension.hxx index 37b2494f1b..f8d33ee024 100644 --- a/src/AIS/AIS_Dimension.hxx +++ b/src/AIS/AIS_Dimension.hxx @@ -20,6 +20,7 @@ #define _AIS_Dimension_Headerfile #include +#include #include #include #include @@ -157,7 +158,10 @@ public: //! For 2d text selection detection sensitive point with tolerance is used //! Important! Only for 2d text Standard_EXPORT Standard_Real SelToleranceForText2d() const; - + //! Sets flyout size for dimension. + Standard_EXPORT void SetFlyout (const Standard_Real theFlyout); + //! @return flyout size for dimension. + Standard_EXPORT Standard_Real GetFlyout () const; DEFINE_STANDARD_RTTI(AIS_Dimension) @@ -224,6 +228,9 @@ protected: Standard_EXPORT void resetGeom(); + //! Fills sensitive entity for flyouts and adds it to the selection. + Standard_EXPORT virtual void computeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, + const Handle(AIS_DimensionOwner)& theOwner); // Fields protected: @@ -299,6 +306,12 @@ protected: TopoDS_Shape mySecondShape; //! Number of shapes Standard_Integer myShapesNumber; + //! Defines flyout lines and direction + //! Flyout direction in the working plane. + //! Can be negative, or positive and is defined by the sign of myFlyout value. + //! The direction vector is counting using the working plane. + //! myFlyout value defined the size of flyout. + Standard_Real myFlyout; //! Geometry of dimensions, needs for advanced selection //! Geometry is computed in Compute() method and is used //! in ComputeSelection() method. diff --git a/src/AIS/AIS_LengthDimension.cxx b/src/AIS/AIS_LengthDimension.cxx index 9a8f6d3808..22280a014e 100755 --- a/src/AIS/AIS_LengthDimension.cxx +++ b/src/AIS/AIS_LengthDimension.cxx @@ -91,8 +91,7 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, const gp_Pln& theDimensionPlane, const Handle(Prs3d_DimensionAspect)& theDimensionAspect, const Standard_Real theExtensionSize /*= 1.0*/) - :AIS_Dimension (theDimensionAspect,theExtensionSize), - myFlyout (15.) + :AIS_Dimension (theDimensionAspect,theExtensionSize) { myIsInitialized = Standard_True; myFirstPoint = theFirstPoint; @@ -100,6 +99,7 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, myShapesNumber = 2; myFirstShape = BRepLib_MakeVertex (myFirstPoint); mySecondShape = BRepLib_MakeVertex (mySecondPoint); + SetFlyout (15.0); SetKindOfDimension(AIS_KOD_LENGTH); SetWorkingPlane (theDimensionPlane); } @@ -112,8 +112,7 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint, const gp_Pln& theDimensionPlane) -: AIS_Dimension (), - myFlyout (15.) +: AIS_Dimension () { myIsInitialized = Standard_True; myFirstPoint = theFirstPoint; @@ -121,6 +120,7 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, myFirstShape = BRepLib_MakeVertex (myFirstPoint); mySecondShape = BRepLib_MakeVertex (mySecondPoint); myShapesNumber = 2; + SetFlyout (15.0); SetKindOfDimension (AIS_KOD_LENGTH); SetWorkingPlane (theDimensionPlane); } @@ -133,13 +133,13 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape, const TopoDS_Shape& theSecondShape, const gp_Pln& theWorkingPlane) -: AIS_Dimension (), - myFlyout (15.) +: AIS_Dimension () { myIsInitialized = Standard_False; myFirstShape = theFirstShape; mySecondShape = theSecondShape; myShapesNumber = 2; + SetFlyout (15.0); SetKindOfDimension (AIS_KOD_LENGTH); SetWorkingPlane (theWorkingPlane); } @@ -151,12 +151,12 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape, AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge, const gp_Pln& theWorkingPlane) -: AIS_Dimension (), - myFlyout (15.) +: AIS_Dimension () { myIsInitialized = Standard_False; myFirstShape = theEdge; myShapesNumber = 1; + SetFlyout (15.0); SetKindOfDimension (AIS_KOD_LENGTH); SetWorkingPlane (theWorkingPlane); } @@ -168,13 +168,13 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge, AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace) -: AIS_Dimension (), - myFlyout (15.) +: AIS_Dimension () { myIsInitialized = Standard_False; myFirstShape = theFirstFace; mySecondShape = theSecondFace; myShapesNumber = 2; + SetFlyout (15.0); SetKindOfDimension(AIS_KOD_LENGTH); } @@ -185,14 +185,14 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace, AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge) - : AIS_Dimension (), - myFlyout (15.) + : AIS_Dimension () { SetKindOfDimension(AIS_KOD_LENGTH); myIsInitialized = Standard_False; myFirstShape = theFace; mySecondShape = theEdge; myShapesNumber = 2; + SetFlyout (15.0); } //======================================================================= @@ -582,7 +582,6 @@ void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& / gp_Dir aTargetPointsVector = gce_MakeDir (myFirstPoint, mySecondPoint); // Count a flyout direction vector. gp_Dir aFlyoutVector = aWorkingPlaneNormal.Direction()^aTargetPointsVector; - gp_Ax3 aLocalSystem (myFirstPoint, aTargetPointsVector, aFlyoutVector); // Create lines for layouts gp_Lin aLine1 (myFirstPoint, aFlyoutVector); @@ -618,23 +617,3 @@ void AIS_LengthDimension::computeValue () myValue = myFirstPoint.Distance (mySecondPoint); AIS_Dimension::computeValue (); } - -//======================================================================= -//function : SetFlyout -//purpose : -//======================================================================= - -void AIS_LengthDimension::SetFlyout (const Standard_Real theFlyout) -{ - myFlyout = theFlyout; -} - -//======================================================================= -//function : GetFlyout -//purpose : -//======================================================================= - -Standard_Real AIS_LengthDimension::GetFlyout () const -{ - return myFlyout; -} diff --git a/src/AIS/AIS_LengthDimension.hxx b/src/AIS/AIS_LengthDimension.hxx index c705da576a..0d1207ea66 100644 --- a/src/AIS/AIS_LengthDimension.hxx +++ b/src/AIS/AIS_LengthDimension.hxx @@ -94,10 +94,6 @@ public: Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge); - Standard_EXPORT void SetFlyout (const Standard_Real theFlyout); - - Standard_EXPORT Standard_Real GetFlyout () const; - DEFINE_STANDARD_RTTI(AIS_LengthDimension) private: Standard_Boolean initTwoEdgesLength (const TopoDS_Edge & theFirstEdge, @@ -126,14 +122,7 @@ private: virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0) ; - // Fields - //! Defines flyout lines and direction - //! Flyout direction in the working plane (stored in the base AIS_Dimension). - //! can be negative , or positive and is defined by the sign of value. - //! The direction vector is counting using the working plane. - //! value defined the size of flyout. - Standard_Real myFlyout; }; #endif diff --git a/src/AIS/AIS_RadiusDimension.cxx b/src/AIS/AIS_RadiusDimension.cxx index 058547e430..9b424752e0 100755 --- a/src/AIS/AIS_RadiusDimension.cxx +++ b/src/AIS/AIS_RadiusDimension.cxx @@ -75,7 +75,6 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_RadiusDimension, AIS_Dimension) AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle) : AIS_Dimension(), - myFlyout (0.0), myCircle (theCircle) { myFirstPoint = ElCLib::Value(0, myCircle); @@ -89,7 +88,6 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle) AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle, const gp_Pnt& theAttachPoint) : AIS_Dimension(), - myFlyout (0.0), myCircle (theCircle) { myFirstPoint = theAttachPoint; @@ -106,8 +104,7 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle, //======================================================================= AIS_RadiusDimension::AIS_RadiusDimension (const TopoDS_Shape& theShape) -: AIS_Dimension (), - myFlyout (0.0) +: AIS_Dimension () { myFirstShape = theShape; myIsInitialized = Standard_False; @@ -126,7 +123,6 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle, const Standard_Real theExtensionSize/* = 1.0*/) : AIS_Dimension (theDimensionAspect,theExtensionSize), - myFlyout (0.0), myCircle (theCircle) { myFirstPoint = ElCLib::Value(0, myCircle); @@ -146,7 +142,6 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle, const Handle(Prs3d_DimensionAspect)& theDimensionAspect, const Standard_Real theExtensionSize/* = 1.0*/) : AIS_Dimension (theDimensionAspect,theExtensionSize), - myFlyout (0.0), myCircle (theCircle) { myFirstPoint = theAttachPoint; @@ -161,9 +156,9 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle, //purpose : //======================================================================= -void AIS_RadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) +void AIS_RadiusDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, + const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Integer theMode) { thePresentation->Clear(); @@ -190,7 +185,6 @@ void AIS_RadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& /* gp_Dir aTargetPointsVector = gce_MakeDir (myFirstPoint, mySecondPoint); // Count a flyout direction vector. gp_Dir aFlyoutVector = aWorkingPlaneNormal.Direction()^aTargetPointsVector; - gp_Ax3 aLocalSystem (myFirstPoint, aTargetPointsVector, aFlyoutVector); // Create lines for layouts gp_Lin aLine1 (myFirstPoint, aFlyoutVector); @@ -242,23 +236,3 @@ void AIS_RadiusDimension::countDefaultPlane () // Set computed value to ResetWorkingPlane (); } - -//======================================================================= -//function : SetFlyout -//purpose : -//======================================================================= - -void AIS_RadiusDimension::SetFlyout (const Standard_Real theFlyout) -{ - myFlyout = theFlyout; -} - -//======================================================================= -//function : GetFlyout -//purpose : -//======================================================================= - -Standard_Real AIS_RadiusDimension::GetFlyout () const -{ - return myFlyout; -} diff --git a/src/AIS/AIS_RadiusDimension.hxx b/src/AIS/AIS_RadiusDimension.hxx index 8ce04ef3fe..88bbe8b4f4 100644 --- a/src/AIS/AIS_RadiusDimension.hxx +++ b/src/AIS/AIS_RadiusDimension.hxx @@ -61,10 +61,6 @@ public: //! shape aShape, the dimension aVal, and the text aText. Standard_EXPORT AIS_RadiusDimension (const TopoDS_Shape& aShape); - Standard_EXPORT void SetFlyout (const Standard_Real theFlyoutSize); - - Standard_EXPORT Standard_Real GetFlyout () const; - DEFINE_STANDARD_RTTI(AIS_RadiusDimension) protected: @@ -80,12 +76,6 @@ private: // Fields - //! Defines flyout lines and direction - //! Flyout direction in the working plane (stored in the base AIS_Dimension). - //! can be negative , or positive and is defined by the sign of value. - //! The direction vector is counting using the working plane. - //! value defined the size of flyout. - Standard_Real myFlyout; gp_Circ myCircle; }; #endif diff --git a/tests/bugs/vis/bug24293 b/tests/bugs/vis/bug24293 new file mode 100644 index 0000000000..b9e829e4a0 --- /dev/null +++ b/tests/bugs/vis/bug24293 @@ -0,0 +1,25 @@ +puts "============" +puts "CR24293" +puts "============" +puts "" +####################################################################### +# Dimension flyout lines don't belong to the dimension sensitive entity. +####################################################################### +pload VISUALIZATION + +vinit +vpoint lengthP1 0 0 0 +vpoint lengthP2 10 10 10 +vdim -length -name=dim1 -plane=xoy lengthP1 lengthP2 +vdisplay dim1 +vfit +vmoveto 202 191 + +set x_coord 272 +set y_coord 198 +checkcolor $x_coord $y_coord 0 1 1 +if { $stat != 1 } { + puts "Error : Highlighting of length dimension is wrong." +} + +set only_screen 1