/// Ñonstructor
/// \param theOrigin point of origin
/// \param theDirX direction of X axis
- /// \param theDirY direction of Y axis
/// \param theNorm direction of normal vector
GeomAPI_Ax3(std::shared_ptr<GeomAPI_Pnt> theOrigin,
std::shared_ptr<GeomAPI_Dir> theDirX,
/// \param theOperation a stopped operation
virtual void operationStopped(ModuleBase_Operation* theOperation);
- /// Realizes some functionality by an operation start
- /// \param theOperation a started operation
+ /// Returns current operation
virtual ModuleBase_Operation* currentOperation() const;
/// Returns True if there are available Undos and the sketch manager allows undo
static bool isNestedCreateOperation(ModuleBase_Operation* theOperation);
/// Returns whether the current operation is a sketch entity - line, point, arc or circle
- /// \param the operation
+ /// \param theId is an id of object
/// \return a boolean value
static bool isEntity(const std::string& theId);
/// Returns whether the current operation is a sketch distance - lenght, distance or radius
- /// \param the operation
+ /// \param theOperation the operation
/// \return a boolean value
static bool isDistanceOperation(ModuleBase_Operation* theOperation);
+ /// Returns true if a mouse cursor is over viewer window
bool isMouseOverWindow() { return myIsMouseOverWindow; }
/// Returns current Sketch feature/ Returns NULL if there is no launched sketch operation
/// It obtains the selected attributes. The highlighted objects can be processes as the selected ones
/// \param theHighlightedUse a boolean flag
void storeSelection(const bool theHighlightedOnly = false);
+
+ /// Restores previously saved selection state
void restoreSelection();
/// Returns list of strings which contains id's of sketch operations
//! the point area in the selection process.
Standard_EXPORT void Areas (SelectBasics_ListOfBox2d& aresult) ;
+ //! Update location of the point
+ //! \param aLocation a new location
Standard_EXPORT Handle(Select3D_SensitiveEntity) GetConnected (const TopLoc_Location& aLocation) ;
//! Checks whether the sensitive entity matches the picking
//! For details please refer to base class declaration.
Standard_EXPORT Standard_Boolean Matches (const SelectBasics_PickArgs& thePickArgs, Standard_Real& theMatchDMin, Standard_Real& theMatchDepth) ;
+ /// Returns true if the current point is matches with given rectangle
+ /// \param XMin an X min coordinate
+ /// \param YMin an Y min coordinate
+ /// \param XMax an X max coordinate
+ /// \param YMax an Y max coordinate
+ /// \param aTol a tolerance
Standard_EXPORT Standard_Boolean Matches (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real aTol) ;
Standard_EXPORT virtual Standard_Boolean Matches (const TColgp_Array1OfPnt2d& Polyline, const Bnd_Box2d& aBox, const Standard_Real aTol) ;
Standard_EXPORT virtual void HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner);
+ /// Returns sketcher plane
Standard_EXPORT std::shared_ptr<GeomAPI_Ax3> plane() const { return myPlane; }
+ /// Returns feature object
Standard_EXPORT ModelAPI_Feature* feature() const { return myConstraint; }
-
+ /// Return array of points where symbols will be placed
Handle(Graphic3d_ArrayOfPoints) pointsArray() const { return myPntArray; }
+ /// Render of the presentation
+ /// \param theWorkspace is OpenGl workspace
void Render(const Handle(OpenGl_Workspace)& theWorkspace) const;
+ /// Release used OpenGl resources
+ /// \param theContext is an OpenGL context
void Release (OpenGl_Context* theContext);
DEFINE_STANDARD_RTTI(SketcherPrs_SymbolPrs)
/// \return true in case of success
virtual bool updatePoints(double theStep) const { return true; }
+ /// Draw a shape into the given presentation scene
+ /// \param theShape the shape to draw
+ /// \param thePrs the presentation scene
void drawShape(const std::shared_ptr<GeomAPI_Shape>& theShape,
const Handle(Prs3d_Presentation)& thePrs) const;
/// Array of symbols positions
mutable Handle(Graphic3d_ArrayOfPoints) myPntArray;
+ /// An owner object of the presentation
Handle(SelectMgr_EntityOwner) myOwner;
private:
/// \param theId an id of an action
QAction* action(const QString& theId) const;
+ /// Returns action object by its Id (name)
+ /// \param theName is an Id of the action
QAction* actionByName(const QString& theName) const;
/// Returns list of registered actions Ids
/// \param isChecked is checked flag
void actionTriggered(const QString& theId, bool isChecked);
+ /// A signal which is sent before context menu show
void beforeContextMenu();
+
+ /// A signal which is sent after context menu show
void afterContextMenu();
private slots:
/// Set color on presentation of an object if it is displayed
/// \param theObject an object
/// \param theColor a color which has to be set
- /// \param theUpdate update viewer flag
+ /// \param toUpdate update viewer flag
/// \return previously defined color on the object
QColor setObjectColor(ObjectPtr theObject, const QColor& theColor, bool toUpdate = true);
#include <QAction>
#include <QStyledItemDelegate>
+/**
+* \ingroup GUI
+* Tree item delegate for definition of data in column items editor
+*/
class XGUI_TreeViewItemDelegate: public QStyledItemDelegate
{
public:
+ /// Constructor
+ /// \param theParent a parent of the delegate
XGUI_TreeViewItemDelegate(XGUI_DataTree* theParent):QStyledItemDelegate(theParent), myTreedView(theParent) {}
+ /// Set data for item editor (name of the item)
+ /// \param editor a widget of editor
+ /// \param index the tree item index
virtual void setEditorData ( QWidget* editor, const QModelIndex& index ) const
{
QLineEdit* aEditor = dynamic_cast<QLineEdit*>(editor);