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
{
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<GeomAPI_Ax3>& 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)
/// 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<GeomAPI_Ax3>& thePlane,
bool isHorisontal);
Standard_EXPORT SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- std::string constraintType() const;
-
DEFINE_STANDARD_RTTI(SketcherPrs_LengthDimension)
protected:
/// Redefinition of virtual function
{
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;
//! 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)
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)
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) {
return false;
}
+ /// Returns True if normal attribute is defined
virtual bool HasNormalAttribute() const
{
for (Standard_Integer anAttribIter = 0; anAttribIter < NbAttributes; ++anAttribIter) {
return false;
}
+ /// Bind position of the attribute
+ /// \param theGlCtx OpenGl context
virtual void BindPositionAttribute (const Handle(OpenGl_Context)& theGlCtx) const
{
if (!OpenGl_VertexBuffer::IsValid()) {
}
}
+ /// Bind all attributes
+ /// \param theGlCtx OpenGl context
virtual void BindAllAttributes (const Handle(OpenGl_Context)& theGlCtx) const
{
if (!OpenGl_VertexBuffer::IsValid())
}
}
+ /// Unbind all attributes
+ /// \param theGlCtx OpenGl context
virtual void UnbindAllAttributes (const Handle(OpenGl_Context)& theGlCtx) const
{
if (!OpenGl_VertexBuffer::IsValid())
public:
+ /// Array of attributes
Graphic3d_Attribute Attribs[1];
+
+ /// A flag
Standard_Integer Stride;
+
+ /// Number of attributes
Standard_Integer NbAttributes;
};
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())
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()) {
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);
/// \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)
/// 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<GeomAPI_Ax3>& thePlane,
bool isTranslation);