Open CASCADE Technology
6.5.4
|
The primitive SetOfMarkers
Warning: This primitive must be use as possible for performance
improvment but is drawn with a global marker attributes
for all the set.
NOTE: than the method PickedIndex() permits to known
the last picked marker in the set.
SAV : 14/11/01 : Added a set of methods (marked SAV before declaration)
to provide highlighting/selection
of SetOfMarkers elements. These methods should be redefined
for other SetOf<>.
SAV : 23/05/02 : WARNING!!! method PickByCircle performs only detection
function. It doesn't cause any visual highlighting.
#include <Graphic2d_SetOfMarkers.hxx>
Public Member Functions | |
Graphic2d_SetOfMarkers (const Handle< Graphic2d_GraphicObject > &aGraphicObject) | |
Creates an empty set of markers in the graphic object <aGraphicObject>. | |
void | Add (const Quantity_Length X, const Quantity_Length Y) |
Add a pixel point marker in the set | |
void | Add (const Standard_Integer anIndex, const Quantity_Length X, const Quantity_Length Y, const Quantity_Length aWidth, const Quantity_Length anHeight, const Quantity_PlaneAngle anAngle=0.0) |
Add a marker of predefined index <anIndex> in the set at position <X>,<Y> and size <aWidth>,<aHeight>. Angle is measured counterclockwise with 0 radian at 3 o'clock. Trigger: Raises MarkerDefinitionError if the marker index is <= 0 or undefined in the MarkMap, or the marker size <aWidth,anHeight> is <= 0. | |
Standard_Integer | Length () const |
Returns the number of markers in the set. | |
void | Values (const Standard_Integer aRank, Standard_Integer &anIndex, Quantity_Length &X, Quantity_Length &Y, Quantity_Length &aW, Quantity_Length &aH, Quantity_PlaneAngle &anAngle) const |
Returns the marker type, position, sizes and angle and type from the set at rank <aRank>. Warning: For the pixel point marker the returned <anIndex> is NULL Trigger: Raises OutOfRange if <aRank> is <1 or >Length() | |
virtual Standard_Boolean | SetElementsSelected () |
Declares that previously highlighted elements will be selected ones. | |
virtual Standard_Boolean | HasSelectedElements () |
virtual void | ClearSelectedElements () |
const TColStd_MapOfInteger & | GetSelectedElements () const |
void | AddOrRemoveSelected (const Standard_Integer index) |
adds/removes marker to/from selection map. | |
virtual void | Save (Aspect_FStream &aFStream) const |
void | SetHighlightedLimit (const Standard_Integer number) |
sets limit of number elements to be highlighted. | |
void | SetScaledWidth (const Standard_ShortReal width) |
Changes myScaledWidth field. As this value used in detection mechanism it should be reset after view transformation. | |
Protected Member Functions | |
void | Draw (const Handle< Graphic2d_Drawer > &aDrawer) |
Draws the set of markers <me>. | |
virtual void | DrawElement (const Handle< Graphic2d_Drawer > &aDrawer, const Standard_Integer anIndex) |
Draws element <anIndex> of the set <me>. | |
virtual void | DrawPickedElements (const Handle< Graphic2d_Drawer > &aDrawer) |
Draws the all picked elements of the primitive <me>. | |
virtual void | DrawSelectedElements (const Handle< Graphic2d_Drawer > &aDrawer) |
Draws the all selected elements of the primitive <me>. | |
virtual void | DrawVertex (const Handle< Graphic2d_Drawer > &aDrawer, const Standard_Integer anIndex) |
Draws vertex <anIndex> of the set <me>. | |
Standard_Boolean | Pick (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal aPrecision, const Handle< Graphic2d_Drawer > &aDrawer) |
Returns Standard_True if one marker of the set <me> is picked, Standard_False if not. Warning: The PickIndex() method returns the rank of the picked marker if any. | |
virtual Standard_Boolean | Pick (const Standard_ShortReal X1, const Standard_ShortReal Y1, const Standard_ShortReal X2, const Standard_ShortReal Y2, const Handle< Graphic2d_Drawer > &aDrawer, const Graphic2d_PickMode aPickMode) |
Returns Standard_True if the primitive <me> is: included in rectangle (<aPickMode = PM_INCLUDE>), excluded from rectangle (<aPickMode = PM_EXLUDE>), intersected by rectangle (<aPickMode = PM_INTERSECT>), defined by Xmin, Ymin, Xmax, Ymax. Standard_False if not. | |
virtual Standard_Boolean | PickByCircle (const Standard_ShortReal x, const Standard_ShortReal y, const Standard_ShortReal radius, const Handle< Graphic2d_Drawer > &aDrawer, const Graphic2d_PickMode aPickMode) |
Returns Standard_True if the primitive <me> is picked, Standard_False if not. |
Graphic2d_SetOfMarkers::Graphic2d_SetOfMarkers | ( | const Handle< Graphic2d_GraphicObject > & | aGraphicObject | ) |
void Graphic2d_SetOfMarkers::Add | ( | const Standard_Integer | anIndex, |
const Quantity_Length | X, | ||
const Quantity_Length | Y, | ||
const Quantity_Length | aWidth, | ||
const Quantity_Length | anHeight, | ||
const Quantity_PlaneAngle | anAngle = 0.0 |
||
) |
virtual void Graphic2d_SetOfMarkers::ClearSelectedElements | ( | ) | [virtual] |
Reimplemented from Graphic2d_Primitive.
void Graphic2d_SetOfMarkers::Draw | ( | const Handle< Graphic2d_Drawer > & | aDrawer | ) | [protected, virtual] |
Implements Graphic2d_Primitive.
virtual void Graphic2d_SetOfMarkers::DrawElement | ( | const Handle< Graphic2d_Drawer > & | aDrawer, |
const Standard_Integer | anIndex | ||
) | [protected, virtual] |
Reimplemented from Graphic2d_Primitive.
virtual void Graphic2d_SetOfMarkers::DrawPickedElements | ( | const Handle< Graphic2d_Drawer > & | aDrawer | ) | [protected, virtual] |
Reimplemented from Graphic2d_Primitive.
virtual void Graphic2d_SetOfMarkers::DrawSelectedElements | ( | const Handle< Graphic2d_Drawer > & | aDrawer | ) | [protected, virtual] |
Reimplemented from Graphic2d_Primitive.
virtual void Graphic2d_SetOfMarkers::DrawVertex | ( | const Handle< Graphic2d_Drawer > & | aDrawer, |
const Standard_Integer | anIndex | ||
) | [protected, virtual] |
Reimplemented from Graphic2d_Primitive.
virtual Standard_Boolean Graphic2d_SetOfMarkers::HasSelectedElements | ( | ) | [virtual] |
Reimplemented from Graphic2d_Primitive.
Standard_Boolean Graphic2d_SetOfMarkers::Pick | ( | const Standard_ShortReal | X, |
const Standard_ShortReal | Y, | ||
const Standard_ShortReal | aPrecision, | ||
const Handle< Graphic2d_Drawer > & | aDrawer | ||
) | [protected, virtual] |
Implements Graphic2d_Primitive.
virtual Standard_Boolean Graphic2d_SetOfMarkers::Pick | ( | const Standard_ShortReal | Xmin, |
const Standard_ShortReal | Ymin, | ||
const Standard_ShortReal | Xmax, | ||
const Standard_ShortReal | Ymax, | ||
const Handle< Graphic2d_Drawer > & | aDrawer, | ||
const Graphic2d_PickMode | aPickMode | ||
) | [protected, virtual] |
Reimplemented from Graphic2d_Primitive.
virtual Standard_Boolean Graphic2d_SetOfMarkers::PickByCircle | ( | const Standard_ShortReal | X, |
const Standard_ShortReal | Y, | ||
const Standard_ShortReal | Radius, | ||
const Handle< Graphic2d_Drawer > & | aDrawer, | ||
const Graphic2d_PickMode | aPickMode | ||
) | [protected, virtual] |
Reimplemented from Graphic2d_Primitive.
virtual void Graphic2d_SetOfMarkers::Save | ( | Aspect_FStream & | aFStream | ) | const [virtual] |
Reimplemented from Graphic2d_Line.
virtual Standard_Boolean Graphic2d_SetOfMarkers::SetElementsSelected | ( | ) | [virtual] |
Reimplemented from Graphic2d_Primitive.
void Graphic2d_SetOfMarkers::Values | ( | const Standard_Integer | aRank, |
Standard_Integer & | anIndex, | ||
Quantity_Length & | X, | ||
Quantity_Length & | Y, | ||
Quantity_Length & | aW, | ||
Quantity_Length & | aH, | ||
Quantity_PlaneAngle & | anAngle | ||
) | const |