Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
Graphic2d_Buffer Class Reference

This class constructs a 2D graphic buffer in a view. It
manages a set of graphic objects and/or primitives.
To draw the buffer, the following elements are required:
More...

#include <Graphic2d_Buffer.hxx>

Inheritance diagram for Graphic2d_Buffer:
Inheritance graph
[legend]

Public Member Functions

 Graphic2d_Buffer (const Handle< Graphic2d_View > &aView, const Quantity_Length aPivotX, const Quantity_Length aPivotY, const Standard_Integer aWidthIndex=0, const Standard_Integer aColorIndex=0, const Standard_Integer aFontIndex=0, const Aspect_TypeOfDrawMode aDrawMode=Aspect_TODM_REPLACE)
 Creates an empty graphic buffer in the view <aView>.
A graphic buffer manages a set of graphic objects
and/or primitives.
A buffer color and font index can be defined,
in place of the default overrideColor or systemFont.
When the drawmode is REPLACE the buffer is drawn with
the right color and background drawing is used for
restoring it at Erase() time.
When the drawmode is XOR the buffer is drawn or erase
with an optimal color depending of the background color
but some side effects can appears depending of
background drawing pixels values.

void Destroy ()
 Deletes the graphic buffer <me>.

 ~Graphic2d_Buffer ()
void Add (const Handle< Graphic2d_GraphicObject > &anObject)
 Adds the graphic object <anObject> in the graphic
buffer <me>.

void Add (const Handle< Graphic2d_Primitive > &aPrimitive)
 Adds the primitive <aPrimitive> in the graphic
buffer <me>.

void Remove (const Handle< Graphic2d_GraphicObject > &anObject)
 Removes the object <anObject> from the graphic
buffer <me>.

void Remove (const Handle< Graphic2d_Primitive > &aPrimitive)
 Removes the primitive <aPrimitive> from the graphic
buffer <me>.

void Clear ()
 Clears the graphic buffer <me>.
Removes all the primitives from the graphic buffer <me>.

void SetAttrib (const Standard_Integer aWidthIndex, const Standard_Integer aColorIndex, const Standard_Integer aFontIndex, const Aspect_TypeOfDrawMode aDrawMode)
 Updates the default buffer color with a new
color index defines in the user ColorMap.
Update the default buffer font with a new
font index defines in the user FontMap.
Update the default buffer drawmode with
REPLACE or XOR .
You can specify the width index

void SetPivot (const Quantity_Length aPivotX, const Quantity_Length aPivotY)
 
  Updates the buffer pivot position. <br>

Warning: The buffer is redisplayed again if it was posted.

void SetPivot ()
 Updates the buffer pivot position with the actual position.

void Move (const Quantity_Length aDeltaX, const Quantity_Length aDeltaY)
 Moves the graphic buffer <me> at the specified
position. The new position of the buffer is :
(<aPivotX> + <aDeltaX>, <aPivotY> + <aDeltaY>)

void Rotate (const Quantity_PlaneAngle anAngle)
 Rotates the graphic buffer <me> with the specified
absolute counter clockwise angle from the pivot X axis.

void Scale (const Quantity_Factor aFactor)
 Scales the graphic buffer <me> with the specified
absolute scale factor from the pivot point.

Handle_Graphic2d_View View () const
 Returns the view which manages the graphic buffer <me>.

Standard_Boolean IsEmpty () const
 Returns Standard_True if the graphic buffer <me>
is empty, Standard_False if not.

Standard_Boolean IsIn (const Handle< Graphic2d_Primitive > &aPrimitive) const
 Returns Standard_True if the primitive <aPrimitive>
is in the graphic buffer <me>, Standard_False if not.

Standard_Boolean IsIn (const Handle< Graphic2d_GraphicObject > &anObject) const
 Returns Standard_True if the graphic object <anObject>
is in the graphic buffer <me>, Standard_False if not.

void Post ()
 
   Post the graphic buffer in the current View driver <br>

and display it.
Warning: The view driver must be defined and of type WindowDriver
or nothing is drawn .

void Post (const Handle< Aspect_WindowDriver > &aDriver, const Handle< Graphic2d_ViewMapping > &aViewMapping, const Standard_Real aXPosition, const Standard_Real aYPosition, const Standard_Real aScale)
 Post the graphic buffer in a View driver and display it.

void UnPost ()
 Unpost the graphic buffer from the view and erase it.

Standard_Boolean IsPosted () const
 Returns Standard_True if the graphic buffer <me>
is posted in the view, Standard_False if not.

Quantity_PlaneAngle Angle () const
 Returns the value of the rotation angle of the
graphic buffer <me>.

Quantity_Factor Scale () const
 Returns the value of the scale factor of the
graphic buffer <me>.

Quantity_Length Xpivot () const
 Returns the actual value of the X pivot point.
of the graphic buffer <me>.

Quantity_Length Ypivot () const
 Returns the actual value of the Y pivot point.
of the graphic buffer <me>.


Detailed Description


Constructor & Destructor Documentation


Member Function Documentation

void Graphic2d_Buffer::Post ( const Handle< Aspect_WindowDriver > &  aDriver,
const Handle< Graphic2d_ViewMapping > &  aViewMapping,
const Standard_Real  aXPosition,
const Standard_Real  aYPosition,
const Standard_Real  aScale 
)
          - -1 draw all lines with the largest width <br>
            defined in the buffer <me> <br>
          - 0 draw all lines with the default width <br>
            defined in the driver (1 pixel) <br>
          - draw all lines with the specified width <br>
            <aWidthIndex> <br>
          You can specify the color index <br>
          - -1 draw all primitives with the color of <br>
            the first primitive color defined in the buffer. <br>
          - 0 draw all primitives with the default color. <br>
          You can specify the font index <br>
          - -1 draw all text primitives with the font of <br>
            the first primitive text defined in the buffer. <br>
          - 0 draw all text primitives with the default font. <br>

Warning: The buffer is redisplayed again if it was posted.

Handle_Graphic2d_View Graphic2d_Buffer::View ( ) const

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