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

Creates a 2D graphic object in a view.
A graphic object is a primitives manager.

#include <Graphic2d_GraphicObject.hxx>

Inheritance diagram for Graphic2d_GraphicObject:
Inheritance graph
[legend]

Public Member Functions

 Graphic2d_GraphicObject ()
 Creates an unattached graphic object,
the attachment will be realized more later
using the method SetView().

 Graphic2d_GraphicObject (const Handle< Graphic2d_View > &aView)
 Creates a graphic object in the view <aView>.
A graphic object manages a sequence of primitives.
By default a graphic object is :

void SetView (const Handle< Graphic2d_View > &aView)
 Attach the graphic object to this view

void SetTransform (const gp_GTrsf2d &aTrsf, const Graphic2d_TypeOfComposition aType=Graphic2d_TOC_REPLACE)
 Sets the transformation <aTrsf> applied to
the primitives according to the composition type.

const gp_GTrsf2dTransform () const
 Returns the transformation applied to
the primitives.

Standard_Boolean IsTransformed () const
 Returns Standard_True if the associated
transformation is not the Identity.

void SetLayer (const Standard_Integer aLayer)
 Modifies the layer of the graphic object <me>.

Standard_Integer Layer () const
 Returns the layer of the graphic object <me>.

void SetPriority (const Standard_Integer aPriority)
 Modifies the drawing priority of the graphic object <me>.
<aPriority> of 0 is the lowest priority.
<aPriority> of MaxPriority() is the highest priority.

Standard_Integer Priority () const
 Returns the drawing priority of the graphic object

virtual Standard_Integer MaxPriority () const
 Returns the max usable relative priority of the
"standard" graphic object.

void EnablePlot ()
 Allows the drawing of graphic object <me> on a plotter.

void DisablePlot ()
 Forbids the drawing of graphic object <me> on a plotter.

Standard_Boolean IsPlottable () const
 Returns Standard_True if the graphic object <me>
is plottable, Standard_False if not.

void EnableDraw ()
 Allows the drawing of graphic object <me>.

void DisableDraw ()
 Forbids the drawing of graphic object <me>.

Standard_Boolean IsDrawable () const
 Returns Standard_True if the graphic object <me>
is drawable, Standard_False if not.

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

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

void RemovePrimitives ()
 Removes all the primitives from <me>.

void Remove ()
 Removes <me> from the associated view.
If <me> was displayed or highlighted, <me>
is removed from the display list of the associated view.

void EnablePick ()
 Allows the picking on the graphic object <me>.

void DisablePick ()
 Forbids the picking on the graphic object <me>.

Standard_Boolean IsPickable () const
 Returns Standard_True if the graphic object <me>
is pickable, Standard_False if not.

void Display ()
 Allows the drawing of the graphic object <me>.

void Erase ()
 Forbids the drawing of the graphic object <me>.

Standard_Boolean IsDisplayed () const
 Returns Standard_True if the graphic object <me>
is displayed, Standard_False if not.

void Highlight ()
 Highlights the graphic object <me> with the
override color of the view.

void Highlight (const Standard_Integer aColorIndex)
 Highlights the graphic object <me> with the
specified color.

void Unhighlight ()
 Suppress the highlight the graphic object <me>.

Standard_Boolean IsHighlighted () const
 Returns Standard_True if the graphic object <me>
is highlighted, Standard_False if not.

void SetOffSet (const Standard_Integer anOffSet)
 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 you have to call this method with <anOffSet> = 0.

Standard_Integer OffSet () const
 Returns the offset applied to the original color
index of all primitives in the graphic object <me>.

Standard_Integer OverrideColor () const
 Returns the current overridel color apply to
this graphic object.

void SetOverrideColor (const Standard_Integer indColor)
 Sets the current overridel color apply to
this graphic object.

Standard_Integer Length () const
 Returns the number of primitive of the graphic object.

Handle_Graphic2d_Primitive Primitive (const Standard_Integer aRank) const
 Returns the primitive of rank <aRank>

virtual Standard_Boolean MinMax (Quantity_Length &Minx, Quantity_Length &Maxx, Quantity_Length &Miny, Quantity_Length &Maxy) const
 Returns the min max values of <me>.
Warning: All markers are ignored.
Warning: If <me> is empty or not displayed or
contains markers and nothing else
returns FALSE and
Minx = Miny = RealFirst ()
Maxx = Maxy = RealLast ()

