mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0031153: Visualization - Non clear highlighting of selected trihedron elements
AIS_Trihedron - removed extra fields holding highlight styles; standard styles are now used instead; fixed unexpected modification of global aspects; fixed unhighligting of selected plane within Shaded trihedron. AIS_InteractiveContext now sets highlight color to highlight aspects, not only base color to drawer itself.
This commit is contained in:
parent
3f1675c941
commit
df8c7e3e18
@ -65,13 +65,15 @@ namespace
|
|||||||
typedef NCollection_DataMap<Handle(SelectMgr_SelectableObject), Handle(SelectMgr_IndexedMapOfOwner)>::Iterator AIS_MapIteratorOfMapOfObjectOwners;
|
typedef NCollection_DataMap<Handle(SelectMgr_SelectableObject), Handle(SelectMgr_IndexedMapOfOwner)>::Iterator AIS_MapIteratorOfMapOfObjectOwners;
|
||||||
|
|
||||||
//! Initialize default highlighting attributes.
|
//! Initialize default highlighting attributes.
|
||||||
static void initDefaultHilightAttributes (const Handle(Prs3d_Drawer)& theDrawer)
|
static void initDefaultHilightAttributes (const Handle(Prs3d_Drawer)& theDrawer,
|
||||||
|
const Quantity_Color& theColor)
|
||||||
{
|
{
|
||||||
theDrawer->SetMethod (Aspect_TOHM_COLOR);
|
theDrawer->SetMethod (Aspect_TOHM_COLOR);
|
||||||
theDrawer->SetDisplayMode (0);
|
theDrawer->SetDisplayMode (0);
|
||||||
|
theDrawer->SetColor (theColor);
|
||||||
|
|
||||||
theDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_BLACK, 1.0));
|
theDrawer->SetupOwnShadingAspect();
|
||||||
*theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
|
theDrawer->SetupOwnPointAspect();
|
||||||
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||||
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||||
@ -82,6 +84,24 @@ namespace
|
|||||||
*theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
|
*theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
|
||||||
theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||||
*theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
|
*theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
|
||||||
|
theDrawer->SetDatumAspect (new Prs3d_DatumAspect());
|
||||||
|
|
||||||
|
theDrawer->ShadingAspect()->SetColor (theColor);
|
||||||
|
theDrawer->WireAspect()->SetColor (theColor);
|
||||||
|
theDrawer->LineAspect()->SetColor (theColor);
|
||||||
|
theDrawer->PlaneAspect()->ArrowAspect()->SetColor (theColor);
|
||||||
|
theDrawer->PlaneAspect()->IsoAspect()->SetColor (theColor);
|
||||||
|
theDrawer->PlaneAspect()->EdgesAspect()->SetColor (theColor);
|
||||||
|
theDrawer->FreeBoundaryAspect()->SetColor (theColor);
|
||||||
|
theDrawer->UnFreeBoundaryAspect()->SetColor (theColor);
|
||||||
|
theDrawer->PointAspect()->SetColor (theColor);
|
||||||
|
for (Standard_Integer aPartIter = 0; aPartIter < Prs3d_DP_None; ++aPartIter)
|
||||||
|
{
|
||||||
|
if (Handle(Prs3d_LineAspect) aLineAsp = theDrawer->DatumAspect()->LineAspect ((Prs3d_DatumParts )aPartIter))
|
||||||
|
{
|
||||||
|
aLineAsp->SetColor (theColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
theDrawer->WireAspect()->SetWidth (2.0);
|
theDrawer->WireAspect()->SetWidth (2.0);
|
||||||
theDrawer->LineAspect()->SetWidth (2.0);
|
theDrawer->LineAspect()->SetWidth (2.0);
|
||||||
@ -130,30 +150,26 @@ myIsAutoActivateSelMode(Standard_True)
|
|||||||
{
|
{
|
||||||
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_Dynamic];
|
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_Dynamic];
|
||||||
aStyle->Link (myDefaultDrawer);
|
aStyle->Link (myDefaultDrawer);
|
||||||
initDefaultHilightAttributes (aStyle);
|
initDefaultHilightAttributes (aStyle, Quantity_NOC_CYAN1);
|
||||||
aStyle->SetZLayer(Graphic3d_ZLayerId_Top);
|
aStyle->SetZLayer(Graphic3d_ZLayerId_Top);
|
||||||
aStyle->SetColor (Quantity_NOC_CYAN1);
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_LocalDynamic];
|
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_LocalDynamic];
|
||||||
aStyle->Link (myDefaultDrawer);
|
aStyle->Link (myDefaultDrawer);
|
||||||
initDefaultHilightAttributes (aStyle);
|
initDefaultHilightAttributes (aStyle, Quantity_NOC_CYAN1);
|
||||||
aStyle->SetZLayer(Graphic3d_ZLayerId_Topmost);
|
aStyle->SetZLayer(Graphic3d_ZLayerId_Topmost);
|
||||||
aStyle->SetColor (Quantity_NOC_CYAN1);
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_Selected];
|
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_Selected];
|
||||||
aStyle->Link (myDefaultDrawer);
|
aStyle->Link (myDefaultDrawer);
|
||||||
initDefaultHilightAttributes (aStyle);
|
initDefaultHilightAttributes (aStyle, Quantity_NOC_GRAY80);
|
||||||
aStyle->SetZLayer(Graphic3d_ZLayerId_UNKNOWN);
|
aStyle->SetZLayer(Graphic3d_ZLayerId_UNKNOWN);
|
||||||
aStyle->SetColor (Quantity_NOC_GRAY80);
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_LocalSelected];
|
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_LocalSelected];
|
||||||
aStyle->Link (myDefaultDrawer);
|
aStyle->Link (myDefaultDrawer);
|
||||||
initDefaultHilightAttributes (aStyle);
|
initDefaultHilightAttributes (aStyle, Quantity_NOC_GRAY80);
|
||||||
aStyle->SetZLayer(Graphic3d_ZLayerId_UNKNOWN);
|
aStyle->SetZLayer(Graphic3d_ZLayerId_UNKNOWN);
|
||||||
aStyle->SetColor (Quantity_NOC_GRAY80);
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_SubIntensity];
|
const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_SubIntensity];
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <Prs3d_DatumAspect.hxx>
|
#include <Prs3d_DatumAspect.hxx>
|
||||||
#include <Prs3d_Drawer.hxx>
|
#include <Prs3d_Drawer.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
|
#include <Prs3d_PointAspect.hxx>
|
||||||
#include <Prs3d_Presentation.hxx>
|
#include <Prs3d_Presentation.hxx>
|
||||||
#include <Prs3d_Projector.hxx>
|
#include <Prs3d_Projector.hxx>
|
||||||
#include <Prs3d_ShadingAspect.hxx>
|
#include <Prs3d_ShadingAspect.hxx>
|
||||||
@ -59,6 +60,8 @@ AIS_Trihedron::AIS_Trihedron (const Handle(Geom_Axis2Placement)& theComponent)
|
|||||||
myTrihDispMode (Prs3d_DM_WireFrame),
|
myTrihDispMode (Prs3d_DM_WireFrame),
|
||||||
myComponent (theComponent)
|
myComponent (theComponent)
|
||||||
{
|
{
|
||||||
|
myAutoHilight = Standard_False;
|
||||||
|
|
||||||
// selection priorities
|
// selection priorities
|
||||||
mySelectionPriority.Bind (Prs3d_DP_None, 5); // complete triedron: priority 5 (same as faces)
|
mySelectionPriority.Bind (Prs3d_DP_None, 5); // complete triedron: priority 5 (same as faces)
|
||||||
mySelectionPriority.Bind (Prs3d_DP_Origin, 8); // origin: priority 8
|
mySelectionPriority.Bind (Prs3d_DP_Origin, 8); // origin: priority 8
|
||||||
@ -70,6 +73,7 @@ AIS_Trihedron::AIS_Trihedron (const Handle(Geom_Axis2Placement)& theComponent)
|
|||||||
{
|
{
|
||||||
mySelectionPriority.Bind ((Prs3d_DatumParts )aPartIter, 5); // planes: priority: 5
|
mySelectionPriority.Bind ((Prs3d_DatumParts )aPartIter, 5); // planes: priority: 5
|
||||||
}
|
}
|
||||||
|
myHiddenLineAspect = new Graphic3d_AspectLine3d (Quantity_NOC_WHITE, Aspect_TOL_EMPTY, 1.0f);
|
||||||
|
|
||||||
// trihedron labels
|
// trihedron labels
|
||||||
myLabel.Bind (Prs3d_DP_XAxis, "X");
|
myLabel.Bind (Prs3d_DP_XAxis, "X");
|
||||||
@ -135,7 +139,6 @@ void AIS_Trihedron::SetSize(const Standard_Real aValue)
|
|||||||
myDrawer->DatumAspect()->SetAxisLength(aValue, aValue, aValue);
|
myDrawer->DatumAspect()->SetAxisLength(aValue, aValue, aValue);
|
||||||
|
|
||||||
SetToUpdate();
|
SetToUpdate();
|
||||||
UpdatePresentations();
|
|
||||||
UpdateSelection();
|
UpdateSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +166,6 @@ void AIS_Trihedron::UnsetSize()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetToUpdate();
|
SetToUpdate();
|
||||||
UpdatePresentations();
|
|
||||||
}
|
}
|
||||||
UpdateSelection();
|
UpdateSelection();
|
||||||
}
|
}
|
||||||
@ -310,36 +312,37 @@ void AIS_Trihedron::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManag
|
|||||||
aPresentation->Clear();
|
aPresentation->Clear();
|
||||||
const Prs3d_DatumParts aPart = anOwner->DatumPart();
|
const Prs3d_DatumParts aPart = anOwner->DatumPart();
|
||||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPresentation);
|
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPresentation);
|
||||||
Handle(Prs3d_DatumAspect) anAspect = myDrawer->DatumAspect();
|
|
||||||
if (aPart >= Prs3d_DP_XOYAxis && aPart <= Prs3d_DP_XOZAxis)
|
if (aPart >= Prs3d_DP_XOYAxis && aPart <= Prs3d_DP_XOZAxis)
|
||||||
{
|
{
|
||||||
// planes selection is equal in both shading and wireframe mode
|
// planes selection is equal in both shading and wireframe mode
|
||||||
aGroup->SetGroupPrimitivesAspect (getHighlightLineAspect()->Aspect());
|
aGroup->SetGroupPrimitivesAspect (theStyle->LineAspect()->Aspect());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (myTrihDispMode == Prs3d_DM_Shaded)
|
if (myTrihDispMode == Prs3d_DM_Shaded)
|
||||||
{
|
{
|
||||||
aGroup->SetGroupPrimitivesAspect (anAspect->ShadingAspect(aPart)->Aspect());
|
aGroup->SetGroupPrimitivesAspect (theStyle->ShadingAspect()->Aspect());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (aPart == Prs3d_DP_Origin)
|
if (aPart == Prs3d_DP_Origin)
|
||||||
{
|
{
|
||||||
aGroup->SetGroupPrimitivesAspect (getHighlightPointAspect()->Aspect());
|
aGroup->SetGroupPrimitivesAspect (theStyle->PointAspect()->Aspect());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aGroup->SetGroupPrimitivesAspect (anAspect->LineAspect(aPart)->Aspect());
|
aGroup->SetGroupPrimitivesAspect(theStyle->LineAspect()->Aspect());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aGroup->AddPrimitiveArray (arrayOfPrimitives(aPart));
|
aGroup->AddPrimitiveArray (arrayOfPrimitives(aPart));
|
||||||
|
|
||||||
if (aPresentation->GetZLayer() != theStyle->ZLayer())
|
const Graphic3d_ZLayerId aLayer = theStyle->ZLayer() != Graphic3d_ZLayerId_UNKNOWN ? theStyle->ZLayer() : myDrawer->ZLayer();
|
||||||
|
if (aPresentation->GetZLayer() != aLayer)
|
||||||
{
|
{
|
||||||
aPresentation->SetZLayer (theStyle->ZLayer());
|
aPresentation->SetZLayer (aLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
aPresentation->Highlight (theStyle);
|
aPresentation->Highlight (theStyle);
|
||||||
thePM->AddToImmediateList (aPresentation);
|
thePM->AddToImmediateList (aPresentation);
|
||||||
}
|
}
|
||||||
@ -356,25 +359,22 @@ void AIS_Trihedron::HilightSelected (const Handle(PrsMgr_PresentationManager3d)&
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Prs3d_DatumAspect) anAspect = myDrawer->DatumAspect();
|
|
||||||
const bool isShadingMode = myTrihDispMode == Prs3d_DM_Shaded;
|
const bool isShadingMode = myTrihDispMode == Prs3d_DM_Shaded;
|
||||||
|
|
||||||
const Handle(Prs3d_Drawer)& aContextSelStyle = GetContext()->SelectionStyle();
|
Handle(Prs3d_Drawer) anAspect = !myHilightDrawer.IsNull() ? myHilightDrawer : GetContext()->SelectionStyle();
|
||||||
const Quantity_Color& aSelectionColor = aContextSelStyle->Color();
|
|
||||||
for (SelectMgr_SequenceOfOwner::Iterator anIterator (theOwners); anIterator.More(); anIterator.Next())
|
for (SelectMgr_SequenceOfOwner::Iterator anIterator (theOwners); anIterator.More(); anIterator.Next())
|
||||||
{
|
{
|
||||||
const Handle(SelectMgr_EntityOwner)& anOwner = anIterator.Value();
|
const Handle(SelectMgr_EntityOwner)& anOwner = anIterator.Value();
|
||||||
Handle(AIS_TrihedronOwner) aTrihedronOwner = Handle(AIS_TrihedronOwner)::DownCast(anOwner);
|
Handle(AIS_TrihedronOwner) aTrihedronOwner = Handle(AIS_TrihedronOwner)::DownCast(anOwner);
|
||||||
if (aTrihedronOwner.IsNull())
|
if (aTrihedronOwner.IsNull())
|
||||||
{
|
{
|
||||||
thePM->Color (this, aContextSelStyle, 0);
|
thePM->Color (this, anAspect, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Prs3d_DatumParts aPart = aTrihedronOwner->DatumPart();
|
const Prs3d_DatumParts aPart = aTrihedronOwner->DatumPart();
|
||||||
Handle(Graphic3d_Group) aGroup;
|
Handle(Graphic3d_Group) aGroup;
|
||||||
if (mySelectedParts.Contains (aPart)
|
if (mySelectedParts.Contains (aPart) || !myPartToGroup.Find (aPart, aGroup))
|
||||||
|| !myPartToGroup.Find (aPart, aGroup))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -382,27 +382,23 @@ void AIS_Trihedron::HilightSelected (const Handle(PrsMgr_PresentationManager3d)&
|
|||||||
if (aPart >= Prs3d_DP_XOYAxis
|
if (aPart >= Prs3d_DP_XOYAxis
|
||||||
&& aPart <= Prs3d_DP_XOZAxis)
|
&& aPart <= Prs3d_DP_XOZAxis)
|
||||||
{
|
{
|
||||||
getHighlightLineAspect()->SetColor (aSelectionColor);
|
aGroup->SetGroupPrimitivesAspect (anAspect->LineAspect()->Aspect());
|
||||||
aGroup->SetGroupPrimitivesAspect (getHighlightLineAspect()->Aspect());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (isShadingMode)
|
if (isShadingMode)
|
||||||
{
|
{
|
||||||
getHighlightAspect()->SetColor (aSelectionColor);
|
aGroup->SetGroupPrimitivesAspect (anAspect->ShadingAspect()->Aspect());
|
||||||
aGroup->SetGroupPrimitivesAspect (getHighlightAspect()->Aspect());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (aPart == Prs3d_DP_Origin)
|
if (aPart == Prs3d_DP_Origin)
|
||||||
{
|
{
|
||||||
getHighlightPointAspect()->SetColor (aSelectionColor);
|
aGroup->SetGroupPrimitivesAspect (anAspect->PointAspect()->Aspect());
|
||||||
aGroup->SetGroupPrimitivesAspect (getHighlightPointAspect()->Aspect());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
getHighlightLineAspect()->SetColor (aSelectionColor);
|
aGroup->SetGroupPrimitivesAspect (anAspect->LineAspect()->Aspect());
|
||||||
aGroup->SetGroupPrimitivesAspect (getHighlightLineAspect()->Aspect());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -426,9 +422,9 @@ void AIS_Trihedron::ClearSelected()
|
|||||||
if (aPart >= Prs3d_DP_XOYAxis
|
if (aPart >= Prs3d_DP_XOYAxis
|
||||||
&& aPart <= Prs3d_DP_XOZAxis)
|
&& aPart <= Prs3d_DP_XOZAxis)
|
||||||
{
|
{
|
||||||
aGroup->SetGroupPrimitivesAspect (anAspect->LineAspect (aPart)->Aspect());
|
aGroup->SetGroupPrimitivesAspect (myHiddenLineAspect);
|
||||||
}
|
}
|
||||||
if (isShadingMode)
|
else if (isShadingMode)
|
||||||
{
|
{
|
||||||
aGroup->SetGroupPrimitivesAspect (anAspect->ShadingAspect (aPart)->Aspect());
|
aGroup->SetGroupPrimitivesAspect (anAspect->ShadingAspect (aPart)->Aspect());
|
||||||
}
|
}
|
||||||
@ -553,11 +549,8 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
|||||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePrs);
|
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePrs);
|
||||||
myPartToGroup.Bind (aPart, aGroup);
|
myPartToGroup.Bind (aPart, aGroup);
|
||||||
|
|
||||||
const Handle(Graphic3d_AspectLine3d)& aLineAspect = anAspect->LineAspect (aPart)->Aspect();
|
|
||||||
aLineAspect->SetType (Aspect_TOL_EMPTY);
|
|
||||||
|
|
||||||
aGroup->AddPrimitiveArray (arrayOfPrimitives (aPart));
|
aGroup->AddPrimitiveArray (arrayOfPrimitives (aPart));
|
||||||
aGroup->SetGroupPrimitivesAspect (aLineAspect);
|
aGroup->SetGroupPrimitivesAspect (myHiddenLineAspect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -933,65 +926,3 @@ void AIS_Trihedron::updatePrimitives(const Handle(Prs3d_DatumAspect)& theAspect,
|
|||||||
myPrimitives.Bind(aPart, aPrims);
|
myPrimitives.Bind(aPart, aPrims);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : getHighlightAspect
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
Handle(Prs3d_ShadingAspect) AIS_Trihedron::getHighlightAspect()
|
|
||||||
{
|
|
||||||
if (!myHighlightAspect.IsNull())
|
|
||||||
return myHighlightAspect;
|
|
||||||
|
|
||||||
Quantity_Color aHighlightColor = Quantity_NOC_GRAY80;
|
|
||||||
if (!myHilightDrawer.IsNull())
|
|
||||||
aHighlightColor = myHilightDrawer->Color();
|
|
||||||
|
|
||||||
myHighlightAspect = new Prs3d_ShadingAspect();
|
|
||||||
myHighlightAspect->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
|
|
||||||
myHighlightAspect->SetColor (aHighlightColor);
|
|
||||||
|
|
||||||
Graphic3d_MaterialAspect aHighlightMaterial;
|
|
||||||
aHighlightMaterial.SetColor (aHighlightColor);
|
|
||||||
myHighlightAspect->SetMaterial (aHighlightMaterial);
|
|
||||||
|
|
||||||
return myHighlightAspect;
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : getHighlightLineAspect
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
Handle(Prs3d_LineAspect) AIS_Trihedron::getHighlightLineAspect()
|
|
||||||
{
|
|
||||||
if (!myHighlightLineAspect.IsNull())
|
|
||||||
return myHighlightLineAspect;
|
|
||||||
|
|
||||||
Quantity_Color aHighlightColor = Quantity_NOC_GRAY80;
|
|
||||||
if (!myHilightDrawer.IsNull())
|
|
||||||
aHighlightColor = myHilightDrawer->Color();
|
|
||||||
|
|
||||||
Handle(Prs3d_DatumAspect) aDatumAspect = Attributes()->DatumAspect();
|
|
||||||
Handle(Prs3d_LineAspect) aLineAspect = aDatumAspect->LineAspect(Prs3d_DP_XAxis);
|
|
||||||
myHighlightLineAspect = new Prs3d_LineAspect (aHighlightColor, aLineAspect->Aspect()->Type(),
|
|
||||||
aLineAspect->Aspect()->Width());
|
|
||||||
|
|
||||||
return myHighlightLineAspect;
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : getHighlightPointAspect
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
Handle(Prs3d_PointAspect) AIS_Trihedron::getHighlightPointAspect()
|
|
||||||
{
|
|
||||||
if (!myHighlightPointAspect.IsNull())
|
|
||||||
return myHighlightPointAspect;
|
|
||||||
|
|
||||||
Quantity_Color aHighlightColor = Quantity_NOC_GRAY80;
|
|
||||||
if (!myHilightDrawer.IsNull())
|
|
||||||
aHighlightColor = myHilightDrawer->Color();
|
|
||||||
myHighlightPointAspect = new Prs3d_PointAspect (Aspect_TOM_PLUS, aHighlightColor, 1.0);
|
|
||||||
|
|
||||||
return myHighlightPointAspect;
|
|
||||||
}
|
|
||||||
|
@ -186,9 +186,6 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Disables auto highlighting to use HilightSelected() and HilightOwnerWithColor() overridden methods.
|
|
||||||
virtual Standard_Boolean IsAutoHilight() const Standard_OVERRIDE { return false; }
|
|
||||||
|
|
||||||
//! Method which clear all selected owners belonging
|
//! Method which clear all selected owners belonging
|
||||||
//! to this selectable object ( for fast presentation draw ).
|
//! to this selectable object ( for fast presentation draw ).
|
||||||
Standard_EXPORT virtual void ClearSelected() Standard_OVERRIDE;
|
Standard_EXPORT virtual void ClearSelected() Standard_OVERRIDE;
|
||||||
@ -248,13 +245,6 @@ protected:
|
|||||||
const gp_Dir& theYDir,
|
const gp_Dir& theYDir,
|
||||||
const gp_Dir& theZDir);
|
const gp_Dir& theZDir);
|
||||||
|
|
||||||
//! Returns highlight line aspect , create if it is the first call
|
|
||||||
Handle(Prs3d_ShadingAspect) getHighlightAspect();
|
|
||||||
//! Returns highlight line aspect , create if it is the first call
|
|
||||||
Handle(Prs3d_LineAspect) getHighlightLineAspect();
|
|
||||||
//! Returns highlight line aspect , create if it is the first call
|
|
||||||
Handle(Prs3d_PointAspect) getHighlightPointAspect();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Standard_Boolean myHasOwnSize;
|
Standard_Boolean myHasOwnSize;
|
||||||
Standard_Boolean myHasOwnTextColor;
|
Standard_Boolean myHasOwnTextColor;
|
||||||
@ -269,10 +259,7 @@ protected:
|
|||||||
|
|
||||||
NCollection_DataMap<Prs3d_DatumParts, Handle(Graphic3d_Group)> myPartToGroup;
|
NCollection_DataMap<Prs3d_DatumParts, Handle(Graphic3d_Group)> myPartToGroup;
|
||||||
NCollection_List<Prs3d_DatumParts> mySelectedParts;
|
NCollection_List<Prs3d_DatumParts> mySelectedParts;
|
||||||
|
Handle(Graphic3d_AspectLine3d) myHiddenLineAspect;
|
||||||
Handle(Prs3d_ShadingAspect) myHighlightAspect;
|
|
||||||
Handle(Prs3d_LineAspect) myHighlightLineAspect;
|
|
||||||
Handle(Prs3d_PointAspect) myHighlightPointAspect;
|
|
||||||
|
|
||||||
NCollection_DataMap<Prs3d_DatumParts, Handle(Graphic3d_ArrayOfPrimitives)> myPrimitives;
|
NCollection_DataMap<Prs3d_DatumParts, Handle(Graphic3d_ArrayOfPrimitives)> myPrimitives;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user