Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions
Graphic2d_SetOfMarkers Class Reference

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>

Inheritance diagram for Graphic2d_SetOfMarkers:
Inheritance graph
[legend]

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_MapOfIntegerGetSelectedElements () 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.


Constructor & Destructor Documentation


Member Function Documentation

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.

Reimplemented from Graphic2d_Primitive.

Implements Graphic2d_Primitive.

Reimplemented from Graphic2d_Primitive.

Reimplemented from Graphic2d_Primitive.

virtual void Graphic2d_SetOfMarkers::Save ( Aspect_FStream aFStream) const [virtual]

Reimplemented from Graphic2d_Line.

Reimplemented from Graphic2d_Primitive.


The documentation for this class was generated from the following file: