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_SetOfSegments Class Reference

The primitive SetOfSegments
Warning: This primitive must be use as possible for performance
improvment but is drawn with a global line attributes
for all the set.
But when the set contains a lot of contigous segments
with a line attrib different to the default,it's
more preferable to use a SetOfPolylines for to insure
a better quality.
NOTE: than the method PickedIndex() permits to known
the last picked segment in the set.

#include <Graphic2d_SetOfSegments.hxx>

Inheritance diagram for Graphic2d_SetOfSegments:
Inheritance graph
[legend]

Public Member Functions

 Graphic2d_SetOfSegments (const Handle< Graphic2d_GraphicObject > &aGraphicObject)
 Creates an empty set of segments in the graphic
object <aGraphicObject>.

void Add (const Quantity_Length X1, const Quantity_Length Y1, const Quantity_Length X2, const Quantity_Length Y2)
 Add a segment in the set
The first point is <X1>, <Y1>.
The second point is <X2>, <Y2>.
Trigger: Raises SegmentDefinitionError if the
first point and the second point are identical.

Standard_Integer Length () const
 Returns the number of segments in the set.

void Values (const Standard_Integer aRank, Quantity_Length &X1, Quantity_Length &Y1, Quantity_Length &X2, Quantity_Length &Y2) const
 Returns the segment of rank <aRank> from the set.
Trigger: Raises OutOfRange if <aRank> is <1 or >Length()

virtual void Save (Aspect_FStream &aFStream) const

Protected Member Functions

void Draw (const Handle< Graphic2d_Drawer > &aDrawer)
 Draws the set of segments <me>.

virtual void DrawElement (const Handle< Graphic2d_Drawer > &aDrawer, const Standard_Integer anIndex)
 Draws element <anIndex> of the set <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 segment of the set <me>
is picked, Standard_False if not.
Warning: The PickIndex() method returns the rank of the picked
segment if any.


Constructor & Destructor Documentation


Member Function Documentation

void Graphic2d_SetOfSegments::Draw ( const Handle< Graphic2d_Drawer > &  aDrawer) [protected, virtual]

Implements Graphic2d_Primitive.

virtual void Graphic2d_SetOfSegments::DrawElement ( const Handle< Graphic2d_Drawer > &  aDrawer,
const Standard_Integer  anIndex 
) [protected, virtual]

Reimplemented from Graphic2d_Primitive.

virtual void Graphic2d_SetOfSegments::DrawVertex ( const Handle< Graphic2d_Drawer > &  aDrawer,
const Standard_Integer  anIndex 
) [protected, virtual]

Reimplemented from Graphic2d_Primitive.

Implements Graphic2d_Primitive.

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

Reimplemented from Graphic2d_Line.


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