myStructureManager->Display (this);
}
- myCStructure->visible = 1;
+ if (myCStructure->visible != 1)
+ {
+ myCStructure->visible = 1;
+ myCStructure->OnVisibilityChanged();
+ }
}
//=============================================================================
myCStructure->IsForHighlight = isForHighlight;
}
-//=============================================================================
-//function : Display
-//purpose :
-//=============================================================================
-void Graphic3d_Structure::Display (const Standard_Integer thePriority)
-{
- if (IsDeleted()) return;
-
- SetDisplayPriority (thePriority);
-
- if (!myCStructure->stick)
- {
- myCStructure->stick = 1;
- myStructureManager->Display (this);
- }
-
- myCStructure->visible = 1;
-}
-
//=============================================================================
//function : SetDisplayPriority
//purpose :
//function : Highlight
//purpose :
//=============================================================================
-void Graphic3d_Structure::Highlight (const Aspect_TypeOfHighlightMethod theMethod)
+void Graphic3d_Structure::Highlight (const Aspect_TypeOfHighlightMethod theMethod,
+ const Quantity_Color& theColor,
+ const Standard_Boolean theToUpdateMgr)
{
if (IsDeleted())
{
return;
}
+ myHighlightColor = theColor;
+
// Highlight on already Highlighted structure.
if (myCStructure->highlight)
{
SetDisplayPriority (Structure_MAX_PRIORITY - 1);
GraphicHighlight (theMethod);
- if (myCStructure->stick)
- {
- myStructureManager->Highlight (this, theMethod);
- }
- Update();
-}
-
-//=============================================================================
-//function : SetHighlightColor
-//purpose :
-//=============================================================================
-void Graphic3d_Structure::SetHighlightColor (const Quantity_Color& theColor)
-{
- if (IsDeleted())
+ if (!theToUpdateMgr)
{
return;
}
- if (!myCStructure->highlight)
+ if (myCStructure->stick)
{
- myHighlightColor = theColor;
- return;
+ myStructureManager->Highlight (this, theMethod);
}
- // Change highlight color on already Highlighted structure.
- Aspect_TypeOfUpdate anUpdateMode = myStructureManager->UpdateMode();
- if (anUpdateMode == Aspect_TOU_WAIT)
- {
- UnHighlight();
- }
- else
- {
- // To avoid call of method : Update()
- // Not useful and can be costly.
- myStructureManager->SetUpdateMode (Aspect_TOU_WAIT);
- UnHighlight();
- myStructureManager->SetUpdateMode (anUpdateMode);
- }
- myHighlightColor = theColor;
- Highlight (myHighlightMethod);
+ Update();
}
//=============================================================================
{
if (IsDeleted()) return;
- myCStructure->visible = theValue ? 1 : 0;
- myCStructure->UpdateNamedStatus();
- Update();
-}
-
-//=============================================================================
-//function : SetPick
-//purpose :
-//=============================================================================
-void Graphic3d_Structure::SetPick (const Standard_Boolean theValue)
-{
- if (IsDeleted ()) return;
-
- myCStructure->pick = theValue ? 1 : 0;
- myCStructure->UpdateNamedStatus();
-
- if (theValue)
+ const unsigned isVisible = theValue ? 1 : 0;
+ if (myCStructure->visible == isVisible)
{
- myStructureManager->Detectable (this);
- }
- else
- {
- myStructureManager->Undetectable (this);
+ return;
}
+
+ myCStructure->visible = isVisible;
+ myCStructure->OnVisibilityChanged();
Update();
}
return myCStructure->highlight ? Standard_True : Standard_False;
}
-//=============================================================================
-//function : IsSelectable
-//purpose :
-//=============================================================================
-Standard_Boolean Graphic3d_Structure::IsSelectable() const
-{
- return myCStructure->pick ? Standard_True : Standard_False;
-}
-
//=============================================================================
//function : IsVisible
//purpose :
{
myHighlightColor.Values (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
myCStructure->HighlightWithColor (Graphic3d_Vec3 (float (anRGB[0]), float (anRGB[1]), float (anRGB[2])), Standard_True);
- myCStructure->UpdateNamedStatus();
break;
}
case Aspect_TOHM_BOUNDBOX:
{
case Aspect_TOHM_COLOR:
myCStructure->HighlightWithColor (Graphic3d_Vec3 (0.0f, 0.0f, 0.0f), Standard_False);
- myCStructure->UpdateNamedStatus();
break;
case Aspect_TOHM_BOUNDBOX:
myCStructure->HighlightWithBndBox (this, Standard_False);
- myCStructure->UpdateNamedStatus();
break;
}
}
//function : SetZLayer
//purpose :
//=======================================================================
-void Graphic3d_Structure::SetZLayer (const Standard_Integer theLayerId)
+void Graphic3d_Structure::SetZLayer (const Graphic3d_ZLayerId theLayerId)
{
// if the structure is not displayed, unable to change its display layer
if (IsDeleted ())
return;
myStructureManager->ChangeZLayer (this, theLayerId);
+ myCStructure->SetZLayer (theLayerId);
}
//=======================================================================
//function : GetZLayer
//purpose :
//=======================================================================
-Standard_Integer Graphic3d_Structure::GetZLayer () const
+Graphic3d_ZLayerId Graphic3d_Structure::GetZLayer() const
{
- return myStructureManager->GetZLayer (this);
+ return myCStructure->ZLayer();
}
//=======================================================================