OCC Main Page | Visualization | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Visualization
TKV2d
Graphic2d


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

Standard_EXPORT Graphic2d_SetOfMarkers (const Handle(Graphic2d_GraphicObject)&aGraphicObject)
 Creates an empty set of markers in the graphic
object <agraphicobject>.
.
Standard_EXPORT void Add (const Quantity_Length X, const Quantity_Length Y)
 Add a pixel point marker in the set
.
Standard_EXPORT 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_EXPORT Standard_Integer Length () const
 Returns the number of markers in the set.
.
Standard_EXPORT 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_EXPORT Standard_Boolean SetElementsSelected ()
 Declares that previously highlighted elements will be selected ones.
.
virtual Standard_EXPORT Standard_Boolean HasSelectedElements ()
virtual Standard_EXPORT void ClearSelectedElements ()
Standard_EXPORT const TColStd_MapOfInteger & GetSelectedElements () const
Standard_EXPORT void AddOrRemoveSelected (const Standard_Integer index)
 adds/removes marker to/from selection map.

virtual Standard_EXPORT void Save (Aspect_FStream &aFStream) const
Standard_EXPORT void SetHighlightedLimit (const Standard_Integer number)
 sets limit of number elements to be highlighted.

Standard_EXPORT void SetScaledWidth (const Standard_ShortReal width)
 Changes myScaledWidth field. As this value used in detection
mechanism it should be reset after view transformation.
.
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Protected Member Functions

Standard_EXPORT void Draw (const Handle(Graphic2d_Drawer)&aDrawer)
 Draws the set of markers <me>.
.
virtual Standard_EXPORT void DrawElement (const Handle(Graphic2d_Drawer)&aDrawer, const Standard_Integer anIndex)
 Draws element <anindex> of the set <me>.
.
virtual Standard_EXPORT void DrawPickedElements (const Handle(Graphic2d_Drawer)&aDrawer)
 Draws the all picked elements of the primitive <me>.
.
virtual Standard_EXPORT void DrawSelectedElements (const Handle(Graphic2d_Drawer)&aDrawer)
 Draws the all selected elements of the primitive <me>.
.
virtual Standard_EXPORT void DrawVertex (const Handle(Graphic2d_Drawer)&aDrawer, const Standard_Integer anIndex)
 Draws vertex <anindex> of the set <me>.
.
Standard_EXPORT 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_EXPORT 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_EXPORT 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.
.

Private Member Functions

Standard_EXPORT void DrawElements (const Handle(Graphic2d_Drawer)&aDrawer, const Handle(TShort_HArray1OfShortReal)&x, const Handle(TShort_HArray1OfShortReal)&y)

Private Attributes

TColStd_SequenceOfInteger myType
TShort_SequenceOfShortReal myX
TShort_SequenceOfShortReal myY
TShort_SequenceOfShortReal myWidth
TShort_SequenceOfShortReal myHeight
TShort_SequenceOfShortReal myAngle
Handle_TColStd_HSequenceOfInteger mySelIndices
TColStd_MapOfInteger myMapOfSelected
Standard_Integer myHLimit
Standard_Boolean mySuppressHigh
Quantity_Length myScaledWidth

Constructor & Destructor Documentation

Standard_EXPORT Graphic2d_SetOfMarkers::Graphic2d_SetOfMarkers const Handle(Graphic2d_GraphicObject)&  aGraphicObject  ) 
 


Member Function Documentation

Standard_EXPORT 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
 

Standard_EXPORT void Graphic2d_SetOfMarkers::Add const Quantity_Length  X,
const Quantity_Length  Y
 

Standard_EXPORT void Graphic2d_SetOfMarkers::AddOrRemoveSelected const Standard_Integer  index  ) 
 

virtual Standard_EXPORT void Graphic2d_SetOfMarkers::ClearSelectedElements  )  [virtual]
 

Reimplemented from Graphic2d_Primitive.

Standard_EXPORT void Graphic2d_SetOfMarkers::Draw const Handle(Graphic2d_Drawer)&  aDrawer  )  [protected, virtual]
 

