# Visualization
TKV2d
Graphic2d

# Graphic2d_Segment Class Reference

The primitive Segment
.

`#include <Graphic2d_Segment.hxx>`

Inheritance diagram for Graphic2d_Segment:

[legend]

## Public Member Functions

Standard_EXPORT | Graphic2d_Segment (const Handle(Graphic2d_GraphicObject)&aGraphicObject, const Quantity_Length X1, const Quantity_Length Y1, const Quantity_Length X2, const Quantity_Length Y2)
| Creates a segment in the graphic object <agraphicobject>. The first point is <x1>, <y1>. The second point is <x2>, <y2>. Warning: Raises SegmentDefinitionError if the first point and the second point are identical. .
Standard_EXPORT void | FirstPoint (Quantity_Length &X, Quantity_Length &Y) const
| returns the coordinates of the first point of the segment
Standard_EXPORT void | SecondPoint (Quantity_Length &X, Quantity_Length &Y) const
| returns the coordinates of the second point of the segment
virtual Standard_EXPORT void | Save (Aspect_FStream &aFStream) const
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Static Public Member Functions

static Standard_EXPORT void | Retrieve (Aspect_IFStream &anIFStream, const Handle(Graphic2d_GraphicObject)&aGraphicObject)

## Protected Member Functions

Standard_EXPORT void | Draw (const Handle(Graphic2d_Drawer)&aDrawer)
| Draws the segment <me>. .
virtual Standard_EXPORT void | DrawElement (const Handle(Graphic2d_Drawer)&aDrawer, const Standard_Integer anIndex)
| Draws edge <anindex> of the segment <me>. .
virtual Standard_EXPORT void | DrawVertex (const Handle(Graphic2d_Drawer)&aDrawer, const Standard_Integer anIndex)
| Draws vertex <anindex> of the segment <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 the segment <me> is picked, Standard_False if not. .

## Private Attributes

Standard_ShortReal | myX1
Standard_ShortReal | myY1
Standard_ShortReal | myX2
Standard_ShortReal | myY2

## Constructor & Destructor Documentation

Standard_EXPORT Graphic2d_Segment::Graphic2d_Segment | ( | const Handle(Graphic2d_GraphicObject)& | aGraphicObject,
|  | const Quantity_Length | X1,
|  | const Quantity_Length | Y1,
|  | const Quantity_Length | X2,
|  | const Quantity_Length | Y2
| ) |

## Member Function Documentation

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

| Implements Graphic2d_Primitive.

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

| Reimplemented from Graphic2d_Primitive.

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

| Reimplemented from Graphic2d_Primitive.

Standard_EXPORT void Graphic2d_Segment::FirstPoint | ( | Quantity_Length & | X,
|  | Quantity_Length & | Y
| ) | const

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

| Reimplemented from Graphic2d_Line.

Standard_EXPORT Standard_Boolean Graphic2d_Segment::Pick | ( | const Standard_ShortReal | X,
|  | const Standard_ShortReal | Y,
|  | const Standard_ShortReal | aPrecision,
|  | const Handle(Graphic2d_Drawer)& | aDrawer
| ) | `[protected, virtual]`

| Implements Graphic2d_Primitive.

static Standard_EXPORT void Graphic2d_Segment::Retrieve | ( | Aspect_IFStream & | anIFStream,
|  | const Handle(Graphic2d_GraphicObject)& | aGraphicObject
| ) | `[static]`

virtual Standard_EXPORT void Graphic2d_Segment::Save | ( | Aspect_FStream & | aFStream | ) | const`[virtual]`

| Reimplemented from Graphic2d_Line.

Standard_EXPORT void Graphic2d_Segment::SecondPoint | ( | Quantity_Length & | X,
|  | Quantity_Length & | Y
| ) | const

## Field Documentation

Standard_ShortReal Graphic2d_Segment::myX1 `[private]`

Standard_ShortReal Graphic2d_Segment::myX2 `[private]`

Standard_ShortReal Graphic2d_Segment::myY1 `[private]`

Standard_ShortReal Graphic2d_Segment::myY2 `[private]`

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

- Graphic2d_Segment.hxx