// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _Graphic2d_Text_HeaderFile #define _Graphic2d_Text_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_DefineHandle_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Text_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _Standard_ShortReal_HeaderFile #include #endif #ifndef _Aspect_TypeOfText_HeaderFile #include #endif #ifndef _TCollection_ExtendedString_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Quantity_Factor_HeaderFile #include #endif #ifndef _Graphic2d_TypeOfAlignment_HeaderFile #include #endif #ifndef _Graphic2d_Primitive_HeaderFile #include #endif #ifndef _Handle_Graphic2d_GraphicObject_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Quantity_PlaneAngle_HeaderFile #include #endif #ifndef _Quantity_Length_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Drawer_HeaderFile #include #endif #ifndef _Aspect_FStream_HeaderFile #include #endif class Graphic2d_GraphicObject; class TCollection_ExtendedString; class Graphic2d_Drawer; //! The primitive Text
class Graphic2d_Text : public Graphic2d_Primitive { public: //! Creates a text in a graphic object
//! The text is .
//! The reference point is , .
//! The orientation angle is .
//! The type of text is and must be one of :
//! Aspect_TOT_SOLID,
//! Aspect_TOT_OUTLINE,
//! The scale factor apply to the original font size,
//! Angles are measured counterclockwise with 0 radian
//! at 3 o'clock.
//! Warning: a text can be orientable,slantable,zoomable or outlinable
//! only when this options are enable regardless of the graphic driver.
//! i.e: Xw driver does not,but Xdps or PS driver does.
Standard_EXPORT Graphic2d_Text(const Handle(Graphic2d_GraphicObject)& aGraphicObject,const TCollection_ExtendedString& aText,const Standard_Real X,const Standard_Real Y,const Quantity_PlaneAngle anAngle = 0.0,const Aspect_TypeOfText aType = Aspect_TOT_SOLID,const Quantity_Factor aScale = 1.0); //! Sets the font index for the text .
//! Warning: Note that the index 0 can be undefined as a FontMapEntry,
//! in this case the default system text font is taken.
Standard_EXPORT void SetFontIndex(const Standard_Integer anIndex = 0) ; //! Sets the slant angle of the text .
Standard_EXPORT void SetSlant(const Quantity_PlaneAngle aSlant = 0.0) ; //! The text follows the scale factor of the view
//! if the flag is Standard_True.
Standard_EXPORT void SetZoomable(const Standard_Boolean aFlag = Standard_True) ; //! Sets the Device space offset of the text .
Standard_EXPORT void SetOffset(const Standard_Real aDx = 0.0,const Standard_Real aDy = 0.0) ; //! Enable/Disable text underline.
Standard_EXPORT void SetUnderline(const Standard_Boolean isUnderlined = Standard_False) ; //! Sets the text alignment.
Standard_EXPORT void SetAlignment(const Graphic2d_TypeOfAlignment anAlignment = Graphic2d_TOA_LEFT) ; //! Compute text size depending of a required bounding box,
//! Adjust the text position depending of the text origine
//! and base line if "Adjust" is TRUE,
//! Expand the text when the Width is smaller that the
//! Fit Width if "Expand" is TRUE.
//! and returns Standard_True if the current Driver used is
//! enable to fit the text size.
//! Warning: The fit computation is apply only if the corresponding
//! dimension is > 0.
Standard_EXPORT virtual Standard_Boolean Fit(const Quantity_Length aWidth,const Quantity_Length aHeight,const Standard_Boolean Adjust = Standard_True,const Standard_Boolean Expand = Standard_True) ; //! Trunc the text when the Width of the text is greater
//! that the defined Width Max,
//! and returns Standard_True if the current Driver used is
//! enable to trunc the text size.
Standard_EXPORT virtual Standard_Boolean Trunc(const Quantity_Length aWidth) ; //! Returns Standard_True if the Text follows
//! the scale factor of the view.
Standard_EXPORT Standard_Boolean IsZoomable() const; //! Returns Standard_True if the Text is underlined.
Standard_EXPORT Standard_Boolean IsUnderlined() const; //! Returns Standard_True if the current Driver used is enabled
//! to get the right size in the
//! world size parameter ,
//! depending of the attributes of the text and the current scale
//! of the view.
Standard_EXPORT Standard_Boolean TextSize(Quantity_Length& aWidth,Quantity_Length& aHeight) const; //! Returns Standard_True if the current Driver used is enabled
//! to get the right size and text offsets in the
//! world size parameter ,,,
//! depending of the attributes of the text and the current scale
//! of the view.
//! NOTE that the text offsets defines the relative position of the
//! of the text string origin from the lower left corner of the text
//! boundary limits.
Standard_EXPORT virtual Standard_Boolean TextSize(Quantity_Length& aWidth,Quantity_Length& aHeight,Quantity_Length& anXoffset,Quantity_Length& anYoffset) const; //! Returns the text position.
Standard_EXPORT void Position(Quantity_Length& X,Quantity_Length& Y) const; //! Returns the text Offset.
Standard_EXPORT void Offset(Standard_Real& X,Standard_Real& Y) const; //! Returns the text slant.
Standard_EXPORT Quantity_PlaneAngle Slant() const; //! Returns the text orientation.
Standard_EXPORT Quantity_PlaneAngle Angle() const; //! Returns the text font index.
Standard_EXPORT Standard_Integer FontIndex() const; //! Returns the text scale.
Standard_EXPORT Quantity_Factor Scale() const; //! Returns the text alignment.
Standard_EXPORT Graphic2d_TypeOfAlignment Alignment() const; //! Returns the text string
Standard_EXPORT TCollection_ExtendedString GetText() const; //! Returns the type text
Standard_EXPORT Aspect_TypeOfText GetType() const; Standard_EXPORT virtual void Save(Aspect_FStream& aFStream) const; DEFINE_STANDARD_RTTI(Graphic2d_Text) protected: //! Draws the text .
Standard_EXPORT virtual void Draw(const Handle(Graphic2d_Drawer)& aDrawer) ; //! Returns Standard_True if the text is picked,
//! Standard_False if not.
Standard_EXPORT virtual Standard_Boolean Pick(const Standard_ShortReal X,const Standard_ShortReal Y,const Standard_ShortReal aPrecision,const Handle(Graphic2d_Drawer)& aDrawer) ; //! Computes the MinMax of the text if possible.
Standard_EXPORT virtual Standard_Boolean ComputeMinMax() ; Standard_Integer myFontIndex; Standard_ShortReal myX; Standard_ShortReal myDx; Standard_ShortReal myY; Standard_ShortReal myDy; Standard_ShortReal myAngle; Aspect_TypeOfText myType; TCollection_ExtendedString myText; Standard_Boolean myAdjustFlag; Standard_ShortReal myDeltax; Standard_ShortReal myDeltay; Standard_ShortReal mySlant; Standard_Boolean myIsZoomable; Standard_Boolean myIsUnderlined; Quantity_Factor myHScale; Quantity_Factor myWScale; Graphic2d_TypeOfAlignment myAlignment; private: }; // other Inline functions and methods (like "C++: function call" methods) #endif