Version: 9.12.0
GEOM_Annotation Class Reference

Interactive object, representating annotation entity.

#include <GEOM_Annotation.hxx>

Inheritance diagram for GEOM_Annotation:
Inheritance graph

Classes

class  GEOM_AnnotationOwner
 Custom entity owner implementing correct highlight for topmost mode. More...
 
class  GEOM_AnnotationSensEntity
 Custom sensitive entity with implementing option to support selection with depth culling flag turned off. More...
 
class  OpenGl_Annotation
 Custom element implementing dynamic rendering of 3D annotation and invoking dynamic callback in presentation class. More...
 

Public Member Functions

 DEFINE_STANDARD_RTTIEXT (GEOM_Annotation, AIS_InteractiveObject) enum HighlightMode
 Enumerates supported highlighting modes. More...
 
Standard_EXPORT GEOM_Annotation ()
 Constructor. More...
 
virtual ~GEOM_Annotation ()
 Destructor. More...
 
Standard_EXPORT void SetText (const TCollection_ExtendedString &theText)
 Sets annotation text string. More...
 
const TCollection_ExtendedString & GetText () const
 Returns annotation text string. More...
 
Standard_EXPORT void SetPosition (const gp_Pnt &thePosition)
 Sets position of the annotation text label. More...
 
const gp_Pnt & GetPosition () const
 Returns position of the annotation text label. More...
 
Standard_EXPORT void SetIsScreenFixed (const Standard_Boolean theIsFixed)
 Sets or disables "2D screen fixed" positioning mode. More...
 
Standard_Boolean GetIsScreenFixed () const
 Returns value of "screen fixed" positioning mode. More...
 
Standard_EXPORT void Set2dPosition (const Handle(V3d_View)&theView)
 Converts annotation position to screen fixed coordinates and modifies its "2D screen fixed" flag correspondingly. More...
 
Standard_EXPORT void Set3dPosition (const Handle(V3d_View)&theView)
 Converts annotation position from screen fixed coordinates to 3D position and modifies its "2D screen fixed" flag correspondingly. More...
 
Standard_EXPORT void SetAttachPoint (const gp_Pnt &thePoint)
 Sets attachment point of extension line. More...
 
const gp_Pnt & GetAttachPoint () const
 Returns attachment point of extension line. More...
 
Standard_EXPORT void SetHilightShape (const TopoDS_Shape &theShape)
 Sets shape (annotated shape) that will be used for highlighting. More...
 
const TopoDS_Shape HilightShape () const
 Returns the highlighting shape. More...
 
virtual Standard_EXPORT void SetColor (const Quantity_Color &theColor) Standard_OVERRIDE
 Sets color for the presentation. More...
 
Standard_EXPORT void SetTextColor (const Quantity_Color &theColor)
 Sets text color. More...
 
Quantity_Color GetTextColor () const
 Returns color for the text's label. More...
 
Standard_EXPORT void SetLineColor (const Quantity_Color &theColor)
 Sets line's color. More...
 
Quantity_Color GetLineColor () const
 Returns color for the connection line. More...
 
Standard_EXPORT void SetLineWidth (const Standard_Real theLineWidth)
 Sets line width to be used for drawing the annotation's extension line and underline. More...
 
Standard_Real GetLineWidth () const
 Returns line width for drawing the annotation's extension line and underline. More...
 
Standard_EXPORT void SetLineStyle (const Aspect_TypeOfLine theStyle)
 Sets style of connection line. More...
 
Aspect_TypeOfLine GetLineStyle () const
 Retusn style of connection line. More...
 
Standard_EXPORT void SetHiddenLineStyle (const Aspect_TypeOfLine theStyle)
 Sets style of hidden connection line. More...
 
Aspect_TypeOfLine GetHiddenLineStyle () const
 Retusn style of hidden connection line. More...
 
Standard_EXPORT void SetTextHeight (const Standard_Real theHeight)
 Sets text height in pixels. More...
 
Standard_Real GetTextHeight () const
 Returns text's height in pixels. More...
 
Standard_EXPORT void SetFontAspect (const Font_FontAspect theFontAspect)
 Sets font aspect for label. More...
 
Font_FontAspect GetFontAspect () const
 Returns label's font aspect. More...
 
Standard_EXPORT void SetFont (const TCollection_AsciiString &theFont)
 Sets font used for drawing the label. More...
 
TCollection_AsciiString GetFont () const
 Returns font used for drawing the label. More...
 
void SetAutoHide (const Standard_Boolean theIsEnable)
 Sets annotation auto-hiding option. More...
 
Standard_Boolean GetAutoHide () const
 Returns current state of the auto-hiding option. More...
 
void SetHighlightMode (const HighlightMode theMode)
 Sets highlight mode used for display of presentation. More...
 
HighlightMode GetHilightMode () const
 Returns highlight mode. More...
 
Standard_EXPORT void SetDepthCulling (const Standard_Boolean theToEnable)
 Sets special flag that allows disabling depth testing when rendering the graphical presentation. More...
 
Standard_Boolean GetDepthCulling () const
 Returns depth culling state. More...
 
Standard_EXPORT void SetDefaultZLayer ()
 Restores default z-layer for this presentation. More...
 
Standard_EXPORT void BeginDrag ()
 Prepares necessary data to perform dragging. More...
 
Standard_EXPORT void Drag (const Standard_Integer theDx, const Standard_Integer theDy, const Handle(V3d_View)&theView)
 Drags annotation presentation in the screen plane using the given pixel delta. More...
 
Standard_EXPORT void EndDrag ()
 Perform necessary update when dragging is finished. More...
 
Standard_EXPORT void UndoDrag ()
 Perform necessary update when dragging need undo. More...
 

Static Public Member Functions

static Standard_EXPORT gp_Pnt GetDefaultPosition (const Standard_Boolean theIsScreenFixed, const gp_Pnt &theAttachPnt, const Standard_Real theOffset, const Handle(V3d_View)&theView)
 Returns default position for placing annotation when its attachment point has been determined. More...
 
static Standard_EXPORT gp_Pnt ConvertPosition2d (const gp_Pnt &thePosition, const gp_Pnt &theAttach, const Handle(V3d_View)&theView)
 Converts 3d position to 2d on screen point. More...
 
static Standard_EXPORT gp_Pnt ConvertPosition3d (const gp_Pnt &thePosition, const gp_Pnt &theAttach, const Handle(V3d_View)&theView)
 Converts 2d position to 3d point. More...
 

Private Member Functions

virtual void Compute (const Handle(PrsMgr_PresentationManager3d)&thePresentationManager, const Handle(Prs3d_Presentation)&thePresentation, const Standard_Integer theMode=0) Standard_OVERRIDE
 
virtual void ComputeSelection (const Handle(SelectMgr_Selection)&theSelection, const Standard_Integer theMode) Standard_OVERRIDE
 
virtual void setLocalTransformation (const Handle(Geom_Transformation)&) Standard_OVERRIDE
 
virtual void SetTransformPersistence (const Handle(Graphic3d_TransformPers)&) Standard_OVERRIDE
 
Bnd_Box TextBoundingBox () const
 
void SetPosition (const gp_Pnt &thePosition, const Standard_Boolean theUpdateSelection)
 

Private Attributes

gp_Pnt myAttach
 Attachment point of extension line. More...
 
gp_Pnt myPosition
 Position of text label. More...
 
gp_Pnt myStartPosition
 Position before starting dragging operation. More...
 
Standard_Boolean myIsScreenFixed
 Flag indicating whether "screen fixed" positioning mode is turned on or off. More...
 
Standard_Boolean myIsAutoHide
 Flag indicating whether "auto-hiding" option is turned on. More...
 
Standard_Boolean myIsDepthCulling
 Flag indicating whether the "depth culling" is turned on. More...
 
HighlightMode myHilightMode
 Highlight mode for presentation. More...
 
TCollection_ExtendedString myText
 Text string of the label presentation. More...
 
TopoDS_Shape myShape
 Highlighting shape. More...
 

Friends

class OpenGl_Annotation
 

Constructor & Destructor Documentation

◆ GEOM_Annotation()

Standard_EXPORT GEOM_Annotation::GEOM_Annotation ( )

◆ ~GEOM_Annotation()

virtual GEOM_Annotation::~GEOM_Annotation ( )
inlinevirtual

Member Function Documentation

◆ BeginDrag()

void GEOM_Annotation::BeginDrag ( )

References myPosition, and myStartPosition.

◆ Compute()

void GEOM_Annotation::Compute ( const Handle(PrsMgr_PresentationManager3d)&  thePresentationManager,
const Handle(Prs3d_Presentation)&  thePresentation,
const Standard_Integer  theMode = 0 
)
privatevirtual

◆ ComputeSelection()

void GEOM_Annotation::ComputeSelection ( const Handle(SelectMgr_Selection)&  theSelection,
const Standard_Integer  theMode 
)
privatevirtual

◆ ConvertPosition2d()

gp_Pnt GEOM_Annotation::ConvertPosition2d ( const gp_Pnt &  thePosition,
const gp_Pnt &  theAttach,
const Handle(V3d_View)&  theView 
)
static
Parameters
thePosition[in] the 3d position.
theAttach[in] the attachment point.
theView[in] the view for projecting coordinates.

◆ ConvertPosition3d()

gp_Pnt GEOM_Annotation::ConvertPosition3d ( const gp_Pnt &  thePosition,
const gp_Pnt &  theAttach,
const Handle(V3d_View)&  theView 
)
static
Parameters
thePosition[in] the 2d position.
theAttach[in] the attachment point.
theView[in] the view for projecting coordinates.

