# Visualization
TKV2d
Prs2d

# Prs2d_Length Class Reference

Constructs the primitive Length
.

`#include <Prs2d_Length.hxx>`

Inheritance diagram for Prs2d_Length:

[legend]

## Public Member Functions

Standard_EXPORT

Prs2d_Length (const Handle(Graphic2d_GraphicObject)&aGraphicObject, const gp_Pnt2d &anAttachPnt1, const gp_Pnt2d &anAttachPnt2, const TCollection_ExtendedString &aText, const Standard_Real aTxtScale=5.0, const Standard_Real aLength=0.0, const Prs2d_TypeOfDist aTypeDist=Prs2d_TOD_AUTOMATIC, const Standard_Real anArrAngle=20.0, const Standard_Real anArrLength=25.0, const Prs2d_TypeOfArrow anArrType=Prs2d_TOA_OPENED, const Prs2d_ArrowSide anArrow=Prs2d_AS_BOTHAR, const Standard_Boolean IsReverseArrow=Standard_False)

| Initializes the length dimension between points anAttachPnt1 and anAttachPnt2. aLength is length of the attach lines aTypeDist defines the orientation of the displayed length: AIS2D_TOD_AUTOMATIC AIS2D_TOD_OBLIQUE AIS2D_TOD_HORIZONTAL AIS2D_TOD_VERTICAL anArrow defines the number of arrows (one, two or none) .

Standard_EXPORT

Prs2d_Length (const Handle(Graphic2d_GraphicObject)&aGraphicObject, const gp_Pnt2d &anAttachPnt, const gp_Lin2d &anAttachLin, const TCollection_ExtendedString &aText, const Standard_Real aTxtScale=10.0, const Standard_Real aLenAttachLin=0.0, const Standard_Real anArrAngle=20.0, const Standard_Real anArrLength=25.0, const Prs2d_TypeOfArrow anArrType=Prs2d_TOA_OPENED, const Prs2d_ArrowSide anArrow=Prs2d_AS_BOTHAR, const Standard_Boolean IsReverseArrow=Standard_False)

| Initializes the length dimension between point anAttachPnt1 and line defined anAttachLin. aLenAttachLin is length of the attach lines .

Standard_EXPORT

Prs2d_Length (const Handle(Graphic2d_GraphicObject)&aGraphicObject, const gp_Lin2d &anAttachLin1, const gp_Lin2d &anAttachLin2, const TCollection_ExtendedString &aText, const Standard_Real aTxtScale=10.0, const Standard_Real aLenAttachLin=0.0, const Standard_Real anArrAngle=20.0, const Standard_Real anArrLength=25.0, const Prs2d_TypeOfArrow anArrType=Prs2d_TOA_OPENED, const Prs2d_ArrowSide anArrow=Prs2d_AS_BOTHAR, const Standard_Boolean IsReverseArrow=Standard_False)

| Initializes the length dimension between line anAttachLin1 and line defined anAttachLin2. aLenAttachLin is length of the attach lines .
Standard_EXPORT void | SetAttachLinLength (const Standard_Real aLength)
| Sets the length of attachment lines .
virtual Standard_EXPORT void | Save (Aspect_FStream &aFStream) const
Standard_EXPORT void | LineCoord (gp_Pnt2d &aFirstPnt, gp_Pnt2d &aSecondPnt) const
| returns coordinates of points, which are begining and end of arrow
Standard_EXPORT void | CallOutCoord (gp_Pnt2d &aFirstPnt, gp_Pnt2d &aSecondPnt) const
| returns coordinates of points, which are begining and end of arrow
Standard_EXPORT Prs2d_TypeOfDist | TypeOfDist () const
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Protected Member Functions

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

## Private Member Functions

Standard_EXPORT void | GetPntProject (const Standard_Real aLength)
Standard_EXPORT void | ComputeArrows (const Standard_Boolean isnotPoints)

## Private Attributes

Standard_ShortReal | myX1
Standard_ShortReal | myY1
Standard_ShortReal | myX2
Standard_ShortReal | myY2
Standard_ShortReal | myAX1
Standard_ShortReal | myAY1
Standard_ShortReal | myAX2
Standard_ShortReal | myAY2
Prs2d_TypeOfDist | myTypeDist
Standard_ShortReal | myXT1
Standard_ShortReal | myYT1
Standard_ShortReal | myXT2
Standard_ShortReal | myYT2

## Constructor & Destructor Documentation

