Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
 Retuns 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 hilighting. More...
 
const TopoDS_Shape HilightShape () const
 Returns the hilighting 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 indiciating 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
 Hilighting shape. More...
 

Friends

class OpenGl_Annotation
 

Constructor & Destructor Documentation

Standard_EXPORT GEOM_Annotation::GEOM_Annotation ( )
virtual GEOM_Annotation::~GEOM_Annotation ( )
inlinevirtual

Member Function Documentation

void GEOM_Annotation::BeginDrag ( )

References myPosition, and myStartPosition.

void GEOM_Annotation::Compute ( const Handle(PrsMgr_PresentationManager3d)&  thePresentationManager,
const Handle(Prs3d_Presentation)&  thePresentation,
const Standard_Integer  theMode = 0 
)
privatevirtual
void GEOM_Annotation::ComputeSelection ( const Handle(SelectMgr_Selection)&  theSelection,
const Standard_Integer  theMode 
)
privatevirtual
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.
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.
GEOM_Annotation::DEFINE_STANDARD_RTTIEXT ( GEOM_Annotation  ,
AIS_InteractiveObject   
)
inline
  • HighlightAll : all elements of the annotation are highlighted.
  • HighlightLabel : only annotation label is highlighted.
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 aHeight, myIsScreenFixed, myStartPosition, and SetPosition().

void GEOM_Annotation::EndDrag ( )
const gp_Pnt& GEOM_Annotation::GetAttachPoint ( ) const
inline

References myAttach.

Standard_Boolean GEOM_Annotation::GetAutoHide ( ) const
inline

References myIsAutoHide.

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.
Standard_Boolean GEOM_Annotation::GetDepthCulling ( ) const
inline

References myIsDepthCulling.

TCollection_AsciiString GEOM_Annotation::GetFont ( ) const
inline
Font_FontAspect GEOM_Annotation::GetFontAspect ( ) const
inline
Aspect_TypeOfLine GEOM_Annotation::GetHiddenLineStyle ( ) const
inline
HighlightMode GEOM_Annotation::GetHilightMode ( ) const
inline

References myHilightMode.

Standard_Boolean GEOM_Annotation::GetIsScreenFixed ( ) const
inline

References myIsScreenFixed.

Quantity_Color GEOM_Annotation::GetLineColor ( ) const
inline
Aspect_TypeOfLine GEOM_Annotation::GetLineStyle ( ) const
inline
Standard_Real GEOM_Annotation::GetLineWidth ( ) const
inline
const gp_Pnt& GEOM_Annotation::GetPosition ( ) const
inline

References myPosition.

const TCollection_ExtendedString& GEOM_Annotation::GetText ( ) const
inline

References myText.

Quantity_Color GEOM_Annotation::GetTextColor ( ) const
inline
Standard_Real GEOM_Annotation::GetTextHeight ( ) const
inline
const TopoDS_Shape GEOM_Annotation::HilightShape ( ) const
inline

References myShape.

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().

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().

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.

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.

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

References SetLineColor(), and SetTextColor().

void GEOM_Annotation::SetDefaultZLayer ( )

References myIsScreenFixed.

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.

void GEOM_Annotation::SetFont ( const TCollection_AsciiString &  theFont)

References GetFont().

void GEOM_Annotation::SetFontAspect ( const Font_FontAspect  theFontAspect)

References GetFontAspect().

void GEOM_Annotation::SetHiddenLineStyle ( const Aspect_TypeOfLine  theStyle)

References GetHiddenLineStyle().

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

References myHilightMode.

void GEOM_Annotation::SetHilightShape ( const TopoDS_Shape &  theShape)

References myShape.

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.

void GEOM_Annotation::SetLineColor ( const Quantity_Color &  theColor)
void GEOM_Annotation::SetLineStyle ( const Aspect_TypeOfLine  theStyle)

References GetLineStyle().

void GEOM_Annotation::SetLineWidth ( const Standard_Real  theLineWidth)

References GetLineWidth().

virtual void GEOM_Annotation::setLocalTransformation ( const Handle(Geom_Transformation)&  )
inlineprivatevirtual
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.
void GEOM_Annotation::SetPosition ( const gp_Pnt &  thePosition,
const Standard_Boolean  theUpdateSelection 
)
private

References Handle(), myIsScreenFixed, and myPosition.

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

References myText.

void GEOM_Annotation::SetTextColor ( const Quantity_Color &  theColor)
void GEOM_Annotation::SetTextHeight ( const Standard_Real  theHeight)

References GetTextHeight().

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

References aFont, aText, Handle(), and myText.

void GEOM_Annotation::UndoDrag ( )

References myStartPosition, and SetPosition().

Friends And Related Function Documentation

friend class OpenGl_Annotation
friend

Member Data Documentation

gp_Pnt GEOM_Annotation::myAttach
private
HighlightMode GEOM_Annotation::myHilightMode
private
Standard_Boolean GEOM_Annotation::myIsAutoHide
private
Standard_Boolean GEOM_Annotation::myIsDepthCulling
private
Standard_Boolean GEOM_Annotation::myIsScreenFixed
private
gp_Pnt GEOM_Annotation::myPosition
private
TopoDS_Shape GEOM_Annotation::myShape
private
gp_Pnt GEOM_Annotation::myStartPosition
private
TCollection_ExtendedString GEOM_Annotation::myText
private

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