mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024070: OpenGL capped object-level clipping planes
Graphical clipping: - Use "Graphic3d_ClipPlane" to defined clipping for PrsMgr_PresentableObject (local clipping), for V3d_View (global clipping). Get rid of old implementations: - Remove Visual3d_ClipPlane. - Port V3d_Plane to Graphic3d_ClipPlane core. Selection Sensitives: - Port "Matches" method to add full set of arguments (SelectBasics_PickArgs), including min-max depth coming from selector. - Get rid of transient data for pair Matches -> ComputeDepth. - Extend SelectMgr_ViewerSelector::LoadResult to work with local clipping, add virtual callbacks to compute globa/local depth clipping for picking. Capping rendering algorithm: - Recursive rendering algorithm for OpenGl_Groups. - Introduced Rendering filter for groups. Clipping plane management in TKOpenGl: - Added OpenGl_ClippingState to OpenGl_Context. DRAWEXE commands: - Ported "vclipplane" command for new approach. - Added "vsettexturemode" command for changing texture details in views (enable / disable textures). Correct DownCast syntax (compilation error) Fix new compiler warnings tests/bugs/vis/bug22906 migrated to the new vclipplane syntax
This commit is contained in:
@@ -31,10 +31,7 @@
|
||||
Select3D_SensitiveGroup::Select3D_SensitiveGroup(const Handle(SelectBasics_EntityOwner)& OwnerId,
|
||||
const Standard_Boolean MatchAll):
|
||||
Select3D_SensitiveEntity(OwnerId),
|
||||
myMustMatchAll(MatchAll),
|
||||
myLastRank(0),
|
||||
myX(0.),
|
||||
myY(0.)
|
||||
myMustMatchAll(MatchAll)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -47,10 +44,7 @@ Select3D_SensitiveGroup::Select3D_SensitiveGroup(const Handle(SelectBasics_Entit
|
||||
Select3D_ListOfSensitive& TheList,
|
||||
const Standard_Boolean MatchAll):
|
||||
Select3D_SensitiveEntity(OwnerId),
|
||||
myMustMatchAll(MatchAll),
|
||||
myLastRank(0),
|
||||
myX(0.),
|
||||
myY(0.)
|
||||
myMustMatchAll(MatchAll)
|
||||
{
|
||||
myList.Append(TheList);
|
||||
}
|
||||
@@ -124,8 +118,6 @@ void Select3D_SensitiveGroup::Clear()
|
||||
|
||||
void Select3D_SensitiveGroup::Project(const Handle(Select3D_Projector)& aProjector)
|
||||
{
|
||||
Select3D_SensitiveEntity::Project(aProjector); // to set the field last proj...
|
||||
|
||||
for(Select3D_ListIteratorOfListOfSensitive It(myList);It.More();It.Next())
|
||||
{
|
||||
It.Value()->Project(aProjector);
|
||||
@@ -215,28 +207,34 @@ void Select3D_SensitiveGroup::ResetLocation()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Select3D_SensitiveGroup::Matches(const Standard_Real X,
|
||||
const Standard_Real Y,
|
||||
const Standard_Real aTol,
|
||||
Standard_Real& DMin)
|
||||
Standard_Boolean Select3D_SensitiveGroup::Matches (const SelectBasics_PickArgs& thePickArgs,
|
||||
Standard_Real& theMatchDMin,
|
||||
Standard_Real& theMatchDepth)
|
||||
{
|
||||
myLastRank = 0;
|
||||
myLastTol = (Standard_ShortReal)aTol;
|
||||
for(Select3D_ListIteratorOfListOfSensitive It(myList);It.More();It.Next()){
|
||||
myLastRank++;
|
||||
if (It.Value()->Matches (X, Y, aTol, DMin))
|
||||
theMatchDMin = RealLast();
|
||||
theMatchDepth = RealLast();
|
||||
Standard_Real aChildDMin, aChildDepth;
|
||||
Standard_Boolean isMatched = Standard_False;
|
||||
|
||||
Select3D_ListIteratorOfListOfSensitive anIt (myList);
|
||||
for (; anIt.More(); anIt.Next())
|
||||
{
|
||||
Handle(SelectBasics_SensitiveEntity)& aChild = anIt.Value();
|
||||
if (!aChild->Matches (thePickArgs, aChildDMin, aChildDepth))
|
||||
{
|
||||
myX = (Standard_ShortReal)X;
|
||||
myY = (Standard_ShortReal)Y;
|
||||
myLastTol = (Standard_ShortReal)aTol;
|
||||
// compute and validate the depth (will call ::ComputeDepth())
|
||||
return Select3D_SensitiveEntity::Matches (X, Y, aTol, DMin);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isMatched)
|
||||
{
|
||||
theMatchDMin = aChildDMin;
|
||||
isMatched = Standard_True;
|
||||
}
|
||||
|
||||
theMatchDepth = Min (aChildDepth, theMatchDepth);
|
||||
}
|
||||
// no match
|
||||
myLastRank = 0;
|
||||
SetLastDepth (ShortRealLast());
|
||||
return Standard_False;
|
||||
|
||||
return isMatched;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -301,37 +299,6 @@ Matches (const TColgp_Array1OfPnt2d& aPoly,
|
||||
return result;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeDepth
|
||||
//purpose : to optimise, the minimum depth for
|
||||
// entities that answer YES to Matches(X,Y,...) is taken
|
||||
// the test is started from mylastRank...
|
||||
//=======================================================================
|
||||
Standard_Real Select3D_SensitiveGroup::ComputeDepth(const gp_Lin& EyeLine) const
|
||||
{
|
||||
Standard_Integer currank = 0;
|
||||
Standard_Real DMin, thedepth (Precision::Infinite());
|
||||
for (Select3D_ListIteratorOfListOfSensitive It(myList);It.More();It.Next())
|
||||
{
|
||||
currank++;
|
||||
if (currank >= myLastRank)
|
||||
{
|
||||
// this recomputes and validates the depth for the entity
|
||||
if (It.Value()->Matches (myX, myY, myLastTol, DMin))
|
||||
{
|
||||
It.Value()->ComputeDepth (EyeLine);
|
||||
if (It.Value()->Depth() < thedepth)
|
||||
{
|
||||
// search for topmost entity
|
||||
thedepth = It.Value()->Depth();
|
||||
//myLastRank = currank; // can not do this here...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return thedepth;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MaxBoxes
|
||||
//purpose :
|
||||
@@ -346,18 +313,6 @@ Standard_Integer Select3D_SensitiveGroup::MaxBoxes() const
|
||||
return nbboxes;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLastPrj
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Select3D_SensitiveGroup::SetLastPrj(const Handle(Select3D_Projector)& Prj)
|
||||
{
|
||||
Select3D_SensitiveEntity::SetLastPrj(Prj);
|
||||
for(Select3D_ListIteratorOfListOfSensitive It(myList);It.More();It.Next())
|
||||
It.Value()->SetLastPrj(Prj);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
|
Reference in New Issue
Block a user