Standard_EXPORT Prs2d_Length::Prs2d_Length | ( | const Handle(Graphic2d_GraphicObject)& | aGraphicObject,
|  | const gp_Pnt2d & | anAttachPnt1,
|  | const gp_Pnt2d & | anAttachPnt2,
|  | const TCollection_ExtendedString & | aText,
|  | const Standard_Real | aTxtScale = `5.0`,
|  | const Standard_Real | aLength = `0.0`,
|  | const Prs2d_TypeOfDist | aTypeDist = `Prs2d_TOD_AUTOMATIC`,
|  | const Standard_Real | anArrAngle = `20.0`,
|  | const Standard_Real | anArrLength = `25.0`,
|  | const Prs2d_TypeOfArrow | anArrType = `Prs2d_TOA_OPENED`,
|  | const Prs2d_ArrowSide | anArrow = `Prs2d_AS_BOTHAR`,
|  | const Standard_Boolean | IsReverseArrow = `Standard_False`
| ) |

Standard_EXPORT Prs2d_Length::Prs2d_Length | ( | const Handle(Graphic2d_GraphicObject)& | aGraphicObject,
|  | const gp_Pnt2d & | anAttachPnt,
|  | const gp_Lin2d & | anAttachLin,
|  | const TCollection_ExtendedString & | aText,
|  | const Standard_Real | aTxtScale = `10.0`,
|  | const Standard_Real | aLenAttachLin = `0.0`,
|  | const Standard_Real | anArrAngle = `20.0`,
|  | const Standard_Real | anArrLength = `25.0`,
|  | const Prs2d_TypeOfArrow | anArrType = `Prs2d_TOA_OPENED`,
|  | const Prs2d_ArrowSide | anArrow = `Prs2d_AS_BOTHAR`,
|  | const Standard_Boolean | IsReverseArrow = `Standard_False`
| ) |

Standard_EXPORT Prs2d_Length::Prs2d_Length | ( | const Handle(Graphic2d_GraphicObject)& | aGraphicObject,
|  | const gp_Lin2d & | anAttachLin1,
|  | const gp_Lin2d & | anAttachLin2,
|  | const TCollection_ExtendedString & | aText,
|  | const Standard_Real | aTxtScale = `10.0`,
|  | const Standard_Real | aLenAttachLin = `0.0`,
|  | const Standard_Real | anArrAngle = `20.0`,
|  | const Standard_Real | anArrLength = `25.0`,
|  | const Prs2d_TypeOfArrow | anArrType = `Prs2d_TOA_OPENED`,
|  | const Prs2d_ArrowSide | anArrow = `Prs2d_AS_BOTHAR`,
|  | const Standard_Boolean | IsReverseArrow = `Standard_False`
| ) |

## Member Function Documentation

void Prs2d_Length::CalcTxtPos | ( | const Standard_Boolean | theFromAbs = `Standard_False` | ) | `[inline, protected, virtual]`

| Implements Prs2d_Dimension.

Standard_EXPORT void Prs2d_Length::CallOutCoord | ( | gp_Pnt2d & | aFirstPnt,
|  | gp_Pnt2d & | aSecondPnt
| ) | const

Standard_EXPORT void Prs2d_Length::ComputeArrows | ( | const Standard_Boolean | isnotPoints | ) | `[private]`

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

| Implements Graphic2d_Primitive.

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

| Reimplemented from Graphic2d_Primitive.

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

| Reimplemented from Graphic2d_Primitive.

Standard_EXPORT void Prs2d_Length::GetPntProject | ( | const Standard_Real | aLength | ) | `[private]`

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

| Reimplemented from Prs2d_Dimension.

Standard_EXPORT void Prs2d_Length::LineCoord | ( | gp_Pnt2d & | aFirstPnt,
|  | gp_Pnt2d & | aSecondPnt
| ) | const

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

| Reimplemented from Graphic2d_Line.

Standard_EXPORT void Prs2d_Length::SetAttachLinLength | ( | const Standard_Real | aLength | ) |

Standard_EXPORT Prs2d_TypeOfDist Prs2d_Length::TypeOfDist | ( |  | ) | const

## Field Documentation

Standard_ShortReal Prs2d_Length::myAX1 `[private]`

Standard_ShortReal Prs2d_Length::myAX2 `[private]`

Standard_ShortReal Prs2d_Length::myAY1 `[private]`

Standard_ShortReal Prs2d_Length::myAY2 `[private]`

Prs2d_TypeOfDist Prs2d_Length::myTypeDist `[private]`

Standard_ShortReal Prs2d_Length::myX1 `[private]`

Standard_ShortReal Prs2d_Length::myX2 `[private]`

Standard_ShortReal Prs2d_Length::myXT1 `[private]`

Standard_ShortReal Prs2d_Length::myXT2 `[private]`

Standard_ShortReal Prs2d_Length::myY1 `[private]`

Standard_ShortReal Prs2d_Length::myY2 `[private]`

Standard_ShortReal Prs2d_Length::myYT1 `[private]`

Standard_ShortReal Prs2d_Length::myYT2 `[private]`

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

- Prs2d_Length.hxx
- Prs2d_Length.lxx