◆ DEFINE_STANDARD_RTTIEXT()

GEOM_Annotation::DEFINE_STANDARD_RTTIEXT ( GEOM_Annotation  ,
AIS_InteractiveObject   
)
inline
  • HighlightAll : all elements of the annotation are highlighted.
  • HighlightLabel : only annotation label is highlighted.

◆ Drag()

void GEOM_Annotation::Drag ( const Standard_Integer  theDx,
const Standard_Integer  theDy,
const Handle(V3d_View)&  theView 
)
Parameters
theDx,theDy[in] the drag offset in pixels (from beginning of dragging).
theView[in] the current view for evaluating drag with 3D position mode.

References myIsScreenFixed, myStartPosition, and SetPosition().

◆ EndDrag()

void GEOM_Annotation::EndDrag ( )

◆ GetAttachPoint()

const gp_Pnt& GEOM_Annotation::GetAttachPoint ( ) const
inline

References myAttach.

◆ GetAutoHide()

Standard_Boolean GEOM_Annotation::GetAutoHide ( ) const
inline

References myIsAutoHide.

◆ GetDefaultPosition()

gp_Pnt GEOM_Annotation::GetDefaultPosition ( const Standard_Boolean  theIsScreenFixed,
const gp_Pnt &  theAttachPnt,
const Standard_Real  theOffset,
const Handle(V3d_View)&  theView 
)
static
Parameters
theIsScreenFixed[in] the state of annotation's "2D screen fixed" mode.
theAttachPnt[in] the attachment point.
theOffset[in] the offset value for placing the position relative to attachment.s
theView[in] the view for projecting coordinates.

◆ GetDepthCulling()

Standard_Boolean GEOM_Annotation::GetDepthCulling ( ) const
inline

References myIsDepthCulling.

◆ GetFont()

TCollection_AsciiString GEOM_Annotation::GetFont ( ) const
inline

◆ GetFontAspect()

Font_FontAspect GEOM_Annotation::GetFontAspect ( ) const
inline

◆ GetHiddenLineStyle()

Aspect_TypeOfLine GEOM_Annotation::GetHiddenLineStyle ( ) const
inline

◆ GetHilightMode()

HighlightMode GEOM_Annotation::GetHilightMode ( ) const
inline

References myHilightMode.

◆ GetIsScreenFixed()

Standard_Boolean GEOM_Annotation::GetIsScreenFixed ( ) const
inline

References myIsScreenFixed.

◆ GetLineColor()

Quantity_Color GEOM_Annotation::GetLineColor ( ) const
inline

◆ GetLineStyle()

Aspect_TypeOfLine GEOM_Annotation::GetLineStyle ( ) const
inline

◆ GetLineWidth()

Standard_Real GEOM_Annotation::GetLineWidth ( ) const
inline

◆ GetPosition()

const gp_Pnt& GEOM_Annotation::GetPosition ( ) const
inline

References myPosition.

◆ GetText()

const TCollection_ExtendedString& GEOM_Annotation::GetText ( ) const
inline

References myText.

◆ GetTextColor()

Quantity_Color GEOM_Annotation::GetTextColor ( ) const
inline

◆ GetTextHeight()

Standard_Real GEOM_Annotation::GetTextHeight ( ) const
inline

◆ HilightShape()

const TopoDS_Shape GEOM_Annotation::HilightShape ( ) const
inline

References myShape.

◆ Set2dPosition()

void GEOM_Annotation::Set2dPosition ( const Handle(V3d_View)&  theView)
Parameters
theView[in] the view to perform projection of coordinates.

References ConvertPosition2d(), myAttach, myIsScreenFixed, myPosition, SetIsScreenFixed(), and SetPosition().

◆ Set3dPosition()

void GEOM_Annotation::Set3dPosition ( const Handle(V3d_View)&  theView)
Parameters
theView[in] the view to perform projection of coordinates.

References ConvertPosition3d(), myAttach, myIsScreenFixed, myPosition, SetIsScreenFixed(), and SetPosition().

◆ SetAttachPoint()

void GEOM_Annotation::SetAttachPoint ( const gp_Pnt &  thePoint)
Parameters
thePoint[in] the 3D cartesian point defined in world's coordinate system (a point on annotated geometry).

References myAttach.

◆ SetAutoHide()

void GEOM_Annotation::SetAutoHide ( const Standard_Boolean  theIsEnable)
inline
Parameters
theIsEnable[in] the option flag. If passed true, the annotation will be automatically hidden in the view if the attachment point goes outside of the view.

References myIsAutoHide.

◆ SetColor()

void GEOM_Annotation::SetColor ( const Quantity_Color &  theColor)
virtual

