Interactive object, representating annotation entity.
#include <GEOM_Annotation.hxx>
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 |
Standard_EXPORT GEOM_Annotation::GEOM_Annotation | ( | ) |
|
inlinevirtual |
void GEOM_Annotation::BeginDrag | ( | ) |
References myPosition, and myStartPosition.
|
privatevirtual |
References Handle(), myIsDepthCulling, myIsScreenFixed, myPosition, myShape, and TextBoundingBox().
|
static |
thePosition | [in] the 3d position. |
theAttach | [in] the attachment point. |
theView | [in] the view for projecting coordinates. |
|
static |
thePosition | [in] the 2d position. |
theAttach | [in] the attachment point. |
theView | [in] the view for projecting coordinates. |
|
inline |
void GEOM_Annotation::Drag | ( | const Standard_Integer | theDx, |
const Standard_Integer | theDy, | ||
const Handle(V3d_View)& | theView | ||
) |
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 | ( | ) |
|
inline |
References myAttach.
|
inline |
References myIsAutoHide.
|
static |
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. |
|
inline |
References myIsDepthCulling.
|
inline |
|
inline |
|
inline |
|
inline |
References myHilightMode.
|
inline |
References myIsScreenFixed.
|
inline |
|
inline |
|
inline |
|
inline |
References myPosition.
|
inline |
References myText.
|
inline |
|
inline |
|
inline |
References myShape.
void GEOM_Annotation::Set2dPosition | ( | const Handle(V3d_View)& | theView | ) |
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 | ) |
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 | ) |
thePoint | [in] the 3D cartesian point defined in world's coordinate system (a point on annotated geometry). |
References myAttach.
|
inline |
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.
|
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().
|
inline |
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().
|
inlineprivatevirtual |
void GEOM_Annotation::SetPosition | ( | const gp_Pnt & | thePosition | ) |
thePosition | [in] the cartesian point defining the position of lower left corner of the text label. When displayed in fixed screen position mode ( |
|
private |
References Handle(), myIsScreenFixed, and myPosition.
void GEOM_Annotation::SetText | ( | const TCollection_ExtendedString & | theText | ) |
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().
|
inlineprivatevirtual |
|
private |
void GEOM_Annotation::UndoDrag | ( | ) |
References myStartPosition, and SetPosition().
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |