20 #ifndef SketcherPrs_SymbolPrs_H
21 #define SketcherPrs_SymbolPrs_H
23 #include "SketcherPrs_SensitivePoint.h"
24 #include <SketchPlugin_Sketch.h>
25 #include <ModelAPI_Feature.h>
26 #include <ModelAPI_AttributeRefList.h>
28 #include <AIS_InteractiveObject.hxx>
29 #include <GeomAPI_Ax3.h>
30 #include <Graphic3d_ArrayOfPoints.hxx>
31 #include <Graphic3d_AspectMarker3d.hxx>
32 #include <Image_AlienPixMap.hxx>
33 #include <SelectMgr_EntityOwner.hxx>
34 #include <Select3D_EntitySequence.hxx>
36 #include <Standard_DefineHandle.hxx>
39 #include <OpenGl_Workspace.hxx>
63 Standard_EXPORT
virtual void HilightSelected(
const Handle(PrsMgr_PresentationManager3d)& thePM,
64 const SelectMgr_SequenceOfOwner& theOwners);
68 const Handle(PrsMgr_PresentationManager3d)& thePM,
69 const Handle(Prs3d_Drawer)& theStyle,
70 const Handle(SelectMgr_EntityOwner)& theOwner);
73 Standard_EXPORT std::shared_ptr<GeomAPI_Ax3>
plane()
const
85 const Handle(Graphic3d_ArrayOfPoints)&
pointsArray()
const {
return myPntArray; }
91 Standard_EXPORT
void SetCustomColor(
const std::vector<int>& theColor);
95 Standard_EXPORT
virtual void BoundingBox (Bnd_Box& theBndBox) Standard_OVERRIDE;
101 Standard_EXPORT
virtual void Compute(
102 const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
103 const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode = 0);
108 Standard_EXPORT
virtual void ComputeSelection(
const Handle(SelectMgr_Selection)& aSelection,
109 const Standard_Integer aMode);
112 virtual const char*
iconName(
bool isActiveIcon =
true)
const = 0;
119 Handle(Image_AlienPixMap) icon();
124 void addLine(
const Handle(Graphic3d_Group)& theGroup, std::string theAttrName)
const;
129 virtual void drawLines(
const Handle(Prs3d_Presentation)& ,
130 Quantity_Color )
const {}
139 void drawShape(
const std::shared_ptr<GeomAPI_Shape>& theShape,
140 const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor)
const;
145 void drawListOfShapes(
const std::shared_ptr<ModelAPI_AttributeRefList>& theListAttr,
146 const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor)
const;
156 Handle(Graphic3d_AspectMarker3d) myAspect;
159 mutable Handle(Graphic3d_ArrayOfPoints) myPntArray;
162 Handle(SelectMgr_EntityOwner) myOwner;
166 static std::map<
const char*, Handle(Image_AlienPixMap)> myIconsMap;
168 Select3D_EntitySequence mySPoints;
170 bool myIsCustomColor;
171 Quantity_Color myCustomColor;
174 Handle(Image_AlienPixMap) myErrorIcon;
175 Handle(Graphic3d_MarkerImage) myErrorImage;
Feature that consists of other features: like sketcher with edges inside.
Definition: ModelAPI_CompositeFeature.h:33
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41
Feature for creation of the new part in PartSet.
Definition: SketchPlugin_Sketch.h:47
std::shared_ptr< GeomAPI_Ax3 > coordinatePlane() const
Returns currently defined plane as an object of Ax3.
Definition: SketchPlugin_Sketch.h:248
Redefinition of OpenGl_Element.
Definition: SketcherPrs_SymbolPrs.cpp:67
A base class of constraint presentation which is represented by an icon.
Definition: SketcherPrs_SymbolPrs.h:52
void SetCustomColor(const std::vector< int > &theColor)
Set state of the presentation, in case of conflicting state, the icon of the presentation is visualiz...
Definition: SketcherPrs_SymbolPrs.cpp:344
virtual void prepareAspect()
Check and creates if it is necessary myAspect member.
Definition: SketcherPrs_SymbolPrs.cpp:208
void drawListOfShapes(const std::shared_ptr< ModelAPI_AttributeRefList > &theListAttr, const Handle &&thePrs, Quantity_Color theColor) const
Draw a list of shapes stored in a RefListAttribute.
Definition: SketcherPrs_SymbolPrs.cpp:411
void addLine(const Handle &&theGroup, std::string theAttrName) const
Add a line into the given group.
Definition: SketcherPrs_SymbolPrs.cpp:219
virtual void HilightOwnerWithColor(const Handle &&thePM, const Handle &&theStyle, const Handle &&theOwner)
Method which highlight an owner belonging to.
Definition: SketcherPrs_SymbolPrs.cpp:252
ModelAPI_CompositeFeature * sketcher() const
Returns Sketcher object (owner of the constraint)
Definition: SketcherPrs_SymbolPrs.h:82
std::shared_ptr< GeomAPI_Ax3 > plane() const
Returns sketcher plane.
Definition: SketcherPrs_SymbolPrs.h:73
SketcherPrs_SymbolPrs(ModelAPI_Feature *theConstraint, SketchPlugin_Sketch *theSketcher)
Constructor.
Definition: SketcherPrs_SymbolPrs.cpp:120
ModelAPI_Feature * feature() const
Returns feature object.
Definition: SketcherPrs_SymbolPrs.h:79
void drawShape(const std::shared_ptr< GeomAPI_Shape > &theShape, const Handle &&thePrs, Quantity_Color theColor) const
Draw a shape into the given presentation scene.
Definition: SketcherPrs_SymbolPrs.cpp:370
const Handle && pointsArray() const
Return array of points where symbols will be placed.
Definition: SketcherPrs_SymbolPrs.h:85
ModelAPI_Feature * myConstraint
Constraint feature.
Definition: SketcherPrs_SymbolPrs.h:150
virtual bool updateIfReadyToDisplay(double, bool) const
Update myPntArray according to presentation positions.
Definition: SketcherPrs_SymbolPrs.h:134
SketchPlugin_Sketch * mySketcher
Sketcher feature.
Definition: SketcherPrs_SymbolPrs.h:153
virtual const char * iconName(bool isActiveIcon=true) const =0
Returns an icon file name. Has to be redefined in successors.
virtual void drawLines(const Handle &&, Quantity_Color) const
Redefine this function in order to add additional lines of constraint base.
Definition: SketcherPrs_SymbolPrs.h:129
virtual DEFINE_STANDARD_RTTIEXT(SketcherPrs_SymbolPrs, AIS_InteractiveObject) protected void ComputeSelection(const Handle &&aSelection, const Standard_Integer aMode)
Redefinition of virtual function.
Definition: SketcherPrs_SymbolPrs.cpp:333
virtual void BoundingBox(Bnd_Box &theBndBox) Standard_OVERRIDE
Add a bounding box of the presentation to common bounding box.
Definition: SketcherPrs_SymbolPrs.cpp:429
virtual void HilightSelected(const Handle &&thePM, const SelectMgr_SequenceOfOwner &theOwners)
Method which draws selected owners ( for fast presentation draw )
Definition: SketcherPrs_SymbolPrs.cpp:239