// 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_Drawer_HeaderFile #define _Graphic2d_Drawer_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_DefineHandle_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Drawer_HeaderFile #include #endif #ifndef _Standard_ShortReal_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Aspect_TypeOfDeflection_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Aspect_DriverPtr_HeaderFile #include #endif #ifndef _Aspect_WindowDriverPtr_HeaderFile #include #endif #ifndef _PlotMgt_PlotterDriverPtr_HeaderFile #include #endif #ifndef _Standard_Transient_HeaderFile #include #endif #ifndef _Handle_Aspect_Driver_HeaderFile #include #endif #ifndef _Handle_Aspect_WindowDriver_HeaderFile #include #endif #ifndef _Handle_PlotMgt_PlotterDriver_HeaderFile #include #endif #ifndef _Handle_Standard_Transient_HeaderFile #include #endif #ifndef _Standard_CString_HeaderFile #include #endif #ifndef _Quantity_Factor_HeaderFile #include #endif #ifndef _Standard_Address_HeaderFile #include #endif #ifndef _Aspect_TypeOfText_HeaderFile #include #endif #ifndef _Handle_TShort_HArray1OfShortReal_HeaderFile #include #endif class Graphic2d_DrawerDefinitionError; class Aspect_Driver; class Aspect_WindowDriver; class PlotMgt_PlotterDriver; class Standard_Transient; class TCollection_ExtendedString; class TShort_Array1OfShortReal; class TShort_HArray1OfShortReal; //! A Drawer groups all conversion methods.
class Graphic2d_Drawer : public Standard_Transient { public: //! A drawer is :
//! - a driver
//! - a "map from" and a "map to"
//! - attributes
Standard_EXPORT Graphic2d_Drawer(); //! Associates the driver to the drawer .
Standard_EXPORT void SetDriver(const Handle(Aspect_Driver)& aDriver) ; //! Returns the associated driver.
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT Handle_Aspect_Driver Driver() const; //! Returns TRUE if the driver is a window driver.
Standard_EXPORT Standard_Boolean IsWindowDriver() const; //! Returns the associated window driver.
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined or is not a WindowDriver.
Standard_EXPORT Handle_Aspect_WindowDriver WindowDriver() const; //! Returns TRUE if the driver is a plotter driver.
Standard_EXPORT Standard_Boolean IsPlotterDriver() const; //! Returns the associated plotter driver.
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined or is not a PlotterDriver
Standard_EXPORT Handle_PlotMgt_PlotterDriver PlotterDriver() const; //! Sets the chordal deviation.
//! is the chordal deviation when the type of
//! deflection is Aspect_TOD_ABSOLUTE.
//! is used when when the type of
//! deflection is Aspect_TOD_RELATIVE.
//! TypeOfDeflection is :
//! Aspect_TOD_RELATIVE
//! Aspect_TOD_ABSOLUTE
//! TypeOfDeflection defines if the maximal chordal deviation
//! used when drawing an object is absolute or relative to the
//! size of the object.
//! Warning: Specify a chordal deviation that is smaller than the
//! workstation pixel size will not improve the display,
//! but will slow the drawing.
Standard_EXPORT void SetDrawPrecision(const Standard_Real aPrecision,const Standard_Real aCoefficient,const Aspect_TypeOfDeflection aType) ; //! Returns the chordal deviation.
Standard_EXPORT void DrawPrecision(Standard_ShortReal& aPrecision,Standard_ShortReal& aCoefficient,Aspect_TypeOfDeflection& aType) const; //! Sets the Text precision in METER
//! Any text is displayed only if his height is greater than
Standard_EXPORT void SetTextPrecision(const Standard_ShortReal aPrecision) ; //! Returns the Text precision in METER.
Standard_EXPORT Standard_ShortReal TextPrecision() const; //! Defines the "map from" and the "map to" of the drawer.
//! The "map from" is defined by the viewmapping.
//! The "map to" is defined by the device.
//! example : the X window for a X driver.
Standard_EXPORT void SetValues(const Standard_Real XF,const Standard_Real YF,const Standard_Real SF,const Standard_Real XT,const Standard_Real YT,const Standard_Real ST,const Standard_Real ZF) ; //! Returns the "map from" and the "map to".
Standard_EXPORT void Values(Standard_ShortReal& XF,Standard_ShortReal& YF,Standard_ShortReal& SF,Standard_ShortReal& XT,Standard_ShortReal& YT,Standard_ShortReal& ST,Standard_ShortReal& ZF) const; //! Manages the highlight, if the highlight color index
//! is defined (No default value)
Standard_EXPORT void SetOverride(const Standard_Boolean aValue) ; //! Sets the highlight color index.
//! Warning: No default value.
Standard_EXPORT void SetOverrideColor(const Standard_Integer anIndex) ; //! Specifies an offset applied to the original color
//! index when drawing a primitives, those already created
//! and the future one.
//! Warning: To reset the real color of the primitives when drawing
//! then this method is called with = 0.
Standard_EXPORT void SetOffSet(const Standard_Integer anOffSet) ; //! Methods to define the Current Line Attributes
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT virtual void SetLineAttrib(const Standard_Integer ColorIndex,const Standard_Integer TypeIndex,const Standard_Integer WidthIndex) ; //! Methods to define the Current Marker Attributes
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void SetMarkerAttrib(const Standard_Integer ColorIndex,const Standard_Integer WidthIndex,const Standard_Boolean FillMarker) ; //! Methods to define the Current polygon Attributes
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void SetPolyAttrib(const Standard_Integer ColorIndex,const Standard_Integer TileIndex,const Standard_Boolean DrawEdge) ; //! Methods to define the Current hiding polygon Attributes
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void SetHidingPolyAttrib(const Standard_Integer HidingColorIndex,const Standard_Integer FrameColorIndex,const Standard_Integer FrameTypeIndex,const Standard_Integer FrameWidthIndex) ; //! Methods to define the Current Text Attributes
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void SetTextAttrib(const Standard_Integer ColorIndex,const Standard_Integer FontIndex,const Standard_ShortReal aSlant,const Standard_ShortReal aHScale,const Standard_ShortReal aWScale,const Standard_Boolean isUnderlined) ; //! Methods to define the Current Hiding Text Attributes
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void SetHidingTextAttrib(const Standard_Integer ColorIndex,const Standard_Integer HidingColorIndex,const Standard_Integer FrameColorIndex,const Standard_Integer FrameWidthIndex,const Standard_Integer FontIndex,const Standard_ShortReal aSlant,const Standard_ShortReal aHScale,const Standard_ShortReal aWScale,const Standard_Boolean isUnderlined) ; //! Methods to define the Current Framed Text Attributes
//! Category: Methods to manage the attributes
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void SetFramedTextAttrib(const Standard_Integer ColorIndex,const Standard_Integer FrameColorIndex,const Standard_Integer FrameWidthIndex,const Standard_Integer FontIndex,const Standard_ShortReal aSlant,const Standard_ShortReal aHScale,const Standard_ShortReal aWScale,const Standard_Boolean isUnderlined) ; //! Returns Standard_True if the associated driver
//! have stored the image and Standard_False if not.
//! For example, returns Standard_True if the associated
//! driver is a X Driver.
//! Category: Methods to manage the images
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT Standard_Boolean IsKnownImage(const Handle(Standard_Transient)& anImageId) ; //! Clears the image in the associated driver.
//! Category: Methods to manage the images
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void ClearImage(const Handle(Standard_Transient)& anImageId) ; //! Draws the image in the associated driver.
//! , is the center of the image.
//! Category: Methods to manage the images
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawImage(const Handle(Standard_Transient)& anImageId,const Standard_ShortReal aX,const Standard_ShortReal aY) ; //! Clears the image file in the associated driver.
//! Category: Methods to manage the images
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void ClearImageFile(const Standard_CString aName) ; //! Draws the image in the associated driver.
//! , is the center of the image.
//! = (if the image is zoomable)
//! initial scale factor of the image *
//! scale factor of the view.
//! = (if the image is not zoomable)
//! initial scale factor of the image
//! Category: Methods to manage the images
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawImageFile(const Standard_CString aName,const Standard_ShortReal aX,const Standard_ShortReal aY,const Quantity_Factor aScale) ; //! Stores a complete image and draws it in the associated
//! driver.
//! , is ????
//! Category: Methods to manage the images
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void FillAndDrawImage(const Handle(Standard_Transient)& anImageId,const Standard_ShortReal aX,const Standard_ShortReal aY,const Standard_Integer aWidth,const Standard_Integer aHeight,const Standard_Address anArrayOfPixels) ; //! Stores a line of an image and draws it in the associated
//! driver.
//! , is ????
//! Category: Methods to manage the images
//! Warning: Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void FillAndDrawImage(const Handle(Standard_Transient)& anImageId,const Standard_ShortReal aX,const Standard_ShortReal aY,const Standard_Integer anIndexOfLine,const Standard_Integer aWidth,const Standard_Integer aHeight,const Standard_Address anArrayOfPixels) ; //! Category: Convert methods
Standard_EXPORT void GetMapFrom(const Standard_ShortReal x1,const Standard_ShortReal y1,Standard_ShortReal& x2,Standard_ShortReal& y2) const; Standard_EXPORT void GetMapFromTo(const Standard_ShortReal x1,const Standard_ShortReal y1,Standard_ShortReal& x2,Standard_ShortReal& y2) const; //! Get text size in world space with the current text
//! attributes and returns TRUE if the driver is enabled
//! to get the right size (WindowDriver ONLY!).
//! Category: Convert methods
Standard_EXPORT virtual Standard_Boolean GetTextSize(const TCollection_ExtendedString& aText,Standard_ShortReal& aWidth,Standard_ShortReal& aHeight) const; //! Get text size and offsets
//! in world space with the current text
//! attributes and returns TRUE if the driver is enabled
//! to get the right size (WindowDriver ONLY!).
//! 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.
//! Warning : SetTextAttrib(...) must be call before.
//! Category: Convert methods
Standard_EXPORT Standard_Boolean GetTextSize(const TCollection_ExtendedString& aText,Standard_ShortReal& aWidth,Standard_ShortReal& aHeight,Standard_ShortReal& anXoffset,Standard_ShortReal& anYoffset) const; //! Get font height,baseline height and slant
//! in world space with the current text
//! attributes and returns TRUE if the driver is enabled
//! to get the right size (WindowDriver ONLY!).
//! Warning : SetTextAttrib(...) must be call before.
//! Category: Convert methods
Standard_EXPORT Standard_Boolean GetFontSize(Standard_ShortReal& aHeight,Standard_ShortReal& aBheight,Standard_ShortReal& aSlant) const; //! Get image size in world space
//! and returns TRUE if the driver is enabled
//! to get the right size (WindowDriver ONLY!).
Standard_EXPORT Standard_Boolean GetImageSize(const Standard_CString aFileName,Standard_ShortReal& aWidth,Standard_ShortReal& aHeight) const; //! Get image size in pixel space
//! and returns TRUE if the driver is enabled
//! to get the right size (WindowDriver ONLY!).
Standard_EXPORT Standard_Boolean GetImageSize(const Standard_CString aFileName,Standard_Integer& aWidth,Standard_Integer& aHeight) const; Standard_EXPORT void UnMapFromTo(const Standard_ShortReal x1,const Standard_ShortReal y1,Standard_ShortReal& x2,Standard_ShortReal& y2) const; Standard_EXPORT Standard_ShortReal Convert(const Standard_ShortReal aValue) const; Standard_EXPORT Standard_ShortReal Convert(const Standard_Integer aValue) const; Standard_EXPORT Standard_ShortReal ConvertMapToFrom(const Standard_ShortReal x) const; Standard_EXPORT Standard_ShortReal Scale() const; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawSegment(const Standard_ShortReal x1,const Standard_ShortReal y1,const Standard_ShortReal x2,const Standard_ShortReal y2) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawPolyline(const Standard_Real aDeltaX,const Standard_Real aDeltaY,const TShort_Array1OfShortReal& aListX,const TShort_Array1OfShortReal& aListY) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawPolygon(const Standard_Real aDeltaX,const Standard_Real aDeltaY,const TShort_Array1OfShortReal& aListX,const TShort_Array1OfShortReal& aListY) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawArc(const Standard_Real aDeltaX,const Standard_Real aDeltaY,const Standard_ShortReal aRadius,const Standard_ShortReal angle1,const Standard_ShortReal angle2) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawPolyArc(const Standard_Real aDeltaX,const Standard_Real aDeltaY,const Standard_ShortReal aRadius,const Standard_ShortReal angle1,const Standard_ShortReal angle2) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawInfiniteLine(const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal dx,const Standard_ShortReal dy) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawMarker(const Standard_Integer anindex,const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal awidth,const Standard_ShortReal anheight,const Standard_ShortReal angle) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawText(const TCollection_ExtendedString& aText,const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal angle,const Aspect_TypeOfText aType) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawPolyText(const TCollection_ExtendedString& aText,const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal angle,const Standard_ShortReal margin,const Aspect_TypeOfText aType) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void DrawFramedText(const TCollection_ExtendedString& aText,const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal angle,const Standard_ShortReal margin,const Aspect_TypeOfText aType) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapInfiniteLineFromTo(const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal dx,const Standard_ShortReal dy) ; //! RRaises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT virtual void MapSegmentFromTo(const Standard_ShortReal x1,const Standard_ShortReal y1,const Standard_ShortReal x2,const Standard_ShortReal y2,const Standard_Integer aMode = 0) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapMarkerFromTo(const Standard_Integer anindex,const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal awidth,const Standard_ShortReal anheight,const Standard_ShortReal angle,const Standard_Integer aMode = 0) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapMarkersFromTo(const Standard_Integer index,const Handle(TShort_HArray1OfShortReal)& x,const Handle(TShort_HArray1OfShortReal)& y,const Standard_ShortReal awidth,const Standard_ShortReal anheight,const Standard_ShortReal angle,const Standard_Integer aMode = 0) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapPolylineFromTo(const TShort_Array1OfShortReal& aListX,const TShort_Array1OfShortReal& aListY,const Standard_Integer aNumber = 0) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapPolylineFromTo(const Standard_ShortReal x,const Standard_ShortReal y,const Standard_Integer aMode = 0) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapPolygonFromTo(const TShort_Array1OfShortReal& aListX,const TShort_Array1OfShortReal& aListY,const Standard_Integer aNumber = 0) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapPolygonFromTo(const Standard_ShortReal x,const Standard_ShortReal y,const Standard_Integer aMode = 0) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT virtual void MapTextFromTo(const TCollection_ExtendedString& aText,const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal angle,const Standard_ShortReal aDeltax,const Standard_ShortReal aDeltay,const Aspect_TypeOfText aType) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapPolyTextFromTo(const TCollection_ExtendedString& aText,const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal angle,const Standard_ShortReal margin,const Standard_ShortReal aDeltax,const Standard_ShortReal aDeltay,const Aspect_TypeOfText aType) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapFramedTextFromTo(const TCollection_ExtendedString& aText,const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal angle,const Standard_ShortReal margin,const Standard_ShortReal aDeltax,const Standard_ShortReal aDeltay,const Aspect_TypeOfText aType) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT virtual void MapArcFromTo(const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal aRadius,const Standard_ShortReal angle1,const Standard_ShortReal angle2,const Standard_Integer aMode = 0) ; //! Raises DrawerDefinitionError if the
//! associated driver is not defined.
Standard_EXPORT void MapPolyArcFromTo(const Standard_ShortReal x,const Standard_ShortReal y,const Standard_ShortReal aRadius,const Standard_ShortReal angle1,const Standard_ShortReal angle2,const Standard_Integer aMode = 0) ; //! Sets the clipping flag with value.
Standard_EXPORT void SetRejection(const Standard_Boolean aClipFlag) ; //! Returns Standard_True if the given min max intersects
//! with the drawer space.
//! Called by the method Draw of a primitive.
//! IsIn permits the rejection of the primitive only
//! if the Clipping flag is TRUE.
//! When the Clipping flag is FALSE,this method returns
//! always TRUE.
Standard_EXPORT Standard_Boolean IsIn(const Standard_ShortReal aMinX,const Standard_ShortReal aMaxX,const Standard_ShortReal aMinY,const Standard_ShortReal aMaxY) const; DEFINE_STANDARD_RTTI(Graphic2d_Drawer) protected: Standard_ShortReal myDrawPrecision; Standard_Real myDeflectionCoefficient; Aspect_TypeOfDeflection myTypeOfDeflection; Standard_ShortReal mySpaceWidth; Standard_ShortReal mySpaceHeight; Aspect_DriverPtr myDriver; Standard_Boolean myDriverIsDefined; Aspect_WindowDriverPtr myWDriver; PlotMgt_PlotterDriverPtr myPDriver; Standard_Boolean myMinMaxIsActivated; Standard_ShortReal myMinX; Standard_ShortReal myMinY; Standard_ShortReal myMaxX; Standard_ShortReal myMaxY; Standard_Boolean myClippingIsActivated; private: Standard_ShortReal myXF; Standard_ShortReal myYF; Standard_ShortReal mySF; Standard_ShortReal myXT; Standard_ShortReal myYT; Standard_ShortReal myST; Standard_ShortReal myZF; Standard_ShortReal myTextPrecision; Standard_Integer myOverrideColor; Standard_Boolean myOverride; Standard_Integer myOffSet; }; // other Inline functions and methods (like "C++: function call" methods) #endif