References SetLineColor(), and SetTextColor().

◆ SetDefaultZLayer()

void GEOM_Annotation::SetDefaultZLayer ( )

References myIsScreenFixed.

◆ SetDepthCulling()

void GEOM_Annotation::SetDepthCulling ( const Standard_Boolean  theToEnable)

When disable the hidden parts such as lines and text become visible and a rendered with another drawing aspect. This mode should be explicitly used with setting top layer for the presentation. Otherwise the behavior is undefined.

References GetDepthCulling(), and myIsDepthCulling.

◆ SetFont()

void GEOM_Annotation::SetFont ( const TCollection_AsciiString &  theFont)

References GetFont().

◆ SetFontAspect()

void GEOM_Annotation::SetFontAspect ( const Font_FontAspect  theFontAspect)

References GetFontAspect().

◆ SetHiddenLineStyle()

void GEOM_Annotation::SetHiddenLineStyle ( const Aspect_TypeOfLine  theStyle)

References GetHiddenLineStyle().

◆ SetHighlightMode()

void GEOM_Annotation::SetHighlightMode ( const HighlightMode  theMode)
inline
Parameters
theMode[in] the one of the supported highlight modes.

References myHilightMode.

◆ SetHilightShape()

void GEOM_Annotation::SetHilightShape ( const TopoDS_Shape &  theShape)

References myShape.

◆ SetIsScreenFixed()

void GEOM_Annotation::SetIsScreenFixed ( const Standard_Boolean  theIsFixed)

In this mode the annotation is fixed at predefined pixel location in the window coordinate space. Other mode is "3D screen aligned" positioning, when the label is aligned in plane of the screen, while its position is a 3D point defined in world's coordinate system.

References Handle(), myIsScreenFixed, and myPosition.

◆ SetLineColor()

void GEOM_Annotation::SetLineColor ( const Quantity_Color &  theColor)

◆ SetLineStyle()

void GEOM_Annotation::SetLineStyle ( const Aspect_TypeOfLine  theStyle)

References GetLineStyle().

◆ SetLineWidth()

void GEOM_Annotation::SetLineWidth ( const Standard_Real  theLineWidth)

References GetLineWidth().

◆ setLocalTransformation()

virtual void GEOM_Annotation::setLocalTransformation ( const Handle(Geom_Transformation)&  )
inlineprivatevirtual

◆ SetPosition() [1/2]

void GEOM_Annotation::SetPosition ( const gp_Pnt &  thePosition)
Parameters
thePosition[in] the cartesian point defining the position of lower left corner of the text label. When displayed in fixed screen position mode (
See also
SetScreenFixed) the position is defined as {x,y} pixel coordinate of window space, otherwise 3D point defined in world's coordinate system is used.

◆ SetPosition() [2/2]

void GEOM_Annotation::SetPosition ( const gp_Pnt &  thePosition,
const Standard_Boolean  theUpdateSelection 
)
private

References Handle(), myIsScreenFixed, and myPosition.

◆ SetText()

void GEOM_Annotation::SetText ( const TCollection_ExtendedString &  theText)
Parameters
theText[in] the string displayed in annotation label.

References myText.

◆ SetTextColor()

void GEOM_Annotation::SetTextColor ( const Quantity_Color &  theColor)

◆ SetTextHeight()

void GEOM_Annotation::SetTextHeight ( const Standard_Real  theHeight)

References GetTextHeight().

◆ SetTransformPersistence()

virtual void GEOM_Annotation::SetTransformPersistence ( const Handle(Graphic3d_TransformPers)&  )
inlineprivatevirtual

◆ TextBoundingBox()

Bnd_Box GEOM_Annotation::TextBoundingBox ( ) const
private

References Handle(), and myText.

◆ UndoDrag()

void GEOM_Annotation::UndoDrag ( )

References myStartPosition, and SetPosition().

Friends And Related Function Documentation

◆ OpenGl_Annotation

friend class OpenGl_Annotation
friend

Member Data Documentation

◆ myAttach

gp_Pnt GEOM_Annotation::myAttach
private

◆ myHilightMode

HighlightMode GEOM_Annotation::myHilightMode
private

◆ myIsAutoHide

Standard_Boolean GEOM_Annotation::myIsAutoHide
private

◆ myIsDepthCulling

Standard_Boolean GEOM_Annotation::myIsDepthCulling
private

◆ myIsScreenFixed

Standard_Boolean GEOM_Annotation::myIsScreenFixed
private

◆ myPosition

gp_Pnt GEOM_Annotation::myPosition
private

◆ myShape

TopoDS_Shape GEOM_Annotation::myShape
private

◆ myStartPosition

gp_Pnt GEOM_Annotation::myStartPosition
private

◆ myText

TCollection_ExtendedString GEOM_Annotation::myText
private

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