From: nds Date: Wed, 24 Oct 2018 12:17:34 +0000 (+0300) Subject: 0030268: Inspectors - improvements in VInspector plugin - Graphic3d_TransformPers... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=43198e085be41297e8368c7aa8f7635ab6d4fc33;p=occt-copy.git 0030268: Inspectors - improvements in VInspector plugin - Graphic3d_TransformPers item --- diff --git a/src/Aspect/Aspect.cxx b/src/Aspect/Aspect.cxx index 0039b5d097..e7ade3a45b 100644 --- a/src/Aspect/Aspect.cxx +++ b/src/Aspect/Aspect.cxx @@ -69,6 +69,11 @@ namespace "DIAGONAL_45", "DIAGONAL_45_WIDE", "DIAGONAL_135", "DIAGONAL_135_WIDE", "GRID", "GRID_WIDE", "GRID_DIAGONAL", "GRID_DIAGONAL_WIDE", "NB" }; + + static Standard_CString Aspect_Table_PrintTypeOfTriedronPosition[9] = + { + "CENTER", "TOP", "BOTTOM", "LEFT", "RIGHT", "LEFT_LOWER", "LEFT_UPPER", "RIGHT_LOWER", "RIGHT_UPPER" + }; } //======================================================================= @@ -403,3 +408,45 @@ Standard_Boolean Aspect::HatchStyleFromString (Standard_CString theTypeString, return Standard_False; } +//======================================================================= +//function : TypeOfTriedronPositionToString +//purpose : +//======================================================================= +Standard_CString Aspect::TypeOfTriedronPositionToString (Aspect_TypeOfTriedronPosition theType) +{ + return Aspect_Table_PrintTypeOfTriedronPosition[theType]; + switch (theType) + { + case Aspect_TOTP_CENTER: return Aspect_Table_PrintTypeOfTriedronPosition[0]; + case Aspect_TOTP_TOP: return Aspect_Table_PrintTypeOfTriedronPosition[1]; + case Aspect_TOTP_BOTTOM: return Aspect_Table_PrintTypeOfTriedronPosition[2]; + case Aspect_TOTP_LEFT: return Aspect_Table_PrintTypeOfTriedronPosition[3]; + case Aspect_TOTP_RIGHT: return Aspect_Table_PrintTypeOfTriedronPosition[4]; + case Aspect_TOTP_LEFT_LOWER: return Aspect_Table_PrintTypeOfTriedronPosition[5]; + case Aspect_TOTP_LEFT_UPPER: return Aspect_Table_PrintTypeOfTriedronPosition[6]; + case Aspect_TOTP_RIGHT_LOWER: return Aspect_Table_PrintTypeOfTriedronPosition[7]; + case Aspect_TOTP_RIGHT_UPPER: return Aspect_Table_PrintTypeOfTriedronPosition[8]; + } + return ""; +} + +//======================================================================= +//function : TypeOfTriedronPositionFromString +//purpose : +//======================================================================= +Standard_Boolean Aspect::TypeOfTriedronPositionFromString (Standard_CString theTypeString, + Aspect_TypeOfTriedronPosition& theType) +{ + TCollection_AsciiString aName (theTypeString); + aName.UpperCase(); + if (aName == Aspect_Table_PrintTypeOfTriedronPosition[0]) { theType = Aspect_TOTP_CENTER; return Standard_True; } + else if (aName == Aspect_Table_PrintTypeOfTriedronPosition[1]) { theType = Aspect_TOTP_TOP; return Standard_True; } + else if (aName == Aspect_Table_PrintTypeOfTriedronPosition[2]) { theType = Aspect_TOTP_BOTTOM; return Standard_True; } + else if (aName == Aspect_Table_PrintTypeOfTriedronPosition[3]) { theType = Aspect_TOTP_LEFT; return Standard_True; } + else if (aName == Aspect_Table_PrintTypeOfTriedronPosition[4]) { theType = Aspect_TOTP_RIGHT; return Standard_True; } + else if (aName == Aspect_Table_PrintTypeOfTriedronPosition[5]) { theType = Aspect_TOTP_LEFT_LOWER; return Standard_True; } + else if (aName == Aspect_Table_PrintTypeOfTriedronPosition[6]) { theType = Aspect_TOTP_LEFT_UPPER; return Standard_True; } + else if (aName == Aspect_Table_PrintTypeOfTriedronPosition[7]) { theType = Aspect_TOTP_RIGHT_LOWER; return Standard_True; } + else if (aName == Aspect_Table_PrintTypeOfTriedronPosition[8]) { theType = Aspect_TOTP_RIGHT_UPPER; return Standard_True; } + return Standard_False; +} diff --git a/src/Aspect/Aspect.hxx b/src/Aspect/Aspect.hxx index 0157100089..75b2d3abe9 100644 --- a/src/Aspect/Aspect.hxx +++ b/src/Aspect/Aspect.hxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -256,6 +257,28 @@ public: Standard_EXPORT static Standard_Boolean HatchStyleFromString (const Standard_CString theTypeString, Aspect_HatchStyle& theType); + //! Returns the string name for a given type. + //! @param theType an enumeration type + //! @return string identifier from the enumeration list + Standard_EXPORT static Standard_CString TypeOfTriedronPositionToString (Aspect_TypeOfTriedronPosition theType); + + //! Returns the orientation type from the given string identifier (using case-insensitive comparison). + //! @param theTypeString string identifier + //! @return enumeration type or Aspect_TOTP_CENTER if string identifier is invalid + static Aspect_TypeOfTriedronPosition TypeOfTriedronPositionFromString (Standard_CString theTypeString) + { + Aspect_TypeOfTriedronPosition aType = Aspect_TOTP_CENTER; + TypeOfTriedronPositionFromString (theTypeString, aType); + return aType; + } + + //! Determines the type from the given string identifier (using case-insensitive comparison). + //! @param theTypeString string identifier + //! @param theType detected type + //! @return TRUE if string identifier is known + Standard_EXPORT static Standard_Boolean TypeOfTriedronPositionFromString (const Standard_CString theTypeString, + Aspect_TypeOfTriedronPosition& theType); + }; #endif // _Aspect_HeaderFile diff --git a/src/Graphic3d/Graphic3d.cxx b/src/Graphic3d/Graphic3d.cxx index 605a517f85..70c637e675 100644 --- a/src/Graphic3d/Graphic3d.cxx +++ b/src/Graphic3d/Graphic3d.cxx @@ -56,6 +56,11 @@ namespace { "USHORT", "UINT", "VEC2", "VEC3", "VEC4", "VEC4UB", "FLOAT" }; + + static Standard_CString Graphic3d_Table_PrintTransModeFlags[6] = + { + "NONE", "ZOOM_PERS", "ROTATE_PERS", "TRIEDRON_PERS", "2d", "ZOOM_ROTATE_PERS" + }; } //======================================================================= @@ -316,3 +321,50 @@ Standard_Boolean Graphic3d::TypeOfDataFromString (Standard_CString theTypeString } return Standard_False; } + +//======================================================================= +//function : TransModeFlagsToString +//purpose : +//======================================================================= +Standard_CString Graphic3d::TransModeFlagsToString (Graphic3d_TransModeFlags theType) +{ + switch (theType) + { + case Graphic3d_TMF_None: return Graphic3d_Table_PrintTransModeFlags[0]; break; + case Graphic3d_TMF_ZoomPers: return Graphic3d_Table_PrintTransModeFlags[1]; break; + case Graphic3d_TMF_RotatePers: return Graphic3d_Table_PrintTransModeFlags[2]; break; + case Graphic3d_TMF_TriedronPers: return Graphic3d_Table_PrintTransModeFlags[3]; break; + case Graphic3d_TMF_2d: return Graphic3d_Table_PrintTransModeFlags[4]; break; + case Graphic3d_TMF_ZoomRotatePers: return Graphic3d_Table_PrintTransModeFlags[5]; break; + } + return ""; +} + +//======================================================================= +//function : ZLayerIdFromString +//purpose : +//======================================================================= +Standard_Boolean Graphic3d::TransModeFlagsFromString (Standard_CString theTypeString, + Graphic3d_TransModeFlags& theType) +{ + TCollection_AsciiString aName (theTypeString); + aName.UpperCase(); + for (Standard_Integer aTypeIter = 0; aTypeIter <= 5; ++aTypeIter) + { + Standard_CString aTypeName = Graphic3d_Table_PrintTransModeFlags[aTypeIter]; + if (aName == aTypeName) + { + switch (aTypeIter) + { + case 0: theType = Graphic3d_TMF_None; break; + case 1: theType = Graphic3d_TMF_ZoomPers; break; + case 2: theType = Graphic3d_TMF_RotatePers; break; + case 3: theType = Graphic3d_TMF_TriedronPers; break; + case 4: theType = Graphic3d_TMF_2d; break; + case 5: theType = Graphic3d_TMF_ZoomRotatePers; break; + } + return Standard_True; + } + } + return Standard_False; +} diff --git a/src/Graphic3d/Graphic3d.hxx b/src/Graphic3d/Graphic3d.hxx index cf0e59dec5..537308bf1e 100644 --- a/src/Graphic3d/Graphic3d.hxx +++ b/src/Graphic3d/Graphic3d.hxx @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -210,6 +211,27 @@ public: Standard_EXPORT static Standard_Boolean TypeOfDataFromString (const Standard_CString theTypeString, Graphic3d_TypeOfData& theType); + //! Returns the string name for a given type. + //! @param theType an enumeration type + //! @return string identifier from the enumeration list + Standard_EXPORT static Standard_CString TransModeFlagsToString (Graphic3d_TransModeFlags theType); + + //! Returns the orientation type from the given string identifier (using case-insensitive comparison). + //! @param theTypeString string identifier + //! @return enumeration type or Graphic3d_TOSM_DEFAULT if string identifier is invalid + static Graphic3d_TransModeFlags TransModeFlagsFromString (Standard_CString theTypeString) + { + Graphic3d_TransModeFlags aType = Graphic3d_TMF_None; + TransModeFlagsFromString (theTypeString, aType); + return aType; + } + + //! Determines the type from the given string identifier (using case-insensitive comparison). + //! @param theTypeString string identifier + //! @param theType detected type + //! @return TRUE if string identifier is known + Standard_EXPORT static Standard_Boolean TransModeFlagsFromString (const Standard_CString theTypeString, + Graphic3d_TransModeFlags& theType); }; #endif // _Graphic3d_HeaderFile diff --git a/tools/VInspector/FILES b/tools/VInspector/FILES index 0996ea3405..7c281b9cef 100644 --- a/tools/VInspector/FILES +++ b/tools/VInspector/FILES @@ -17,6 +17,8 @@ VInspector_ItemGraphic3dCStructure.cxx VInspector_ItemGraphic3dCStructure.hxx VInspector_ItemGraphic3dGroup.cxx VInspector_ItemGraphic3dGroup.hxx +VInspector_ItemGraphic3dTransformPers.cxx +VInspector_ItemGraphic3dTransformPers.hxx VInspector_ItemHistoryElement.cxx VInspector_ItemHistoryElement.hxx VInspector_ItemHistoryRoot.cxx diff --git a/tools/VInspector/VInspector_ItemFolderObject.cxx b/tools/VInspector/VInspector_ItemFolderObject.cxx index 81f8f737ce..2ec8394f8c 100644 --- a/tools/VInspector/VInspector_ItemFolderObject.cxx +++ b/tools/VInspector/VInspector_ItemFolderObject.cxx @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -66,7 +67,7 @@ int VInspector_ItemFolderObject::initRowCount() const } case ParentKind_PresentationItem: { - return 3; // Attributes, HilightAttributes and DynamicHilightAttributes + return 4; // TransformPers, Attributes, HilightAttributes and DynamicHilightAttributes } case ParentKind_FolderItem: return (GetContext().IsNull() ? 0 : GetContext()->Filters().Extent()); @@ -94,7 +95,12 @@ TreeModel_ItemBasePtr VInspector_ItemFolderObject::createChild (int theRow, int return VInspector_ItemPrs3dDrawer::CreateItem (currentItem(), theRow, theColumn); } case ParentKind_PresentationItem: - return VInspector_ItemPrs3dDrawer::CreateItem (currentItem(), theRow, theColumn); + { + if (theRow == 0) + return VInspector_ItemGraphic3dTransformPers::CreateItem (currentItem(), theRow, theColumn); + else + return VInspector_ItemPrs3dDrawer::CreateItem (currentItem(), theRow, theColumn); + } case ParentKind_FolderItem: return VInspector_ItemSelectMgrFilter::CreateItem (currentItem(), theRow, theColumn); default: return TreeModel_ItemBasePtr(); @@ -160,9 +166,10 @@ Handle(Prs3d_Drawer) VInspector_ItemFolderObject::GetPrs3dDrawer (const int theR Handle(AIS_InteractiveObject) aPrs = aParentPrsItem->GetInteractiveObject(); switch (theRow) { - case 0: theName = "Attributes"; return aPrs->Attributes(); - case 1: theName = "HilightAttributes"; return aPrs->HilightAttributes(); - case 2: theName = "DynamicHilightAttributes"; return aPrs->DynamicHilightAttributes(); + case 0: return 0; // "TransformPers" + case 1: theName = "Attributes"; return aPrs->Attributes(); + case 2: theName = "HilightAttributes"; return aPrs->HilightAttributes(); + case 3: theName = "DynamicHilightAttributes"; return aPrs->DynamicHilightAttributes(); default: break; } } diff --git a/tools/VInspector/VInspector_ItemGraphic3dCStructure.cxx b/tools/VInspector/VInspector_ItemGraphic3dCStructure.cxx index bf466b3b05..6974bb1340 100644 --- a/tools/VInspector/VInspector_ItemGraphic3dCStructure.cxx +++ b/tools/VInspector/VInspector_ItemGraphic3dCStructure.cxx @@ -123,7 +123,8 @@ QVariant VInspector_ItemGraphic3dCStructure::initValue (const int theItemRole) c switch (Column()) { - case 0: return aCStructure->DynamicType()->Name(); + case 0: return theItemRole == Qt::DisplayRole ? aCStructure->DynamicType()->Name() + : STANDARD_TYPE (Graphic3d_CStructure)->Name(); case 1: return rowCount(); default: break; diff --git a/tools/VInspector/VInspector_ItemGraphic3dGroup.cxx b/tools/VInspector/VInspector_ItemGraphic3dGroup.cxx index 69cb56ac87..526c765035 100644 --- a/tools/VInspector/VInspector_ItemGraphic3dGroup.cxx +++ b/tools/VInspector/VInspector_ItemGraphic3dGroup.cxx @@ -107,7 +107,8 @@ QVariant VInspector_ItemGraphic3dGroup::initValue (const int theItemRole) const switch (Column()) { - case 0: return aGroup->DynamicType()->Name(); + case 0: return theItemRole == Qt::DisplayRole ? aGroup->DynamicType()->Name() + : STANDARD_TYPE (Graphic3d_Group)->Name(); case 1: return rowCount(); case 2: diff --git a/tools/VInspector/VInspector_ItemGraphic3dTransformPers.cxx b/tools/VInspector/VInspector_ItemGraphic3dTransformPers.cxx new file mode 100644 index 0000000000..f29dfef850 --- /dev/null +++ b/tools/VInspector/VInspector_ItemGraphic3dTransformPers.cxx @@ -0,0 +1,164 @@ +// Created on: 2018-08-16 +// Created by: Natalia ERMOLAEVA +// Copyright (c) 2018 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +// ======================================================================= +// function : GetTransformPers +// purpose : +// ======================================================================= +Handle(Graphic3d_TransformPers) VInspector_ItemGraphic3dTransformPers::GetTransformPers() const +{ + initItem(); + return myTransformPers; +} + +// ======================================================================= +// function : Init +// purpose : +// ======================================================================= +void VInspector_ItemGraphic3dTransformPers::Init() +{ + VInspector_ItemFolderObjectPtr aParentItem = itemDynamicCast(Parent()); + if (aParentItem) + { + VInspector_ItemPresentableObjectPtr aParentPrsItem = itemDynamicCast(aParentItem->Parent()); + if (aParentPrsItem) + { + Handle(AIS_InteractiveObject) anObject = aParentPrsItem->GetInteractiveObject(); + myTransformPers = anObject->TransformPersistence(); + } + } + + TreeModel_ItemBase::Init(); +} + +// ======================================================================= +// function : Reset +// purpose : +// ======================================================================= +void VInspector_ItemGraphic3dTransformPers::Reset() +{ + VInspector_ItemBase::Reset(); + myTransformPers = NULL; +} + +// ======================================================================= +// function : initItem +// purpose : +// ======================================================================= +void VInspector_ItemGraphic3dTransformPers::initItem() const +{ + if (IsInitialized()) + return; + const_cast(this)->Init(); +} + +// ======================================================================= +// function : initRowCount +// purpose : +// ======================================================================= +int VInspector_ItemGraphic3dTransformPers::initRowCount() const +{ + return 0; +} + +// ======================================================================= +// function : initValue +// purpose : +// ======================================================================= +QVariant VInspector_ItemGraphic3dTransformPers::initValue (const int theItemRole) const +{ + if (theItemRole != Qt::DisplayRole && theItemRole != Qt::EditRole && theItemRole != Qt::ToolTipRole) + return QVariant(); + + Handle(Graphic3d_TransformPers) aTransformPers = GetTransformPers(); + if (aTransformPers.IsNull()) + return Column() == 0 ? "Graphic3d_TransformPers" : ""; + + switch (Column()) + { + case 0: return aTransformPers->DynamicType()->Name(); + case 1: return rowCount(); + default: + break; + } + return QVariant(); +} + +// ======================================================================= +// function : GetTableRowCount +// purpose : +// ======================================================================= +int VInspector_ItemGraphic3dTransformPers::GetTableRowCount() const +{ + return 5; +} + +// ======================================================================= +// function : GetTableData +// purpose : +// ======================================================================= +QVariant VInspector_ItemGraphic3dTransformPers::GetTableData (const int theRow, const int theColumn, const int theRole) const +{ + if (theRole != Qt::DisplayRole) + return QVariant(); + + bool isFirstColumn = theColumn == 0; + + Handle(Graphic3d_TransformPers) aTransformPers = GetTransformPers(); + if (aTransformPers.IsNull()) + return QVariant(); + + switch (theRow) + { + case 0: return isFirstColumn ? QVariant ("Mode") + : QVariant (Graphic3d::TransModeFlagsToString (aTransformPers->Mode())); + case 1: return isFirstColumn ? QVariant ("AnchorPoint") + : aTransformPers->IsZoomOrRotate() ? QVariant (ViewControl_Tools::ToString (aTransformPers->AnchorPoint()).ToCString()) : QVariant(); + case 2: return isFirstColumn ? QVariant ("Corner2d") + : aTransformPers->IsTrihedronOr2d() ? QVariant (Aspect::TypeOfTriedronPositionToString (aTransformPers->Corner2d())) : QVariant(); + case 3: return isFirstColumn ? QVariant ("OffsetX") + : aTransformPers->IsTrihedronOr2d() ? QVariant (aTransformPers->Offset2d().x()) : QVariant(); + case 4: return isFirstColumn ? QVariant ("OffsetY") + : aTransformPers->IsTrihedronOr2d() ? QVariant (aTransformPers->Offset2d().y()) : QVariant(); + + default: return QVariant(); + } +} + +// ======================================================================= +// function : createChild +// purpose : +// ======================================================================= +TreeModel_ItemBasePtr VInspector_ItemGraphic3dTransformPers::createChild (int, int) +{ + return TreeModel_ItemBasePtr(); +} diff --git a/tools/VInspector/VInspector_ItemGraphic3dTransformPers.hxx b/tools/VInspector/VInspector_ItemGraphic3dTransformPers.hxx new file mode 100644 index 0000000000..95db23d2d2 --- /dev/null +++ b/tools/VInspector/VInspector_ItemGraphic3dTransformPers.hxx @@ -0,0 +1,98 @@ +// Created on: 2018-08-16 +// Created by: Natalia ERMOLAEVA +// Copyright (c) 2018 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef VInspector_ItemGraphic3dTransformPers_H +#define VInspector_ItemGraphic3dTransformPers_H + +#include +#include + +class Graphic3d_TransformPers; + +class VInspector_ItemGraphic3dTransformPers; +typedef QExplicitlySharedDataPointer VInspector_ItemGraphic3dTransformPersPtr; + +//! \class VInspector_ItemGraphic3dTransformPers +//! Parent item, that corresponds to AIS_InteractiveContext +//! Children of the item are: +//! - "Property" item to show context attributes such as selection filters and drawer properties +//! - presentation items to show all interactive elements displayed/erased in the context +class VInspector_ItemGraphic3dTransformPers : public VInspector_ItemBase +{ +public: + + //! Creates an item wrapped by a shared pointer + static VInspector_ItemGraphic3dTransformPersPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn) + { return VInspector_ItemGraphic3dTransformPersPtr (new VInspector_ItemGraphic3dTransformPers (theParent, theRow, theColumn)); } + + //! Destructor + virtual ~VInspector_ItemGraphic3dTransformPers() Standard_OVERRIDE {}; + + //! Returns the current C structure, init item if it was not initialized yet + //! \return graphic C structure object + Standard_EXPORT Handle(Graphic3d_TransformPers) GetTransformPers() const; + + //! Inits the item, fills internal containers + Standard_EXPORT virtual void Init() Standard_OVERRIDE; + + //! Resets cached values + Standard_EXPORT virtual void Reset() Standard_OVERRIDE; + + //! Returns number of table rows + //! \return an integer value + virtual int GetTableRowCount() const Standard_OVERRIDE; + + //! Returns table value for the row in form: + //! \param theRow a model index row + //! \param theColumn a model index column + virtual QVariant GetTableData (const int theRow, const int theColumn, const int theRole) const Standard_OVERRIDE; + +protected: + + //! Initialize the current item. It creates a backup of the specific item information + //! Do nothing as context has been already set into item + virtual void initItem() const Standard_OVERRIDE; + + //! Returns number of displayed presentations + //! \return rows count + virtual int initRowCount() const Standard_OVERRIDE; + + //! Returns item information for the given role. Fills internal container if it was not filled yet + //! \param theItemRole a value role + //! \return the value + virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE; + +protected: + + //! Creates a child item in the given position. + //! \param theRow the child row position + //! \param theColumn the child column position + //! \return the created item + virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE; + +private: + + //! Constructor + //! param theParent a parent item + //! \param theRow the item row positition in the parent item + //! \param theColumn the item column positition in the parent item + VInspector_ItemGraphic3dTransformPers(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn) + : VInspector_ItemBase(theParent, theRow, theColumn) {} + +private: + Handle(Graphic3d_TransformPers) myTransformPers; +}; + +#endif diff --git a/tools/VInspector/VInspector_ItemOpenGlElement.cxx b/tools/VInspector/VInspector_ItemOpenGlElement.cxx index a5c159ae64..9fca52a31e 100644 --- a/tools/VInspector/VInspector_ItemOpenGlElement.cxx +++ b/tools/VInspector/VInspector_ItemOpenGlElement.cxx @@ -104,6 +104,9 @@ QVariant VInspector_ItemOpenGlElement::initValue (const int theItemRole) const { case 0: { + if (theItemRole != Qt::ToolTipRole) + return "OpenGl_Element"; + VInspector_ElementKind aKind = GetElementKind(); if (aKind == VInspector_ElementKind_PrimitiveArray) return "OpenGl_PrimitiveArray"; else if (aKind == VInspector_ElementKind_Text) return "OpenGl_Text";