0030268: Inspectors - improvements in VInspector plugin
[occt.git] / tools / VInspector / VInspector_ItemBase.cxx
index 8f1cee2..591ecb0 100644 (file)
 #include <inspector/VInspector_ItemBase.hxx>
 #include <inspector/VInspector_ItemContext.hxx>
 
+#include <inspector/ViewControl_Tools.hxx>
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+void VInspector_ItemBase::Reset()
+{
+  myPresentationShape = TopoDS_Shape();
+  TreeModel_ItemBase::Reset();
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemBase::initValue (const int theItemRole) const
+{
+  if (theItemRole != Qt::DisplayRole && theItemRole != Qt::ToolTipRole)
+    return QVariant();
+
+  switch (Column())
+  {
+    case 3: return Standard_Dump::GetPointerInfo (Object(), true).ToCString();
+  }
+
+  return QVariant();
+}
+
 // =======================================================================
 // function : GetContext
 // purpose :
@@ -49,3 +78,16 @@ Handle(AIS_InteractiveContext) VInspector_ItemBase::GetContext() const
 
   return myContext;
 }
+
+// =======================================================================
+// function : GetContext
+// purpose :
+// =======================================================================
+TopoDS_Shape VInspector_ItemBase::GetPresentationShape() const
+{
+  if (Column() != TreeModel_ColumnType_Name)
+    return TopoDS_Shape();
+  
+  initItem();
+  return myPresentationShape;
+}