// 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_TransientManager_HeaderFile #define _Graphic2d_TransientManager_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_DefineHandle_HeaderFile #include #endif #ifndef _Handle_Graphic2d_TransientManager_HeaderFile #include #endif #ifndef _Graphic2d_ViewPtr_HeaderFile #include #endif #ifndef _gp_GTrsf2d_HeaderFile #include #endif #ifndef _Graphic2d_TypeOfComposition_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Aspect_TypeOfPrimitive_HeaderFile #include #endif #ifndef _Graphic2d_Drawer_HeaderFile #include #endif #ifndef _Handle_Graphic2d_View_HeaderFile #include #endif #ifndef _Handle_Aspect_WindowDriver_HeaderFile #include #endif #ifndef _Handle_Graphic2d_ViewMapping_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Primitive_HeaderFile #include #endif #ifndef _Handle_Graphic2d_GraphicObject_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _Quantity_Length_HeaderFile #include #endif #ifndef _Quantity_PlaneAngle_HeaderFile #include #endif #ifndef _Aspect_TypeOfText_HeaderFile #include #endif #ifndef _Graphic2d_TypeOfAlignment_HeaderFile #include #endif #ifndef _Quantity_Ratio_HeaderFile #include #endif #ifndef _Quantity_Factor_HeaderFile #include #endif class Graphic2d_TransientDefinitionError; class Graphic2d_View; class Aspect_WindowDriver; class Graphic2d_ViewMapping; class Graphic2d_Primitive; class Graphic2d_GraphicObject; class TCollection_ExtendedString; class gp_GTrsf2d; //! This class allows to manage transient graphics
//! above one View.
//! A simple way to drawn something very quicly above
//! a complex scene (Hilighting,Sketching,...)
//! All transient graphics will be erased at the
//! next View::Update(),Redraw().
class Graphic2d_TransientManager : public Graphic2d_Drawer { public: Standard_EXPORT Graphic2d_TransientManager(const Handle(Graphic2d_View)& aView); //! Creates a TransientManager associated to the view
Standard_EXPORT Graphic2d_TransientManager(const Graphic2d_ViewPtr& aView); //! Suppress the TransientManager .
Standard_EXPORT void Destroy() ; ~Graphic2d_TransientManager() { Destroy(); } //! Begins any graphics in the view and Driver
//! with the current view attributes in a transient area.
//! Restore the front buffer from the back before
//! if is TRUE.
//!
//! Warning: Returns TRUE if transient backing-store is enabled in
//! the associated view.
//! Returns FALSE ,if nothing works because something
//! is wrong for the transient principle :
//! Immediat mode is not implemented depending of the
//! graphic library used.
//! MBX,PIXMAP double buffering don't works depending of
//! the graphic board and the visual of the window supporting
//! the view.
Standard_EXPORT Standard_Boolean BeginDraw(const Handle(Aspect_WindowDriver)& aDriver,const Standard_Boolean ClearBefore = Standard_True) ; //! Begins any graphics in the view and Driver
//! with the view attributes in a transient area defined
//! by :
//! defines the "map from".
//! , , define the "map to".
//! Restore the front buffer from the back before
//! if is TRUE.
Standard_EXPORT Standard_Boolean BeginDraw(const Handle(Aspect_WindowDriver)& aDriver,const Handle(Graphic2d_ViewMapping)& aViewMapping,const Standard_Real aXPosition,const Standard_Real aYPosition,const Standard_Real aScale,const Standard_Boolean ClearBefore = Standard_True) ; //! Flush all graphics to the front buffer.
//! Synchronize graphics to the screen if is
//! TRUE (make becarefull to the performances!).
Standard_EXPORT void EndDraw(const Standard_Boolean Synchronize = Standard_True) ; //! Restore the full transient view,
//! returns TRUE if the transient area has been restored
//! correctly or FALSE if the view has been redrawn.
Standard_EXPORT Standard_Boolean Restore(const Handle(Aspect_WindowDriver)& aDriver) ; //! Restore the last updated transient area,
//! returns TRUE if the transient area has been restored
//! correctly or FALSE if the view has been redrawn.
Standard_EXPORT Standard_Boolean RestoreArea(const Handle(Aspect_WindowDriver)& aDriver) ; //! Drawn the primitive ,
//! with the internal primitive attributes.
Standard_EXPORT void Draw(const Handle(Graphic2d_Primitive)& aPrimitive) ; //! Drawn the graphic object .
//! with the internal graphic object primitives attributes.
Standard_EXPORT void Draw(const Handle(Graphic2d_GraphicObject)& aGraphicObject) ; //! Drawn the element from the primitive ,
//! with the internal primitive attributes.
Standard_EXPORT void DrawElement(const Handle(Graphic2d_Primitive)& aPrimitive,const Standard_Integer anIndex) ; //! Draws all picked elements.
Standard_EXPORT void DrawPickedElements(const Handle(Graphic2d_Primitive)& aPrimitive) ; //! Drawn the vertex from the primitive ,
//! with the internal primitive attributes.
Standard_EXPORT void DrawVertex(const Handle(Graphic2d_Primitive)& aPrimitive,const Standard_Integer anIndex) ; //! Sets the current type of primitive to be opened.
//! After this call, is ready to receive
//! a definition of an incremental primitive
//! such as a polyline or polygon with DrawPoint(),
//! or the definition of a set of primitives such as
//! a segment with DrawSegment() or DrawMarker().
//! Warning: The max number of element of the primitive can be defined
//! with for optimization.
//! Example: This sequence drawn a polyline square of size 1.
//! myTransientManager->BeginDraw(myDriver)
//! myTransientManager->BeginPrimitive(Aspect_TOP_POLYLINE,5)
//! myTransientManager->DrawPoint(-0.5,-0.5)
//! myTransientManager->DrawPoint(-0.5, 0.5)
//! myTransientManager->DrawPoint( 0.5, 0.5)
//! myTransientManager->DrawPoint( 0.5,-0.5)
//! myTransientManager->DrawPoint(-0.5,-0.5)
//! myTransientManager->ClosePrimitive()
//! myTransientManager->EndDraw()
Standard_EXPORT void BeginPrimitive(const Aspect_TypeOfPrimitive aType,const Standard_Integer aSize = 0) ; //! After this call, stops the reception of
//! a definition of a Begin... primitive.
Standard_EXPORT void ClosePrimitive() ; //! Draw a segment.
Standard_EXPORT void DrawSegment(const Quantity_Length X1,const Quantity_Length Y1,const Quantity_Length X2,const Quantity_Length Y2) ; //! Draw an infinite line defined by a reference point
//! and a slope
Standard_EXPORT void DrawInfiniteLine(const Quantity_Length X,const Quantity_Length Y,const Quantity_Length Dx,const Quantity_Length Dy) ; //! Draw a circle arc from the start angle
//! to the ending angle .
//! NOTE that if is equal to
//! a full circle is drawn.
Standard_EXPORT void DrawArc(const Quantity_Length Xc,const Quantity_Length Yc,const Quantity_Length aRadius,const Quantity_PlaneAngle anAngle1 = 0.0,const Quantity_PlaneAngle anAngle2 = 0.0) ; //! Draw a filled circle arc from the start angle
//! to the ending angle .
//! NOTE that if is equal to
//! a full circle is drawn.
Standard_EXPORT void DrawPolyArc(const Quantity_Length Xc,const Quantity_Length Yc,const Quantity_Length aRadius,const Quantity_PlaneAngle anAngle1 = 0.0,const Quantity_PlaneAngle anAngle2 = 0.0) ; //! Draw a marker point.
Standard_EXPORT void DrawPoint(const Quantity_Length X,const Quantity_Length Y) ; //! Draw an indexed marker.
Standard_EXPORT void DrawMarker(const Standard_Integer anIndex,const Quantity_Length X,const Quantity_Length Y,const Quantity_Length aWidth,const Quantity_Length anHeight,const Quantity_PlaneAngle anAngle = 0.0) ; //! Draw a text at the position added to
//! the untransformed drawer offset ,
//! with an orientation and a type .
Standard_EXPORT void DrawText(const TCollection_ExtendedString& aText,const Quantity_Length X,const Quantity_Length Y,const Quantity_PlaneAngle anAngle = 0.0,const Standard_Real aDeltaX = 0.0,const Standard_Real aDeltaY = 0.0,const Aspect_TypeOfText aType = Aspect_TOT_SOLID,const Graphic2d_TypeOfAlignment anAlignment = Graphic2d_TOA_LEFT) ; //! Draw an hiding text at the position added to
//! the untransformed offset ,
//! with an orientation and a type .
//! defined the relative margin factor between
//! the text string and the frame height.
Standard_EXPORT void DrawPolyText(const TCollection_ExtendedString& aText,const Quantity_Length X,const Quantity_Length Y,const Quantity_PlaneAngle anAngle = 0.0,const Quantity_Ratio aMargin = 0.1,const Standard_Real aDeltaX = 0.0,const Standard_Real aDeltaY = 0.0,const Aspect_TypeOfText aType = Aspect_TOT_SOLID,const Graphic2d_TypeOfAlignment anAlignment = Graphic2d_TOA_LEFT) ; //! Draw a framed text at the position added to
//! the untransformed offset ,
//! with an orientation and a type .
//! defined the relative margin factor between
//! the text string and the frame height.
//! Draw a curve.
//! raises TransientDefinitionError from Graphic2d is static;
Standard_EXPORT void DrawFramedText(const TCollection_ExtendedString& aText,const Quantity_Length X,const Quantity_Length Y,const Quantity_PlaneAngle anAngle = 0.0,const Quantity_Ratio aMargin = 0.1,const Standard_Real aDeltaX = 0.0,const Standard_Real aDeltaY = 0.0,const Aspect_TypeOfText aType = Aspect_TOT_SOLID,const Graphic2d_TypeOfAlignment anAlignment = Graphic2d_TOA_LEFT) ; //! Methods to define the Current Text Attributes
//! NOTE that ,if isZoomable is TRUE the text size follow
//! the scale factor of the view and the current transformation
//! scale factor.
Standard_EXPORT void SetTextAttrib(const Standard_Integer ColorIndex,const Standard_Integer FontIndex,const Quantity_PlaneAngle aSlant = 0.0,const Quantity_Factor aHScale = 1.0,const Quantity_Factor aWScale = 1.0,const Standard_Boolean isUnderlined = Standard_False,const Standard_Boolean isZoomable = Standard_True) ; //! Methods to define the Current Hiding Text Attributes
//! NOTE that ,if isZoomable is TRUE the text size follow
//! the scale factor of the view and the current transformation
//! scale factor.
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 Quantity_PlaneAngle aSlant = 0.0,const Quantity_Factor aHScale = 1.0,const Quantity_Factor aWScale = 1.0,const Standard_Boolean isUnderlined = Standard_False,const Standard_Boolean isZoomable = Standard_True) ; //! Methods to define the Current Framed Text Attributes
//! NOTE that ,if isZoomable is TRUE the text size follow
//! the scale factor of the view and the current transformation
//! scale factor.
Standard_EXPORT void SetFramedTextAttrib(const Standard_Integer ColorIndex,const Standard_Integer FrameColorIndex,const Standard_Integer FrameWidthIndex,const Standard_Integer FontIndex,const Quantity_PlaneAngle aSlant = 0.0,const Quantity_Factor aHScale = 1.0,const Quantity_Factor aWScale = 1.0,const Standard_Boolean isUnderlined = Standard_False,const Standard_Boolean isZoomable = Standard_True) ; //! Sets the current transformation applied to
//! the primitives.
Standard_EXPORT void SetTransform(const gp_GTrsf2d& aTrsf,const Graphic2d_TypeOfComposition aType = Graphic2d_TOC_REPLACE) ; //! Enable/Disable the mapping conversion between
//! the view and the driver system coordinates.
Standard_EXPORT void SetMapping(const Standard_Boolean aStatus = Standard_True) ; //! Returns the world coordinates of the boundary box
//! of the Transient graphics actually drawn
//! since BeginDraw() has been call.
//! Warning: If nothing has been drawn then :
//! XMin = YMin = RealFirst ().
//! XMax = YMax = RealLast ().
//! and returns a min-max status to FALSE;
Standard_EXPORT Standard_Boolean MinMax(Quantity_Length& XMin,Quantity_Length& YMin,Quantity_Length& XMax,Quantity_Length& YMax) const; //! Returns the current transformation.
Standard_EXPORT gp_GTrsf2d Transform() const; DEFINE_STANDARD_RTTI(Graphic2d_TransientManager) protected: private: //! Redraw the view.
Standard_EXPORT void Redraw(const Handle(Aspect_WindowDriver)& aDriver) ; //! Enable/Disable the min-max computation.
//! and reset the boundary-box if is TRUE.
Standard_EXPORT void EnableMinMax(const Standard_Boolean aStatus = Standard_True,const Standard_Boolean Reset = Standard_True) ; //! Returns TRUE if the returned pixel space min max
//! boundary box has been computed correctly arround
//! all the primitives drawn in the driver.
//! Warning: the boundary box size cannot be greater that
//! the associated window space size.
//! Returns FALSE if the min-max boundary box is NULL.
Standard_EXPORT Standard_Boolean MinMax(Standard_Integer& aMinX,Standard_Integer& aMaxX,Standard_Integer& aMinY,Standard_Integer& aMaxY) const; Graphic2d_ViewPtr myPView; gp_GTrsf2d myTrsf; gp_GTrsf2d myCompositeTrsf; Graphic2d_TypeOfComposition myTypeOfComposition; Standard_Boolean myDrawingIsStarted; Standard_Boolean myTrsfIsDefined; Standard_Boolean myMappingIsEnable; Aspect_TypeOfPrimitive myTypeOfPrimitive; }; // other Inline functions and methods (like "C++: function call" methods) #endif