mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0024420: Add methods to switch the type of sensitivity in AIS_Circle and AIS_Plane
Added methods to AIS_Circle and AIS_Plane for switching type of sensitivity By default AIS_Circle and AIS_Plane have boundary sensitivity
This commit is contained in:
@@ -45,15 +45,15 @@ is
|
||||
returns mutable Circle from AIS;
|
||||
---Purpose: Initializes this algorithm for constructing AIS circle
|
||||
-- datums initializes the circle aCircle
|
||||
Create(aCircle : Circle from Geom;
|
||||
aUStart : Real from Standard;
|
||||
aUEnd : Real from Standard;
|
||||
aSens : Boolean from Standard = Standard_True)
|
||||
Create(theCircle : Circle from Geom;
|
||||
theUStart : Real from Standard;
|
||||
theUEnd : Real from Standard;
|
||||
theIsFilledCircleSens : Boolean from Standard = Standard_False)
|
||||
returns mutable Circle from AIS;
|
||||
---Purpose: Initializes this algorithm for constructing AIS circle datums.
|
||||
-- Initializes the circle aCircle, the arc
|
||||
-- starting point UStart, the arc ending point UEnd,
|
||||
-- and the direction aSens.
|
||||
---Purpose: Initializes this algorithm for constructing AIS circle datums.
|
||||
-- Initializes the circle theCircle, the arc
|
||||
-- starting point theUStart, the arc ending point theUEnd,
|
||||
-- and the type of sensitivity theIsFilledCircleSens.
|
||||
|
||||
Compute(me : mutable;
|
||||
aPresentationManager: PresentationManager3d from PrsMgr;
|
||||
@@ -136,6 +136,15 @@ is
|
||||
is redefined static;
|
||||
---Purpose: Removes width settings from the solid line boundary of the circle datum.
|
||||
|
||||
IsFilledCircleSens (me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
---Purpose: Returns the type of sensitivity for the circle;
|
||||
|
||||
SetFilledCircleSens (me: mutable;
|
||||
theIsFilledCircleSens : Boolean from Standard);
|
||||
---C++: inline
|
||||
---Purpose: Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to Standard_True
|
||||
-- then the whole circle will be detectable, otherwise only the boundary of the circle.
|
||||
|
||||
ComputeCircle(me: mutable;
|
||||
aPresentation : mutable Presentation from Prs3d)
|
||||
@@ -159,6 +168,6 @@ fields
|
||||
myUStart : Real from Standard;
|
||||
myUEnd : Real from Standard;
|
||||
myCircleIsArc : Boolean from Standard;
|
||||
mySens : Boolean from Standard;
|
||||
myIsFilledCircleSens : Boolean from Standard;
|
||||
|
||||
end Circle ;
|
||||
|
@@ -48,7 +48,8 @@ AIS_InteractiveObject(PrsMgr_TOP_AllView),
|
||||
myComponent(aComponent),
|
||||
myUStart(0.),
|
||||
myUEnd(2*M_PI),
|
||||
myCircleIsArc(Standard_False)
|
||||
myCircleIsArc(Standard_False),
|
||||
myIsFilledCircleSens (Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -56,17 +57,17 @@ myCircleIsArc(Standard_False)
|
||||
//function : AIS_Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
AIS_Circle::AIS_Circle(const Handle(Geom_Circle)& aComponent,
|
||||
const Standard_Real aUStart,
|
||||
const Standard_Real aUEnd,
|
||||
const Standard_Boolean aSens):
|
||||
AIS_InteractiveObject(PrsMgr_TOP_AllView)
|
||||
AIS_Circle::AIS_Circle(const Handle(Geom_Circle)& theComponent,
|
||||
const Standard_Real theUStart,
|
||||
const Standard_Real theUEnd,
|
||||
const Standard_Boolean theIsFilledCircleSens)
|
||||
: AIS_InteractiveObject(PrsMgr_TOP_AllView),
|
||||
myComponent (theComponent),
|
||||
myUStart (theUStart),
|
||||
myUEnd (theUEnd),
|
||||
myCircleIsArc (Standard_True),
|
||||
myIsFilledCircleSens (theIsFilledCircleSens)
|
||||
{
|
||||
myComponent = aComponent;
|
||||
myUStart = aUStart;
|
||||
myUEnd = aUEnd;
|
||||
mySens = aSens;
|
||||
myCircleIsArc = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -236,8 +237,9 @@ void AIS_Circle::ComputeArc( const Handle(Prs3d_Presentation)& aPresentation)
|
||||
void AIS_Circle::ComputeCircleSelection(const Handle(SelectMgr_Selection)& aSelection)
|
||||
{
|
||||
Handle(SelectMgr_EntityOwner) eown = new SelectMgr_EntityOwner(this);
|
||||
Handle(Select3D_SensitiveCircle) seg = new Select3D_SensitiveCircle(eown,
|
||||
myComponent);
|
||||
Handle(Select3D_SensitiveCircle) seg = new Select3D_SensitiveCircle (eown,
|
||||
myComponent,
|
||||
myIsFilledCircleSens);
|
||||
aSelection->Add(seg);
|
||||
}
|
||||
//=======================================================================
|
||||
@@ -250,8 +252,10 @@ void AIS_Circle::ComputeArcSelection(const Handle(SelectMgr_Selection)& aSelecti
|
||||
|
||||
|
||||
Handle(SelectMgr_EntityOwner) eown = new SelectMgr_EntityOwner(this);
|
||||
Handle(Select3D_SensitiveCircle) seg = new Select3D_SensitiveCircle(eown,
|
||||
myComponent,myUStart,myUEnd);
|
||||
Handle(Select3D_SensitiveCircle) seg = new Select3D_SensitiveCircle (eown,
|
||||
myComponent,
|
||||
myUStart, myUEnd,
|
||||
myIsFilledCircleSens);
|
||||
aSelection->Add(seg);
|
||||
}
|
||||
|
||||
|
@@ -39,3 +39,13 @@ inline void AIS_Circle::SetFirstParam(const Standard_Real U)
|
||||
{myUStart=U;myCircleIsArc = Standard_True;}
|
||||
inline void AIS_Circle::SetLastParam(const Standard_Real U)
|
||||
{myUEnd=U; myCircleIsArc = Standard_True;}
|
||||
|
||||
inline Standard_Boolean AIS_Circle::IsFilledCircleSens() const
|
||||
{
|
||||
return myIsFilledCircleSens;
|
||||
}
|
||||
|
||||
inline void AIS_Circle::SetFilledCircleSens (const Standard_Boolean theIsFilledCircleSens)
|
||||
{
|
||||
myIsFilledCircleSens = theIsFilledCircleSens;
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ uses
|
||||
NameOfColor from Quantity,
|
||||
Color from Quantity,
|
||||
Selection from SelectMgr,
|
||||
TypeOfSensitivity from Select3D,
|
||||
Pnt from gp,
|
||||
Projector from Prs3d,
|
||||
Transformation from Geom,
|
||||
@@ -187,6 +188,15 @@ is
|
||||
SetContext(me:mutable; aCtx : InteractiveContext from AIS) is redefined;
|
||||
---Purpose: connection to <aCtx> default drawer implies a recomputation of Frame values.
|
||||
|
||||
TypeOfSensitivity (me) returns TypeOfSensitivity from Select3D;
|
||||
---C++: inline
|
||||
---Purpose: Returns the type of sensitivity for the plane;
|
||||
|
||||
SetTypeOfSensitivity (me: mutable;
|
||||
theTypeOfSensitivity: TypeOfSensitivity from Select3D);
|
||||
---C++: inline
|
||||
---Purpose: Sets the type of sensitivity for the plane.
|
||||
|
||||
-- Methods from PresentableObject
|
||||
|
||||
Compute(me : mutable;
|
||||
@@ -249,5 +259,6 @@ fields
|
||||
myTypeOfPlane : TypeOfPlane from AIS;
|
||||
myIsXYZPlane : Boolean from Standard;
|
||||
myHasOwnSize : Boolean from Standard;
|
||||
myTypeOfSensitivity: TypeOfSensitivity from Select3D;
|
||||
|
||||
end Plane;
|
||||
|
@@ -74,7 +74,8 @@ myCenter(gp_Pnt(0.,0.,0.)),
|
||||
myCurrentMode(aCurrentMode),
|
||||
myAutomaticPosition(Standard_True),
|
||||
myTypeOfPlane(AIS_TOPL_Unknown),
|
||||
myIsXYZPlane(Standard_False)
|
||||
myIsXYZPlane(Standard_False),
|
||||
myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
|
||||
{
|
||||
InitDrawerAttributes();
|
||||
}
|
||||
@@ -91,7 +92,8 @@ myCenter(aCenter),
|
||||
myCurrentMode(aCurrentMode),
|
||||
myAutomaticPosition(Standard_True),
|
||||
myTypeOfPlane(AIS_TOPL_Unknown),
|
||||
myIsXYZPlane(Standard_False)
|
||||
myIsXYZPlane(Standard_False),
|
||||
myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
|
||||
{
|
||||
InitDrawerAttributes();
|
||||
}
|
||||
@@ -112,7 +114,8 @@ myPmax(aPmax),
|
||||
myCurrentMode(aCurrentMode),
|
||||
myAutomaticPosition(Standard_False),
|
||||
myTypeOfPlane(AIS_TOPL_Unknown),
|
||||
myIsXYZPlane(Standard_False)
|
||||
myIsXYZPlane(Standard_False),
|
||||
myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
|
||||
{
|
||||
InitDrawerAttributes();
|
||||
SetHilightMode(0);
|
||||
@@ -129,7 +132,8 @@ myAx2(aComponent),
|
||||
myCurrentMode(aCurrentMode),
|
||||
myAutomaticPosition(Standard_True),
|
||||
myTypeOfPlane(aPlaneType),
|
||||
myIsXYZPlane(Standard_True)
|
||||
myIsXYZPlane(Standard_True),
|
||||
myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
|
||||
{
|
||||
InitDrawerAttributes();
|
||||
ComputeFields();
|
||||
@@ -325,7 +329,7 @@ void AIS_Plane::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
thegoodpl->D0(-lx,-ly,arr(3));
|
||||
thegoodpl->D0(-lx,ly,arr(4));
|
||||
arr(5) = arr(1);
|
||||
sfac = new Select3D_SensitiveFace(eown,harr,Select3D_TOS_BOUNDARY);
|
||||
sfac = new Select3D_SensitiveFace(eown,harr,myTypeOfSensitivity);
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -336,7 +340,7 @@ void AIS_Plane::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
arr1(2) = myPmin;
|
||||
arr1(3) = myPmax;
|
||||
arr1(4) = myCenter;
|
||||
sfac = new Select3D_SensitiveFace(eown,harr1,Select3D_TOS_BOUNDARY);
|
||||
sfac = new Select3D_SensitiveFace(eown,harr1,myTypeOfSensitivity);
|
||||
|
||||
}
|
||||
aSelection->Add(sfac);
|
||||
|
@@ -49,3 +49,13 @@ inline void AIS_Plane::SetCenter(const gp_Pnt& aCenter)
|
||||
{
|
||||
myCenter = aCenter;
|
||||
}
|
||||
|
||||
inline Select3D_TypeOfSensitivity AIS_Plane::TypeOfSensitivity() const
|
||||
{
|
||||
return myTypeOfSensitivity;
|
||||
}
|
||||
|
||||
inline void AIS_Plane::SetTypeOfSensitivity (const Select3D_TypeOfSensitivity theTypeOfSensitivity)
|
||||
{
|
||||
myTypeOfSensitivity = theTypeOfSensitivity;
|
||||
}
|
||||
|
Reference in New Issue
Block a user