1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0029674: Improvements in Inspector tool

- preferences for dock windows geometry, tree view columns and current view projection;
- ViewControl package for common functionality between plugins;
- processing Location and Orientation for external TopoDS_Shape object
- 'F5' key to update content of each plugin
- visibility column in tree view (used now only in ShapeView)
- properties child item for context (presents tree of current Filters of context)
This commit is contained in:
nds
2018-03-23 16:08:11 +03:00
committed by bugmaster
parent 6dfdbb7ab8
commit 6822a3bef1
135 changed files with 4187 additions and 1603 deletions

View File

@@ -66,9 +66,11 @@ public:
//! Returns selection parameters, that may be useful for communicate between tools
//! \param theModel one of selection models provided by this pane
//! \theParameters a container of parameters, might be extended depending on the pane state(e.g. selection)
//! \theItemNames names to be selected for each selection parameter
virtual void GetSelectionParameters (QItemSelectionModel* theModel,
NCollection_List<Handle(Standard_Transient)>& theParameters)
{ (void)theModel; (void)theParameters; }
NCollection_List<Handle(Standard_Transient)>& theParameters,
NCollection_List<TCollection_AsciiString>& theItemNames)
{ (void)theModel; (void)theParameters; (void)theItemNames; }
//! Returns presentation of the attribute to be visualized in the view
//! \param theAttribute a current attribute

View File

@@ -29,7 +29,16 @@
DFBrowserPane_TDataStdTreeNodeModel::DFBrowserPane_TDataStdTreeNodeModel (QObject* theParent)
: TreeModel_ModelBase (theParent)
{
m_pRootItem = DFBrowserPane_TDataStdTreeNodeItem::CreateItem (TreeModel_ItemBasePtr(), 0, 0);
createRootItem(0);
}
// =======================================================================
// function : createRootItem
// purpose :
// =======================================================================
void DFBrowserPane_TDataStdTreeNodeModel::createRootItem (const int theColumnId)
{
m_pRootItem = DFBrowserPane_TDataStdTreeNodeItem::CreateItem (TreeModel_ItemBasePtr(), 0, theColumnId);
}
// =======================================================================

View File

@@ -56,6 +56,11 @@ public:
virtual int columnCount (const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE
{ (void)theParent; return 1; }
protected:
//! Creates root item
//! \param theColumnId index of a column
virtual void createRootItem (const int theColumnId) Standard_OVERRIDE;
private:
Handle(TDF_Attribute) myAttribute; //! the parent attribute

View File

@@ -106,7 +106,7 @@ void DFBrowserPane_TDocStdOwner::GetValues (const Handle(TDF_Attribute)& theAttr
<< aSeparationStr.ToCString() << aSeparationStr.ToCString()
<< "IsSaved" << DFBrowserPane_Tools::BoolToStr (aDocument->IsSaved())
<< "IsChanged" << DFBrowserPane_Tools::BoolToStr (aDocument->IsChanged())
<< "GetSavedTime" << aDocument->GetSavedTime()
<< "GetSavedTime" << QString::number (aDocument->GetSavedTime())
<< "GetName" << (aDocument->IsSaved() ? DFBrowserPane_Tools::ToString (aDocument->GetName()) : "")
<< "GetPath" << (aDocument->IsSaved() ? DFBrowserPane_Tools::ToString (aDocument->GetPath()) : "")
<< "GetData" << aDocumentDataInfo.ToCString()

View File

@@ -22,6 +22,7 @@
#include <inspector/DFBrowserPane_SelectionKind.hxx>
#include <inspector/DFBrowserPane_TableView.hxx>
#include <inspector/DFBrowserPane_Tools.hxx>
#include <inspector/TInspectorAPI_PluginParameters.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_Shape.hxx>
@@ -367,7 +368,8 @@ int DFBrowserPane_TNamingNamedShape::GetSelectionKind (QItemSelectionModel* theM
// purpose :
// =======================================================================
void DFBrowserPane_TNamingNamedShape::GetSelectionParameters (QItemSelectionModel* theModel,
NCollection_List<Handle(Standard_Transient)>& theParameters)
NCollection_List<Handle(Standard_Transient)>& theParameters,
NCollection_List<TCollection_AsciiString>& theItemNames)
{
QTableView* aTableView = myTableView->GetTableView();
if (aTableView->selectionModel() != theModel)
@@ -385,6 +387,7 @@ void DFBrowserPane_TNamingNamedShape::GetSelectionParameters (QItemSelectionMode
if (aShape.IsNull())
return;
theParameters.Append (aShape.TShape());
theItemNames.Append (TInspectorAPI_PluginParameters::ParametersToString (aShape));
}
// =======================================================================

View File

@@ -75,8 +75,10 @@ public:
//! Returns selection parameters, that may be useful for communicate between tools
//! \param theModel one of selection models provided by this pane
//! \theParameters a container of parameters, might be extended depending on the pane state(e.g. selection)
//! \theItemNames names to be selected for each selection parameter
Standard_EXPORT virtual void GetSelectionParameters (QItemSelectionModel* theModel,
NCollection_List<Handle(Standard_Transient)>& theParameters) Standard_OVERRIDE;
NCollection_List<Handle(Standard_Transient)>& theParameters,
NCollection_List<TCollection_AsciiString>& theItemNames) Standard_OVERRIDE;
//! Returns container of Label references to the attribute
//! \param theAttribute a current attribute

View File

@@ -16,6 +16,8 @@
#include <inspector/DFBrowserPane_TableView.hxx>
#include <inspector/DFBrowserPane_Tools.hxx>
#include <inspector/TreeModel_Tools.hxx>
#include <Standard_WarningsDisable.hxx>
#include <QAbstractTableModel>
#include <QHeaderView>
@@ -70,7 +72,7 @@ void DFBrowserPane_TableView::SetModel (QAbstractTableModel* theModel)
// =======================================================================
void DFBrowserPane_TableView::SetFixedRowCount (const int theCount, QTableView* theView, const bool theScroll)
{
int aHeight = theView->verticalHeader()->defaultSectionSize() * theCount + DFBrowserPane_Tools::HeaderSectionMargin();
int aHeight = theView->verticalHeader()->defaultSectionSize()*theCount + TreeModel_Tools::HeaderSectionMargin();
if (theScroll)
aHeight += theView->horizontalScrollBar()->sizeHint().height();

View File

@@ -25,9 +25,7 @@
#include <TopoDS_Shape.hxx>
#include <Standard_WarningsDisable.hxx>
#include <QApplication>
#include <QString>
#include <QStyle>
#include <QString>
#include <QVariant>
#include <Standard_WarningsRestore.hxx>
@@ -45,10 +43,6 @@ public:
//! \returns value
Standard_EXPORT static int DefaultPanelColumnWidth (const int theColumnId);
//! Returns header margin, defined in style settings of application
//! \return integer value
Standard_EXPORT static int HeaderSectionMargin() { return qApp->style()->pixelMetric (QStyle::PM_HeaderMargin); }
//! Returns a string presentation of the label
//! \param theLabel a label object
//! \return the string value
@@ -69,7 +63,7 @@ public:
//! Returns "true" or "false" text for the given boolean state
//! \param theValue a boolean value
//! \return string value
Standard_EXPORT static QString BoolToStr (const Standard_Boolean theValue) { return theValue ? "true" : "false"; }
Standard_EXPORT static QString BoolToStr (const bool theValue) { return theValue ? "true" : "false"; }
//! Converts a Qt string to OCCT extended string
//! \param theValue a converted string