From cb201b7ca01366621e6d279076dfb210ee0b633e Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 18 Sep 2015 19:17:23 +0300 Subject: [PATCH] Update of documentation --- src/PartSet/PartSet_WidgetSketchCreator.h | 8 +++++ src/SketcherPrs/SketcherPrs_Coincident.h | 7 ++++- src/SketcherPrs/SketcherPrs_HVDirection.h | 1 + src/SketcherPrs/SketcherPrs_LengthDimension.h | 2 -- src/SketcherPrs/SketcherPrs_SensitivePoint.h | 8 +++-- src/SketcherPrs/SketcherPrs_SymbolPrs.cpp | 29 ++++++++++++++----- src/SketcherPrs/SketcherPrs_SymbolPrs.h | 7 ++--- src/SketcherPrs/SketcherPrs_Transformation.h | 1 + 8 files changed, 45 insertions(+), 18 deletions(-) diff --git a/src/PartSet/PartSet_WidgetSketchCreator.h b/src/PartSet/PartSet_WidgetSketchCreator.h index 9bcc8a67f..5f1d8d996 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.h +++ b/src/PartSet/PartSet_WidgetSketchCreator.h @@ -16,6 +16,14 @@ class QLineEdit; class PartSet_Module; class ModuleBase_Operation; + +/** +* \ingroup Modules +* A widget which allow creation of a sketch in another operation. +* It creates sketch on aqctivation of this widget. If sketch object is already created then +* it will transfer a focus to next widget. It is supposed that the widget will be placed as +* a first widget in property panel +*/ class PARTSET_EXPORT PartSet_WidgetSketchCreator : public ModuleBase_ModelWidget { Q_OBJECT diff --git a/src/SketcherPrs/SketcherPrs_Coincident.h b/src/SketcherPrs/SketcherPrs_Coincident.h index 5aaf5d635..52ea362c5 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.h +++ b/src/SketcherPrs/SketcherPrs_Coincident.h @@ -25,12 +25,17 @@ class SketcherPrs_Coincident: public AIS_InteractiveObject { public: /// Constructor - /// \param theResult a result object + /// \param theConstraint a constraint object + /// \param thePlane plane of a sketch Standard_EXPORT SketcherPrs_Coincident(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); + /// Defines color for the presentation + /// \param aColor a color object Standard_EXPORT virtual void SetColor(const Quantity_Color& aColor); + /// Defines color for the presentation + /// \param aColor a color name Standard_EXPORT virtual void SetColor(const Quantity_NameOfColor aColor); DEFINE_STANDARD_RTTI(SketcherPrs_Coincident) diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.h b/src/SketcherPrs/SketcherPrs_HVDirection.h index 079991dd2..9f6204d28 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.h +++ b/src/SketcherPrs/SketcherPrs_HVDirection.h @@ -24,6 +24,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch + /// \param isHorisontal a flag horizontal or vertical presentation Standard_EXPORT SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, bool isHorisontal); diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.h b/src/SketcherPrs/SketcherPrs_LengthDimension.h index 703dc9577..76e71c85d 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.h +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.h @@ -30,8 +30,6 @@ public: Standard_EXPORT SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); - std::string constraintType() const; - DEFINE_STANDARD_RTTI(SketcherPrs_LengthDimension) protected: /// Redefinition of virtual function diff --git a/src/SketcherPrs/SketcherPrs_SensitivePoint.h b/src/SketcherPrs/SketcherPrs_SensitivePoint.h index 033b81a0d..000df1a4f 100644 --- a/src/SketcherPrs/SketcherPrs_SensitivePoint.h +++ b/src/SketcherPrs/SketcherPrs_SensitivePoint.h @@ -22,16 +22,19 @@ class SketcherPrs_SensitivePoint : public Select3D_SensitiveEntity { public: //! Constructs a sensitive point object defined by the - //! owner OwnerId and the point Point. + //! \param OwnerId an Id of the Owner. + //! \param theId and Id of its point Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId, int theId); + /// Returns number of sub-elements Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE; //! Update location of the point - //! \param aLocation a new location Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE; //! Checks whether the point overlaps current selecting volume + //! \param theMgr selection manager + //! \param thePickResult returns pick result Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, SelectBasics_PickResult& thePickResult) Standard_OVERRIDE; @@ -46,6 +49,7 @@ public: //! transformation is set, it will be applied Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE; + /// Clear sub-elements Standard_EXPORT virtual void Clear() Standard_OVERRIDE; DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint) diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index c106f87aa..05fa43cf8 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -82,6 +82,8 @@ class SketcherPrs_VertexBuffer : public OpenGl_VertexBuffer public: //! Create uninitialized VBO.. + //! \param theAttribs attributes + //! \param theStride a flag SketcherPrs_VertexBuffer (const Graphic3d_Attribute* theAttribs, const Standard_Integer theStride) : Stride (theStride), NbAttributes(1) @@ -97,6 +99,7 @@ public: memcpy (Attribs, theAttribs.AttributesArray(), sizeof(Graphic3d_Attribute) * NbAttributes); } + /// Returns True if color attribute is defined virtual bool HasColorAttribute() const { for (Standard_Integer anAttribIter = 0; anAttribIter < NbAttributes; ++anAttribIter) { @@ -108,6 +111,7 @@ public: return false; } + /// Returns True if normal attribute is defined virtual bool HasNormalAttribute() const { for (Standard_Integer anAttribIter = 0; anAttribIter < NbAttributes; ++anAttribIter) { @@ -119,6 +123,8 @@ public: return false; } + /// Bind position of the attribute + /// \param theGlCtx OpenGl context virtual void BindPositionAttribute (const Handle(OpenGl_Context)& theGlCtx) const { if (!OpenGl_VertexBuffer::IsValid()) { @@ -142,6 +148,8 @@ public: } } + /// Bind all attributes + /// \param theGlCtx OpenGl context virtual void BindAllAttributes (const Handle(OpenGl_Context)& theGlCtx) const { if (!OpenGl_VertexBuffer::IsValid()) @@ -162,6 +170,8 @@ public: } } + /// Unbind all attributes + /// \param theGlCtx OpenGl context virtual void UnbindAllAttributes (const Handle(OpenGl_Context)& theGlCtx) const { if (!OpenGl_VertexBuffer::IsValid()) @@ -176,8 +186,13 @@ public: public: + /// Array of attributes Graphic3d_Attribute Attribs[1]; + + /// A flag Standard_Integer Stride; + + /// Number of attributes Standard_Integer NbAttributes; }; @@ -186,15 +201,21 @@ public: class SketcherPrs_Element: public OpenGl_Element { public: + /// Constructor + /// \param theObj a presentation SketcherPrs_Element(const Handle(SketcherPrs_SymbolPrs)& theObj) : OpenGl_Element(), myObj(theObj) {} + /// Render the current presentation + /// \param theWorkspace OpenGL workspace virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const { if (!myObj.IsNull()) myObj->Render(theWorkspace); } + /// Releases OpenGL resources + /// \param theContext OpenGL context virtual void Release (OpenGl_Context* theContext) { if (!myObj.IsNull()) @@ -268,14 +289,6 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon() return Handle(Image_AlienPixMap)(); } -//void SketcherPrs_SymbolPrs::ClearSelected() -//{ -// Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( NULL ); -// if( !aSelectionPrs.IsNull() ) { -// aSelectionPrs->Clear(); -// } -//} - void SketcherPrs_SymbolPrs::prepareAspect() { if (myAspect.IsNull()) { diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.h b/src/SketcherPrs/SketcherPrs_SymbolPrs.h index 6c0512c25..baf7a928f 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.h +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.h @@ -44,11 +44,6 @@ public: virtual ~SketcherPrs_SymbolPrs(); - //! Method which clear all selected owners belonging - //! to this selectable object ( for fast presentation draw ) - //Standard_EXPORT virtual void ClearSelected(); - - //! Method which draws selected owners ( for fast presentation draw ) Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, const SelectMgr_SequenceOfOwner& theOwners); @@ -75,6 +70,8 @@ public: /// \param theContext is an OpenGL context void Release (OpenGl_Context* theContext); + /// Add a bounding box of the presentation to common bounding box + /// \param theBndBox the common bounding box to update Standard_EXPORT virtual void BoundingBox (Bnd_Box& theBndBox) Standard_OVERRIDE; DEFINE_STANDARD_RTTI(SketcherPrs_SymbolPrs) diff --git a/src/SketcherPrs/SketcherPrs_Transformation.h b/src/SketcherPrs/SketcherPrs_Transformation.h index 6ba9bc8e4..ea28b24a3 100644 --- a/src/SketcherPrs/SketcherPrs_Transformation.h +++ b/src/SketcherPrs/SketcherPrs_Transformation.h @@ -24,6 +24,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch + /// \param isTranslation a flag is it translation or rotation Standard_EXPORT SketcherPrs_Transformation(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, bool isTranslation); -- 2.39.2