]> OCCT Git - occt-copy.git/commitdiff
0030268: Inspectors - improvements in VInspector plugin - Graphic3d_TransformPers...
authornds <nds@opencascade.com>
Wed, 24 Oct 2018 12:17:34 +0000 (15:17 +0300)
committernds <nds@opencascade.com>
Wed, 24 Oct 2018 12:17:34 +0000 (15:17 +0300)
src/Aspect/Aspect.cxx
src/Aspect/Aspect.hxx
src/Graphic3d/Graphic3d.cxx
src/Graphic3d/Graphic3d.hxx
tools/VInspector/FILES
tools/VInspector/VInspector_ItemFolderObject.cxx
tools/VInspector/VInspector_ItemGraphic3dCStructure.cxx
tools/VInspector/VInspector_ItemGraphic3dGroup.cxx
tools/VInspector/VInspector_ItemGraphic3dTransformPers.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemGraphic3dTransformPers.hxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemOpenGlElement.cxx

index 0039b5d0972b77fd76a0fda43b88afa721370b0b..e7ade3a45bbdc5148b523e23999beb8260c3c78f 100644 (file)
@@ -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;
+}
index 015710008988ca8c05115b8653e4f400a313b204..75b2d3abe94118f4e0f6b7a5cd07d493a6092a92 100644 (file)
@@ -24,6 +24,7 @@
 #include <Aspect_TypeOfLine.hxx>
 #include <Aspect_TypeOfMarker.hxx>
 #include <Aspect_TypeOfStyleText.hxx>
+#include <Aspect_TypeOfTriedronPosition.hxx>
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Macro.hxx>
 #include <Standard_Type.hxx>
@@ -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
index 605a517f853475cb10a48ff9c24a39215ae5dce7..70c637e675fc58bd8a1a6a1c2ac9faf4ec78f61c 100644 (file)
@@ -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;
+}
index cf0e59dec5cb08bf1717792905c52a1f47b40298..537308bf1e10ca80de49ba06ba7a07c532955ef7 100644 (file)
@@ -19,6 +19,7 @@
 #include <Graphic3d_HorizontalTextAlignment.hxx>
 #include <Graphic3d_VerticalTextAlignment.hxx>
 #include <Graphic3d_TextPath.hxx>
+#include <Graphic3d_TransModeFlags.hxx>
 #include <Graphic3d_TypeOfShadingModel.hxx>
 
 #include <Graphic3d_ZLayerId.hxx>
@@ -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
index 0996ea34052584ff432e547b3cf99815915df019..7c281b9cefdbef3d25c99927bf06a4ed69acfdd7 100644 (file)
@@ -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
index 81f8f737ce7159da424d6b759434f91bc658f7ca..2ec8394f8c8ea64416a6a37741e0d0f114aa3753 100644 (file)
@@ -16,6 +16,7 @@
 #include <inspector/VInspector_ItemFolderObject.hxx>
 
 #include <inspector/VInspector_ItemContext.hxx>
+#include <inspector/VInspector_ItemGraphic3dTransformPers.hxx>
 #include <inspector/VInspector_ItemPresentableObject.hxx>
 #include <inspector/VInspector_ItemPrs3dDrawer.hxx>
 #include <inspector/VInspector_ItemSelectMgrFilter.hxx>
@@ -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;
       }
     }
index bf466b3b0511bdbf23703d70df10ea18c4377963..6974bb1340fa7b40cb3e52567d95f7ab3da543ba 100644 (file)
@@ -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;
index 69cb56ac87b77ef01c6217c4bfb7d4a3963429f4..526c7650357602542ef70fb894062daab8cb1450 100644 (file)
@@ -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 (file)
index 0000000..f29dfef
--- /dev/null
@@ -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 <inspector/VInspector_ItemGraphic3dTransformPers.hxx>
+#include <inspector/VInspector_ItemFolderObject.hxx>
+#include <inspector/VInspector_ItemPresentableObject.hxx>
+
+#include <inspector/VInspector_ItemPrs3dPresentation.hxx>
+#include <inspector/VInspector_Tools.hxx>
+#include <inspector/ViewControl_Tools.hxx>
+
+#include <Aspect.hxx>
+#include <Graphic3d.hxx>
+#include <Graphic3d_TransformPers.hxx>
+#include <Graphic3d_GraphicDriver.hxx>
+
+#include <Standard_WarningsDisable.hxx>
+#include <QStringList>
+#include <Standard_WarningsRestore.hxx>
+
+// =======================================================================
+// function : GetTransformPers
+// purpose :
+// =======================================================================
+Handle(Graphic3d_TransformPers) VInspector_ItemGraphic3dTransformPers::GetTransformPers() const
+{
+  initItem();
+  return myTransformPers;
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void VInspector_ItemGraphic3dTransformPers::Init()
+{
+  VInspector_ItemFolderObjectPtr aParentItem = itemDynamicCast<VInspector_ItemFolderObject>(Parent());
+  if (aParentItem)
+  {
+   VInspector_ItemPresentableObjectPtr aParentPrsItem = itemDynamicCast<VInspector_ItemPresentableObject>(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<VInspector_ItemGraphic3dTransformPers*>(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 (file)
index 0000000..95db23d
--- /dev/null
@@ -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 <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+class Graphic3d_TransformPers;
+
+class VInspector_ItemGraphic3dTransformPers;
+typedef QExplicitlySharedDataPointer<VInspector_ItemGraphic3dTransformPers> 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: <function name> <function value>
+  //! \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
index a5c159ae645753a3bc1d579b0113efafcc7b2dc3..9fca52a31eb9bc09698e2605c657c082b5e3b528 100644 (file)
@@ -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";