Removed unused legacy show icons option
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
This commit is contained in:
@@ -761,72 +761,6 @@ void CBaseObject::SetModified(bool)
|
||||
{
|
||||
}
|
||||
|
||||
void CBaseObject::DrawDefault(DisplayContext& dc, const QColor& labelColor)
|
||||
{
|
||||
Vec3 wp = GetWorldPos();
|
||||
|
||||
bool bDisplaySelectionHelper = false;
|
||||
if (!CanBeDrawn(dc, bDisplaySelectionHelper))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw link between parent and child.
|
||||
if (dc.flags & DISPLAY_LINKS)
|
||||
{
|
||||
if (GetParent())
|
||||
{
|
||||
dc.DrawLine(GetParentAttachPointWorldTM().GetTranslation(), wp, IsFrozen() ? kLinkColorGray : kLinkColorParent, IsFrozen() ? kLinkColorGray : kLinkColorChild);
|
||||
}
|
||||
size_t nChildCount = GetChildCount();
|
||||
for (size_t i = 0; i < nChildCount; ++i)
|
||||
{
|
||||
const CBaseObject* pChild = GetChild(i);
|
||||
dc.DrawLine(pChild->GetParentAttachPointWorldTM().GetTranslation(), pChild->GetWorldPos(), pChild->IsFrozen() ? kLinkColorGray : kLinkColorParent, pChild->IsFrozen() ? kLinkColorGray : kLinkColorChild);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Bounding box
|
||||
if (dc.flags & DISPLAY_BBOX)
|
||||
{
|
||||
AABB box;
|
||||
GetBoundBox(box);
|
||||
dc.SetColor(Vec3(1, 1, 1));
|
||||
dc.DrawWireBox(box.min, box.max);
|
||||
}
|
||||
|
||||
if (IsHighlighted())
|
||||
{
|
||||
DrawHighlight(dc);
|
||||
}
|
||||
|
||||
if (IsSelected())
|
||||
{
|
||||
DrawArea(dc);
|
||||
|
||||
CSelectionGroup* pSelection = GetObjectManager()->GetSelection();
|
||||
|
||||
// If the number of selected object is over 2, the merged boundbox should be used to render the measurement axis.
|
||||
if (!pSelection || (pSelection && pSelection->GetCount() == 1))
|
||||
{
|
||||
DrawDimensions(dc);
|
||||
}
|
||||
}
|
||||
|
||||
if (bDisplaySelectionHelper)
|
||||
{
|
||||
DrawSelectionHelper(dc, wp, labelColor, 1.0f);
|
||||
}
|
||||
else if (!(dc.flags & DISPLAY_HIDENAMES))
|
||||
{
|
||||
DrawLabel(dc, wp, labelColor);
|
||||
}
|
||||
|
||||
SetDrawTextureIconProperties(dc, wp);
|
||||
DrawTextureIcon(dc, wp);
|
||||
DrawWarningIcons(dc, wp);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::DrawDimensions(DisplayContext&, AABB*)
|
||||
{
|
||||
@@ -850,91 +784,6 @@ void CBaseObject::DrawSelectionHelper(DisplayContext& dc, const Vec3& pos, const
|
||||
dc.SetState(nPrevState);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha, int texIconFlags)
|
||||
{
|
||||
if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons)
|
||||
{
|
||||
if (IsHighlighted())
|
||||
{
|
||||
dc.SetColor(QColor(255, 120, 0), 0.8f * alpha);
|
||||
}
|
||||
else if (IsSelected())
|
||||
{
|
||||
dc.SetSelectedColor(alpha);
|
||||
}
|
||||
else if (IsFrozen())
|
||||
{
|
||||
dc.SetFreezeColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetColor(QColor(255, 255, 255), alpha);
|
||||
}
|
||||
|
||||
m_vDrawIconPos = pos;
|
||||
|
||||
int nIconFlags = texIconFlags;
|
||||
if (CheckFlags(OBJFLAG_SHOW_ICONONTOP))
|
||||
{
|
||||
Vec3 objectPos = GetWorldPos();
|
||||
|
||||
AABB box;
|
||||
GetBoundBox(box);
|
||||
m_vDrawIconPos.z = (m_vDrawIconPos.z - objectPos.z) + box.max.z;
|
||||
nIconFlags |= DisplayContext::TEXICON_ALIGN_BOTTOM;
|
||||
}
|
||||
m_nIconFlags = nIconFlags;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::DrawTextureIcon(DisplayContext& dc, [[maybe_unused]] const Vec3& pos, [[maybe_unused]] float alpha)
|
||||
{
|
||||
if (m_nTextureIcon && (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons))
|
||||
{
|
||||
dc.DrawTextureLabel(GetTextureIconDrawPos(), OBJECT_TEXTURE_ICON_SIZEX, OBJECT_TEXTURE_ICON_SIZEY, GetTextureIcon(), GetTextureIconFlags());
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::DrawWarningIcons(DisplayContext& dc, const Vec3&)
|
||||
{
|
||||
if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons)
|
||||
{
|
||||
const int warningIconSizeX = OBJECT_TEXTURE_ICON_SIZEX / 2;
|
||||
const int warningIconSizeY = OBJECT_TEXTURE_ICON_SIZEY / 2;
|
||||
|
||||
const int iconOffsetX = m_nTextureIcon ? (-OBJECT_TEXTURE_ICON_SIZEX / 2) : 0;
|
||||
const int iconOffsetY = m_nTextureIcon ? (-OBJECT_TEXTURE_ICON_SIZEY / 2) : 0;
|
||||
|
||||
if (gSettings.viewports.bShowScaleWarnings)
|
||||
{
|
||||
const EScaleWarningLevel scaleWarningLevel = GetScaleWarningLevel();
|
||||
|
||||
if (scaleWarningLevel != eScaleWarningLevel_None)
|
||||
{
|
||||
dc.SetColor(QColor(255, scaleWarningLevel == eScaleWarningLevel_RescaledNonUniform ? 50 : 255, 50), 1.0f);
|
||||
dc.DrawTextureLabel(GetTextureIconDrawPos(), warningIconSizeX, warningIconSizeY,
|
||||
GetIEditor()->GetIconManager()->GetIconTexture(eIcon_ScaleWarning), GetTextureIconFlags(),
|
||||
-warningIconSizeX / 2, iconOffsetX - (warningIconSizeY / 2));
|
||||
}
|
||||
}
|
||||
|
||||
if (gSettings.viewports.bShowRotationWarnings)
|
||||
{
|
||||
const ERotationWarningLevel rotationWarningLevel = GetRotationWarningLevel();
|
||||
if (rotationWarningLevel != eRotationWarningLevel_None)
|
||||
{
|
||||
dc.SetColor(QColor(255, rotationWarningLevel == eRotationWarningLevel_RotatedNonRectangular ? 50 : 255, 50), 1.0f);
|
||||
dc.DrawTextureLabel(GetTextureIconDrawPos(), warningIconSizeX, warningIconSizeY,
|
||||
GetIEditor()->GetIconManager()->GetIconTexture(eIcon_RotationWarning), GetTextureIconFlags(),
|
||||
warningIconSizeX / 2, iconOffsetY - (warningIconSizeY / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& lC, float alpha, float size)
|
||||
{
|
||||
|
||||
@@ -398,9 +398,6 @@ public:
|
||||
// Interface to be implemented in plugins.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! Draw object to specified viewport.
|
||||
virtual void Display([[maybe_unused]] DisplayContext& disp) {}
|
||||
|
||||
//! Perform intersection testing of this object.
|
||||
//! Return true if was hit.
|
||||
virtual bool HitTest([[maybe_unused]] HitContext& hc) { return false; };
|
||||
@@ -529,8 +526,6 @@ protected:
|
||||
void ResolveParent(CBaseObject* object);
|
||||
void SetColor(const QColor& color);
|
||||
|
||||
//! Draw default object items.
|
||||
virtual void DrawDefault(DisplayContext& dc, const QColor& labelColor = QColor(255, 255, 255));
|
||||
//! Draw object label.
|
||||
void DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& labelColor = QColor(255, 255, 255), float alpha = 1.0f, float size = 1.f);
|
||||
//! Draw 3D Axis at object position.
|
||||
@@ -539,10 +534,6 @@ protected:
|
||||
void DrawArea(DisplayContext& dc);
|
||||
//! Draw selection helper.
|
||||
void DrawSelectionHelper(DisplayContext& dc, const Vec3& pos, const QColor& labelColor = QColor(255, 255, 255), float alpha = 1.0f);
|
||||
//! Draw helper icon.
|
||||
virtual void DrawTextureIcon(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f);
|
||||
//! Draw warning icons
|
||||
virtual void DrawWarningIcons(DisplayContext& dc, const Vec3& pos);
|
||||
//! Check if dimension's figures can be displayed before draw them.
|
||||
virtual void DrawDimensions(DisplayContext& dc, AABB* pMergedBoundBox = nullptr);
|
||||
|
||||
@@ -575,7 +566,6 @@ protected:
|
||||
//! Only used by ObjectManager.
|
||||
bool IsPotentiallyVisible() const;
|
||||
|
||||
void SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f, int texIconFlags = 0);
|
||||
const Vec3& GetTextureIconDrawPos(){ return m_vDrawIconPos; };
|
||||
int GetTextureIconFlags(){ return m_nIconFlags; };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user