Implements Graphic2d_Primitive.

virtual Standard_EXPORT void Graphic2d_SetOfMarkers::DrawElement const Handle(Graphic2d_Drawer)&  aDrawer,
const Standard_Integer  anIndex
[protected, virtual]
 

Reimplemented from Graphic2d_Primitive.

Standard_EXPORT void Graphic2d_SetOfMarkers::DrawElements const Handle(Graphic2d_Drawer)&  aDrawer,
const Handle(TShort_HArray1OfShortReal)&  x,
const Handle(TShort_HArray1OfShortReal)&  y
[private]
 

virtual Standard_EXPORT void Graphic2d_SetOfMarkers::DrawPickedElements const Handle(Graphic2d_Drawer)&  aDrawer  )  [protected, virtual]
 

Reimplemented from Graphic2d_Primitive.

virtual Standard_EXPORT void Graphic2d_SetOfMarkers::DrawSelectedElements const Handle(Graphic2d_Drawer)&  aDrawer  )  [protected, virtual]
 

Reimplemented from Graphic2d_Primitive.

virtual Standard_EXPORT void Graphic2d_SetOfMarkers::DrawVertex const Handle(Graphic2d_Drawer)&  aDrawer,
const Standard_Integer  anIndex
[protected, virtual]
 

Reimplemented from Graphic2d_Primitive.

Standard_EXPORT const TColStd_MapOfInteger& Graphic2d_SetOfMarkers::GetSelectedElements  )  const
 

Standard_EXPORT const Graphic2d_SetOfMarkers::Handle Standard_Type   )  const
 

Reimplemented from Graphic2d_Line.

virtual Standard_EXPORT Standard_Boolean Graphic2d_SetOfMarkers::HasSelectedElements  )  [virtual]
 

Reimplemented from Graphic2d_Primitive.

Standard_EXPORT Standard_Integer Graphic2d_SetOfMarkers::Length  )  const
 

virtual Standard_EXPORT Standard_Boolean Graphic2d_SetOfMarkers::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
[protected, virtual]
 

Reimplemented from Graphic2d_Primitive.

Standard_EXPORT 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_EXPORT 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 Standard_EXPORT void Graphic2d_SetOfMarkers::Save Aspect_FStream aFStream  )  const [virtual]
 

Reimplemented from Graphic2d_Line.

virtual Standard_EXPORT Standard_Boolean Graphic2d_SetOfMarkers::SetElementsSelected  )  [virtual]
 

Reimplemented from Graphic2d_Primitive.

Standard_EXPORT void Graphic2d_SetOfMarkers::SetHighlightedLimit const Standard_Integer  number  ) 
 

Standard_EXPORT void Graphic2d_SetOfMarkers::SetScaledWidth const Standard_ShortReal  width  ) 
 

Standard_EXPORT 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
 


Field Documentation

TShort_SequenceOfShortReal Graphic2d_SetOfMarkers::myAngle [private]
 

TShort_SequenceOfShortReal Graphic2d_SetOfMarkers::myHeight [private]
 

Standard_Integer Graphic2d_SetOfMarkers::myHLimit [private]
 

TColStd_MapOfInteger Graphic2d_SetOfMarkers::myMapOfSelected [private]
 

Quantity_Length Graphic2d_SetOfMarkers::myScaledWidth [private]
 

Handle_TColStd_HSequenceOfInteger Graphic2d_SetOfMarkers::mySelIndices [private]
 

Standard_Boolean Graphic2d_SetOfMarkers::mySuppressHigh [private]
 

TColStd_SequenceOfInteger Graphic2d_SetOfMarkers::myType [private]
 

TShort_SequenceOfShortReal Graphic2d_SetOfMarkers::myWidth [private]
 

TShort_SequenceOfShortReal Graphic2d_SetOfMarkers::myX [private]
 

TShort_SequenceOfShortReal Graphic2d_SetOfMarkers::myY [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:55:36 2008 for OpenCASCADE by  doxygen 1.4.1