virtual Standard_Boolean MarkerMinMax (Quantity_Length &Minx, Quantity_Length &Maxx, Quantity_Length &Miny, Quantity_Length &Maxy) const
 Returns the min max values of all markers in <me>.
Warning: If <me> is empty or not displayed or without markers
returns FALSE and
Minx = Miny = RealFirst ()
Maxx = Maxy = RealLast ()

Standard_Integer PickedIndex () const
 Returns the last picked primitive index in this.
Warning: This is available only if the Pick() method has
returned Standard_True.

Handle_TColStd_HSequenceOfInteger PickList () const
 Returns the sequence of picked primitives.

Protected Member Functions

void SetPickedIndex (const Standard_Integer anIndex)
 Sets the index of the picked primitive if any.

virtual void Draw (const Handle< Graphic2d_Drawer > &aDrawer, const Standard_Boolean Reset)
 Drawn the last Undrawn primitives managed by the
graphic object <me> in the drawer <aDrawer>.
Called by the methods :

virtual void Draw (const Handle< Graphic2d_Drawer > &aDrawer, const Handle< Graphic2d_Primitive > &aPrimitive)
 Drawn a primitive managed by the
graphic object <me> in the drawer <aDrawer>.
Called by the method Graphic2d_View::Update (aPrimitive)

virtual Standard_Boolean Pick (const Standard_Real X, const Standard_Real Y, const Standard_Real aPrecision, const Handle< Graphic2d_Drawer > &aDrawer)
 Returns Standard_True if the graphic object <me>
is picked, Standard_False if not.
Called by the method Graphic2d_View::Pick

virtual Standard_Boolean PickByCircle (const Standard_Real X, const Standard_Real Y, const Standard_Real Radius, const Handle< Graphic2d_Drawer > &aDrawer)
 Returns Standard_True if the graphic object <me>
is picked, Standard_False if not.
Called by the method Graphic2d_View::PickByCircle

virtual Standard_Boolean Pick (const Standard_Real Xmin, const Standard_Real Ymin, const Standard_Real Xmax, const Standard_Real Ymax, const Handle< Graphic2d_Drawer > &aDrawer, const Graphic2d_PickMode aPickMode=Graphic2d_PM_INCLUDE)
 Returns Standard_True if the primitive <me> is:
included in rectangle (<aPickMode = PM_INCLUDE>),
excluded from rectangle (<aPickMode = PM_EXLUDE>),
intersected by rectangle (<aPickMode = PM_INTERSECT>),
defined by Xmin, Ymin, Xmax, Ymax.
Standard_False if not.

Standard_Boolean IsUpToDate () const
 Returns TRUE when the graphic object is
up to date at screen;

Protected Attributes

Standard_Integer myOverrideColor
Standard_Integer myCurrentIndex
Standard_Integer myOffSet
Standard_Boolean myIsUpToDate
Standard_Boolean myIsTransformed

Constructor & Destructor Documentation

  • empty.
  • plottable.
  • drawable.
  • pickable.
  • not displayed.
  • not highlighted.
  • a relative drawing priority of 0

Member Function Documentation

virtual void Graphic2d_GraphicObject::Draw ( const Handle< Graphic2d_Drawer > &  aDrawer,
const Standard_Boolean  Reset 
) [protected, virtual]
virtual void Graphic2d_GraphicObject::Draw ( const Handle< Graphic2d_Drawer > &  aDrawer,
const Handle< Graphic2d_Primitive > &  aPrimitive 
) [protected, virtual]
virtual Standard_Boolean Graphic2d_GraphicObject::MarkerMinMax ( Quantity_Length Minx,
Quantity_Length Maxx,
Quantity_Length Miny,
Quantity_Length Maxy 
) const [virtual]
virtual Standard_Boolean Graphic2d_GraphicObject::MinMax ( Quantity_Length Minx,
Quantity_Length Maxx,
Quantity_Length Miny,
Quantity_Length Maxy 
) const [virtual]

Reimplemented in Graphic2d_HidingGraphicObject.

virtual Standard_Boolean Graphic2d_GraphicObject::Pick ( const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  aPrecision,
const Handle< Graphic2d_Drawer > &  aDrawer 
) [protected, virtual]
Handle_TColStd_HSequenceOfInteger Graphic2d_GraphicObject::PickList ( ) const
Handle_Graphic2d_Primitive Graphic2d_GraphicObject::Primitive ( const Standard_Integer  aRank) const

Field Documentation


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