# Visualization
TKV2d
Graphic2d

# 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:

[legend]

## Public Member Functions

Standard_EXPORT | Graphic2d_SetOfSegments (const Handle(Graphic2d_GraphicObject)&aGraphicObject)
| Creates an empty set of segments in the graphic object <agraphicobject>. .
Standard_EXPORT 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_EXPORT Standard_Integer | Length () const
| Returns the number of segments in the set. .
Standard_EXPORT 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 Standard_EXPORT void | Save (Aspect_FStream &aFStream) const
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Protected Member Functions

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

## Private Attributes

TShort_SequenceOfShortReal | myX1
TShort_SequenceOfShortReal | myY1
TShort_SequenceOfShortReal | myX2
TShort_SequenceOfShortReal | myY2

## Constructor & Destructor Documentation

Standard_EXPORT Graphic2d_SetOfSegments::Graphic2d_SetOfSegments | ( | const Handle(Graphic2d_GraphicObject)& | aGraphicObject | ) |

## Member Function Documentation

Standard_EXPORT void Graphic2d_SetOfSegments::Add | ( | const Quantity_Length | X1,
|  | const Quantity_Length | Y1,
|  | const Quantity_Length | X2,
|  | const Quantity_Length | Y2
| ) |

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

| Implements Graphic2d_Primitive.

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

| Reimplemented from Graphic2d_Primitive.

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

| Reimplemented from Graphic2d_Primitive.

Standard_EXPORT const Graphic2d_SetOfSegments::Handle | ( | Standard_Type |  | ) | const

| Reimplemented from Graphic2d_Line.

Standard_EXPORT Standard_Integer Graphic2d_SetOfSegments::Length | ( |  | ) | const

Standard_EXPORT Standard_Boolean Graphic2d_SetOfSegments::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 void Graphic2d_SetOfSegments::Save | ( | Aspect_FStream & | aFStream | ) | const`[virtual]`

| Reimplemented from Graphic2d_Line.

Standard_EXPORT void Graphic2d_SetOfSegments::Values | ( | const Standard_Integer | aRank,
|  | Quantity_Length & | X1,
|  | Quantity_Length & | Y1,
|  | Quantity_Length & | X2,
|  | Quantity_Length & | Y2
| ) | const

## Field Documentation

TShort_SequenceOfShortReal Graphic2d_SetOfSegments::myX1 `[private]`

TShort_SequenceOfShortReal Graphic2d_SetOfSegments::myX2 `[private]`

TShort_SequenceOfShortReal Graphic2d_SetOfSegments::myY1 `[private]`

TShort_SequenceOfShortReal Graphic2d_SetOfSegments::myY2 `[private]`

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

- Graphic2d_SetOfSegments.hxx