mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0030268: Inspectors - improvements in VInspector plugin
- Convert package creation. It is used to prepare some auxiliary presentations/methods to prepare variables for inspector based on occt classes. - ViewControl package improvement: Classes for property view, table, table model are implemented to visualize view of properties. This view is filled by selection in tree if the selected object has implemented DumpJson functionality. - TreeModel package improvements: Method InitColumn is implemented in TreeModel_TreeModel to fill default columns in base model. The default columns are: Name, Visibility, Rows. Additional columns should be added in successors. Container of root items is moved into the base class - View package imrovements: Store preferences: display mode, fit all checked state and type of external context View_DisplayPreview is added to process preview for selected in tree view objects hide actions Clear, Multi, Single by default (as selection in tree view or Visibility state of item define which presentations should be displayed or erased) - ShapeView plugin improvements: Property View content based on DumpJson (columns in tree view for properties are removed), Properties for TopoDS_Shape are displayed Explode shape action in tree view to see content of shape by selected shape type. Type of displayed shapes is only preview, it is not used in export action. Export shape into BREP. The previous implementation about BREP files in some directory and default view is removed. - VInspector plugin imrovements: Property View content based on DumpJson (columns in tree view for properties are removed), Properties for AIS_InteractiveContext and AIS_InteractiveObject are displayed obsolete classes to provide properties are removed. - DFBrowser plugin improvements: Property View content based on DumpJson is not used yet. But there is the USE_DUMPJSON macro. It's switch off by default. If switch ON, it creates a Property View filled with DumpJson. It's a way of DFBrowser moving on this property view. Init uses static variable CDF_Session::CurrentSession()->CurrentApplication to fill plugin if application in plugin is not set but OCAF application exists - OCC_VERSION_HEX variable used for previous OCCT versions support (before 6.9.0 or 7.2.0) is removed
This commit is contained in:
@@ -33,7 +33,10 @@
|
||||
|
||||
class View_Window;
|
||||
|
||||
class ViewControl_PropertyView;
|
||||
|
||||
class QAction;
|
||||
class QDockWidget;
|
||||
class QMainWindow;
|
||||
class QWidget;
|
||||
|
||||
@@ -59,7 +62,7 @@ public:
|
||||
//! \param theParameters a parameters container
|
||||
void SetParameters (const Handle(TInspectorAPI_PluginParameters)& theParameters) { myParameters = theParameters; }
|
||||
|
||||
//! Provide container for actions available in inspector on general level
|
||||
//! Provides container for actions available in inspector on general level
|
||||
//! \param theMenu if Qt implementation, it is QMenu object
|
||||
Standard_EXPORT virtual void FillActionsMenu (void* theMenu);
|
||||
|
||||
@@ -80,9 +83,6 @@ public:
|
||||
//! Returns current tree view
|
||||
QTreeView* GetTreeView() const { return myTreeView; }
|
||||
|
||||
//! Returns path to temporary directory
|
||||
TCollection_AsciiString GetTemporaryDirectory() const { return myParameters->GetTemporaryDirectory(); }
|
||||
|
||||
//! Removes all shapes in tree view model, remove all stored BREP files
|
||||
Standard_EXPORT void RemoveAllShapes();
|
||||
|
||||
@@ -98,7 +98,7 @@ private:
|
||||
//! \param theParameters a parameters container
|
||||
void Init (NCollection_List<Handle(Standard_Transient)>& theParameters);
|
||||
|
||||
//! Read Shape from the file name, add Shape into tree view
|
||||
//! Reads Shape from the file name, add Shape into tree view
|
||||
//! \param theFileName BREP file name
|
||||
void OpenFile (const TCollection_AsciiString& theFileName);
|
||||
|
||||
@@ -108,64 +108,47 @@ protected slots:
|
||||
//! \param thePosition a clicked point
|
||||
void onTreeViewContextMenuRequested (const QPoint& thePosition);
|
||||
|
||||
//! Processes selection in tree view: make presentation or owner selected in the context if corresponding
|
||||
//! check box is checked
|
||||
//! \param theSelected a selected items
|
||||
//! \param theDeselected a deselected items
|
||||
void onTreeViewSelectionChanged (const QItemSelection& theSelected, const QItemSelection& theDeselected);
|
||||
|
||||
//! Updates visibility states by erase all in context
|
||||
void onEraseAllPerformed();
|
||||
|
||||
//! Exports shape to BREP file and view result file
|
||||
void onBREPDirectory();
|
||||
//! Sets the shape item exploded
|
||||
void onExplode();
|
||||
|
||||
//! Removes all shapes in tree view
|
||||
void onClearView() { RemoveAllShapes(); }
|
||||
|
||||
//! Load BREP file and updates tree model to have shape of the file
|
||||
//! Loads BREP file and updates tree model to have shape of the file
|
||||
void onLoadFile();
|
||||
|
||||
//! View BREP files of selected items if exist
|
||||
void onBREPView();
|
||||
|
||||
//! Remove BREP views, close views
|
||||
void onCloseAllBREPViews();
|
||||
|
||||
//! Remove all BREP Viewse excepting active
|
||||
void onEditorDestroyed (QObject* theObject);
|
||||
//! Views BREP files of selected items if exist
|
||||
void onExportToBREP();
|
||||
|
||||
//! Convers file name to Ascii String and perform opeging file
|
||||
//! \param theFileName a file name to be opened
|
||||
void onOpenFile(const QString& theFileName) { OpenFile (TCollection_AsciiString (theFileName.toUtf8().data())); }
|
||||
|
||||
protected:
|
||||
|
||||
//! Views file name content in a text editor. It creates new Qt free control with content.
|
||||
//! \param theFileName a file name
|
||||
void viewFile (const QString& theFileName);
|
||||
|
||||
//! Removes all BREP files in tmp directory
|
||||
void removeBREPFiles();
|
||||
|
||||
//! Creates new action and connect it to the given slot
|
||||
//! \param theText an action text
|
||||
//! \param theSlot a listener method
|
||||
QAction* createAction (const QString& theText, const char* theSlot);
|
||||
|
||||
//! Key that uses to generate BREP file name
|
||||
//! \return string value
|
||||
static TCollection_AsciiString viewBREPPrefix() { return "ShapeView_Window"; }
|
||||
|
||||
//! Returns newxt temporary name using BREPPrefix and pointer information
|
||||
//! \param thePointerInfo a pointer value
|
||||
//! \return string value
|
||||
TCollection_AsciiString getNextTmpName (const TCollection_AsciiString& thePointerInfo);
|
||||
|
||||
private:
|
||||
|
||||
QMainWindow* myMainWindow; //!< main control, parent for all ShapeView controls
|
||||
|
||||
QDockWidget* myPropertyPanelWidget; //!< property pane dockable widget
|
||||
ViewControl_PropertyView* myPropertyView; //!< property control to display model item values if exist
|
||||
|
||||
View_Window* myViewWindow; //!< OCC 3d view to visualize presentations
|
||||
QTreeView* myTreeView; //!< tree view visualized shapes
|
||||
|
||||
int myNextPosition; //!< delta of moving control of view BREP file
|
||||
|
||||
QList<QWidget*> myBREPViews; //!< list of view BREP file controls
|
||||
Handle(TInspectorAPI_PluginParameters) myParameters; //!< plugins parameters container
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user