mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0026272: Visualization - provide a possibility to activate selection modes without opening local context
- picked or selected objects are now highlighted via owners instead of interactive objects; - support methods for owners were added to AIS_InteractiveContext; - dynamically highlighted owners are now displayed in immediate mode; - selection without opening of local context is enabled by default; - added "-local" key to vselmode command to enable selection in local context; - selection filters are now completely supported in AIS_InteractiveContext; - the idea of differencing of selected items onto current (in interactive context) and selected (local selection) was eliminated; - all calls to "current" were replaced by calls to "selected" in terms of future local context removal; - AIS_InteractiveObject::mySelectionMode was removed; - now each selectable object can define own selection mode for "global" selection of the whole object; - whole object selection mode is 0 by default for all standard interactive objects; - immediate structures are now added to topmost and top layer lists; - added support of drawing immediate structures in different layers; - unused code for immediate mode was removed; - vfeedback and vexport commands now produce correct output for raytrace mode.
This commit is contained in:
parent
a7cb665a6a
commit
c3282ec170
@ -293,7 +293,7 @@ void CViewer2dDoc::OnBUTTONTestRect()
|
|||||||
Handle_AIS_Shape aRect2 = new AIS_Shape(W2);
|
Handle_AIS_Shape aRect2 = new AIS_Shape(W2);
|
||||||
myAISContext->Display(aRect2);
|
myAISContext->Display(aRect2);
|
||||||
myAISContext->SetColor(aRect2,Quantity_NOC_YELLOW);
|
myAISContext->SetColor(aRect2,Quantity_NOC_YELLOW);
|
||||||
myAISContext->SetSelectionMode(aRect2,2);
|
myAISContext->Activate(aRect2,2);
|
||||||
|
|
||||||
FitAll2DViews(Standard_True); // Update Viewer
|
FitAll2DViews(Standard_True); // Update Viewer
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ AIS_InteractiveObject(PrsMgr_TOP_ProjectorDependant)
|
|||||||
BRepPrimAPI_MakeCylinder S(R,H);
|
BRepPrimAPI_MakeCylinder S(R,H);
|
||||||
myShape = S.Shape();
|
myShape = S.Shape();
|
||||||
SetHilightMode(0);
|
SetHilightMode(0);
|
||||||
SetSelectionMode(0);
|
|
||||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||||
myPlanarFaceColor = Quantity_NOC_FIREBRICK3;
|
myPlanarFaceColor = Quantity_NOC_FIREBRICK3;
|
||||||
myCylindricalFaceColor = Quantity_NOC_GRAY;
|
myCylindricalFaceColor = Quantity_NOC_GRAY;
|
||||||
@ -48,7 +47,6 @@ AIS_InteractiveObject(PrsMgr_TOP_ProjectorDependant)
|
|||||||
BRepBuilderAPI_NurbsConvert aNurbsConvert(S.Shape());
|
BRepBuilderAPI_NurbsConvert aNurbsConvert(S.Shape());
|
||||||
myShape = aNurbsConvert.Shape();
|
myShape = aNurbsConvert.Shape();
|
||||||
SetHilightMode(0);
|
SetHilightMode(0);
|
||||||
SetSelectionMode(0);
|
|
||||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||||
myPlanarFaceColor = Quantity_NOC_FIREBRICK3;
|
myPlanarFaceColor = Quantity_NOC_FIREBRICK3;
|
||||||
myCylindricalFaceColor = Quantity_NOC_KHAKI4;
|
myCylindricalFaceColor = Quantity_NOC_KHAKI4;
|
||||||
|
@ -143,6 +143,10 @@ void AIS_InteractiveContext::Delete() const
|
|||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) anObj = anObjIter.Key();
|
Handle(AIS_InteractiveObject) anObj = anObjIter.Key();
|
||||||
anObj->SetContext (aNullContext);
|
anObj->SetContext (aNullContext);
|
||||||
|
for (anObj->Init(); anObj->More(); anObj->Next())
|
||||||
|
{
|
||||||
|
anObj->CurrentSelection()->UpdateBVHStatus (SelectMgr_TBU_Renew);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
MMgt_TShared::Delete();
|
MMgt_TShared::Delete();
|
||||||
}
|
}
|
||||||
@ -1069,7 +1073,44 @@ Standard_Boolean AIS_InteractiveContext::IsHilighted(const Handle(AIS_Interactiv
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsHilighted
|
||||||
|
//purpose : Returns true if the objects global status is set to highlighted.
|
||||||
|
// theIsCustomColor flag defines if highlight color is not equal to OCCT's
|
||||||
|
// default Quantity_NOC_WHITE color. If theIsCustomColor is true,
|
||||||
|
// custom highlight color name will be stored to theCustomColorName
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean AIS_InteractiveContext::IsHilighted (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||||
|
Standard_Boolean& theIsCustomColor,
|
||||||
|
Quantity_NameOfColor& theCustomColorName) const
|
||||||
|
{
|
||||||
|
if (theOwner.IsNull() || !theOwner->HasSelectable())
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
|
const Handle(AIS_InteractiveObject) anObj =
|
||||||
|
Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||||
|
|
||||||
|
if (!myObjects.IsBound (anObj))
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
|
const Handle(AIS_GlobalStatus)& anObjStatus = myObjects (anObj);
|
||||||
|
if (anObjStatus->IsHilighted())
|
||||||
|
{
|
||||||
|
if (anObjStatus->HilightColor() != Quantity_NOC_WHITE)
|
||||||
|
{
|
||||||
|
theIsCustomColor = Standard_True;
|
||||||
|
theCustomColorName = anObjStatus->HilightColor();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
theIsCustomColor = Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Standard_True;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsDisplayed
|
//function : IsDisplayed
|
||||||
@ -1541,6 +1582,12 @@ void AIS_InteractiveContext::SetDisplayMode (const AIS_DisplayMode theMode,
|
|||||||
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
|
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
|
||||||
{
|
{
|
||||||
myMainPM->Display (anObj, theMode);
|
myMainPM->Display (anObj, theMode);
|
||||||
|
if (!myLastPicked.IsNull() && myLastPicked->Selectable() == anObj)
|
||||||
|
{
|
||||||
|
myMainPM->BeginImmediateDraw();
|
||||||
|
myMainPM->Unhighlight (anObj, myDisplayMode);
|
||||||
|
myMainPM->EndImmediateDraw (myMainVwr);
|
||||||
|
}
|
||||||
if (aStatus->IsSubIntensityOn())
|
if (aStatus->IsSubIntensityOn())
|
||||||
{
|
{
|
||||||
myMainPM->Color (anObj, mySubIntensity, theMode);
|
myMainPM->Color (anObj, mySubIntensity, theMode);
|
||||||
@ -2074,6 +2121,19 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
|
|||||||
|
|
||||||
theIObj->SetWidth (theWidth);
|
theIObj->SetWidth (theWidth);
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||||
|
if (!myLastinMain.IsNull() && myLastinMain->Selectable() == theIObj)
|
||||||
|
{
|
||||||
|
if (myLastinMain->IsAutoHilight())
|
||||||
|
{
|
||||||
|
const Standard_Integer aHiMode =
|
||||||
|
theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
|
||||||
|
myLastinMain->HilightWithColor (myMainPM, myLastinMain->IsSelected() ? mySelectionColor : myHilightColor, aHiMode);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
theIObj->HilightOwnerWithColor (myMainPM, myLastinMain->IsSelected() ? mySelectionColor : myHilightColor, myLastinMain);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2290,7 +2350,6 @@ void AIS_InteractiveContext::Status (const Handle(AIS_InteractiveObject)& theIOb
|
|||||||
theStatus += TCollection_AsciiString (aDispModeIter.Value());
|
theStatus += TCollection_AsciiString (aDispModeIter.Value());
|
||||||
theStatus += "\n";
|
theStatus += "\n";
|
||||||
}
|
}
|
||||||
if (IsCurrent (theIObj)) theStatus +="\t| Current\n";
|
|
||||||
if (IsSelected(theIObj)) theStatus +="\t| Selected\n";
|
if (IsSelected(theIObj)) theStatus +="\t| Selected\n";
|
||||||
|
|
||||||
theStatus += "\t| Active Selection Modes in the MainViewer :\n";
|
theStatus += "\t| Active Selection Modes in the MainViewer :\n";
|
||||||
@ -2323,7 +2382,7 @@ void AIS_InteractiveContext::GetDefModes (const Handle(AIS_InteractiveObject)& t
|
|||||||
? myDisplayMode
|
? myDisplayMode
|
||||||
: 0);
|
: 0);
|
||||||
theHiMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : theDispMode;
|
theHiMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : theDispMode;
|
||||||
theSelMode = theIObj->HasSelectionMode() ? theIObj->SelectionMode() : -1;
|
theSelMode = theIObj->GlobalSelectionMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2365,7 +2424,7 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
myMainPM->SetVisibility (theIObj, aDispModeIter.Value(), Standard_False);
|
myMainPM->SetVisibility (theIObj, aDispModeIter.Value(), Standard_False);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsCurrent (theIObj)
|
if (IsSelected (theIObj)
|
||||||
&& !aStatus->IsDModeIn (aDispMode))
|
&& !aStatus->IsDModeIn (aDispMode))
|
||||||
{
|
{
|
||||||
myMainPM->SetVisibility (theIObj, aDispMode, Standard_False);
|
myMainPM->SetVisibility (theIObj, aDispMode, Standard_False);
|
||||||
@ -2375,6 +2434,7 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
{
|
{
|
||||||
mgrSelector->Deactivate (theIObj, aSelModeIter.Value(), myMainSel);
|
mgrSelector->Deactivate (theIObj, aSelModeIter.Value(), myMainSel);
|
||||||
}
|
}
|
||||||
|
aStatus->ClearSelectionModes();
|
||||||
aStatus->SetGraphicStatus (AIS_DS_Erased);
|
aStatus->SetGraphicStatus (AIS_DS_Erased);
|
||||||
|
|
||||||
if (theToUpdateviewer)
|
if (theToUpdateviewer)
|
||||||
@ -2383,6 +2443,31 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : unhighlightOwners
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void AIS_InteractiveContext::unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject)
|
||||||
|
{
|
||||||
|
Handle(AIS_Selection) aSel = AIS_Selection::Selection (myCurrentName.ToCString());
|
||||||
|
aSel->Init();
|
||||||
|
while (aSel->More())
|
||||||
|
{
|
||||||
|
const Handle(SelectMgr_EntityOwner) anOwner =
|
||||||
|
Handle(SelectMgr_EntityOwner)::DownCast (aSel->Value());
|
||||||
|
if (anOwner->Selectable() == theObject)
|
||||||
|
{
|
||||||
|
if (anOwner->IsSelected())
|
||||||
|
{
|
||||||
|
AddOrRemoveSelected (anOwner, Standard_False);
|
||||||
|
aSel->Init();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aSel->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ClearGlobal
|
//function : ClearGlobal
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -2401,27 +2486,11 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
|
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
|
||||||
|
unhighlightOwners (theIObj);
|
||||||
for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
|
for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
|
||||||
{
|
{
|
||||||
if (aStatus->IsHilighted())
|
|
||||||
{
|
|
||||||
if (IsCurrent (theIObj))
|
|
||||||
{
|
|
||||||
AddOrRemoveCurrentObject (theIObj, theToUpdateviewer);
|
|
||||||
}
|
|
||||||
else if (myMainPM->IsHighlighted (theIObj, aDispModeIter.Value()))
|
|
||||||
{
|
|
||||||
myMainPM->Unhighlight (theIObj, aDispModeIter.Value());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myMainPM->Erase (theIObj, aDispModeIter.Value());
|
myMainPM->Erase (theIObj, aDispModeIter.Value());
|
||||||
myMainPM->Clear (theIObj, aDispModeIter.Value());
|
myMainPM->Clear (theIObj, aDispModeIter.Value());
|
||||||
if (theIObj->HasHilightMode())
|
|
||||||
{
|
|
||||||
Standard_Integer im = theIObj->HilightMode();
|
|
||||||
myMainPM->Unhighlight (theIObj, im);
|
|
||||||
myMainPM->Erase (theIObj, im);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object removes from Detected sequence
|
// Object removes from Detected sequence
|
||||||
@ -2435,15 +2504,6 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myLastinMain == theIObj)
|
|
||||||
{
|
|
||||||
myLastinMain.Nullify();
|
|
||||||
}
|
|
||||||
if (myLastPicked == theIObj)
|
|
||||||
{
|
|
||||||
myLastPicked.Nullify();
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove IO from the selection manager to avoid memory leaks
|
// remove IO from the selection manager to avoid memory leaks
|
||||||
const Handle(SelectMgr_SelectableObject)& anObj = theIObj; // to avoid ambiguity
|
const Handle(SelectMgr_SelectableObject)& anObj = theIObj; // to avoid ambiguity
|
||||||
mgrSelector->Remove (anObj);
|
mgrSelector->Remove (anObj);
|
||||||
@ -2455,8 +2515,13 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
myMainVwr->DefinedView()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
|
myMainVwr->DefinedView()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theToUpdateviewer
|
if (!myLastinMain.IsNull() && myLastinMain->Selectable() == theIObj)
|
||||||
&& aStatus->GraphicStatus() == AIS_DS_Displayed)
|
myLastinMain.Nullify();
|
||||||
|
if (!myLastPicked.IsNull() && myLastPicked->Selectable() == theIObj)
|
||||||
|
myLastPicked.Nullify();
|
||||||
|
myMainPM->ClearImmediateDraw();
|
||||||
|
|
||||||
|
if (theToUpdateviewer && aStatus->GraphicStatus() == AIS_DS_Displayed)
|
||||||
{
|
{
|
||||||
myMainVwr->Update();
|
myMainVwr->Update();
|
||||||
}
|
}
|
||||||
@ -2599,25 +2664,6 @@ Standard_Boolean AIS_InteractiveContext::IsoOnPlane() const
|
|||||||
return myDefaultDrawer->IsoOnPlane();
|
return myDefaultDrawer->IsoOnPlane();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : SetSelectionMode
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void AIS_InteractiveContext::SetSelectionMode (const Handle(AIS_InteractiveObject)& ,
|
|
||||||
const Standard_Integer )
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : UnsetSelectionMode
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void AIS_InteractiveContext::UnsetSelectionMode (const Handle(AIS_InteractiveObject)& )
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetPixelTolerance
|
//function : SetPixelTolerance
|
||||||
//purpose : Disables the mechanism of adaptive tolerance calculation in
|
//purpose : Disables the mechanism of adaptive tolerance calculation in
|
||||||
|
@ -94,7 +94,7 @@ DEFINE_STANDARD_HANDLE(AIS_InteractiveContext, MMgt_TShared)
|
|||||||
//! - working on only a few objects,
|
//! - working on only a few objects,
|
||||||
//! - working on a single object.
|
//! - working on a single object.
|
||||||
//! 1. When you want ot work on one type of entity, you
|
//! 1. When you want ot work on one type of entity, you
|
||||||
//! should open a local context with the option
|
//! may open a local context with the option
|
||||||
//! UseDisplayedObjects set to false. DisplayedObjects
|
//! UseDisplayedObjects set to false. DisplayedObjects
|
||||||
//! allows you to recover the visualized Interactive
|
//! allows you to recover the visualized Interactive
|
||||||
//! Objects which have a given Type and
|
//! Objects which have a given Type and
|
||||||
@ -124,6 +124,14 @@ DEFINE_STANDARD_HANDLE(AIS_InteractiveContext, MMgt_TShared)
|
|||||||
//! of setting up the different contexts of
|
//! of setting up the different contexts of
|
||||||
//! selection/presentation according to the operation
|
//! selection/presentation according to the operation
|
||||||
//! which you want to perform.
|
//! which you want to perform.
|
||||||
|
|
||||||
|
//! Selection of parts of the objects can also be done without opening a local context.
|
||||||
|
//! Interactive context itself supports decomposed object selection with selection filters
|
||||||
|
//! support. Note that each selectable object must specify the selection mode that is
|
||||||
|
//! responsible for selection of object as a whole (global selection mode). By default, global
|
||||||
|
//! selection mode is equal to 0, but it might be redefined if needed. Sub-part selection
|
||||||
|
//! of the objects without using local context provides a possibility to activate part
|
||||||
|
//! selection modes along with global selection mode.
|
||||||
class AIS_InteractiveContext : public MMgt_TShared
|
class AIS_InteractiveContext : public MMgt_TShared
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -353,17 +361,7 @@ public:
|
|||||||
//! Object returns to the default selection mode; the
|
//! Object returns to the default selection mode; the
|
||||||
//! object is displayed but no viewer will be updated.
|
//! object is displayed but no viewer will be updated.
|
||||||
Standard_EXPORT void UnsetDisplayMode (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void UnsetDisplayMode (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Boolean updateviewer = Standard_True);
|
||||||
|
|
||||||
|
|
||||||
//! Sets the selection mode of Interactive Objects.
|
|
||||||
//! aMode provides the selection mode index of the entity aniobj.
|
|
||||||
Standard_EXPORT void SetSelectionMode (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Integer aMode);
|
|
||||||
|
|
||||||
|
|
||||||
//! Removes selection mode from Interactive Objects.
|
|
||||||
//! aMode provides the selection mode index of the entity aniobj.
|
|
||||||
Standard_EXPORT void UnsetSelectionMode (const Handle(AIS_InteractiveObject)& aniobj);
|
|
||||||
|
|
||||||
//! Disables the mechanism of adaptive tolerance calculation in SelectMgr_ViewerSelector and
|
//! Disables the mechanism of adaptive tolerance calculation in SelectMgr_ViewerSelector and
|
||||||
//! sets the given tolerance for ALL sensitive entities activated. For more information, see
|
//! sets the given tolerance for ALL sensitive entities activated. For more information, see
|
||||||
//! SelectMgr_ViewerSelector documentation
|
//! SelectMgr_ViewerSelector documentation
|
||||||
@ -564,7 +562,12 @@ public:
|
|||||||
//! <WithColor> will be returned TRUE
|
//! <WithColor> will be returned TRUE
|
||||||
//! <theHiCol> gives the name of the hilightcolor
|
//! <theHiCol> gives the name of the hilightcolor
|
||||||
Standard_EXPORT Standard_Boolean IsHilighted (const Handle(AIS_InteractiveObject)& anIobj, Standard_Boolean& WithColor, Quantity_NameOfColor& theHiCol) const;
|
Standard_EXPORT Standard_Boolean IsHilighted (const Handle(AIS_InteractiveObject)& anIobj, Standard_Boolean& WithColor, Quantity_NameOfColor& theHiCol) const;
|
||||||
|
|
||||||
|
//! if <theOwner> is hilighted with a specific color, than <theIsCustomColor> will be set
|
||||||
|
//! to true and <theCustomColorName> will have the name of the color stored
|
||||||
|
Standard_EXPORT Standard_Boolean IsHilighted (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||||
|
Standard_Boolean& theIsCustomColor,
|
||||||
|
Quantity_NameOfColor& theCustomColorName) const;
|
||||||
|
|
||||||
//! Returns the display priority of the entity anIobj. This
|
//! Returns the display priority of the entity anIobj. This
|
||||||
//! will be display mode of anIobj if it is in the main
|
//! will be display mode of anIobj if it is in the main
|
||||||
@ -894,7 +897,9 @@ public:
|
|||||||
//! Return value specified whether selected object must be hilighted
|
//! Return value specified whether selected object must be hilighted
|
||||||
//! when mouse cursor is moved above it
|
//! when mouse cursor is moved above it
|
||||||
Standard_Boolean ToHilightSelected() const;
|
Standard_Boolean ToHilightSelected() const;
|
||||||
|
|
||||||
|
|
||||||
|
//! @name OBSOLETE METHODS THAT ARE VALID FOR LOCAL CONTEXT ONLY
|
||||||
|
|
||||||
//! Updates the view of the current object in open context.
|
//! Updates the view of the current object in open context.
|
||||||
//! Objects selected when there is no open local context
|
//! Objects selected when there is no open local context
|
||||||
@ -907,16 +912,12 @@ public:
|
|||||||
Standard_EXPORT void SetCurrentObject (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void SetCurrentObject (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Boolean updateviewer = Standard_True);
|
||||||
|
|
||||||
|
|
||||||
//! Allows you to add a current object to the list of current
|
//! Allows to add or remove the object given to the list of current and highlight/unhighlight it
|
||||||
//! objects or remove it from that list.
|
//! correspondingly. Is valid for global context only; for local context use method AddOrRemoveSelected.
|
||||||
//! Objects selected when there is no open local context
|
//! Since this method makes sence only for neutral point selection of a whole object, if 0 selection
|
||||||
//! are called current objects; those selected in open
|
//! of the object is empty this method simply does nothing.
|
||||||
//! local context, selected objects.
|
Standard_EXPORT void AddOrRemoveCurrentObject (const Handle(AIS_InteractiveObject)& theObj,
|
||||||
//! If a local context is open and if updateviewer equals
|
const Standard_Boolean theIsToUpdateViewer = Standard_True);
|
||||||
//! Standard_False, the presentation of the Interactive
|
|
||||||
//! Object activates the selection mode; the object is
|
|
||||||
//! displayed but no viewer will be updated.
|
|
||||||
Standard_EXPORT void AddOrRemoveCurrentObject (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Boolean updateviewer = Standard_True);
|
|
||||||
|
|
||||||
//! Updates the list of current objects, i.e. hilights new
|
//! Updates the list of current objects, i.e. hilights new
|
||||||
//! current objects, removes hilighting from former current objects.
|
//! current objects, removes hilighting from former current objects.
|
||||||
@ -936,10 +937,9 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//! Returns true if there is a non-null interactive object in Neutral Point.
|
//! Returns true if there is a non-null interactive object in Neutral Point.
|
||||||
//! Objects selected when there is no open local context
|
//! Objects selected when there is no open local context are called current objects;
|
||||||
//! are called current objects; those selected in open
|
//! those selected in open local context, selected objects.
|
||||||
//! local context, selected objects.
|
Standard_EXPORT Standard_Boolean IsCurrent (const Handle(AIS_InteractiveObject)& theObject) const;
|
||||||
Standard_EXPORT Standard_Boolean IsCurrent (const Handle(AIS_InteractiveObject)& aniobj) const;
|
|
||||||
|
|
||||||
|
|
||||||
//! Initializes a scan of the current selected objects in
|
//! Initializes a scan of the current selected objects in
|
||||||
@ -973,14 +973,6 @@ public:
|
|||||||
Standard_EXPORT Handle(AIS_InteractiveObject) Current() const;
|
Standard_EXPORT Handle(AIS_InteractiveObject) Current() const;
|
||||||
|
|
||||||
Standard_EXPORT Standard_Integer NbCurrents();
|
Standard_EXPORT Standard_Integer NbCurrents();
|
||||||
|
|
||||||
|
|
||||||
//! Returns the first current object in the list of current objects.
|
|
||||||
//! Objects selected when there is no open local context
|
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
Standard_EXPORT Handle(AIS_InteractiveObject) FirstCurrentObject();
|
|
||||||
|
|
||||||
|
|
||||||
//! Highlights current objects.
|
//! Highlights current objects.
|
||||||
//! Objects selected when there is no open local context
|
//! Objects selected when there is no open local context
|
||||||
@ -990,8 +982,7 @@ public:
|
|||||||
//! Standard_False, the presentation of the Interactive
|
//! Standard_False, the presentation of the Interactive
|
||||||
//! Object activates the selection mode; the object is
|
//! Object activates the selection mode; the object is
|
||||||
//! displayed but no viewer will be updated.
|
//! displayed but no viewer will be updated.
|
||||||
Standard_EXPORT void HilightCurrents (const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void HilightCurrents (const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
|
|
||||||
|
|
||||||
//! Removes highlighting from current objects.
|
//! Removes highlighting from current objects.
|
||||||
//! Objects selected when there is no open local context
|
//! Objects selected when there is no open local context
|
||||||
@ -1002,7 +993,6 @@ public:
|
|||||||
//! Object activates the selection mode; the object is
|
//! Object activates the selection mode; the object is
|
||||||
//! displayed but no viewer will be updated.
|
//! displayed but no viewer will be updated.
|
||||||
Standard_EXPORT void UnhilightCurrents (const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void UnhilightCurrents (const Standard_Boolean updateviewer = Standard_True);
|
||||||
|
|
||||||
|
|
||||||
//! Empties previous current objects in order to get the
|
//! Empties previous current objects in order to get the
|
||||||
//! current objects detected by the selector using
|
//! current objects detected by the selector using
|
||||||
@ -1014,118 +1004,97 @@ public:
|
|||||||
//! Standard_False, the presentation of the Interactive
|
//! Standard_False, the presentation of the Interactive
|
||||||
//! Object activates the selection mode; the object is
|
//! Object activates the selection mode; the object is
|
||||||
//! displayed but no viewer will be updated.
|
//! displayed but no viewer will be updated.
|
||||||
Standard_EXPORT void ClearCurrents (const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void ClearCurrents (const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
|
|
||||||
|
//! @return current mouse-detected shape or empty (null) shape, if current interactive object
|
||||||
|
//! is not a shape (AIS_Shape) or there is no current mouse-detected interactive object at all.
|
||||||
|
Standard_EXPORT const TopoDS_Shape& DetectedCurrentShape() const;
|
||||||
|
|
||||||
|
//! @return current mouse-detected interactive object or null object, if there is no
|
||||||
|
//! currently detected interactives
|
||||||
|
Standard_EXPORT Handle(AIS_InteractiveObject) DetectedCurrentObject() const;
|
||||||
|
|
||||||
|
//! @name COMMON SELECTION METHODS VALID FOR BOTH GLOBAL AND LOCAL CONTEXT
|
||||||
|
|
||||||
|
//! Unhighlights previously selected owners and marks them as not selected.
|
||||||
|
//! Marks owner given as selected and highlights it.
|
||||||
|
Standard_EXPORT void SetSelected (const Handle(SelectMgr_EntityOwner)& theOwners,
|
||||||
|
const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
|
|
||||||
//! Puts the interactive object aniObj in the list of
|
//! Puts the interactive object aniObj in the list of
|
||||||
//! selected objects.
|
//! selected objects.
|
||||||
//! If a local context is open and if updateviewer equals
|
//! If a local context is open and if updateviewer equals
|
||||||
//! Standard_False, the presentation of the Interactive
|
//! Standard_False, the presentation of the Interactive
|
||||||
//! Object activates the selection mode; the object is
|
//! Object activates the selection mode; the object is
|
||||||
//! displayed but no viewer will be updated.
|
//! displayed but no viewer will be updated.
|
||||||
Standard_EXPORT void SetSelected (const Handle(AIS_InteractiveObject)& aniObj, const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void SetSelected (const Handle(AIS_InteractiveObject)& theObject,
|
||||||
|
const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
//! puts the selected list in the current objects List.
|
|
||||||
Standard_EXPORT void SetSelectedCurrent();
|
//! Updates the list of selected objects:
|
||||||
|
//! i.e. highlights the newely selected ones and unhighlights previously selected objects.
|
||||||
//! updates the list of selected objects
|
Standard_EXPORT void UpdateSelected (const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
//! i.e. hilights the new selected
|
|
||||||
//! unhilights old selected objects
|
|
||||||
Standard_EXPORT void UpdateSelected (const Standard_Boolean updateviewer = Standard_True);
|
|
||||||
|
|
||||||
//! Allows you to add a selected object to the list of
|
|
||||||
//! selected objects or remove it from that list. This entity
|
|
||||||
//! can be an Interactive Object aniobj or its owner
|
|
||||||
//! aShape as can be seen in the two syntaxes above.
|
|
||||||
//! Objects selected when there is no open local context
|
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
//! If a local context is open and if updateviewer equals
|
|
||||||
//! Standard_False, the presentation of the Interactive
|
|
||||||
//! Object activates the selection mode; the object is
|
|
||||||
//! displayed but no viewer will be updated.
|
|
||||||
Standard_EXPORT void AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Boolean updateviewer = Standard_True);
|
|
||||||
|
|
||||||
|
//! Allows to highlight or unhighlight the owner given depending on its selection status
|
||||||
|
Standard_EXPORT void AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& theObject,
|
||||||
|
const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
|
|
||||||
//! Highlights selected objects.
|
//! Highlights selected objects.
|
||||||
//! Objects selected when there is no open local context
|
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
//! If a local context is open and if updateviewer equals
|
//! If a local context is open and if updateviewer equals
|
||||||
//! Standard_False, the presentation of the Interactive
|
//! Standard_False, the presentation of the Interactive
|
||||||
//! Object activates the selection mode; the object is
|
//! Object activates the selection mode; the object is
|
||||||
//! displayed but no viewer will be updated.
|
//! displayed but no viewer will be updated.
|
||||||
Standard_EXPORT void HilightSelected (const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void HilightSelected (const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
|
|
||||||
|
|
||||||
//! Removes highlighting from selected objects.
|
//! Removes highlighting from selected objects.
|
||||||
//! Objects selected when there is no open local context
|
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
//! If a local context is open and if updateviewer equals
|
//! If a local context is open and if updateviewer equals
|
||||||
//! Standard_False, the presentation of the Interactive
|
//! Standard_False, the presentation of the Interactive
|
||||||
//! Object activates the selection mode; the object is
|
//! Object activates the selection mode; the object is
|
||||||
//! displayed but no viewer will be updated.
|
//! displayed but no viewer will be updated.
|
||||||
Standard_EXPORT void UnhilightSelected (const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void UnhilightSelected (const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
|
|
||||||
|
|
||||||
//! Empties previous selected objects in order to get the
|
//! Empties previous selected objects in order to get the
|
||||||
//! selected objects detected by the selector using
|
//! selected objects detected by the selector using
|
||||||
//! UpdateSelected.
|
//! UpdateSelected.
|
||||||
//! Objects selected when there is no open local context
|
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
//! If a local context is open and if updateviewer equals
|
//! If a local context is open and if updateviewer equals
|
||||||
//! Standard_False, the presentation of the Interactive
|
//! Standard_False, the presentation of the Interactive
|
||||||
//! Object activates the selection mode; the object is
|
//! Object activates the selection mode; the object is
|
||||||
//! displayed but no viewer will be updated.
|
//! displayed but no viewer will be updated.
|
||||||
Standard_EXPORT void ClearSelected (const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void ClearSelected (const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
|
|
||||||
//! No right to Add a selected Shape (Internal Management
|
//! No right to Add a selected Shape (Internal Management
|
||||||
//! of shape Selection).
|
//! of shape Selection).
|
||||||
//! A Previous selected shape may only be removed.
|
//! A Previous selected shape may only be removed.
|
||||||
Standard_EXPORT void AddOrRemoveSelected (const TopoDS_Shape& aShape, const Standard_Boolean updateviewer = Standard_True);
|
Standard_EXPORT void AddOrRemoveSelected (const TopoDS_Shape& aShape, const Standard_Boolean updateviewer = Standard_True);
|
||||||
|
|
||||||
//! allows to add/remove in the selected list the entities
|
|
||||||
//! represented by <anOwner> in the selection process.
|
|
||||||
Standard_EXPORT void AddOrRemoveSelected (const Handle(SelectMgr_EntityOwner)& anOwner, const Standard_Boolean updateviewer = Standard_True);
|
|
||||||
|
|
||||||
|
|
||||||
//! Finds the selected object aniobj in local context and
|
//! Allows to highlight or unhighlight the owner given depending on its selection status
|
||||||
//! returns its name.
|
Standard_EXPORT void AddOrRemoveSelected (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||||
//! Objects selected when there is no open local context
|
const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
Standard_EXPORT Standard_Boolean IsSelected (const Handle(AIS_InteractiveObject)& aniobj) const;
|
|
||||||
|
|
||||||
|
|
||||||
//! Initializes a scan of the selected objects in local context.
|
//! Returns true is the owner given is selected
|
||||||
//! Objects selected when there is no open local context
|
Standard_EXPORT Standard_Boolean IsSelected (const Handle(SelectMgr_EntityOwner)& theOwner) const;
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
//! Returns true is the object given is selected
|
||||||
|
Standard_EXPORT Standard_Boolean IsSelected (const Handle(AIS_InteractiveObject)& theObj) const;
|
||||||
|
|
||||||
|
//! Returns the first selected object in the list of current selected.
|
||||||
|
Standard_EXPORT Handle(AIS_InteractiveObject) FirstSelectedObject();
|
||||||
|
|
||||||
|
//! Initializes a scan of the selected objects.
|
||||||
Standard_EXPORT void InitSelected();
|
Standard_EXPORT void InitSelected();
|
||||||
|
|
||||||
|
|
||||||
//! Returns true if there is another object found by the
|
//! Returns true if there is another object found by the
|
||||||
//! scan of the list of selected objects.
|
//! scan of the list of selected objects.
|
||||||
//! Objects selected when there is no open local context
|
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
Standard_EXPORT Standard_Boolean MoreSelected() const;
|
Standard_EXPORT Standard_Boolean MoreSelected() const;
|
||||||
|
|
||||||
|
|
||||||
//! Continues the scan to the next object in the list of
|
//! Continues the scan to the next object in the list of
|
||||||
//! selected objects.
|
//! selected objects.
|
||||||
//! Objects selected when there is no open local context
|
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
Standard_EXPORT void NextSelected();
|
Standard_EXPORT void NextSelected();
|
||||||
|
|
||||||
Standard_EXPORT Standard_Integer NbSelected();
|
Standard_EXPORT Standard_Integer NbSelected();
|
||||||
|
|
||||||
|
|
||||||
//! Returns true if the interactive context has a shape
|
//! Returns true if the interactive context has a shape
|
||||||
//! selected in it which results from the decomposition of
|
//! selected in it which results from the decomposition of
|
||||||
//! another entity in local context.
|
//! another entity.
|
||||||
//! If HasSelectedShape returns true, SelectedShape
|
//! If HasSelectedShape returns true, SelectedShape
|
||||||
//! returns the shape which has been shown to be
|
//! returns the shape which has been shown to be
|
||||||
//! selected. Interactive returns the Interactive Object
|
//! selected. Interactive returns the Interactive Object
|
||||||
@ -1133,30 +1102,23 @@ public:
|
|||||||
//! If HasSelectedShape returns false, Interactive
|
//! If HasSelectedShape returns false, Interactive
|
||||||
//! returns the interactive entity selected by the click of the mouse.
|
//! returns the interactive entity selected by the click of the mouse.
|
||||||
Standard_EXPORT Standard_Boolean HasSelectedShape() const;
|
Standard_EXPORT Standard_Boolean HasSelectedShape() const;
|
||||||
|
|
||||||
|
|
||||||
//! Returns the selected shape in the open local context.
|
//! Returns the selected shape.
|
||||||
//! Objects selected when there is no open local context
|
|
||||||
//! are called current objects; those selected in open
|
|
||||||
//! local context, selected objects.
|
|
||||||
Standard_EXPORT TopoDS_Shape SelectedShape() const;
|
Standard_EXPORT TopoDS_Shape SelectedShape() const;
|
||||||
|
|
||||||
|
|
||||||
//! Returns the owner of the selected entity resulting
|
//! Returns the owner of the selected entity resulting
|
||||||
//! from the decomposition of another entity in local context.
|
//! from the decomposition of another entity.
|
||||||
Standard_EXPORT Handle(SelectMgr_EntityOwner) SelectedOwner() const;
|
Standard_EXPORT Handle(SelectMgr_EntityOwner) SelectedOwner() const;
|
||||||
|
|
||||||
//! Returns a collection containing all entity owners
|
//! Returns a collection containing all entity owners
|
||||||
//! created for the interactive object <theIObj> in
|
//! created for the interactive object <theIObj> in
|
||||||
//! the selection mode theMode (in all active modes
|
//! the selection mode theMode (in all active modes
|
||||||
//! if the Mode == -1)
|
//! if the Mode == -1)
|
||||||
Standard_EXPORT void EntityOwners (Handle(SelectMgr_IndexedMapOfOwner)& theOwners, const Handle(AIS_InteractiveObject)& theIObj, const Standard_Integer theMode = -1) const;
|
Standard_EXPORT void EntityOwners (Handle(SelectMgr_IndexedMapOfOwner)& theOwners,
|
||||||
|
const Handle(AIS_InteractiveObject)& theIObj,
|
||||||
//! Returns the location of the selected Interactive Object.
|
const Standard_Integer theMode = -1) const;
|
||||||
Standard_EXPORT Handle(AIS_InteractiveObject) Interactive() const;
|
|
||||||
|
|
||||||
Standard_EXPORT Handle(AIS_InteractiveObject) SelectedInteractive() const;
|
Standard_EXPORT Handle(AIS_InteractiveObject) SelectedInteractive() const;
|
||||||
|
|
||||||
|
|
||||||
//! Returns true if the applicative object has an owner
|
//! Returns true if the applicative object has an owner
|
||||||
//! from Interactive attributed to it.
|
//! from Interactive attributed to it.
|
||||||
@ -1222,14 +1184,6 @@ public:
|
|||||||
//! Gets next current object during iteration through mouse-detected
|
//! Gets next current object during iteration through mouse-detected
|
||||||
//! interactive objects.
|
//! interactive objects.
|
||||||
Standard_EXPORT void NextDetected();
|
Standard_EXPORT void NextDetected();
|
||||||
|
|
||||||
|
|
||||||
//! @return current mouse-detected shape or empty (null) shape, if current interactive object
|
|
||||||
//! is not a shape (AIS_Shape) or there is no current mouse-detected interactive object at all.
|
|
||||||
Standard_EXPORT const TopoDS_Shape& DetectedCurrentShape() const;
|
|
||||||
|
|
||||||
Standard_EXPORT Handle(AIS_InteractiveObject) DetectedCurrentObject() const;
|
|
||||||
|
|
||||||
|
|
||||||
//! Opens local contexts and specifies how this is to be
|
//! Opens local contexts and specifies how this is to be
|
||||||
//! done. The options listed above function in the following manner:
|
//! done. The options listed above function in the following manner:
|
||||||
@ -1303,7 +1257,7 @@ public:
|
|||||||
Standard_EXPORT void NotUseDisplayedObjects();
|
Standard_EXPORT void NotUseDisplayedObjects();
|
||||||
|
|
||||||
//! initializes the list of presentations to be displayed
|
//! initializes the list of presentations to be displayed
|
||||||
//! returns False if No Local COnte
|
//! returns False if no local context is opened.
|
||||||
Standard_EXPORT Standard_Boolean BeginImmediateDraw();
|
Standard_EXPORT Standard_Boolean BeginImmediateDraw();
|
||||||
|
|
||||||
//! returns True if <anIObj> has been stored in the list.
|
//! returns True if <anIObj> has been stored in the list.
|
||||||
@ -1582,6 +1536,9 @@ public:
|
|||||||
//! Query objects visible or hidden in specified view due to affinity mask.
|
//! Query objects visible or hidden in specified view due to affinity mask.
|
||||||
Standard_EXPORT void ObjectsForView (AIS_ListOfInteractive& theListOfIO, const Handle(V3d_View)& theView, const Standard_Boolean theIsVisibleInView, const AIS_DisplayStatus theStatus = AIS_DS_None) const;
|
Standard_EXPORT void ObjectsForView (AIS_ListOfInteractive& theListOfIO, const Handle(V3d_View)& theView, const Standard_Boolean theIsVisibleInView, const AIS_DisplayStatus theStatus = AIS_DS_None) const;
|
||||||
|
|
||||||
|
//! Redraws immediate structures in all views of the viewer given taking into account its visibility.
|
||||||
|
Standard_EXPORT void RedrawImmediate (const Handle(V3d_Viewer)& theViewer);
|
||||||
|
|
||||||
|
|
||||||
friend class AIS_LocalContext;
|
friend class AIS_LocalContext;
|
||||||
|
|
||||||
@ -1614,6 +1571,24 @@ private:
|
|||||||
//! UNKNOWN
|
//! UNKNOWN
|
||||||
Standard_EXPORT void redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Boolean theToUpdateViewer = Standard_True);
|
Standard_EXPORT void redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Boolean theToUpdateViewer = Standard_True);
|
||||||
|
|
||||||
|
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
|
||||||
|
void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);
|
||||||
|
|
||||||
|
//! Helper function that highlights the owner given with <theColor> without
|
||||||
|
//! performing AutoHighlight checks, e.g. is used for dynamic highlight.
|
||||||
|
//! If the parameter <theViewer> is set and <theIsImmediate> is true, highlight will be synchronized
|
||||||
|
//! automatically in all views of the viewer.
|
||||||
|
void highlightWithColor (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||||
|
const Quantity_NameOfColor theColor,
|
||||||
|
const Handle(V3d_Viewer)& theViewer = NULL);
|
||||||
|
|
||||||
|
//! Helper function that highlights the owner given with <theColor> with check
|
||||||
|
//! for AutoHighlight, e.g. is used for selection.
|
||||||
|
//! If the parameter <theViewer> is set and <theIsImmediate> is true, selection color will be synchronized
|
||||||
|
//! automatically in all views of the viewer.
|
||||||
|
void highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||||
|
const Quantity_NameOfColor theSelColor);
|
||||||
|
|
||||||
AIS_DataMapOfIOStatus myObjects;
|
AIS_DataMapOfIOStatus myObjects;
|
||||||
Handle(SelectMgr_SelectionManager) mgrSelector;
|
Handle(SelectMgr_SelectionManager) mgrSelector;
|
||||||
Handle(PrsMgr_PresentationManager3d) myMainPM;
|
Handle(PrsMgr_PresentationManager3d) myMainPM;
|
||||||
@ -1621,8 +1596,8 @@ private:
|
|||||||
Handle(StdSelect_ViewerSelector3d) myMainSel;
|
Handle(StdSelect_ViewerSelector3d) myMainSel;
|
||||||
TCollection_AsciiString mySelectionName;
|
TCollection_AsciiString mySelectionName;
|
||||||
TCollection_AsciiString myCurrentName;
|
TCollection_AsciiString myCurrentName;
|
||||||
Handle(AIS_InteractiveObject) myLastPicked;
|
Handle(SelectMgr_EntityOwner) myLastPicked;
|
||||||
Handle(AIS_InteractiveObject) myLastinMain;
|
Handle(SelectMgr_EntityOwner) myLastinMain;
|
||||||
Standard_Boolean myWasLastMain;
|
Standard_Boolean myWasLastMain;
|
||||||
Standard_Boolean myCurrentTouched;
|
Standard_Boolean myCurrentTouched;
|
||||||
Standard_Boolean mySelectedTouched;
|
Standard_Boolean mySelectedTouched;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -55,10 +55,12 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
|
|||||||
{
|
{
|
||||||
|
|
||||||
// the entities eventually detected just before the context was opened are unhighlighted...
|
// the entities eventually detected just before the context was opened are unhighlighted...
|
||||||
if(!IsCurrent(myLastPicked)){
|
if(!IsSelected(myLastPicked)){
|
||||||
if(!myLastPicked.IsNull()){
|
if(!myLastPicked.IsNull()){
|
||||||
Standard_Integer HiMod = myLastPicked->HasHilightMode()?myLastPicked->HilightMode():0;
|
const Handle(AIS_InteractiveObject) aLastPickedAIS =
|
||||||
myMainPM->Unhighlight(myLastPicked,HiMod);
|
Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable());
|
||||||
|
Standard_Integer HiMod = aLastPickedAIS->HasHilightMode()?aLastPickedAIS->HilightMode():0;
|
||||||
|
myMainPM->Unhighlight (aLastPickedAIS, HiMod);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
if(!mylastmoveview.IsNull()){
|
if(!mylastmoveview.IsNull()){
|
||||||
@ -750,7 +752,7 @@ Standard_Boolean AIS_InteractiveContext::ImmediateAdd (const Handle(AIS_Interact
|
|||||||
Standard_Boolean AIS_InteractiveContext::EndImmediateDraw (const Handle(V3d_View)& theView)
|
Standard_Boolean AIS_InteractiveContext::EndImmediateDraw (const Handle(V3d_View)& theView)
|
||||||
{
|
{
|
||||||
return HasOpenedContext()
|
return HasOpenedContext()
|
||||||
&& myLocalContexts (myCurLocalIndex)->EndImmediateDraw (theView);
|
&& myLocalContexts (myCurLocalIndex)->EndImmediateDraw (theView->Viewer());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -772,7 +774,7 @@ Standard_Boolean AIS_InteractiveContext::EndImmediateDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle(V3d_View) aView = myMainVwr->ActiveView();
|
Handle(V3d_View) aView = myMainVwr->ActiveView();
|
||||||
return myLocalContexts (myCurLocalIndex)->EndImmediateDraw (aView);
|
return myLocalContexts (myCurLocalIndex)->EndImmediateDraw (aView->Viewer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ myRecomputeEveryPrs(Standard_True),
|
|||||||
myCTXPtr(NULL),
|
myCTXPtr(NULL),
|
||||||
mySelPriority(-1),
|
mySelPriority(-1),
|
||||||
myDisplayMode (-1),
|
myDisplayMode (-1),
|
||||||
mySelectionMode(0),
|
|
||||||
mystate(0)
|
mystate(0)
|
||||||
{
|
{
|
||||||
Handle (AIS_InteractiveContext) Bid;
|
Handle (AIS_InteractiveContext) Bid;
|
||||||
@ -197,18 +196,6 @@ void AIS_InteractiveObject::SetDisplayMode(const Standard_Integer aMode)
|
|||||||
if( AcceptDisplayMode(aMode) )
|
if( AcceptDisplayMode(aMode) )
|
||||||
myDisplayMode = aMode;
|
myDisplayMode = aMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function :
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void AIS_InteractiveObject::SetSelectionMode(const Standard_Integer aMode)
|
|
||||||
{
|
|
||||||
mySelectionMode = aMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function :
|
//function :
|
||||||
|
@ -263,41 +263,7 @@ public:
|
|||||||
//! This range can, however, be extended through the
|
//! This range can, however, be extended through the
|
||||||
//! creation of new display modes.
|
//! creation of new display modes.
|
||||||
Standard_Integer DisplayMode() const;
|
Standard_Integer DisplayMode() const;
|
||||||
|
|
||||||
//! Allows you to change the selection mode of an
|
|
||||||
//! Interactive Object.
|
|
||||||
//! The default selection mode setting is 0.
|
|
||||||
//! For shapes, for example, the selection modes are as follows:
|
|
||||||
//! - mode 0 - selection of the shape itself
|
|
||||||
//! - mode 1 - selection of vertices
|
|
||||||
//! - mode 2 - selection of edges
|
|
||||||
//! - mode 3 - selection of wires
|
|
||||||
//! - mode 4 - selection of faces
|
|
||||||
//! - mode 5 - selection of shells
|
|
||||||
//! - mode 6 - selection of solids
|
|
||||||
//! - mode 7 - selection of compounds
|
|
||||||
//! For trihedra, on the other hand, the selection modes are the following four:
|
|
||||||
//! - mode 0 - selection of a trihedron
|
|
||||||
//! - mode 1 - selection of its origin
|
|
||||||
//! - mode 2 - selection of its axes
|
|
||||||
//! - mode 3 - selection of its planes
|
|
||||||
Standard_EXPORT Standard_Boolean HasSelectionMode() const;
|
|
||||||
|
|
||||||
//! Returns the selection mode of the interactive object.
|
|
||||||
Standard_EXPORT Standard_Integer SelectionMode() const;
|
|
||||||
|
|
||||||
//! You can change the default selection mode index
|
|
||||||
//! aMode of an Interactive Object.
|
|
||||||
//! This is only of interest if you decide that mode 0
|
|
||||||
//! adopted by convention will not do.
|
|
||||||
Standard_EXPORT void SetSelectionMode (const Standard_Integer aMode);
|
|
||||||
|
|
||||||
//! You can change the default selection mode index of
|
|
||||||
//! an Interactive Object.
|
|
||||||
//! This is only of interest if you decide that the 0 mode
|
|
||||||
//! adopted by convention will not do.
|
|
||||||
void UnsetSelectionMode();
|
|
||||||
|
|
||||||
//! Returns the selection priority setting. -1 indicates that there is none.
|
//! Returns the selection priority setting. -1 indicates that there is none.
|
||||||
//! You can modify the selection priority of an owner to
|
//! You can modify the selection priority of an owner to
|
||||||
//! make one entity more selectionable than another one.
|
//! make one entity more selectionable than another one.
|
||||||
@ -498,7 +464,7 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
//! The TypeOfPresention3d means that the interactive object
|
//! The TypeOfPresention3d means that the interactive object
|
||||||
//! may have a presentation dependant of the view of Display
|
//! may have a presentation dependant of the view of Display.
|
||||||
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
||||||
|
|
||||||
Standard_Real myTransparency;
|
Standard_Real myTransparency;
|
||||||
@ -530,7 +496,6 @@ private:
|
|||||||
TColStd_ListOfTransient myUsers;
|
TColStd_ListOfTransient myUsers;
|
||||||
Standard_Integer mySelPriority;
|
Standard_Integer mySelPriority;
|
||||||
Standard_Integer myDisplayMode;
|
Standard_Integer myDisplayMode;
|
||||||
Standard_Integer mySelectionMode;
|
|
||||||
Standard_Integer mystate;
|
Standard_Integer mystate;
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,17 +44,6 @@ inline void AIS_InteractiveObject::UnsetDisplayMode()
|
|||||||
inline Standard_Integer AIS_InteractiveObject::DisplayMode() const
|
inline Standard_Integer AIS_InteractiveObject::DisplayMode() const
|
||||||
{return myDisplayMode;}
|
{return myDisplayMode;}
|
||||||
|
|
||||||
inline Standard_Boolean AIS_InteractiveObject::HasSelectionMode() const
|
|
||||||
{return mySelectionMode!=-1;}
|
|
||||||
|
|
||||||
inline void AIS_InteractiveObject::UnsetSelectionMode()
|
|
||||||
{mySelectionMode =-1;}
|
|
||||||
|
|
||||||
inline Standard_Integer AIS_InteractiveObject::SelectionMode() const
|
|
||||||
{return mySelectionMode;}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline Quantity_NameOfColor AIS_InteractiveObject::Color() const
|
inline Quantity_NameOfColor AIS_InteractiveObject::Color() const
|
||||||
{
|
{
|
||||||
return myOwnColor.Name();
|
return myOwnColor.Name();
|
||||||
|
@ -319,10 +319,10 @@ Erase(const Handle(AIS_InteractiveObject)& anInteractive)
|
|||||||
const Handle(SelectMgr_SelectableObject)& anObj = anInteractive; // to avoid ambiguity
|
const Handle(SelectMgr_SelectableObject)& anObj = anInteractive; // to avoid ambiguity
|
||||||
if (mySM->Contains (anObj))
|
if (mySM->Contains (anObj))
|
||||||
{
|
{
|
||||||
TColStd_ListIteratorOfListOfInteger aModeIter (STAT->SelectionModes());
|
while (!STAT->SelectionModes().IsEmpty())
|
||||||
for (; aModeIter.More(); aModeIter.Next())
|
|
||||||
{
|
{
|
||||||
mySM->Deactivate (anInteractive, aModeIter.Value(), myMainVS);
|
mySM->Deactivate (anInteractive, STAT->SelectionModes().Last(), myMainVS);
|
||||||
|
STAT->RemoveSelectionMode (STAT->SelectionModes().Last());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -637,13 +637,6 @@ void AIS_LocalContext::Terminate (const Standard_Boolean theToUpdate)
|
|||||||
AIS_Selection::Select();
|
AIS_Selection::Select();
|
||||||
AIS_Selection::Remove(mySelName.ToCString());
|
AIS_Selection::Remove(mySelName.ToCString());
|
||||||
|
|
||||||
Handle(V3d_Viewer) aViewer = myCTX->CurrentViewer();
|
|
||||||
for (aViewer->InitActiveViews(); aViewer->MoreActiveViews(); aViewer->NextActiveViews())
|
|
||||||
{
|
|
||||||
Handle(V3d_View) aView = aViewer->ActiveView();
|
|
||||||
aView->View()->ClearImmediate();
|
|
||||||
}
|
|
||||||
|
|
||||||
Handle(V3d_View) aDummyView;
|
Handle(V3d_View) aDummyView;
|
||||||
myMainVS->ClearSensitive (aDummyView);
|
myMainVS->ClearSensitive (aDummyView);
|
||||||
|
|
||||||
@ -1122,14 +1115,14 @@ Standard_Boolean AIS_LocalContext::ImmediateAdd (const Handle(AIS_InteractiveObj
|
|||||||
//function : EndImmediateDraw
|
//function : EndImmediateDraw
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean AIS_LocalContext::EndImmediateDraw (const Handle(V3d_View)& theView)
|
Standard_Boolean AIS_LocalContext::EndImmediateDraw (const Handle(V3d_Viewer)& theViewer)
|
||||||
{
|
{
|
||||||
if (!myMainPM->IsImmediateModeOn())
|
if (!myMainPM->IsImmediateModeOn())
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
myMainPM->EndImmediateDraw (theView);
|
myMainPM->EndImmediateDraw (theViewer);
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ class SelectMgr_Filter;
|
|||||||
class TCollection_AsciiString;
|
class TCollection_AsciiString;
|
||||||
class AIS_InteractiveObject;
|
class AIS_InteractiveObject;
|
||||||
class V3d_View;
|
class V3d_View;
|
||||||
|
class V3d_Viewer;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class SelectMgr_EntityOwner;
|
class SelectMgr_EntityOwner;
|
||||||
class Standard_Transient;
|
class Standard_Transient;
|
||||||
@ -329,7 +330,7 @@ public:
|
|||||||
Standard_EXPORT Standard_Boolean ImmediateAdd (const Handle(AIS_InteractiveObject)& theObj, const Standard_Integer theMode = 0);
|
Standard_EXPORT Standard_Boolean ImmediateAdd (const Handle(AIS_InteractiveObject)& theObj, const Standard_Integer theMode = 0);
|
||||||
|
|
||||||
//! Allows rapid drawing of the view theView by avoiding an update of the whole background.
|
//! Allows rapid drawing of the view theView by avoiding an update of the whole background.
|
||||||
Standard_EXPORT Standard_Boolean EndImmediateDraw (const Handle(V3d_View)& theView);
|
Standard_EXPORT Standard_Boolean EndImmediateDraw (const Handle(V3d_Viewer)& theViewer);
|
||||||
|
|
||||||
//! Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
|
//! Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
|
||||||
Standard_EXPORT Standard_Boolean IsImmediateModeOn() const;
|
Standard_EXPORT Standard_Boolean IsImmediateModeOn() const;
|
||||||
|
@ -482,7 +482,7 @@ void AIS_LocalContext::Hilight (const Handle(SelectMgr_EntityOwner)& theOwner,
|
|||||||
const Standard_Integer aHilightMode = GetHiMod (Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable()));
|
const Standard_Integer aHilightMode = GetHiMod (Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable()));
|
||||||
myMainPM->BeginImmediateDraw();
|
myMainPM->BeginImmediateDraw();
|
||||||
theOwner->HilightWithColor (myMainPM, myCTX->HilightColor(), aHilightMode);
|
theOwner->HilightWithColor (myMainPM, myCTX->HilightColor(), aHilightMode);
|
||||||
myMainPM->EndImmediateDraw (theView);
|
myMainPM->EndImmediateDraw (theView->Viewer());
|
||||||
}
|
}
|
||||||
|
|
||||||
//==================================================
|
//==================================================
|
||||||
@ -1397,7 +1397,7 @@ Standard_Boolean AIS_LocalContext::UnhilightLastDetected (const Handle(V3d_View)
|
|||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
myMapOfOwner->FindKey (mylastindex)->Unhilight (myMainPM, aHilightMode);
|
myMapOfOwner->FindKey (mylastindex)->Unhilight (myMainPM, aHilightMode);
|
||||||
myMainPM->EndImmediateDraw (theView);
|
myMainPM->EndImmediateDraw (theView->Viewer());
|
||||||
mylastindex = 0;
|
mylastindex = 0;
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
@ -391,3 +391,12 @@ void AIS_MultipleConnectedInteractive::ComputeSelection (const Handle(SelectMgr_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GlobalSelOwner
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Handle(SelectMgr_EntityOwner) AIS_MultipleConnectedInteractive::GlobalSelOwner() const
|
||||||
|
{
|
||||||
|
return myAssemblyOwner;
|
||||||
|
}
|
||||||
|
@ -96,7 +96,8 @@ public:
|
|||||||
//! may be decomposed into sub-shapes for dynamic selection.
|
//! may be decomposed into sub-shapes for dynamic selection.
|
||||||
Standard_EXPORT virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE;
|
Standard_EXPORT virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE;
|
||||||
|
|
||||||
|
//! Returns the owner of mode for selection of object as a whole
|
||||||
|
Standard_EXPORT virtual Handle(SelectMgr_EntityOwner) GlobalSelOwner() const Standard_OVERRIDE;
|
||||||
|
|
||||||
|
|
||||||
DEFINE_STANDARD_RTTI(AIS_MultipleConnectedInteractive,AIS_InteractiveObject)
|
DEFINE_STANDARD_RTTI(AIS_MultipleConnectedInteractive,AIS_InteractiveObject)
|
||||||
|
@ -194,13 +194,7 @@ public:
|
|||||||
//! But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
|
//! But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
|
||||||
//! @return previous mode.
|
//! @return previous mode.
|
||||||
Standard_EXPORT virtual Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView& theCView, const Standard_Boolean theDrawToFrontBuffer) = 0;
|
Standard_EXPORT virtual Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView& theCView, const Standard_Boolean theDrawToFrontBuffer) = 0;
|
||||||
|
|
||||||
//! Display structure in immediate mode on top of general presentation
|
|
||||||
Standard_EXPORT virtual void DisplayImmediateStructure (const Graphic3d_CView& theCView, const Handle(Graphic3d_Structure)& theStructure) = 0;
|
|
||||||
|
|
||||||
//! Erases immediate structure
|
|
||||||
Standard_EXPORT virtual void EraseImmediateStructure (const Graphic3d_CView& theCView, const Graphic3d_CStructure& theCStructure) = 0;
|
|
||||||
|
|
||||||
//! call_togl_layer2d
|
//! call_togl_layer2d
|
||||||
Standard_EXPORT virtual void Layer (Aspect_CLayer2d& ACLayer) = 0;
|
Standard_EXPORT virtual void Layer (Aspect_CLayer2d& ACLayer) = 0;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
//! Empty constructor.
|
//! Empty constructor.
|
||||||
Graphic3d_ViewAffinity()
|
Graphic3d_ViewAffinity()
|
||||||
{
|
{
|
||||||
::memset (&myMask, 0xFF, sizeof(myMask));
|
SetVisible (Standard_True);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Return visibility flag.
|
//! Return visibility flag.
|
||||||
@ -38,6 +38,12 @@ public:
|
|||||||
return (myMask & aBit) != 0;
|
return (myMask & aBit) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Setup visibility flag for all views.
|
||||||
|
void SetVisible (const Standard_Boolean theIsVisible)
|
||||||
|
{
|
||||||
|
::memset (&myMask, theIsVisible ? 0xFF : 0x00, sizeof(myMask));
|
||||||
|
}
|
||||||
|
|
||||||
//! Setup visibility flag.
|
//! Setup visibility flag.
|
||||||
void SetVisible (const Standard_Integer theViewId,
|
void SetVisible (const Standard_Integer theViewId,
|
||||||
const bool theIsVisible)
|
const bool theIsVisible)
|
||||||
|
@ -986,6 +986,8 @@ void MeshVS_Mesh::HilightSelected ( const Handle(PrsMgr_PresentationManager3d)&
|
|||||||
|
|
||||||
IsNeedToRedisplay = Standard_True;
|
IsNeedToRedisplay = Standard_True;
|
||||||
|
|
||||||
|
aSelectionPrs->SetZLayer (Graphic3d_ZLayerId_Top);
|
||||||
|
|
||||||
if ( IsNeedToRedisplay )
|
if ( IsNeedToRedisplay )
|
||||||
{
|
{
|
||||||
aSelectionPrs->SetDisplayPriority(9);
|
aSelectionPrs->SetDisplayPriority(9);
|
||||||
@ -1100,6 +1102,8 @@ void MeshVS_Mesh::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationManage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aHilightPrs->SetZLayer (Graphic3d_ZLayerId_Topmost);
|
||||||
|
|
||||||
if (PM->IsImmediateModeOn())
|
if (PM->IsImmediateModeOn())
|
||||||
{
|
{
|
||||||
PM->AddToImmediateList (aHilightPrs);
|
PM->AddToImmediateList (aHilightPrs);
|
||||||
|
@ -28,8 +28,10 @@ OpenGl_Caps::OpenGl_Caps()
|
|||||||
keepArrayData (Standard_False),
|
keepArrayData (Standard_False),
|
||||||
#if !defined(GL_ES_VERSION_2_0)
|
#if !defined(GL_ES_VERSION_2_0)
|
||||||
ffpEnable (Standard_True),
|
ffpEnable (Standard_True),
|
||||||
|
useSystemBuffer (Standard_False),
|
||||||
#else
|
#else
|
||||||
ffpEnable (Standard_False),
|
ffpEnable (Standard_False),
|
||||||
|
useSystemBuffer (Standard_True),
|
||||||
#endif
|
#endif
|
||||||
swapInterval (1),
|
swapInterval (1),
|
||||||
buffersNoSwap (Standard_False),
|
buffersNoSwap (Standard_False),
|
||||||
@ -63,6 +65,7 @@ OpenGl_Caps& OpenGl_Caps::operator= (const OpenGl_Caps& theCopy)
|
|||||||
pntSpritesDisable = theCopy.pntSpritesDisable;
|
pntSpritesDisable = theCopy.pntSpritesDisable;
|
||||||
keepArrayData = theCopy.keepArrayData;
|
keepArrayData = theCopy.keepArrayData;
|
||||||
ffpEnable = theCopy.ffpEnable;
|
ffpEnable = theCopy.ffpEnable;
|
||||||
|
useSystemBuffer = theCopy.useSystemBuffer;
|
||||||
swapInterval = theCopy.swapInterval;
|
swapInterval = theCopy.swapInterval;
|
||||||
buffersNoSwap = theCopy.buffersNoSwap;
|
buffersNoSwap = theCopy.buffersNoSwap;
|
||||||
contextStereo = theCopy.contextStereo;
|
contextStereo = theCopy.contextStereo;
|
||||||
|
@ -30,6 +30,7 @@ public: //! @name flags to disable particular functionality, should be used only
|
|||||||
Standard_Boolean pntSpritesDisable; //!< flag permits Point Sprites usage, will significantly affect performance (OFF by default)
|
Standard_Boolean pntSpritesDisable; //!< flag permits Point Sprites usage, will significantly affect performance (OFF by default)
|
||||||
Standard_Boolean keepArrayData; //!< Disables freeing CPU memory after building VBOs (OFF by default)
|
Standard_Boolean keepArrayData; //!< Disables freeing CPU memory after building VBOs (OFF by default)
|
||||||
Standard_Boolean ffpEnable; //!< Enables FFP (fixed-function pipeline), do not use built-in GLSL programs (ON by default on desktop OpenGL and OFF on OpenGL ES)
|
Standard_Boolean ffpEnable; //!< Enables FFP (fixed-function pipeline), do not use built-in GLSL programs (ON by default on desktop OpenGL and OFF on OpenGL ES)
|
||||||
|
Standard_Boolean useSystemBuffer; //!< Enables usage of system backbuffer for blitting (OFF by default on desktop OpenGL and ON on OpenGL ES for testing)
|
||||||
Standard_Integer swapInterval; //!< controls swap interval - 0 for VSync off and 1 for VSync on, 1 by default
|
Standard_Integer swapInterval; //!< controls swap interval - 0 for VSync off and 1 for VSync on, 1 by default
|
||||||
|
|
||||||
public: //! @name context creation parameters
|
public: //! @name context creation parameters
|
||||||
|
@ -413,40 +413,6 @@ Standard_Boolean OpenGl_GraphicDriver::SetImmediateModeDrawToFront (const Graphi
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : DisplayImmediateStructure
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
void OpenGl_GraphicDriver::DisplayImmediateStructure (const Graphic3d_CView& theCView,
|
|
||||||
const Handle(Graphic3d_Structure)& theStructure)
|
|
||||||
{
|
|
||||||
OpenGl_CView* aCView = (OpenGl_CView* )theCView.ptrView;
|
|
||||||
if (aCView == NULL)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
aCView->View->DisplayImmediateStructure (theStructure);
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : EraseImmediateStructure
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
void OpenGl_GraphicDriver::EraseImmediateStructure (const Graphic3d_CView& theCView,
|
|
||||||
const Graphic3d_CStructure& theCStructure)
|
|
||||||
{
|
|
||||||
OpenGl_CView* aCView = (OpenGl_CView* )theCView.ptrView;
|
|
||||||
OpenGl_Structure* aStructure = (OpenGl_Structure* )&theCStructure;
|
|
||||||
if (aCView == NULL)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
aCView->View->EraseImmediateStructure (aStructure);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// function : Print
|
// function : Print
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -131,10 +131,6 @@ public: // Methods for graphical structures
|
|||||||
|
|
||||||
Standard_EXPORT Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView& theCView,
|
Standard_EXPORT Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView& theCView,
|
||||||
const Standard_Boolean theDrawToFrontBuffer);
|
const Standard_Boolean theDrawToFrontBuffer);
|
||||||
Standard_EXPORT void DisplayImmediateStructure (const Graphic3d_CView& theCView,
|
|
||||||
const Handle(Graphic3d_Structure)& theStructure);
|
|
||||||
Standard_EXPORT void EraseImmediateStructure (const Graphic3d_CView& theCView,
|
|
||||||
const Graphic3d_CStructure& theCStructure);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -40,5 +40,7 @@ OpenGl_StructureShadow::OpenGl_StructureShadow (const Handle(Graphic3d_Structure
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateTransformation();
|
||||||
|
myInstancedStructure = const_cast<OpenGl_Structure*> (myParent->InstancedStructure());
|
||||||
TransformPersistence = myParent->TransformPersistence;
|
TransformPersistence = myParent->TransformPersistence;
|
||||||
}
|
}
|
||||||
|
@ -128,12 +128,6 @@ class OpenGl_View : public MMgt_TShared
|
|||||||
//! Erase structure from display list.
|
//! Erase structure from display list.
|
||||||
void EraseStructure (const Handle(Graphic3d_Structure)& theStructure);
|
void EraseStructure (const Handle(Graphic3d_Structure)& theStructure);
|
||||||
|
|
||||||
//! Add structure to the list of immediate structures.
|
|
||||||
void DisplayImmediateStructure (const Handle(Graphic3d_Structure)& theStructure);
|
|
||||||
|
|
||||||
//! Erase structure from display list.
|
|
||||||
void EraseImmediateStructure (const OpenGl_Structure* theStructure);
|
|
||||||
|
|
||||||
//! Insert a new top-level z layer with ID <theLayerId>
|
//! Insert a new top-level z layer with ID <theLayerId>
|
||||||
void AddZLayer (const Graphic3d_ZLayerId theLayerId);
|
void AddZLayer (const Graphic3d_ZLayerId theLayerId);
|
||||||
|
|
||||||
@ -192,17 +186,10 @@ class OpenGl_View : public MMgt_TShared
|
|||||||
//! marks primitive set for rebuild.
|
//! marks primitive set for rebuild.
|
||||||
void InvalidateBVHData (const Standard_Integer theLayerId);
|
void InvalidateBVHData (const Standard_Integer theLayerId);
|
||||||
|
|
||||||
//! Returns list of immediate structures rendered on top of main presentation
|
|
||||||
const OpenGl_IndexedMapOfStructure& ImmediateStructures() const
|
|
||||||
{
|
|
||||||
return myImmediateList;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Returns true if there are immediate structures to display
|
//! Returns true if there are immediate structures to display
|
||||||
bool HasImmediateStructures() const
|
bool HasImmediateStructures() const
|
||||||
{
|
{
|
||||||
return !myImmediateList.IsEmpty()
|
return myZLayers.NbImmediateStructures() != 0;
|
||||||
|| myZLayers.NbImmediateStructures() != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -260,7 +247,6 @@ protected:
|
|||||||
//View_LABDepthCueing - fixed index used
|
//View_LABDepthCueing - fixed index used
|
||||||
|
|
||||||
OpenGl_LayerList myZLayers; //!< main list of displayed structure, sorted by layers
|
OpenGl_LayerList myZLayers; //!< main list of displayed structure, sorted by layers
|
||||||
OpenGl_IndexedMapOfStructure myImmediateList; //!< list of immediate structures rendered on top of main presentation
|
|
||||||
|
|
||||||
//! Modification state
|
//! Modification state
|
||||||
Graphic3d_WorldViewProjState myWorldViewProjState;
|
Graphic3d_WorldViewProjState myWorldViewProjState;
|
||||||
|
@ -552,7 +552,9 @@ void OpenGl_View::RenderStructs (const Handle(OpenGl_Workspace)& theWorkspace,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean toRenderGL = theToDrawImmediate ||
|
Standard_Boolean toRenderGL = theToDrawImmediate ||
|
||||||
theCView.RenderParams.Method != Graphic3d_RM_RAYTRACING || myRaytraceInitStatus == OpenGl_RT_FAIL;
|
theCView.RenderParams.Method != Graphic3d_RM_RAYTRACING ||
|
||||||
|
myRaytraceInitStatus == OpenGl_RT_FAIL ||
|
||||||
|
aCtx->IsFeedback();
|
||||||
|
|
||||||
if (!toRenderGL)
|
if (!toRenderGL)
|
||||||
{
|
{
|
||||||
@ -895,17 +897,6 @@ void OpenGl_View::DisplayStructure (const Handle(Graphic3d_Structure)& theStruct
|
|||||||
myZLayers.AddStructure (aStruct, aZLayer, thePriority);
|
myZLayers.AddStructure (aStruct, aZLayer, thePriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : DisplayImmediateStructure
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
void OpenGl_View::DisplayImmediateStructure (const Handle(Graphic3d_Structure)& theStructure)
|
|
||||||
{
|
|
||||||
const OpenGl_Structure* aStruct = reinterpret_cast<const OpenGl_Structure*> (theStructure->CStructure().operator->());
|
|
||||||
myImmediateList.Add (aStruct);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : EraseStructure
|
//function : EraseStructure
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -916,22 +907,6 @@ void OpenGl_View::EraseStructure (const Handle(Graphic3d_Structure)& theStructur
|
|||||||
myZLayers.RemoveStructure (theStructure);
|
myZLayers.RemoveStructure (theStructure);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : EraseImmediateStructure
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
void OpenGl_View::EraseImmediateStructure (const OpenGl_Structure* theStructure)
|
|
||||||
{
|
|
||||||
const Standard_Integer anIndex = myImmediateList.FindIndex (theStructure);
|
|
||||||
|
|
||||||
if (anIndex != 0)
|
|
||||||
{
|
|
||||||
myImmediateList.Swap (myImmediateList.Size(), anIndex);
|
|
||||||
myImmediateList.RemoveLast();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ChangeZLayer
|
//function : ChangeZLayer
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -761,7 +761,7 @@ bool OpenGl_Workspace::blitBuffers (OpenGl_FrameBuffer* theReadFbo,
|
|||||||
OpenGl_FrameBuffer* theDrawFbo,
|
OpenGl_FrameBuffer* theDrawFbo,
|
||||||
const Standard_Boolean theToFlip)
|
const Standard_Boolean theToFlip)
|
||||||
{
|
{
|
||||||
if (theReadFbo == NULL)
|
if (theReadFbo == NULL || myGlContext->IsFeedback())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1056,8 +1056,7 @@ void OpenGl_Workspace::Redraw (const Graphic3d_CView& theCView,
|
|||||||
{
|
{
|
||||||
myMainSceneFbos[0]->Init (myGlContext, aSizeX, aSizeY);
|
myMainSceneFbos[0]->Init (myGlContext, aSizeX, aSizeY);
|
||||||
}
|
}
|
||||||
if (myToFlipOutput
|
if (!myGlContext->caps->useSystemBuffer && myMainSceneFbos[0]->IsValid())
|
||||||
&& myMainSceneFbos[0]->IsValid())
|
|
||||||
{
|
{
|
||||||
myImmediateSceneFbos[0]->InitLazy (myGlContext, aSizeX, aSizeY);
|
myImmediateSceneFbos[0]->InitLazy (myGlContext, aSizeX, aSizeY);
|
||||||
}
|
}
|
||||||
@ -1168,8 +1167,7 @@ void OpenGl_Workspace::Redraw (const Graphic3d_CView& theCView,
|
|||||||
{
|
{
|
||||||
OpenGl_FrameBuffer* aMainFbo = myMainSceneFbos[0]->IsValid() ? myMainSceneFbos[0].operator->() : NULL;
|
OpenGl_FrameBuffer* aMainFbo = myMainSceneFbos[0]->IsValid() ? myMainSceneFbos[0].operator->() : NULL;
|
||||||
OpenGl_FrameBuffer* anImmFbo = aFrameBuffer;
|
OpenGl_FrameBuffer* anImmFbo = aFrameBuffer;
|
||||||
if (myToFlipOutput
|
if (!myGlContext->caps->useSystemBuffer && myImmediateSceneFbos[0]->IsValid())
|
||||||
&& myImmediateSceneFbos[0]->IsValid())
|
|
||||||
{
|
{
|
||||||
anImmFbo = myImmediateSceneFbos[0].operator->();
|
anImmFbo = myImmediateSceneFbos[0].operator->();
|
||||||
}
|
}
|
||||||
@ -1482,8 +1480,7 @@ void OpenGl_Workspace::RedrawImmediate (const Graphic3d_CView& theCView,
|
|||||||
{
|
{
|
||||||
OpenGl_FrameBuffer* aMainFbo = myMainSceneFbos[0]->IsValid() ? myMainSceneFbos[0].operator->() : NULL;
|
OpenGl_FrameBuffer* aMainFbo = myMainSceneFbos[0]->IsValid() ? myMainSceneFbos[0].operator->() : NULL;
|
||||||
OpenGl_FrameBuffer* anImmFbo = aFrameBuffer;
|
OpenGl_FrameBuffer* anImmFbo = aFrameBuffer;
|
||||||
if (myToFlipOutput
|
if (!myGlContext->caps->useSystemBuffer && myImmediateSceneFbos[0]->IsValid())
|
||||||
&& myImmediateSceneFbos[0]->IsValid())
|
|
||||||
{
|
{
|
||||||
anImmFbo = myImmediateSceneFbos[0].operator->();
|
anImmFbo = myImmediateSceneFbos[0].operator->();
|
||||||
}
|
}
|
||||||
@ -1586,21 +1583,6 @@ bool OpenGl_Workspace::redrawImmediate (const Graphic3d_CView& theCView,
|
|||||||
|
|
||||||
myView->Render (myPrintContext, aWS, theDrawFbo, theProjection,
|
myView->Render (myPrintContext, aWS, theDrawFbo, theProjection,
|
||||||
theCView, theCUnderLayer, theCOverLayer, Standard_True);
|
theCView, theCUnderLayer, theCOverLayer, Standard_True);
|
||||||
if (!myView->ImmediateStructures().IsEmpty())
|
|
||||||
{
|
|
||||||
myUseZBuffer = Standard_False;
|
|
||||||
glDisable (GL_DEPTH_TEST);
|
|
||||||
}
|
|
||||||
for (OpenGl_IndexedMapOfStructure::Iterator anIter (myView->ImmediateStructures()); anIter.More(); anIter.Next())
|
|
||||||
{
|
|
||||||
const OpenGl_Structure* aStructure = anIter.Value();
|
|
||||||
if (!aStructure->IsVisible())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
aStructure->Render (aWS);
|
|
||||||
}
|
|
||||||
|
|
||||||
return !toCopyBackToFront;
|
return !toCopyBackToFront;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,9 @@
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
Prs3d_PresentationShadow::Prs3d_PresentationShadow (const Handle(Graphic3d_StructureManager)& theViewer,
|
Prs3d_PresentationShadow::Prs3d_PresentationShadow (const Handle(Graphic3d_StructureManager)& theViewer,
|
||||||
const Handle(Prs3d_Presentation)& thePrs)
|
const Handle(Prs3d_Presentation)& thePrs)
|
||||||
: Prs3d_Presentation (theViewer, thePrs)
|
: Prs3d_Presentation (theViewer, thePrs),
|
||||||
|
myParentStructId (thePrs->Identification()),
|
||||||
|
myParentAffinity (thePrs->CStructure()->ViewAffinity)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,20 @@ public:
|
|||||||
Standard_EXPORT Prs3d_PresentationShadow (const Handle(Graphic3d_StructureManager)& theViewer,
|
Standard_EXPORT Prs3d_PresentationShadow (const Handle(Graphic3d_StructureManager)& theViewer,
|
||||||
const Handle(Prs3d_Presentation)& thePrs);
|
const Handle(Prs3d_Presentation)& thePrs);
|
||||||
|
|
||||||
|
//! Returns the id of the parent presentation
|
||||||
|
Standard_EXPORT inline Standard_Integer ParentId() const { return myParentStructId; }
|
||||||
|
|
||||||
|
//! Returns view affinity of the parent presentation
|
||||||
|
Standard_EXPORT inline const Handle(Graphic3d_ViewAffinity)& ParentAffinity() const { return myParentAffinity; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
DEFINE_STANDARD_RTTI(Prs3d_PresentationShadow, Prs3d_Presentation)
|
DEFINE_STANDARD_RTTI(Prs3d_PresentationShadow, Prs3d_Presentation)
|
||||||
|
|
||||||
|
private:
|
||||||
|
Standard_Integer myParentStructId;
|
||||||
|
Handle(Graphic3d_ViewAffinity) myParentAffinity;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_STANDARD_HANDLE(Prs3d_PresentationShadow, Prs3d_Presentation)
|
DEFINE_STANDARD_HANDLE(Prs3d_PresentationShadow, Prs3d_Presentation)
|
||||||
|
@ -324,40 +324,108 @@ void PrsMgr_PresentationManager::BeginImmediateDraw()
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
void PrsMgr_PresentationManager::ClearImmediateDraw()
|
void PrsMgr_PresentationManager::ClearImmediateDraw()
|
||||||
{
|
{
|
||||||
if (myImmediateView.IsNull())
|
|
||||||
{
|
|
||||||
myImmediateList.Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
|
for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
|
||||||
{
|
{
|
||||||
myImmediateView->View()->EraseImmediate (anIter.Value());
|
anIter.Value()->Erase();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (PrsMgr_ListOfPresentations::Iterator anIter (myViewDependentImmediateList); anIter.More(); anIter.Next())
|
||||||
|
{
|
||||||
|
anIter.Value()->Erase();
|
||||||
}
|
}
|
||||||
|
|
||||||
myImmediateList.Clear();
|
myImmediateList.Clear();
|
||||||
myImmediateView.Nullify();
|
myViewDependentImmediateList.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : displayImmediate
|
||||||
|
// purpose : Handles the structures from myImmediateList and its visibility
|
||||||
|
// in all views of the viewer given by setting proper affinity
|
||||||
|
// =======================================================================
|
||||||
|
void PrsMgr_PresentationManager::displayImmediate (const Handle(V3d_Viewer)& theViewer)
|
||||||
|
{
|
||||||
|
for (theViewer->InitActiveViews(); theViewer->MoreActiveViews(); theViewer->NextActiveViews())
|
||||||
|
{
|
||||||
|
const Handle(Visual3d_View)& aView = theViewer->ActiveView()->View();
|
||||||
|
for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
|
||||||
|
{
|
||||||
|
const Handle(Prs3d_Presentation)& aPrs = anIter.Value();
|
||||||
|
if (aPrs.IsNull())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Handle(Prs3d_Presentation) aViewDepPrs;
|
||||||
|
Handle(Prs3d_PresentationShadow) aShadowPrs = Handle(Prs3d_PresentationShadow)::DownCast (aPrs);
|
||||||
|
if (!aShadowPrs.IsNull() && aView->IsComputed (aShadowPrs->ParentId(), aViewDepPrs))
|
||||||
|
{
|
||||||
|
aShadowPrs.Nullify();
|
||||||
|
aShadowPrs = new Prs3d_PresentationShadow (myStructureManager, aViewDepPrs);
|
||||||
|
aShadowPrs->SetZLayer (aViewDepPrs->CStructure()->ZLayer());
|
||||||
|
aShadowPrs->SetClipPlanes (aViewDepPrs->GetClipPlanes());
|
||||||
|
aShadowPrs->CStructure()->IsForHighlight = 1;
|
||||||
|
aShadowPrs->Highlight (Aspect_TOHM_COLOR, aPrs->HighlightColor());
|
||||||
|
myViewDependentImmediateList.Append (aShadowPrs);
|
||||||
|
}
|
||||||
|
// handles custom highlight presentations which were defined in overriden
|
||||||
|
// HilightOwnerWithColor method of a custom AIS objects and maintain its
|
||||||
|
// visibility in different views on their own
|
||||||
|
else if (aShadowPrs.IsNull())
|
||||||
|
{
|
||||||
|
aPrs->Display();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!aShadowPrs->IsDisplayed())
|
||||||
|
{
|
||||||
|
aShadowPrs->CStructure()->ViewAffinity = new Graphic3d_ViewAffinity();
|
||||||
|
aShadowPrs->CStructure()->ViewAffinity->SetVisible (Standard_False);
|
||||||
|
aShadowPrs->Display();
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Integer aViewId = aView->Identification();
|
||||||
|
bool isParentVisible = aShadowPrs->ParentAffinity().IsNull() ?
|
||||||
|
Standard_True : aShadowPrs->ParentAffinity()->IsVisible (aViewId);
|
||||||
|
aShadowPrs->CStructure()->ViewAffinity->SetVisible (aViewId, isParentVisible);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// function : EndImmediateDraw
|
// function : EndImmediateDraw
|
||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void PrsMgr_PresentationManager::EndImmediateDraw (const Handle(V3d_View)& theView)
|
void PrsMgr_PresentationManager::EndImmediateDraw (const Handle(V3d_Viewer)& theViewer)
|
||||||
{
|
{
|
||||||
if (--myImmediateModeOn > 0)
|
if (--myImmediateModeOn > 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
displayImmediate (theViewer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : RedrawImmediate
|
||||||
|
// purpose : Clears all immediate structures and redisplays with proper
|
||||||
|
// affinity
|
||||||
|
//=======================================================================
|
||||||
|
void PrsMgr_PresentationManager::RedrawImmediate (const Handle(V3d_Viewer)& theViewer)
|
||||||
|
{
|
||||||
|
if (myImmediateList.IsEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Clear previously displayed structures
|
||||||
for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
|
for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
|
||||||
{
|
{
|
||||||
theView->View()->DisplayImmediate (anIter.Value(), Standard_True);
|
anIter.Value()->Erase();
|
||||||
}
|
}
|
||||||
if (!myImmediateList.IsEmpty())
|
for (PrsMgr_ListOfPresentations::Iterator anIter (myViewDependentImmediateList); anIter.More(); anIter.Next())
|
||||||
{
|
{
|
||||||
myImmediateView = theView;
|
anIter.Value()->Erase();
|
||||||
}
|
}
|
||||||
|
myViewDependentImmediateList.Clear();
|
||||||
|
|
||||||
|
displayImmediate (theViewer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@ -526,11 +594,12 @@ void PrsMgr_PresentationManager::Transform (const Handle(PrsMgr_PresentableObjec
|
|||||||
void PrsMgr_PresentationManager::Color (const Handle(PrsMgr_PresentableObject)& thePrsObj,
|
void PrsMgr_PresentationManager::Color (const Handle(PrsMgr_PresentableObject)& thePrsObj,
|
||||||
const Quantity_NameOfColor theColor,
|
const Quantity_NameOfColor theColor,
|
||||||
const Standard_Integer theMode,
|
const Standard_Integer theMode,
|
||||||
const Handle(PrsMgr_PresentableObject)& theSelObj)
|
const Handle(PrsMgr_PresentableObject)& theSelObj,
|
||||||
|
const Standard_Integer theImmediateStructLayerId)
|
||||||
{
|
{
|
||||||
for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
|
for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
|
||||||
{
|
{
|
||||||
Color (anIter.Value(), theColor, theMode);
|
Color (anIter.Value(), theColor, theMode, NULL, theImmediateStructLayerId);
|
||||||
}
|
}
|
||||||
if (!thePrsObj->HasOwnPresentations())
|
if (!thePrsObj->HasOwnPresentations())
|
||||||
{
|
{
|
||||||
@ -546,6 +615,9 @@ void PrsMgr_PresentationManager::Color (const Handle(PrsMgr_PresentableObject)&
|
|||||||
if (myImmediateModeOn > 0)
|
if (myImmediateModeOn > 0)
|
||||||
{
|
{
|
||||||
Handle(Prs3d_PresentationShadow) aShadow = new Prs3d_PresentationShadow (myStructureManager, aPrs->Presentation());
|
Handle(Prs3d_PresentationShadow) aShadow = new Prs3d_PresentationShadow (myStructureManager, aPrs->Presentation());
|
||||||
|
aShadow->SetZLayer (theImmediateStructLayerId);
|
||||||
|
aShadow->SetClipPlanes (aPrs->Presentation()->GetClipPlanes());
|
||||||
|
aShadow->CStructure()->IsForHighlight = 1;
|
||||||
aShadow->Highlight (Aspect_TOHM_COLOR, theColor);
|
aShadow->Highlight (Aspect_TOHM_COLOR, theColor);
|
||||||
AddToImmediateList (aShadow);
|
AddToImmediateList (aShadow);
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,9 @@
|
|||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
#include <Quantity_NameOfColor.hxx>
|
#include <Quantity_NameOfColor.hxx>
|
||||||
#include <Graphic3d_NameOfMaterial.hxx>
|
#include <Graphic3d_NameOfMaterial.hxx>
|
||||||
|
#include <Graphic3d_ZLayerId.hxx>
|
||||||
class Visual3d_ViewManager;
|
class Visual3d_ViewManager;
|
||||||
class V3d_View;
|
class V3d_Viewer;
|
||||||
class Standard_NoSuchObject;
|
class Standard_NoSuchObject;
|
||||||
class PrsMgr_PresentableObject;
|
class PrsMgr_PresentableObject;
|
||||||
class Prs3d_Presentation;
|
class Prs3d_Presentation;
|
||||||
@ -116,18 +117,25 @@ public:
|
|||||||
//! Stores thePrs in the transient list of presentations to be displayed in immediate mode.
|
//! Stores thePrs in the transient list of presentations to be displayed in immediate mode.
|
||||||
//! Will be taken in account in EndImmediateDraw method.
|
//! Will be taken in account in EndImmediateDraw method.
|
||||||
Standard_EXPORT void AddToImmediateList (const Handle(Prs3d_Presentation)& thePrs);
|
Standard_EXPORT void AddToImmediateList (const Handle(Prs3d_Presentation)& thePrs);
|
||||||
|
|
||||||
//! Allows rapid drawing of the view theView by avoiding an update of the whole background.
|
//! Allows rapid drawing of the each view in theViewer by avoiding an update of the whole background.
|
||||||
Standard_EXPORT void EndImmediateDraw (const Handle(V3d_View)& theView);
|
Standard_EXPORT void EndImmediateDraw (const Handle(V3d_Viewer)& theViewer);
|
||||||
|
|
||||||
|
//! Clears and redisplays immediate structures of the viewer taking into account its affinity.
|
||||||
|
Standard_EXPORT void RedrawImmediate (const Handle(V3d_Viewer)& theViewer);
|
||||||
|
|
||||||
//! Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
|
//! Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
|
||||||
Standard_Boolean IsImmediateModeOn() const;
|
Standard_EXPORT Standard_Boolean IsImmediateModeOn() const;
|
||||||
|
|
||||||
//! Highlights the graphic object thePrsObject in the color theColor.
|
//! Highlights the graphic object thePrsObject in the color theColor.
|
||||||
//! thePrsObject has the display mode theMode;
|
//! thePrsObject has the display mode theMode;
|
||||||
//! this has the default value of 0, that is, the wireframe display mode.
|
//! this has the default value of 0, that is, the wireframe display mode.
|
||||||
Standard_EXPORT void Color (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Quantity_NameOfColor theColor = Quantity_NOC_YELLOW, const Standard_Integer theMode = 0, const Handle(PrsMgr_PresentableObject)& theSelObj = NULL);
|
Standard_EXPORT void Color (const Handle(PrsMgr_PresentableObject)& thePrsObject,
|
||||||
|
const Quantity_NameOfColor theColor = Quantity_NOC_YELLOW,
|
||||||
|
const Standard_Integer theMode = 0,
|
||||||
|
const Handle(PrsMgr_PresentableObject)& theSelObj = NULL,
|
||||||
|
const Graphic3d_ZLayerId theImmediateStructLayerId = Graphic3d_ZLayerId_Topmost);
|
||||||
|
|
||||||
//! highlights the boundbox of the presentation
|
//! highlights the boundbox of the presentation
|
||||||
Standard_EXPORT void BoundBox (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode = 0);
|
Standard_EXPORT void BoundBox (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode = 0);
|
||||||
|
|
||||||
@ -170,15 +178,15 @@ protected:
|
|||||||
Handle(Visual3d_ViewManager) myStructureManager;
|
Handle(Visual3d_ViewManager) myStructureManager;
|
||||||
Standard_Integer myImmediateModeOn;
|
Standard_Integer myImmediateModeOn;
|
||||||
PrsMgr_ListOfPresentations myImmediateList;
|
PrsMgr_ListOfPresentations myImmediateList;
|
||||||
Handle(V3d_View) myImmediateView;
|
PrsMgr_ListOfPresentations myViewDependentImmediateList;
|
||||||
Quantity_Color mySelectionColor;
|
Quantity_Color mySelectionColor;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
//! Handles the structures from <myImmediateList> and displays it separating view-dependent structures and taking into account
|
||||||
|
//! structure visibility by setting proper affinity.
|
||||||
|
void displayImmediate (const Handle(V3d_Viewer)& theViewer);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -417,13 +417,14 @@ static Standard_Integer OCC74bug_set (Draw_Interpretor& di, Standard_Integer arg
|
|||||||
di << argv[1] << " : No interactive object" << "\n";
|
di << argv[1] << " : No interactive object" << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
AISObj->SetSelectionMode(SelectMode);
|
|
||||||
if (!aContext->HasOpenedContext()) {
|
if (!aContext->HasOpenedContext()) {
|
||||||
aContext->OpenLocalContext();
|
aContext->OpenLocalContext();
|
||||||
}
|
}
|
||||||
aContext->Erase(AISObj, updateviewer);
|
aContext->Erase(AISObj, updateviewer);
|
||||||
aContext->UpdateCurrentViewer();
|
aContext->UpdateCurrentViewer();
|
||||||
|
aContext->SetAutoActivateSelection (Standard_False);
|
||||||
aContext->Display(AISObj, updateviewer);
|
aContext->Display(AISObj, updateviewer);
|
||||||
|
aContext->Activate (AISObj, SelectMode);
|
||||||
aContext->UpdateCurrentViewer();
|
aContext->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -456,8 +457,10 @@ static Standard_Integer OCC74bug_get (Draw_Interpretor& di, Standard_Integer arg
|
|||||||
di << argv[1] << " : No interactive object" << "\n";
|
di << argv[1] << " : No interactive object" << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
Standard_Integer SelectMode = AISObj->SelectionMode();
|
TColStd_ListOfInteger anActivatedModes;
|
||||||
di << SelectMode << "\n";
|
aContext->ActivatedModes (AISObj, anActivatedModes);
|
||||||
|
Standard_Integer aMode = anActivatedModes.IsEmpty() ? -1 : anActivatedModes.Last();
|
||||||
|
di << aMode << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -218,24 +218,24 @@ static Standard_Integer OCC136 (Draw_Interpretor& di, Standard_Integer argc, con
|
|||||||
anAISCtx->EraseAll();
|
anAISCtx->EraseAll();
|
||||||
|
|
||||||
//load primitives to context
|
//load primitives to context
|
||||||
Handle(AIS_Shape) aSh1 = new AIS_Shape(aBox);
|
Handle(AIS_InteractiveObject) aSh1 = new AIS_Shape(aBox);
|
||||||
anAISCtx->Display(aSh1);
|
anAISCtx->Display(aSh1);
|
||||||
|
|
||||||
Handle(AIS_Shape) aSh2 = new AIS_Shape(aSphere);
|
Handle(AIS_InteractiveObject) aSh2 = new AIS_Shape(aSphere);
|
||||||
anAISCtx->Display(aSh2);
|
anAISCtx->Display(aSh2);
|
||||||
|
|
||||||
Handle(AIS_Shape) aSh3 = new AIS_Shape(aCone);
|
Handle(AIS_InteractiveObject) aSh3 = new AIS_Shape(aCone);
|
||||||
anAISCtx->Display(aSh3);
|
anAISCtx->Display(aSh3);
|
||||||
|
|
||||||
Handle(AIS_Shape) aSh4 = new AIS_Shape(aCyl);
|
Handle(AIS_InteractiveObject) aSh4 = new AIS_Shape(aCyl);
|
||||||
anAISCtx->Display(aSh4);
|
anAISCtx->Display(aSh4);
|
||||||
|
|
||||||
//set selected
|
//set selected
|
||||||
anAISCtx->InitCurrent();
|
anAISCtx->InitSelected();
|
||||||
anAISCtx->AddOrRemoveCurrentObject(aSh1);
|
anAISCtx->AddOrRemoveSelected(aSh1);
|
||||||
anAISCtx->AddOrRemoveCurrentObject(aSh2);
|
anAISCtx->AddOrRemoveSelected(aSh2);
|
||||||
anAISCtx->AddOrRemoveCurrentObject(aSh3);
|
anAISCtx->AddOrRemoveSelected(aSh3);
|
||||||
anAISCtx->AddOrRemoveCurrentObject(aSh4);
|
anAISCtx->AddOrRemoveSelected(aSh4);
|
||||||
|
|
||||||
//remove all this objects from context
|
//remove all this objects from context
|
||||||
anAISCtx->Remove (aSh1, Standard_False);
|
anAISCtx->Remove (aSh1, Standard_False);
|
||||||
@ -739,12 +739,13 @@ static Standard_Integer OCC166 (Draw_Interpretor& di, Standard_Integer /*argc*/,
|
|||||||
|
|
||||||
BRepPrimAPI_MakeBox aBox(gp_Pnt(0, 0, 0), 100, 100, 100);
|
BRepPrimAPI_MakeBox aBox(gp_Pnt(0, 0, 0), 100, 100, 100);
|
||||||
Handle(AIS_Shape) anAISBox = new AIS_Shape(aBox.Shape());
|
Handle(AIS_Shape) anAISBox = new AIS_Shape(aBox.Shape());
|
||||||
|
myAISContext->SetAutoActivateSelection (Standard_False);
|
||||||
myAISContext->Display(anAISBox, 1);
|
myAISContext->Display(anAISBox, 1);
|
||||||
anAISBox->SetSelectionMode(-1);
|
|
||||||
Standard_Integer myLocContInd = myAISContext->OpenLocalContext();
|
Standard_Integer myLocContInd = myAISContext->OpenLocalContext();
|
||||||
myAISContext->CloseLocalContext(myLocContInd);
|
myAISContext->CloseLocalContext(myLocContInd);
|
||||||
Standard_Integer aSelMode = ((Handle(AIS_InteractiveObject)) anAISBox)->SelectionMode();
|
TColStd_ListOfInteger anActivatedModes;
|
||||||
if(aSelMode != -1)
|
myAISContext->ActivatedModes (anAISBox, anActivatedModes);
|
||||||
|
if(anActivatedModes.Extent() != 1 || anActivatedModes.First() != -1 )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -5258,7 +5259,7 @@ Standard_Integer CR23234 (Draw_Interpretor& di, Standard_Integer argc, const cha
|
|||||||
Handle(Geom_Axis2Placement) trihedronAxis = new Geom_Axis2Placement(gp::XOY());
|
Handle(Geom_Axis2Placement) trihedronAxis = new Geom_Axis2Placement(gp::XOY());
|
||||||
Handle(AIS_Trihedron) trihedron = new AIS_Trihedron(trihedronAxis);
|
Handle(AIS_Trihedron) trihedron = new AIS_Trihedron(trihedronAxis);
|
||||||
if (aMode)
|
if (aMode)
|
||||||
trihedron->UnsetSelectionMode(); // this line causes an exception on OpenLocalContext
|
aisContext->SetAutoActivateSelection (Standard_False); // if selection must not be activated
|
||||||
trihedron->SetSize(20);
|
trihedron->SetSize(20);
|
||||||
trihedron->SetColor(Quantity_NOC_GRAY30);
|
trihedron->SetColor(Quantity_NOC_GRAY30);
|
||||||
trihedron->SetArrowColor(Quantity_NOC_GRAY30);
|
trihedron->SetArrowColor(Quantity_NOC_GRAY30);
|
||||||
|
@ -391,29 +391,29 @@ static Standard_Integer OCC138 (Draw_Interpretor& di, Standard_Integer /*argc*/
|
|||||||
BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
|
BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
|
||||||
BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
|
BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
|
||||||
|
|
||||||
Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
|
Handle(AIS_InteractiveObject) ais1 = new AIS_Shape(box1.Shape());
|
||||||
Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
|
Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
|
||||||
Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
|
Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
|
||||||
|
|
||||||
aContext->Display(ais1);
|
aContext->Display(ais1);
|
||||||
aContext->Display(ais2);
|
aContext->Display(ais2);
|
||||||
aContext->Display(ais3);
|
aContext->Display(ais3);
|
||||||
|
|
||||||
aContext->AddOrRemoveCurrentObject(ais1);
|
aContext->AddOrRemoveSelected(ais1);
|
||||||
aContext->AddOrRemoveCurrentObject(ais2);
|
aContext->AddOrRemoveSelected(ais2);
|
||||||
aContext->AddOrRemoveCurrentObject(ais3);
|
aContext->AddOrRemoveSelected(ais3);
|
||||||
|
|
||||||
di << "\n No of currents = " << aContext->NbCurrents();
|
di << "\n No of currents = " << aContext->NbSelected();
|
||||||
|
|
||||||
aContext->InitCurrent();
|
aContext->InitSelected();
|
||||||
|
|
||||||
int count = 1;
|
int count = 1;
|
||||||
while(aContext->MoreCurrent())
|
while(aContext->MoreSelected())
|
||||||
{
|
{
|
||||||
di << "\n count is = " << count++;
|
di << "\n count is = " << count++;
|
||||||
Handle(AIS_InteractiveObject) ais = aContext->Current();
|
Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
|
||||||
aContext->AddOrRemoveCurrentObject(ais);
|
aContext->AddOrRemoveSelected(ais);
|
||||||
aContext->InitCurrent();
|
aContext->InitSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -683,9 +683,9 @@ static Standard_Integer OCC189 (Draw_Interpretor& di, Standard_Integer /*argc*/
|
|||||||
BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300, 300));
|
BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300, 300));
|
||||||
BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500, 500));
|
BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500, 500));
|
||||||
|
|
||||||
Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
|
Handle(AIS_InteractiveObject) ais1 = new AIS_Shape(box1.Shape());
|
||||||
Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
|
Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
|
||||||
Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
|
Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
|
||||||
|
|
||||||
aContext1->Display(ais1);
|
aContext1->Display(ais1);
|
||||||
aContext1->Display(ais2);
|
aContext1->Display(ais2);
|
||||||
@ -695,51 +695,51 @@ static Standard_Integer OCC189 (Draw_Interpretor& di, Standard_Integer /*argc*/
|
|||||||
aContext2->Display(ais2);
|
aContext2->Display(ais2);
|
||||||
aContext2->Display(ais3);
|
aContext2->Display(ais3);
|
||||||
|
|
||||||
aContext1->AddOrRemoveCurrentObject(ais1);
|
aContext1->AddOrRemoveSelected(ais1);
|
||||||
aContext1->AddOrRemoveCurrentObject(ais2);
|
aContext1->AddOrRemoveSelected(ais2);
|
||||||
aContext1->AddOrRemoveCurrentObject(ais3);
|
aContext1->AddOrRemoveSelected(ais3);
|
||||||
|
|
||||||
di << "\n Stage : 1";
|
di << "\n Stage : 1";
|
||||||
di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
|
di << "\n \t No of currents on aContext1 = " << aContext1->NbSelected();
|
||||||
di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
|
di << "\n \t No of currents on aContext2 = " << aContext2->NbSelected() << "\n\n";
|
||||||
|
|
||||||
di << "\n aContext1->IsCurrent = " << (Standard_Integer) aContext1->IsCurrent(ais1) << ", aContext2->IsCurrent = " << (Standard_Integer) aContext2->IsCurrent(ais1) << " ";
|
di << "\n aContext1->IsSelected = " << (Standard_Integer) aContext1->IsCurrent(ais1) << ", aContext2->IsCurrent = " << (Standard_Integer) aContext2->IsCurrent(ais1) << " ";
|
||||||
|
|
||||||
aContext2->AddOrRemoveCurrentObject(ais1);
|
aContext2->AddOrRemoveSelected(ais1);
|
||||||
aContext2->AddOrRemoveCurrentObject(ais2);
|
aContext2->AddOrRemoveSelected(ais2);
|
||||||
aContext2->AddOrRemoveCurrentObject(ais3);
|
aContext2->AddOrRemoveSelected(ais3);
|
||||||
|
|
||||||
di << "\n Stage : 2";
|
di << "\n Stage : 2";
|
||||||
di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
|
di << "\n \t No of currents on aContext1 = " << aContext1->NbSelected();
|
||||||
di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
|
di << "\n \t No of currents on aContext2 = " << aContext2->NbSelected() << "\n\n";
|
||||||
|
|
||||||
aContext1->InitCurrent();
|
aContext1->InitSelected();
|
||||||
int count1 = 1;
|
int count1 = 1;
|
||||||
while(aContext1->MoreCurrent())
|
while(aContext1->MoreSelected())
|
||||||
{
|
{
|
||||||
di << "\n count1 is = " << count1++;
|
di << "\n count1 is = " << count1++;
|
||||||
Handle(AIS_InteractiveObject) ais = aContext1->Current();
|
Handle(AIS_InteractiveObject) ais = aContext1->SelectedInteractive();
|
||||||
aContext1->AddOrRemoveCurrentObject(ais);
|
aContext1->AddOrRemoveSelected(ais);
|
||||||
aContext1->InitCurrent();
|
aContext1->InitSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
di << "\n Stage : 3";
|
di << "\n Stage : 3";
|
||||||
di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
|
di << "\n \t No of currents on aContext1 = " << aContext1->NbSelected();
|
||||||
di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
|
di << "\n \t No of currents on aContext2 = " << aContext2->NbSelected() << "\n\n";
|
||||||
|
|
||||||
aContext2->InitCurrent();
|
aContext2->InitSelected();
|
||||||
int count2 = 1;
|
int count2 = 1;
|
||||||
while(aContext2->MoreCurrent())
|
while(aContext2->MoreSelected())
|
||||||
{
|
{
|
||||||
di << "\n count2 is = " << count2++;
|
di << "\n count2 is = " << count2++;
|
||||||
Handle(AIS_InteractiveObject) ais = aContext2->Current();
|
Handle(AIS_InteractiveObject) ais = aContext2->SelectedInteractive();
|
||||||
aContext2->AddOrRemoveCurrentObject(ais);
|
aContext2->AddOrRemoveSelected(ais);
|
||||||
aContext2->InitCurrent();
|
aContext2->InitSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
di << "\n\n Stage : 4";
|
di << "\n\n Stage : 4";
|
||||||
di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
|
di << "\n \t No of currents on aContext1 = " << aContext1->NbSelected();
|
||||||
di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents();
|
di << "\n \t No of currents on aContext2 = " << aContext2->NbSelected();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ static Standard_Integer OCC172 (Draw_Interpretor& di, Standard_Integer /*argc*/
|
|||||||
AIS_ListIteratorOfListOfInteractive It;
|
AIS_ListIteratorOfListOfInteractive It;
|
||||||
for (It.Initialize(aListOfIO);It.More();It.Next())
|
for (It.Initialize(aListOfIO);It.More();It.Next())
|
||||||
{
|
{
|
||||||
aContext->AddOrRemoveCurrentObject(It.Value());
|
aContext->AddOrRemoveSelected(It.Value());
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -96,29 +96,29 @@ static Standard_Integer OCC204 (Draw_Interpretor& di, Standard_Integer argc, co
|
|||||||
BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120 + deltaY, 120), gp_Pnt(300, 300 + deltaY,300));
|
BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120 + deltaY, 120), gp_Pnt(300, 300 + deltaY,300));
|
||||||
BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320 + deltaY, 320), gp_Pnt(500, 500 + deltaY,500));
|
BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320 + deltaY, 320), gp_Pnt(500, 500 + deltaY,500));
|
||||||
|
|
||||||
Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
|
Handle(AIS_InteractiveObject) ais1 = new AIS_Shape(box1.Shape());
|
||||||
Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
|
Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
|
||||||
Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
|
Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
|
||||||
|
|
||||||
aContext->Display(ais1);
|
aContext->Display(ais1);
|
||||||
aContext->Display(ais2);
|
aContext->Display(ais2);
|
||||||
aContext->Display(ais3);
|
aContext->Display(ais3);
|
||||||
|
|
||||||
aContext->AddOrRemoveCurrentObject(ais1);
|
aContext->AddOrRemoveSelected(ais1);
|
||||||
aContext->AddOrRemoveCurrentObject(ais2);
|
aContext->AddOrRemoveSelected(ais2);
|
||||||
aContext->AddOrRemoveCurrentObject(ais3);
|
aContext->AddOrRemoveSelected(ais3);
|
||||||
|
|
||||||
//printf("\n No of currents = %d", aContext->NbCurrents());
|
//printf("\n No of currents = %d", aContext->NbCurrents());
|
||||||
|
|
||||||
aContext->InitCurrent();
|
aContext->InitSelected();
|
||||||
|
|
||||||
//int count = 1;
|
//int count = 1;
|
||||||
while(aContext->MoreCurrent())
|
while(aContext->MoreSelected())
|
||||||
{
|
{
|
||||||
//printf("\n count is = %d", count++);
|
//printf("\n count is = %d", count++);
|
||||||
Handle(AIS_InteractiveObject) ais = aContext->Current();
|
Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
|
||||||
aContext->Remove(ais, UpdateViewer);
|
aContext->Remove(ais, UpdateViewer);
|
||||||
aContext->InitCurrent();
|
aContext->InitSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -90,7 +90,11 @@ void SelectMgr_EntityOwner::HilightWithColor(const Handle(PrsMgr_PresentationMan
|
|||||||
{
|
{
|
||||||
if( HasSelectable() ) {
|
if( HasSelectable() ) {
|
||||||
if( IsAutoHilight() )
|
if( IsAutoHilight() )
|
||||||
PM->Color(mySelectable,aColor,aMode);
|
{
|
||||||
|
const Graphic3d_ZLayerId aLayerId = mySelectable->GlobalSelOwner().get() == this ?
|
||||||
|
Graphic3d_ZLayerId_Top : Graphic3d_ZLayerId_Topmost;
|
||||||
|
PM->Color(mySelectable,aColor,aMode, NULL, aLayerId);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
mySelectable->HilightOwnerWithColor( PM, aColor, this );
|
mySelectable->HilightOwnerWithColor( PM, aColor, this );
|
||||||
}
|
}
|
||||||
|
@ -55,12 +55,13 @@ static Standard_Integer Search (const SelectMgr_SequenceOfSelection& seq,
|
|||||||
// Purpose :
|
// Purpose :
|
||||||
//==================================================
|
//==================================================
|
||||||
|
|
||||||
SelectMgr_SelectableObject::SelectMgr_SelectableObject( const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):
|
SelectMgr_SelectableObject::SelectMgr_SelectableObject (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d)
|
||||||
PrsMgr_PresentableObject (aTypeOfPresentation3d),
|
: PrsMgr_PresentableObject (aTypeOfPresentation3d),
|
||||||
myDrawer (new Prs3d_Drawer()),
|
myDrawer (new Prs3d_Drawer()),
|
||||||
myHilightDrawer (new Prs3d_Drawer()),
|
myHilightDrawer (new Prs3d_Drawer()),
|
||||||
myAssemblyOwner (NULL),
|
myAssemblyOwner (NULL),
|
||||||
myAutoHilight (Standard_True)
|
myAutoHilight (Standard_True),
|
||||||
|
myGlobalSelMode (0)
|
||||||
{
|
{
|
||||||
InitDefaultHilightAttributes (myHilightDrawer);
|
InitDefaultHilightAttributes (myHilightDrawer);
|
||||||
myHilightDrawer->Link (myDrawer);
|
myHilightDrawer->Link (myDrawer);
|
||||||
@ -634,3 +635,25 @@ Bnd_Box SelectMgr_SelectableObject::BndBoxOfSelected (Handle(SelectMgr_IndexedMa
|
|||||||
|
|
||||||
return aBnd;
|
return aBnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GlobalSelOwner
|
||||||
|
//purpose : Returns entity owner corresponding to selection of the object as a whole
|
||||||
|
//=======================================================================
|
||||||
|
Handle(SelectMgr_EntityOwner) SelectMgr_SelectableObject::GlobalSelOwner() const
|
||||||
|
{
|
||||||
|
Handle(SelectMgr_EntityOwner) anOwner;
|
||||||
|
|
||||||
|
if (!HasSelection (myGlobalSelMode))
|
||||||
|
return anOwner;
|
||||||
|
|
||||||
|
const Handle(SelectMgr_Selection)& aGlobalSel = Selection (myGlobalSelMode);
|
||||||
|
if (aGlobalSel->IsEmpty())
|
||||||
|
return anOwner;
|
||||||
|
|
||||||
|
aGlobalSel->Init();
|
||||||
|
anOwner =
|
||||||
|
Handle(SelectMgr_EntityOwner)::DownCast (aGlobalSel->Sensitive()->BaseSensitive()->OwnerId());
|
||||||
|
|
||||||
|
return anOwner;
|
||||||
|
}
|
||||||
|
@ -189,6 +189,12 @@ public:
|
|||||||
//! if they are a part of activated selection
|
//! if they are a part of activated selection
|
||||||
Standard_EXPORT Bnd_Box BndBoxOfSelected (Handle(SelectMgr_IndexedMapOfOwner)& theOwners);
|
Standard_EXPORT Bnd_Box BndBoxOfSelected (Handle(SelectMgr_IndexedMapOfOwner)& theOwners);
|
||||||
|
|
||||||
|
//! Returns the mode for selection of object as a whole
|
||||||
|
inline Standard_Integer GlobalSelectionMode() const;
|
||||||
|
|
||||||
|
//! Returns the owner of mode for selection of object as a whole
|
||||||
|
Standard_EXPORT virtual Handle(SelectMgr_EntityOwner) GlobalSelOwner() const;
|
||||||
|
|
||||||
|
|
||||||
friend class SelectMgr_SelectionManager;
|
friend class SelectMgr_SelectionManager;
|
||||||
|
|
||||||
@ -200,6 +206,8 @@ protected:
|
|||||||
|
|
||||||
Standard_EXPORT SelectMgr_SelectableObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
Standard_EXPORT SelectMgr_SelectableObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
||||||
|
|
||||||
|
inline void setGlobalSelMode (const Standard_Integer theMode);
|
||||||
|
|
||||||
SelectMgr_SequenceOfSelection myselections;
|
SelectMgr_SequenceOfSelection myselections;
|
||||||
Handle(Prs3d_Drawer) myDrawer;
|
Handle(Prs3d_Drawer) myDrawer;
|
||||||
Handle(Prs3d_Drawer) myHilightDrawer;
|
Handle(Prs3d_Drawer) myHilightDrawer;
|
||||||
@ -213,6 +221,7 @@ private:
|
|||||||
Standard_Boolean myAutoHilight;
|
Standard_Boolean myAutoHilight;
|
||||||
Handle(Prs3d_Presentation) mySelectionPrs;
|
Handle(Prs3d_Presentation) mySelectionPrs;
|
||||||
Handle(Prs3d_Presentation) myHilightPrs;
|
Handle(Prs3d_Presentation) myHilightPrs;
|
||||||
|
Standard_Integer myGlobalSelMode;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -32,3 +32,21 @@ Attributes() const
|
|||||||
inline const Handle(Prs3d_Drawer)& SelectMgr_SelectableObject::
|
inline const Handle(Prs3d_Drawer)& SelectMgr_SelectableObject::
|
||||||
HilightAttributes() const
|
HilightAttributes() const
|
||||||
{return myHilightDrawer;}
|
{return myHilightDrawer;}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GlobalSelectionMode
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
inline Standard_Integer SelectMgr_SelectableObject::GlobalSelectionMode() const
|
||||||
|
{
|
||||||
|
return myGlobalSelMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : setGlobalSelMode
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
inline void SelectMgr_SelectableObject::setGlobalSelMode (const Standard_Integer theMode)
|
||||||
|
{
|
||||||
|
myGlobalSelMode = theMode > 0 ? theMode : 0;
|
||||||
|
}
|
||||||
|
@ -134,6 +134,8 @@ void StdSelect_BRepOwner::HilightWithColor(const Handle(PrsMgr_PresentationManag
|
|||||||
const Standard_Integer aMode)
|
const Standard_Integer aMode)
|
||||||
{
|
{
|
||||||
Standard_Integer M = (aMode < 0) ? myCurMode : aMode;
|
Standard_Integer M = (aMode < 0) ? myCurMode : aMode;
|
||||||
|
Graphic3d_ZLayerId aHiLayer = this == Selectable()->GlobalSelOwner().get() ?
|
||||||
|
Graphic3d_ZLayerId_Top : Graphic3d_ZLayerId_Topmost;
|
||||||
Handle(SelectMgr_SelectableObject) aSel = Selectable();
|
Handle(SelectMgr_SelectableObject) aSel = Selectable();
|
||||||
if (myFromDecomposition)
|
if (myFromDecomposition)
|
||||||
{
|
{
|
||||||
@ -175,17 +177,17 @@ void StdSelect_BRepOwner::HilightWithColor(const Handle(PrsMgr_PresentationManag
|
|||||||
}
|
}
|
||||||
|
|
||||||
// highlight with color and set layer
|
// highlight with color and set layer
|
||||||
PM->Color (myPrsSh, aCol, M, aSel);
|
PM->Color (myPrsSh, aCol, M, aSel, aHiLayer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!myPrsSh.IsNull())
|
if (!myPrsSh.IsNull())
|
||||||
{
|
{
|
||||||
PM->Color (myPrsSh, aCol, M, aSel);
|
PM->Color (myPrsSh, aCol, M, aSel, aHiLayer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PM->Color (aSel, aCol, M);
|
PM->Color (aSel, aCol, M, NULL, aHiLayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,8 @@
|
|||||||
#include <TDF_RelocationTable.hxx>
|
#include <TDF_RelocationTable.hxx>
|
||||||
#include <TDF_Tool.hxx>
|
#include <TDF_Tool.hxx>
|
||||||
#include <TPrsStd_AISPresentation.hxx>
|
#include <TPrsStd_AISPresentation.hxx>
|
||||||
|
#include <TColStd_ListOfInteger.hxx>
|
||||||
|
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||||
#include <TPrsStd_AISViewer.hxx>
|
#include <TPrsStd_AISViewer.hxx>
|
||||||
#include <TPrsStd_Driver.hxx>
|
#include <TPrsStd_Driver.hxx>
|
||||||
#include <TPrsStd_DriverTable.hxx>
|
#include <TPrsStd_DriverTable.hxx>
|
||||||
@ -576,17 +578,12 @@ void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelecti
|
|||||||
{
|
{
|
||||||
// OCC2932 correction
|
// OCC2932 correction
|
||||||
if(hasOwnSelectionMode && mySelectionMode == theSelectionMode && !myAIS.IsNull())
|
if(hasOwnSelectionMode && mySelectionMode == theSelectionMode && !myAIS.IsNull())
|
||||||
if(myAIS->SelectionMode() == theSelectionMode )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Backup();
|
Backup();
|
||||||
mySelectionMode = theSelectionMode;
|
mySelectionMode = theSelectionMode;
|
||||||
hasOwnSelectionMode = Standard_True;
|
hasOwnSelectionMode = Standard_True;
|
||||||
if( myAIS.IsNull() ) AISUpdate();
|
if( myAIS.IsNull() ) AISUpdate();
|
||||||
if( !myAIS.IsNull() ) {
|
|
||||||
if( myAIS->SelectionMode() == theSelectionMode ) return;
|
|
||||||
myAIS->SetSelectionMode(theSelectionMode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -596,15 +593,12 @@ void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelecti
|
|||||||
void TPrsStd_AISPresentation::UnsetSelectionMode()
|
void TPrsStd_AISPresentation::UnsetSelectionMode()
|
||||||
{
|
{
|
||||||
if(!hasOwnSelectionMode && !myAIS.IsNull())
|
if(!hasOwnSelectionMode && !myAIS.IsNull())
|
||||||
if(!myAIS->HasSelectionMode())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Backup();
|
Backup();
|
||||||
hasOwnSelectionMode = Standard_False;
|
hasOwnSelectionMode = Standard_False;
|
||||||
if( myAIS.IsNull() ) AISUpdate();
|
if( myAIS.IsNull() ) AISUpdate();
|
||||||
if( !myAIS.IsNull() && myAIS->HasSelectionMode() ) {
|
mySelectionMode = myAIS->GlobalSelectionMode();
|
||||||
myAIS->UnsetSelectionMode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -921,9 +915,25 @@ void TPrsStd_AISPresentation::AISUpdate ()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasOwnSelectionMode) {
|
if (hasOwnSelectionMode) {
|
||||||
if (myAIS->SelectionMode() != mySelectionMode ) {
|
const Handle(AIS_InteractiveContext) aContext =
|
||||||
myAIS->SetSelectionMode(mySelectionMode);
|
ctx.IsNull() ? myAIS->GetContext() : ctx;
|
||||||
|
if (!aContext.IsNull())
|
||||||
|
{
|
||||||
|
TColStd_ListOfInteger anActivatedModes;
|
||||||
|
aContext->ActivatedModes (myAIS, anActivatedModes);
|
||||||
|
Standard_Boolean isActivated = Standard_False;
|
||||||
|
for (TColStd_ListIteratorOfListOfInteger aModeIter (anActivatedModes); aModeIter.More(); aModeIter.Next())
|
||||||
|
{
|
||||||
|
if (aModeIter.Value() == mySelectionMode)
|
||||||
|
{
|
||||||
|
isActivated = Standard_True;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isActivated)
|
||||||
|
aContext->Activate (myAIS, mySelectionMode, Standard_False);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ void V3d_Viewer::DeactivateGrid()
|
|||||||
if (myGridEcho
|
if (myGridEcho
|
||||||
&& !myGridEchoStructure.IsNull())
|
&& !myGridEchoStructure.IsNull())
|
||||||
{
|
{
|
||||||
ActiveView()->View()->EraseImmediate (myGridEchoStructure);
|
myGridEchoStructure->Erase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Update();
|
Update();
|
||||||
@ -256,10 +256,7 @@ void V3d_Viewer::SetGridEcho (const Standard_Boolean theToShowGrid)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (InitActiveViews(); MoreActiveViews(); NextActiveViews())
|
myGridEchoStructure->Erase();
|
||||||
{
|
|
||||||
ActiveView()->View()->EraseImmediate (myGridEchoStructure);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@ -323,7 +320,12 @@ void V3d_Viewer::ShowGridEcho (const Handle(V3d_View)& theView,
|
|||||||
anArrayOfPoints->AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z());
|
anArrayOfPoints->AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z());
|
||||||
myGridEchoGroup->AddPrimitiveArray (anArrayOfPoints);
|
myGridEchoGroup->AddPrimitiveArray (anArrayOfPoints);
|
||||||
|
|
||||||
theView->View()->DisplayImmediate (myGridEchoStructure, Standard_True);
|
myGridEchoStructure->SetZLayer (Graphic3d_ZLayerId_Topmost);
|
||||||
|
myGridEchoStructure->SetInfiniteState (Standard_True);
|
||||||
|
myGridEchoStructure->CStructure()->ViewAffinity = new Graphic3d_ViewAffinity();
|
||||||
|
myGridEchoStructure->CStructure()->ViewAffinity->SetVisible (Standard_False);
|
||||||
|
myGridEchoStructure->CStructure()->ViewAffinity->SetVisible (theView->View()->Identification(), true);
|
||||||
|
myGridEchoStructure->Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@ -338,5 +340,7 @@ void V3d_Viewer::HideGridEcho (const Handle(V3d_View)& theView)
|
|||||||
}
|
}
|
||||||
|
|
||||||
myGridEchoLastVert.SetCoord (ShortRealLast(), ShortRealLast(), ShortRealLast());
|
myGridEchoLastVert.SetCoord (ShortRealLast(), ShortRealLast(), ShortRealLast());
|
||||||
theView->View()->EraseImmediate (myGridEchoStructure);
|
const Handle(Graphic3d_ViewAffinity)& anAffinity = myGridEchoStructure->CStructure()->ViewAffinity;
|
||||||
|
if (!anAffinity.IsNull() && anAffinity->IsVisible (theView->View()->Identification()))
|
||||||
|
myGridEchoStructure->Erase();
|
||||||
}
|
}
|
||||||
|
@ -496,14 +496,14 @@ void ViewerTest::StandardModeActivation(const Standard_Integer mode )
|
|||||||
|
|
||||||
if(!aContext->HasOpenedContext()) {
|
if(!aContext->HasOpenedContext()) {
|
||||||
// To unhilight the preselected object
|
// To unhilight the preselected object
|
||||||
aContext->UnhilightCurrents(Standard_False);
|
aContext->UnhilightSelected(Standard_False);
|
||||||
// Open a local Context in order to be able to select subshape from
|
// Open a local Context in order to be able to select subshape from
|
||||||
// the selected shape if any or for all if there is no selection
|
// the selected shape if any or for all if there is no selection
|
||||||
if (!aContext->FirstCurrentObject().IsNull()){
|
if (!aContext->FirstSelectedObject().IsNull()){
|
||||||
aContext->OpenLocalContext(Standard_False);
|
aContext->OpenLocalContext(Standard_False);
|
||||||
|
|
||||||
for(aContext->InitCurrent();aContext->MoreCurrent();aContext->NextCurrent()){
|
for(aContext->InitSelected();aContext->MoreSelected();aContext->NextSelected()){
|
||||||
aContext->Load( aContext->Current(),-1,Standard_True);
|
aContext->Load( aContext->SelectedInteractive(),-1,Standard_True);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1078,18 +1078,13 @@ static int VDispMode (Draw_Interpretor& , Standard_Integer argc, const char** ar
|
|||||||
//unset displaymode.. comportement particulier...
|
//unset displaymode.. comportement particulier...
|
||||||
if(TypeOfOperation==4){
|
if(TypeOfOperation==4){
|
||||||
if(argc==1){
|
if(argc==1){
|
||||||
if(Ctx->NbCurrents()==0 ||
|
if(Ctx->NbSelected()==0){
|
||||||
Ctx->NbSelected()==0){
|
|
||||||
Handle(AIS_InteractiveObject) IO;
|
Handle(AIS_InteractiveObject) IO;
|
||||||
VwrTst_DispErase(IO,-1,4,Standard_False);
|
VwrTst_DispErase(IO,-1,4,Standard_False);
|
||||||
}
|
}
|
||||||
else if(!Ctx->HasOpenedContext()){
|
|
||||||
for(Ctx->InitCurrent();Ctx->MoreCurrent();Ctx->NextCurrent())
|
|
||||||
VwrTst_DispErase(Ctx->Current(),-1,4,Standard_False);
|
|
||||||
}
|
|
||||||
else{
|
else{
|
||||||
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
||||||
VwrTst_DispErase(Ctx->Interactive(),-1,4,Standard_False);}
|
VwrTst_DispErase(Ctx->SelectedInteractive(),-1,4,Standard_False);}
|
||||||
Ctx->UpdateCurrentViewer();
|
Ctx->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -1104,20 +1099,20 @@ static int VDispMode (Draw_Interpretor& , Standard_Integer argc, const char** ar
|
|||||||
}
|
}
|
||||||
else if(argc==2){
|
else if(argc==2){
|
||||||
Standard_Integer Dmode = Draw::Atoi(argv[1]);
|
Standard_Integer Dmode = Draw::Atoi(argv[1]);
|
||||||
if(Ctx->NbCurrents()==0 && TypeOfOperation==3){
|
if(Ctx->NbSelected()==0 && TypeOfOperation==3){
|
||||||
Handle(AIS_InteractiveObject) IO;
|
Handle(AIS_InteractiveObject) IO;
|
||||||
VwrTst_DispErase(IO,Dmode,TypeOfOperation,Standard_True);
|
VwrTst_DispErase(IO,Dmode,TypeOfOperation,Standard_True);
|
||||||
}
|
}
|
||||||
if(!Ctx->HasOpenedContext()){
|
if(!Ctx->HasOpenedContext()){
|
||||||
// set/unset display mode sur le Contexte...
|
// set/unset display mode sur le Contexte...
|
||||||
for(Ctx->InitCurrent();Ctx->MoreCurrent();Ctx->NextCurrent()){
|
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected()){
|
||||||
VwrTst_DispErase(Ctx->Current(),Dmode,TypeOfOperation,Standard_False);
|
VwrTst_DispErase(Ctx->SelectedInteractive(),Dmode,TypeOfOperation,Standard_False);
|
||||||
}
|
}
|
||||||
Ctx->UpdateCurrentViewer();
|
Ctx->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
||||||
Ctx->Display(Ctx->Interactive(),Dmode);
|
Ctx->Display(Ctx->SelectedInteractive(),Dmode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -1142,30 +1137,22 @@ static int VSubInt(Draw_Interpretor& di, Standard_Integer argc, const char** arg
|
|||||||
Standard_Integer On = Draw::Atoi(argv[1]);
|
Standard_Integer On = Draw::Atoi(argv[1]);
|
||||||
const Handle(AIS_InteractiveContext)& Ctx = ViewerTest::GetAISContext();
|
const Handle(AIS_InteractiveContext)& Ctx = ViewerTest::GetAISContext();
|
||||||
|
|
||||||
if(argc==2){
|
if(argc==2)
|
||||||
|
{
|
||||||
|
TCollection_AsciiString isOnOff = On == 1 ? "on" : "off";
|
||||||
|
di << "Sub intensite is turned " << isOnOff << " for " << Ctx->NbSelected() << "objects\n";
|
||||||
|
for (Ctx->InitSelected(); Ctx->MoreSelected(); Ctx->NextSelected())
|
||||||
|
{
|
||||||
|
if(On==1)
|
||||||
|
{
|
||||||
|
Ctx->SubIntensityOn (Ctx->SelectedInteractive(), Standard_False);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ctx->SubIntensityOff (Ctx->SelectedInteractive(), Standard_False);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!Ctx->HasOpenedContext()){
|
|
||||||
di<<"sub intensite ";
|
|
||||||
if(On==1) di<<"On";
|
|
||||||
else di<<"Off";
|
|
||||||
di<<" pour "<<Ctx->NbCurrents()<<" objets"<<"\n";
|
|
||||||
for(Ctx->InitCurrent();Ctx->MoreCurrent();Ctx->NextCurrent()){
|
|
||||||
if(On==1){
|
|
||||||
Ctx->SubIntensityOn(Ctx->Current(),Standard_False);}
|
|
||||||
else{
|
|
||||||
di <<"passage dans off"<<"\n";
|
|
||||||
Ctx->SubIntensityOff(Ctx->Current(),Standard_False);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected()){
|
|
||||||
if(On==1){
|
|
||||||
Ctx->SubIntensityOn(Ctx->Interactive(),Standard_False);}
|
|
||||||
else{
|
|
||||||
Ctx->SubIntensityOff(Ctx->Interactive(),Standard_False);}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ctx->UpdateCurrentViewer();
|
Ctx->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1220,11 +1207,11 @@ public:
|
|||||||
mySource = IterSource_List;
|
mySource = IterSource_List;
|
||||||
mySeqIter = NCollection_Sequence<TCollection_AsciiString>::Iterator (mySeq);
|
mySeqIter = NCollection_Sequence<TCollection_AsciiString>::Iterator (mySeq);
|
||||||
}
|
}
|
||||||
else if (aCtx->NbCurrents() > 0)
|
else if (aCtx->NbSelected() > 0)
|
||||||
{
|
{
|
||||||
mySource = IterSource_Selected;
|
mySource = IterSource_Selected;
|
||||||
mySelIter = aCtx;
|
mySelIter = aCtx;
|
||||||
mySelIter->InitCurrent();
|
mySelIter->InitSelected();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1256,7 +1243,7 @@ public:
|
|||||||
{
|
{
|
||||||
case IterSource_All: return myMapIter.More();
|
case IterSource_All: return myMapIter.More();
|
||||||
case IterSource_List: return mySeqIter.More();
|
case IterSource_List: return mySeqIter.More();
|
||||||
case IterSource_Selected: return mySelIter->MoreCurrent();
|
case IterSource_Selected: return mySelIter->MoreSelected();
|
||||||
}
|
}
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -1281,7 +1268,7 @@ public:
|
|||||||
}
|
}
|
||||||
case IterSource_Selected:
|
case IterSource_Selected:
|
||||||
{
|
{
|
||||||
mySelIter->NextCurrent();
|
mySelIter->NextSelected();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1321,10 +1308,10 @@ private:
|
|||||||
}
|
}
|
||||||
case IterSource_Selected:
|
case IterSource_Selected:
|
||||||
{
|
{
|
||||||
if (mySelIter->MoreCurrent())
|
if (mySelIter->MoreSelected())
|
||||||
{
|
{
|
||||||
myCurrentName = GetMapOfAIS().Find1 (mySelIter->Current());
|
myCurrentName = GetMapOfAIS().Find1 (mySelIter->SelectedInteractive());
|
||||||
myCurrent = mySelIter->Current();
|
myCurrent = mySelIter->SelectedInteractive();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2363,14 +2350,14 @@ static int VDonly2 (Draw_Interpretor& ,
|
|||||||
if (anArgIter >= theArgNb)
|
if (anArgIter >= theArgNb)
|
||||||
{
|
{
|
||||||
// display only selected objects
|
// display only selected objects
|
||||||
if (aCtx->NbCurrents() < 1)
|
if (aCtx->NbSelected() < 1)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (aCtx->InitCurrent(); aCtx->MoreCurrent(); aCtx->NextCurrent())
|
for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected())
|
||||||
{
|
{
|
||||||
aDispSet.Add (aCtx->Current());
|
aDispSet.Add (aCtx->SelectedInteractive());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2512,13 +2499,13 @@ int VRemove (Draw_Interpretor& theDI,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aCtx->NbCurrents() > 0)
|
else if (aCtx->NbSelected() > 0)
|
||||||
{
|
{
|
||||||
for (ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName anIter (GetMapOfAIS());
|
for (ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName anIter (GetMapOfAIS());
|
||||||
anIter.More(); anIter.Next())
|
anIter.More(); anIter.Next())
|
||||||
{
|
{
|
||||||
const Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast (anIter.Key1());
|
const Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast (anIter.Key1());
|
||||||
if (!aCtx->IsCurrent (anIO))
|
if (!aCtx->IsSelected (anIO))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -2645,7 +2632,7 @@ int VErase (Draw_Interpretor& theDI,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!toEraseAll && aCtx->NbCurrents() > 0)
|
else if (!toEraseAll && aCtx->NbSelected() > 0)
|
||||||
{
|
{
|
||||||
// Erase selected objects
|
// Erase selected objects
|
||||||
for (ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName anIter (GetMapOfAIS());
|
for (ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName anIter (GetMapOfAIS());
|
||||||
@ -2653,7 +2640,7 @@ int VErase (Draw_Interpretor& theDI,
|
|||||||
{
|
{
|
||||||
const Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast (anIter.Key1());
|
const Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast (anIter.Key1());
|
||||||
if (!anIO.IsNull()
|
if (!anIO.IsNull()
|
||||||
&& aCtx->IsCurrent (anIO))
|
&& aCtx->IsSelected (anIO))
|
||||||
{
|
{
|
||||||
theDI << anIter.Key2().ToCString() << " ";
|
theDI << anIter.Key2().ToCString() << " ";
|
||||||
if (toEraseInView)
|
if (toEraseInView)
|
||||||
@ -2903,12 +2890,12 @@ int VBounding (Draw_Interpretor& theDI,
|
|||||||
bndPresentation (theDI, aPrs, aName, anAction);
|
bndPresentation (theDI, aPrs, aName, anAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aCtx->NbCurrents() > 0)
|
else if (aCtx->NbSelected() > 0)
|
||||||
{
|
{
|
||||||
// remove all currently selected objects
|
// remove all currently selected objects
|
||||||
for (aCtx->InitCurrent(); aCtx->MoreCurrent(); aCtx->NextCurrent())
|
for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected())
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) anIO = aCtx->Current();
|
Handle(AIS_InteractiveObject) anIO = aCtx->SelectedInteractive();
|
||||||
Handle(PrsMgr_Presentation) aPrs = findPresentation (aCtx, anIO, aMode);
|
Handle(PrsMgr_Presentation) aPrs = findPresentation (aCtx, anIO, aMode);
|
||||||
if (!aPrs.IsNull())
|
if (!aPrs.IsNull())
|
||||||
{
|
{
|
||||||
@ -3537,7 +3524,7 @@ static int VDisplay2 (Draw_Interpretor& theDI,
|
|||||||
Standard_Integer aSelMode = -1;
|
Standard_Integer aSelMode = -1;
|
||||||
if (isSelectable == 1 || (isSelectable == -1 && aCtx->GetAutoActivateSelection()))
|
if (isSelectable == 1 || (isSelectable == -1 && aCtx->GetAutoActivateSelection()))
|
||||||
{
|
{
|
||||||
aSelMode = aShape->HasSelectionMode() ? aShape->SelectionMode() : -1;
|
aSelMode = aShape->GlobalSelectionMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
aCtx->Display (aShape, aDispMode, aSelMode,
|
aCtx->Display (aShape, aDispMode, aSelMode,
|
||||||
@ -3588,7 +3575,7 @@ static int VDisplay2 (Draw_Interpretor& theDI,
|
|||||||
Standard_Integer aSelMode = -1;
|
Standard_Integer aSelMode = -1;
|
||||||
if (isSelectable == 1 || (isSelectable == -1 && aCtx->GetAutoActivateSelection()))
|
if (isSelectable == 1 || (isSelectable == -1 && aCtx->GetAutoActivateSelection()))
|
||||||
{
|
{
|
||||||
aSelMode = aShape->HasSelectionMode() ? aShape->SelectionMode() : -1;
|
aSelMode = aShape->GlobalSelectionMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aShape->Type() == AIS_KOI_Datum)
|
if (aShape->Type() == AIS_KOI_Datum)
|
||||||
@ -3990,11 +3977,11 @@ static int VActivatedMode (Draw_Interpretor& di, Standard_Integer argc, const ch
|
|||||||
// on load tous les objets displayees et on Activate les objets de la liste
|
// on load tous les objets displayees et on Activate les objets de la liste
|
||||||
AIS_ListOfInteractive ListOfIO;
|
AIS_ListOfInteractive ListOfIO;
|
||||||
// on sauve dans une AISListOfInteractive tous les objets currents
|
// on sauve dans une AISListOfInteractive tous les objets currents
|
||||||
if (TheAISContext()->NbCurrents()>0 ){
|
if (TheAISContext()->NbSelected()>0 ){
|
||||||
TheAISContext()->UnhilightCurrents(Standard_False);
|
TheAISContext()->UnhilightSelected(Standard_False);
|
||||||
|
|
||||||
for (TheAISContext()->InitCurrent(); TheAISContext()->MoreCurrent(); TheAISContext()->NextCurrent() ){
|
for (TheAISContext()->InitSelected(); TheAISContext()->MoreSelected(); TheAISContext()->NextSelected() ){
|
||||||
ListOfIO.Append(TheAISContext()->Current() );
|
ListOfIO.Append(TheAISContext()->SelectedInteractive() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4042,7 +4029,7 @@ static int VActivatedMode (Draw_Interpretor& di, Standard_Integer argc, const ch
|
|||||||
TheAISContext()->UnhilightSelected(Standard_False);
|
TheAISContext()->UnhilightSelected(Standard_False);
|
||||||
// il y a des objets selected,on les parcourt
|
// il y a des objets selected,on les parcourt
|
||||||
for (TheAISContext()->InitSelected(); TheAISContext()->MoreSelected(); TheAISContext()->NextSelected() ){
|
for (TheAISContext()->InitSelected(); TheAISContext()->MoreSelected(); TheAISContext()->NextSelected() ){
|
||||||
Handle(AIS_InteractiveObject) aIO=TheAISContext()->Interactive();
|
Handle(AIS_InteractiveObject) aIO=TheAISContext()->SelectedInteractive();
|
||||||
|
|
||||||
|
|
||||||
if (HaveMode(aIO,aMode) ) {
|
if (HaveMode(aIO,aMode) ) {
|
||||||
@ -4373,12 +4360,12 @@ static Standard_Integer VState (Draw_Interpretor& theDI,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aCtx->NbCurrents() > 0
|
if (aCtx->NbSelected() > 0
|
||||||
&& !toShowAll)
|
&& !toShowAll)
|
||||||
{
|
{
|
||||||
for (aCtx->InitCurrent(); aCtx->MoreCurrent(); aCtx->NextCurrent())
|
for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected())
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) anObj = aCtx->Current();
|
Handle(AIS_InteractiveObject) anObj = aCtx->SelectedInteractive();
|
||||||
TCollection_AsciiString aName = GetMapOfAIS().Find1 (anObj);
|
TCollection_AsciiString aName = GetMapOfAIS().Find1 (anObj);
|
||||||
aName.LeftJustify (20, ' ');
|
aName.LeftJustify (20, ' ');
|
||||||
theDI << aName << " ";
|
theDI << aName << " ";
|
||||||
@ -5275,7 +5262,7 @@ static Standard_Integer VLoadSelection (Draw_Interpretor& /*theDi*/,
|
|||||||
}
|
}
|
||||||
|
|
||||||
aCtx->Load (aShape, -1, Standard_False);
|
aCtx->Load (aShape, -1, Standard_False);
|
||||||
aCtx->Activate (aShape, aShape->SelectionMode(), Standard_True);
|
aCtx->Activate (aShape, aShape->GlobalSelectionMode(), Standard_True);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ static int VSize (Draw_Interpretor& di, Standard_Integer argc, const char** argv
|
|||||||
TheAISContext()->CloseLocalContext();
|
TheAISContext()->CloseLocalContext();
|
||||||
|
|
||||||
// On set le booleen ThereIsCurrent
|
// On set le booleen ThereIsCurrent
|
||||||
if (TheAISContext() -> NbCurrents() > 0) {ThereIsCurrent=Standard_True;}
|
if (TheAISContext() -> NbSelected() > 0) {ThereIsCurrent=Standard_True;}
|
||||||
else {ThereIsCurrent=Standard_False;}
|
else {ThereIsCurrent=Standard_False;}
|
||||||
|
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ static int VSize (Draw_Interpretor& di, Standard_Integer argc, const char** argv
|
|||||||
Handle(AIS_InteractiveObject) aShape=
|
Handle(AIS_InteractiveObject) aShape=
|
||||||
Handle(AIS_InteractiveObject)::DownCast(it.Key1());
|
Handle(AIS_InteractiveObject)::DownCast(it.Key1());
|
||||||
|
|
||||||
if (!aShape.IsNull() && TheAISContext()->IsCurrent(aShape) )
|
if (!aShape.IsNull() && TheAISContext()->IsSelected(aShape) )
|
||||||
{
|
{
|
||||||
|
|
||||||
// On verifie que l'AIS InteraciveObject selectionne est bien
|
// On verifie que l'AIS InteraciveObject selectionne est bien
|
||||||
@ -493,7 +493,7 @@ static int VPlaneTrihedron (Draw_Interpretor& di, Standard_Integer argc, const c
|
|||||||
|
|
||||||
Handle(AIS_InteractiveObject) theIOB;
|
Handle(AIS_InteractiveObject) theIOB;
|
||||||
for(TheAISContext()->InitSelected() ;TheAISContext()->MoreSelected() ;TheAISContext()->NextSelected() ) {
|
for(TheAISContext()->InitSelected() ;TheAISContext()->MoreSelected() ;TheAISContext()->NextSelected() ) {
|
||||||
theIOB = TheAISContext()->Interactive();
|
theIOB = TheAISContext()->SelectedInteractive();
|
||||||
}
|
}
|
||||||
// on le downcast
|
// on le downcast
|
||||||
Handle(AIS_Plane) PlaneB =(Handle(AIS_Plane)::DownCast (theIOB));
|
Handle(AIS_Plane) PlaneB =(Handle(AIS_Plane)::DownCast (theIOB));
|
||||||
@ -4177,16 +4177,21 @@ static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check the arguments
|
// Check the arguments
|
||||||
if (theArgc != 3 && theArgc != 4)
|
if (theArgc < 3 && theArgc > 5)
|
||||||
{
|
{
|
||||||
std::cerr << "vselmode error : expects at least 2 arguments.\n"
|
std::cerr << "vselmode error : expects at least 2 arguments.\n"
|
||||||
<< "Type help "<< theArgv[0] <<" for more information." << std::endl;
|
<< "Type help "<< theArgv[0] <<" for more information." << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TCollection_AsciiString aLastArg (theArgv[theArgc - 1]);
|
||||||
|
aLastArg.LowerCase();
|
||||||
|
Standard_Boolean isToOpenLocalCtx = aLastArg == "-local";
|
||||||
|
|
||||||
// get objects to change selection mode
|
// get objects to change selection mode
|
||||||
AIS_ListOfInteractive aTargetIOs;
|
AIS_ListOfInteractive aTargetIOs;
|
||||||
if (theArgc == 3)
|
Standard_Integer anArgNb = isToOpenLocalCtx ? theArgc - 1 : theArgc;
|
||||||
|
if (anArgNb == 3)
|
||||||
{
|
{
|
||||||
anAISContext->DisplayedObjects (aTargetIOs);
|
anAISContext->DisplayedObjects (aTargetIOs);
|
||||||
}
|
}
|
||||||
@ -4206,8 +4211,8 @@ static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Standard_Integer aSelectionMode = Draw::Atoi (theArgc == 3 ? theArgv[1] : theArgv[2]);
|
const Standard_Integer aSelectionMode = Draw::Atoi (anArgNb == 3 ? theArgv[1] : theArgv[2]);
|
||||||
const Standard_Boolean toTurnOn = Draw::Atoi (theArgc == 3 ? theArgv[2] : theArgv[3]);
|
const Standard_Boolean toTurnOn = Draw::Atoi (anArgNb == 3 ? theArgv[2] : theArgv[3]);
|
||||||
if (aSelectionMode == 0 && anAISContext->HasOpenedContext())
|
if (aSelectionMode == 0 && anAISContext->HasOpenedContext())
|
||||||
{
|
{
|
||||||
anAISContext->CloseLocalContext();
|
anAISContext->CloseLocalContext();
|
||||||
@ -4220,6 +4225,12 @@ static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/,
|
|||||||
for (AIS_ListIteratorOfListOfInteractive aTargetIt (aTargetIOs); aTargetIt.More(); aTargetIt.Next())
|
for (AIS_ListIteratorOfListOfInteractive aTargetIt (aTargetIOs); aTargetIt.More(); aTargetIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(AIS_InteractiveObject)& anIO = aTargetIt.Value();
|
const Handle(AIS_InteractiveObject)& anIO = aTargetIt.Value();
|
||||||
|
TColStd_ListOfInteger anActiveModes;
|
||||||
|
anAISContext->ActivatedModes (anIO, anActiveModes);
|
||||||
|
if (!anActiveModes.IsEmpty())
|
||||||
|
{
|
||||||
|
anAISContext->Deactivate (anIO);
|
||||||
|
}
|
||||||
if (!InList (anAISContext, anIO, aSelectionMode))
|
if (!InList (anAISContext, anIO, aSelectionMode))
|
||||||
{
|
{
|
||||||
anAISContext->Activate (anIO);
|
anAISContext->Activate (anIO);
|
||||||
@ -4241,7 +4252,7 @@ static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/,
|
|||||||
|
|
||||||
if (aSelectionMode != 0 && toTurnOn) // Turn on specified mode
|
if (aSelectionMode != 0 && toTurnOn) // Turn on specified mode
|
||||||
{
|
{
|
||||||
if (!anAISContext->HasOpenedContext())
|
if (!anAISContext->HasOpenedContext() && isToOpenLocalCtx)
|
||||||
{
|
{
|
||||||
anAISContext->OpenLocalContext (Standard_False);
|
anAISContext->OpenLocalContext (Standard_False);
|
||||||
}
|
}
|
||||||
@ -4249,6 +4260,10 @@ static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/,
|
|||||||
for (AIS_ListIteratorOfListOfInteractive aTargetIt (aTargetIOs); aTargetIt.More(); aTargetIt.Next())
|
for (AIS_ListIteratorOfListOfInteractive aTargetIt (aTargetIOs); aTargetIt.More(); aTargetIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(AIS_InteractiveObject)& anIO = aTargetIt.Value();
|
const Handle(AIS_InteractiveObject)& anIO = aTargetIt.Value();
|
||||||
|
if (InList (anAISContext, anIO, 0))
|
||||||
|
{
|
||||||
|
anAISContext->Deactivate (anIO, 0);
|
||||||
|
}
|
||||||
if (!InList (anAISContext, anIO, aSelectionMode))
|
if (!InList (anAISContext, anIO, aSelectionMode))
|
||||||
{
|
{
|
||||||
anAISContext->Load (anIO, -1, Standard_True);
|
anAISContext->Load (anIO, -1, Standard_True);
|
||||||
@ -4259,11 +4274,6 @@ static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/,
|
|||||||
|
|
||||||
if (aSelectionMode != 0 && !toTurnOn) // Turn off specified mode
|
if (aSelectionMode != 0 && !toTurnOn) // Turn off specified mode
|
||||||
{
|
{
|
||||||
if (!anAISContext->HasOpenedContext())
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (AIS_ListIteratorOfListOfInteractive aTargetIt (aTargetIOs); aTargetIt.More(); aTargetIt.Next())
|
for (AIS_ListIteratorOfListOfInteractive aTargetIt (aTargetIOs); aTargetIt.More(); aTargetIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(AIS_InteractiveObject)& anIO = aTargetIt.Value();
|
const Handle(AIS_InteractiveObject)& anIO = aTargetIt.Value();
|
||||||
|
@ -688,6 +688,7 @@ TCollection_AsciiString ViewerTest::ViewerInit (const Standard_Integer thePxLeft
|
|||||||
// View setup
|
// View setup
|
||||||
Handle(V3d_View) aView = a3DViewer->CreateView();
|
Handle(V3d_View) aView = a3DViewer->CreateView();
|
||||||
aView->SetWindow (VT_GetWindow());
|
aView->SetWindow (VT_GetWindow());
|
||||||
|
ViewerTest::GetAISContext()->RedrawImmediate (a3DViewer);
|
||||||
|
|
||||||
ViewerTest::CurrentView(aView);
|
ViewerTest::CurrentView(aView);
|
||||||
ViewerTest_myViews.Bind (aViewNames.GetViewName(), aView);
|
ViewerTest_myViews.Bind (aViewNames.GetViewName(), aView);
|
||||||
@ -1378,7 +1379,7 @@ void VT_ProcessKeyPress (const char* buf_ret)
|
|||||||
aContext->DefaultDrawer()->SetTypeOfHLR(Prs3d_TOH_PolyAlgo);
|
aContext->DefaultDrawer()->SetTypeOfHLR(Prs3d_TOH_PolyAlgo);
|
||||||
else
|
else
|
||||||
aContext->DefaultDrawer()->SetTypeOfHLR(Prs3d_TOH_Algo);
|
aContext->DefaultDrawer()->SetTypeOfHLR(Prs3d_TOH_Algo);
|
||||||
if (aContext->NbCurrents()==0 || aContext->NbSelected() == 0)
|
if (aContext->NbSelected()==0)
|
||||||
{
|
{
|
||||||
AIS_ListOfInteractive aListOfShapes;
|
AIS_ListOfInteractive aListOfShapes;
|
||||||
aContext->DisplayedObjects(aListOfShapes);
|
aContext->DisplayedObjects(aListOfShapes);
|
||||||
@ -1397,9 +1398,9 @@ void VT_ProcessKeyPress (const char* buf_ret)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (aContext->InitCurrent();aContext->MoreCurrent();aContext->NextCurrent())
|
for (aContext->InitSelected();aContext->MoreSelected();aContext->NextSelected())
|
||||||
{
|
{
|
||||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(aContext->Current());
|
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(aContext->SelectedInteractive());
|
||||||
if (aShape.IsNull())
|
if (aShape.IsNull())
|
||||||
continue;
|
continue;
|
||||||
if(aShape->TypeOfHLR() == Prs3d_TOH_PolyAlgo)
|
if(aShape->TypeOfHLR() == Prs3d_TOH_PolyAlgo)
|
||||||
@ -1418,18 +1419,11 @@ void VT_ProcessKeyPress (const char* buf_ret)
|
|||||||
std::cout << "setup Shaded display mode" << std::endl;
|
std::cout << "setup Shaded display mode" << std::endl;
|
||||||
|
|
||||||
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
|
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
|
||||||
if(Ctx->NbCurrents()==0 ||
|
if(Ctx->NbSelected()==0)
|
||||||
Ctx->NbSelected()==0)
|
|
||||||
Ctx->SetDisplayMode(AIS_Shaded);
|
Ctx->SetDisplayMode(AIS_Shaded);
|
||||||
else{
|
else{
|
||||||
if(Ctx->HasOpenedContext()){
|
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
||||||
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
Ctx->SetDisplayMode(Ctx->SelectedInteractive(),1,Standard_False);
|
||||||
Ctx->SetDisplayMode(Ctx->Interactive(),1,Standard_False);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
for(Ctx->InitCurrent();Ctx->MoreCurrent();Ctx->NextCurrent())
|
|
||||||
Ctx->SetDisplayMode(Ctx->Current(),1,Standard_False);
|
|
||||||
}
|
|
||||||
Ctx->UpdateCurrentViewer();
|
Ctx->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1439,18 +1433,11 @@ void VT_ProcessKeyPress (const char* buf_ret)
|
|||||||
std::cout << "reset display mode to defaults" << std::endl;
|
std::cout << "reset display mode to defaults" << std::endl;
|
||||||
|
|
||||||
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
|
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
|
||||||
if(Ctx->NbCurrents()==0 ||
|
if(Ctx->NbSelected()==0)
|
||||||
Ctx->NbSelected()==0)
|
|
||||||
Ctx->SetDisplayMode(AIS_WireFrame);
|
Ctx->SetDisplayMode(AIS_WireFrame);
|
||||||
else{
|
else{
|
||||||
if(Ctx->HasOpenedContext()){
|
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
||||||
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
Ctx->UnsetDisplayMode(Ctx->SelectedInteractive(),Standard_False);
|
||||||
Ctx->UnsetDisplayMode(Ctx->Interactive(),Standard_False);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
for(Ctx->InitCurrent();Ctx->MoreCurrent();Ctx->NextCurrent())
|
|
||||||
Ctx->UnsetDisplayMode(Ctx->Current(),Standard_False);
|
|
||||||
}
|
|
||||||
Ctx->UpdateCurrentViewer();
|
Ctx->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1479,18 +1466,11 @@ void VT_ProcessKeyPress (const char* buf_ret)
|
|||||||
{
|
{
|
||||||
std::cout << "setup WireFrame display mode" << std::endl;
|
std::cout << "setup WireFrame display mode" << std::endl;
|
||||||
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
|
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
|
||||||
if(Ctx->NbCurrents()==0 ||
|
if(Ctx->NbSelected()==0)
|
||||||
Ctx->NbSelected()==0)
|
|
||||||
Ctx->SetDisplayMode(AIS_WireFrame);
|
Ctx->SetDisplayMode(AIS_WireFrame);
|
||||||
else{
|
else{
|
||||||
if(Ctx->HasOpenedContext()){
|
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
||||||
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
|
Ctx->SetDisplayMode(Ctx->SelectedInteractive(),0,Standard_False);
|
||||||
Ctx->SetDisplayMode(Ctx->Interactive(),0,Standard_False);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
for(Ctx->InitCurrent();Ctx->MoreCurrent();Ctx->NextCurrent())
|
|
||||||
Ctx->SetDisplayMode(Ctx->Current(),0,Standard_False);
|
|
||||||
}
|
|
||||||
Ctx->UpdateCurrentViewer();
|
Ctx->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1542,7 +1522,6 @@ void VT_ProcessKeyPress (const char* buf_ret)
|
|||||||
{
|
{
|
||||||
Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
|
Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
|
||||||
if (!aCtx.IsNull()
|
if (!aCtx.IsNull()
|
||||||
&& aCtx->NbCurrents() > 0
|
|
||||||
&& aCtx->NbSelected() > 0)
|
&& aCtx->NbSelected() > 0)
|
||||||
{
|
{
|
||||||
Draw_Interprete ("verase");
|
Draw_Interprete ("verase");
|
||||||
@ -3395,11 +3374,11 @@ static int VExport(Draw_Interpretor& di, Standard_Integer argc, const char** arg
|
|||||||
{
|
{
|
||||||
if (aFileName.Value (aLen - 2) == '.')
|
if (aFileName.Value (aLen - 2) == '.')
|
||||||
{
|
{
|
||||||
aFormatStr = aFileName.SubString (aLen - 1, aLen);
|
aFormatStr = aFileName.ToCString() + aLen - 2;
|
||||||
}
|
}
|
||||||
else if (aFileName.Value (aLen - 3) == '.')
|
else if (aFileName.Value (aLen - 3) == '.')
|
||||||
{
|
{
|
||||||
aFormatStr = aFileName.SubString (aLen - 2, aLen);
|
aFormatStr = aFileName.ToCString() + aLen - 3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -6242,14 +6221,7 @@ static Standard_Integer VChangeSelected (Draw_Interpretor& di,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aContext->HasOpenedContext())
|
aContext->AddOrRemoveSelected(anAISObject);
|
||||||
{
|
|
||||||
aContext->AddOrRemoveSelected(anAISObject);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
aContext->AddOrRemoveCurrentObject(anAISObject);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -973,7 +973,6 @@ void Visual3d_View::Redraw (const Handle(Visual3d_Layer)& theUnderLayer,
|
|||||||
if (myGraphicDriver->IsDeviceLost())
|
if (myGraphicDriver->IsDeviceLost())
|
||||||
{
|
{
|
||||||
myViewManager->RecomputeStructures();
|
myViewManager->RecomputeStructures();
|
||||||
myViewManager->RecomputeStructures (myImmediateStructures);
|
|
||||||
myGraphicDriver->ResetDeviceLostFlag();
|
myGraphicDriver->ResetDeviceLostFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1239,69 +1238,6 @@ void Visual3d_View::Disconnect (const Handle(Graphic3d_Structure)& theMother,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================================================================
|
|
||||||
// function : DisplayImmediate
|
|
||||||
// purpose :
|
|
||||||
// ========================================================================
|
|
||||||
Standard_Boolean Visual3d_View::DisplayImmediate (const Handle(Graphic3d_Structure)& theStructure,
|
|
||||||
const Standard_Boolean theIsSingleView)
|
|
||||||
{
|
|
||||||
if (!myImmediateStructures.Add (theStructure))
|
|
||||||
{
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (theIsSingleView)
|
|
||||||
{
|
|
||||||
const Visual3d_SequenceOfView& aViews = myViewManager->DefinedViews();
|
|
||||||
for (Standard_Integer aViewIter = 1; aViewIter <= aViews.Length(); ++aViewIter)
|
|
||||||
{
|
|
||||||
const Handle(Visual3d_View)& aView = aViews.Value (aViewIter);
|
|
||||||
if (aView != this)
|
|
||||||
{
|
|
||||||
aView->EraseImmediate (theStructure);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
myGraphicDriver->DisplayImmediateStructure (MyCView, theStructure);
|
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========================================================================
|
|
||||||
// function : EraseImmediate
|
|
||||||
// purpose :
|
|
||||||
// ========================================================================
|
|
||||||
Standard_Boolean Visual3d_View::EraseImmediate (const Handle(Graphic3d_Structure)& theStructure)
|
|
||||||
{
|
|
||||||
const Standard_Boolean isErased = myImmediateStructures.Remove (theStructure);
|
|
||||||
if (isErased)
|
|
||||||
{
|
|
||||||
myGraphicDriver->EraseImmediateStructure (MyCView, *theStructure->CStructure());
|
|
||||||
}
|
|
||||||
|
|
||||||
return isErased;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========================================================================
|
|
||||||
// function : ClearImmediate
|
|
||||||
// purpose :
|
|
||||||
// ========================================================================
|
|
||||||
Standard_Boolean Visual3d_View::ClearImmediate()
|
|
||||||
{
|
|
||||||
if (myImmediateStructures.IsEmpty())
|
|
||||||
{
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Graphic3d_MapOfStructure::Iterator aStructIter (myImmediateStructures); aStructIter.More(); aStructIter.Next())
|
|
||||||
{
|
|
||||||
myGraphicDriver->EraseImmediateStructure (MyCView, *aStructIter.Key()->CStructure());
|
|
||||||
}
|
|
||||||
myImmediateStructures.Clear();
|
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
// function : Display
|
// function : Display
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -1517,7 +1453,6 @@ void Visual3d_View::Erase (const Handle(Graphic3d_Structure)& theStruct,
|
|||||||
const Aspect_TypeOfUpdate theUpdateMode)
|
const Aspect_TypeOfUpdate theUpdateMode)
|
||||||
{
|
{
|
||||||
if ( IsDeleted()
|
if ( IsDeleted()
|
||||||
|| EraseImmediate (theStruct)
|
|
||||||
|| !IsDisplayed (theStruct))
|
|| !IsDisplayed (theStruct))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -1557,11 +1492,34 @@ void Visual3d_View::Highlight (const Handle(Graphic3d_Structure)& theStruct,
|
|||||||
const Standard_Integer anIndex = IsComputed (theStruct);
|
const Standard_Integer anIndex = IsComputed (theStruct);
|
||||||
if (anIndex != 0)
|
if (anIndex != 0)
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex);
|
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.Value (anIndex);
|
||||||
aCompStruct->Highlight (theMethod, theStruct->HighlightColor(), Standard_False);
|
aCompStruct->Highlight (theMethod, theStruct->HighlightColor(), Standard_False);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// function : IsComputed
|
||||||
|
// purpose :
|
||||||
|
// ========================================================================
|
||||||
|
Standard_Boolean Visual3d_View::IsComputed (const Standard_Integer theStructId,
|
||||||
|
Handle(Graphic3d_Structure)& theComputedStruct) const
|
||||||
|
{
|
||||||
|
theComputedStruct.Nullify();
|
||||||
|
if (!ComputedMode())
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
|
const Standard_Integer aNbStructs = myStructsToCompute.Length();
|
||||||
|
for (Standard_Integer aStructIter = 1; aStructIter <= aNbStructs; ++aStructIter)
|
||||||
|
{
|
||||||
|
if (myStructsToCompute.Value (aStructIter)->Identification() == theStructId)
|
||||||
|
{
|
||||||
|
theComputedStruct = myStructsComputed (aStructIter);
|
||||||
|
return Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
// function : SetTransform
|
// function : SetTransform
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -1681,8 +1639,6 @@ Standard_Boolean Visual3d_View::ContainsFacet (const Graphic3d_MapOfStructure& t
|
|||||||
Bnd_Box Visual3d_View::MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag) const
|
Bnd_Box Visual3d_View::MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag) const
|
||||||
{
|
{
|
||||||
Bnd_Box aResult = MinMaxValues (myStructsDisplayed, theToIgnoreInfiniteFlag);
|
Bnd_Box aResult = MinMaxValues (myStructsDisplayed, theToIgnoreInfiniteFlag);
|
||||||
Bnd_Box anImmediate = MinMaxValues (myImmediateStructures, theToIgnoreInfiniteFlag);
|
|
||||||
aResult.Add (anImmediate);
|
|
||||||
return aResult;
|
return aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,19 +433,7 @@ public:
|
|||||||
//! structure <AStructure> displayed in <me>
|
//! structure <AStructure> displayed in <me>
|
||||||
//! with the type Graphic3d_TOS_COMPUTED.
|
//! with the type Graphic3d_TOS_COMPUTED.
|
||||||
Standard_EXPORT void ReCompute (const Handle(Graphic3d_Structure)& AStructure);
|
Standard_EXPORT void ReCompute (const Handle(Graphic3d_Structure)& AStructure);
|
||||||
|
|
||||||
//! Add structure to the list of immediate presentations.
|
|
||||||
//! @return true if structure has not been registered in this view
|
|
||||||
Standard_EXPORT Standard_Boolean DisplayImmediate (const Handle(Graphic3d_Structure)& theStructure, const Standard_Boolean theIsSingleView = Standard_True);
|
|
||||||
|
|
||||||
//! Removes the structure from the list of immediate presentations.
|
|
||||||
//! @return true if structure has been registered in view
|
|
||||||
Standard_EXPORT Standard_Boolean EraseImmediate (const Handle(Graphic3d_Structure)& theStructure);
|
|
||||||
|
|
||||||
//! Clears list of immediate presentations.
|
|
||||||
//! @return true if list was not empty
|
|
||||||
Standard_EXPORT Standard_Boolean ClearImmediate();
|
|
||||||
|
|
||||||
//! Returns the identification number of the view <me>.
|
//! Returns the identification number of the view <me>.
|
||||||
Standard_EXPORT Standard_Integer Identification() const;
|
Standard_EXPORT Standard_Integer Identification() const;
|
||||||
|
|
||||||
@ -530,6 +518,11 @@ public:
|
|||||||
//! Returns map of objects hidden within this specific view (not viewer-wise).
|
//! Returns map of objects hidden within this specific view (not viewer-wise).
|
||||||
Standard_EXPORT Handle(Graphic3d_NMapOfTransient)& ChangeHiddenObjects();
|
Standard_EXPORT Handle(Graphic3d_NMapOfTransient)& ChangeHiddenObjects();
|
||||||
|
|
||||||
|
//! Returns Standard_True in case if the structure with the given <theStructId> is
|
||||||
|
//! in list of structures to be computed and stores computed struct to <theComputedStruct>.
|
||||||
|
Standard_EXPORT Standard_Boolean IsComputed (const Standard_Integer theStructId,
|
||||||
|
Handle(Graphic3d_Structure)& theComputedStruct) const;
|
||||||
|
|
||||||
friend class Visual3d_ViewManager;
|
friend class Visual3d_ViewManager;
|
||||||
|
|
||||||
|
|
||||||
@ -642,7 +635,6 @@ private:
|
|||||||
Aspect_Background MyBackground;
|
Aspect_Background MyBackground;
|
||||||
Aspect_GradientBackground MyGradientBackground;
|
Aspect_GradientBackground MyGradientBackground;
|
||||||
Graphic3d_MapOfStructure myStructsDisplayed;
|
Graphic3d_MapOfStructure myStructsDisplayed;
|
||||||
Graphic3d_MapOfStructure myImmediateStructures;
|
|
||||||
Graphic3d_GraduatedTrihedron myGTrihedron;
|
Graphic3d_GraduatedTrihedron myGTrihedron;
|
||||||
Handle(Graphic3d_Camera) myDefaultCamera;
|
Handle(Graphic3d_Camera) myDefaultCamera;
|
||||||
Standard_Boolean myAutoZFitIsOn;
|
Standard_Boolean myAutoZFitIsOn;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
puts "TODO OCC11111 ALL: Error : Colors are not equal in default coordinate and in the near coordinates too"
|
|
||||||
|
|
||||||
puts "================"
|
puts "================"
|
||||||
puts "OCC1629"
|
puts "OCC1629"
|
||||||
puts "OCC2707"
|
puts "OCC2707"
|
||||||
@ -37,7 +35,7 @@ set Selection_G 0.8
|
|||||||
set Selection_B 0.8
|
set Selection_B 0.8
|
||||||
|
|
||||||
#QASetChoiceMode EDGE ON
|
#QASetChoiceMode EDGE ON
|
||||||
vselmode 2 1
|
vselmode 2 1 -local
|
||||||
|
|
||||||
set BeforeNbSelected [vnbselected]
|
set BeforeNbSelected [vnbselected]
|
||||||
|
|
||||||
@ -84,11 +82,11 @@ puts ""
|
|||||||
|
|
||||||
set CloseNbSelected [vnbselected]
|
set CloseNbSelected [vnbselected]
|
||||||
|
|
||||||
checkcolor ${x1} ${y1} ${Selection_R} ${Selection_G} ${Selection_B}
|
checkcolor ${x1} ${y1} 1 1 0
|
||||||
checkcolor ${x2} ${y2} ${Selection_R} ${Selection_G} ${Selection_B}
|
checkcolor ${x2} ${y2} 1 1 0
|
||||||
checkcolor ${x3} ${y3} ${Selection_R} ${Selection_G} ${Selection_B}
|
checkcolor ${x3} ${y3} 1 1 0
|
||||||
checkcolor ${x4} ${y4} ${Selection_R} ${Selection_G} ${Selection_B}
|
checkcolor ${x4} ${y4} 1 1 0
|
||||||
checkcolor ${x5} ${y5} ${Selection_R} ${Selection_G} ${Selection_B}
|
checkcolor ${x5} ${y5} 1 1 0
|
||||||
|
|
||||||
if {${CloseNbSelected} == 0} {
|
if {${CloseNbSelected} == 0} {
|
||||||
puts "OCC1629: OK (case 13: after close local context)"
|
puts "OCC1629: OK (case 13: after close local context)"
|
||||||
|
@ -18,8 +18,8 @@ vertex p2 150 300 0
|
|||||||
edge e1 p1 p2
|
edge e1 p1 p2
|
||||||
|
|
||||||
vdisplay e1
|
vdisplay e1
|
||||||
vselmode e1 2 1
|
vselmode e1 2 1 -local
|
||||||
vselmode e1 1 1
|
vselmode e1 1 1 -local
|
||||||
vselect 0 0 2500 2500
|
vselect 0 0 2500 2500
|
||||||
verase -local
|
verase -local
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ vdisplay b
|
|||||||
vfit
|
vfit
|
||||||
|
|
||||||
# opening a local context for local selection
|
# opening a local context for local selection
|
||||||
vselmode b 4 1
|
vselmode b 4 1 -local
|
||||||
# Select a face just to simulate the scenario used in a real application
|
# Select a face just to simulate the scenario used in a real application
|
||||||
vselect 200 200
|
vselect 200 200
|
||||||
# This line should not lead to exception
|
# This line should not lead to exception
|
||||||
|
Loading…
x
Reference in New Issue
Block a user