OCC Main Page | Visualization | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Visualization
TKV2d
Graphic2d


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

Standard_EXPORT Graphic2d_GraphicObject ()
 Creates an unattached graphic object,
the attachment will be realized more later
using the method SetView().
.
Standard_EXPORT 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 :
- empty.
- plottable.
- drawable.
- pickable.
- not displayed.
- not highlighted.
- a relative drawing priority of 0
.
Standard_EXPORT void SetView (const Handle(Graphic2d_View)&aView)
 Attach the graphic object to this view
.
Standard_EXPORT 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.
.
Standard_EXPORT const gp_GTrsf2d & Transform () const
 Returns the transformation applied to
the primitives.
.
Standard_EXPORT Standard_Boolean IsTransformed () const
 Returns Standard_True if the associated
transformation is not the Identity.
.
Standard_EXPORT void SetLayer (const Standard_Integer aLayer)
 Modifies the layer of the graphic object <me>.
.
Standard_EXPORT Standard_Integer Layer () const
 Returns the layer of the graphic object <me>.
.
Standard_EXPORT 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_EXPORT Standard_Integer Priority () const
 Returns the drawing priority of the graphic object
.
virtual Standard_EXPORT Standard_Integer MaxPriority () const
 Returns the max usable relative priority of the
"standard" graphic object.
.
Standard_EXPORT void EnablePlot ()
 Allows the drawing of graphic object <me> on a plotter.
.
Standard_EXPORT void DisablePlot ()
 Forbids the drawing of graphic object <me> on a plotter.
.
Standard_EXPORT Standard_Boolean IsPlottable () const
 Returns Standard_True if the graphic object <me>
is plottable, Standard_False if not.
.
Standard_EXPORT void EnableDraw ()
 Allows the drawing of graphic object <me>.
.
Standard_EXPORT void DisableDraw ()
 Forbids the drawing of graphic object <me>.
.
Standard_EXPORT Standard_Boolean IsDrawable () const
 Returns Standard_True if the graphic object <me>
is drawable, Standard_False if not.
.
Standard_EXPORT 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.
.
Standard_EXPORT void RemovePrimitive (const Handle(Graphic2d_Primitive)&aPrimitive)
 Removes the primitive <aprimitive> from <me>.
.
Standard_EXPORT void RemovePrimitives ()
 Removes all the primitives from <me>.
.
Standard_EXPORT 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.
.
Standard_EXPORT void EnablePick ()
 Allows the picking on the graphic object <me>.
.
Standard_EXPORT void DisablePick ()
 Forbids the picking on the graphic object <me>.
.
Standard_EXPORT Standard_Boolean IsPickable () const
 Returns Standard_True if the graphic object <me>
is pickable, Standard_False if not.
.
Standard_EXPORT void Display ()
 Allows the drawing of the graphic object <me>.
.
Standard_EXPORT void Erase ()
 Forbids the drawing of the graphic object <me>.
.
Standard_EXPORT Standard_Boolean IsDisplayed () const
 Returns Standard_True if the graphic object <me>
is displayed, Standard_False if not.
.
Standard_EXPORT void Highlight ()
 Highlights the graphic object <me> with the
override color of the view.
.
Standard_EXPORT void Highlight (const Standard_Integer aColorIndex)
 Highlights the graphic object <me> with the
specified color.
.
Standard_EXPORT void Unhighlight ()
 Suppress the highlight the graphic object <me>.
.
Standard_EXPORT Standard_Boolean IsHighlighted () const
 Returns Standard_True if the graphic object <me>
is highlighted, Standard_False if not.
.
Standard_EXPORT 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_EXPORT Standard_Integer OffSet () const
 Returns the offset applied to the original color
index of all primitives in the graphic object <me>.
.
Standard_EXPORT Standard_Integer OverrideColor () const
 Returns the current overridel color apply to
this graphic object.
.
Standard_EXPORT void SetOverrideColor (const Standard_Integer indColor)
 Sets the current overridel color apply to
this graphic object.
.
Standard_EXPORT Standard_Integer Length () const
 Returns the number of primitive of the graphic object.
.
Standard_EXPORT Handle_Graphic2d_Primitive Primitive (const Standard_Integer aRank) const
 Returns the primitive of rank <arank>
.
virtual Standard_EXPORT 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_EXPORT 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_EXPORT 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.
.
Standard_EXPORT Handle_TColStd_HSequenceOfInteger PickList () const
 Returns the sequence of picked primitives.
.
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Protected Member Functions

Standard_EXPORT void SetPickedIndex (const Standard_Integer anIndex)
 Sets the index of the picked primitive if any.
.
virtual Standard_EXPORT 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 :
- Graphic2d_View::TinyUpdate ()
.
virtual Standard_EXPORT 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_EXPORT 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_EXPORT 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_EXPORT 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_EXPORT 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

Private Member Functions

Standard_EXPORT void Redraw (const Handle(Graphic2d_Drawer)&aDrawer)
 Drawn all the primitives managed by the
graphic object <me> in the drawer <adrawer>.
Called by the method :
- Graphic2d_View::Update (aViewMapping, x, y, scale)
.
Standard_EXPORT Handle_Graphic2d_View View () const
 Returns the view which manages <me>.
Called by the constructor of Primitive.
.
Standard_EXPORT void AddPrimitive (const Handle(Graphic2d_Primitive)&aPrimitive)
 Adds the primitive <aprimitive> in <me>.
Called by the constructor of Primitive.
.
Standard_EXPORT void SetIndex (const Handle(Graphic2d_Primitive)&aPrimitive)
 Sets the current index in the GraphicObject <me>
to the index of the primitive <aprimitive>.
.
virtual Standard_EXPORT Standard_Integer BasePriority () const
 Returns the min usable absolute priority of the
"standard" graphic object.
.

Private Attributes

Graphic2d_ViewPtr myViewPtr
TColStd_IndexedMapOfTransient myPrimitives
Standard_Integer myLayer
gp_GTrsf2d myTrsf
Graphic2d_CBitFields8 myCBitFields
Standard_Integer myPickedIndex
Standard_Integer myPriority
Handle_TColStd_HSequenceOfInteger myPickIndices
Graphic2d_DisplayStatus myDisplayStatus

Constructor & Destructor Documentation

Standard_EXPORT Graphic2d_GraphicObject::Graphic2d_GraphicObject  ) 
 

Standard_EXPORT Graphic2d_GraphicObject::Graphic2d_GraphicObject const Handle(Graphic2d_View)&  aView  ) 
 


Member Function Documentation

Standard_EXPORT void Graphic2d_GraphicObject::AddPrimitive const Handle(Graphic2d_Primitive)&  aPrimitive  )  [private]
 

virtual Standard_EXPORT Standard_Integer Graphic2d_GraphicObject::BasePriority  )  const [private, virtual]
 

Reimplemented in Graphic2d_HidingGraphicObject, and V2d_BackgroundGraphicObject.

Standard_EXPORT void Graphic2d_GraphicObject::DisableDraw  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::DisablePick  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::DisablePlot  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::Display  ) 
 

virtual Standard_EXPORT void Graphic2d_GraphicObject::Draw const Handle(Graphic2d_Drawer)&  aDrawer,
const Handle(Graphic2d_Primitive)&  aPrimitive
[protected, virtual]
 

Reimplemented in Graphic2d_HidingGraphicObject.

virtual Standard_EXPORT void Graphic2d_GraphicObject::Draw const Handle(Graphic2d_Drawer)&  aDrawer,
const Standard_Boolean  Reset
[protected, virtual]
 

Reimplemented in Graphic2d_HidingGraphicObject.

Standard_EXPORT void Graphic2d_GraphicObject::EnableDraw  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::EnablePick  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::EnablePlot  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::Erase  ) 
 

Standard_EXPORT const Graphic2d_GraphicObject::Handle Standard_Type   )  const
 

Reimplemented in AIS2D_InteractiveObject, AIS2D_ProjShape, Graphic2d_HidingGraphicObject, and V2d_BackgroundGraphicObject.

Standard_EXPORT void Graphic2d_GraphicObject::Highlight const Standard_Integer  aColorIndex  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::Highlight  ) 
 

Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::IsDisplayed  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::IsDrawable  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::IsHighlighted  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::IsIn const Handle(Graphic2d_Primitive)&  aPrimitive  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::IsPickable  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::IsPlottable  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::IsTransformed  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::IsUpToDate  )  const [protected]
 

Standard_EXPORT Standard_Integer Graphic2d_GraphicObject::Layer  )  const
 

Standard_EXPORT Standard_Integer Graphic2d_GraphicObject::Length  )  const
 

virtual Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::MarkerMinMax Quantity_Length &  Minx,
Quantity_Length &  Maxx,
Quantity_Length &  Miny,
Quantity_Length &  Maxy
const [virtual]
 

virtual Standard_EXPORT Standard_Integer Graphic2d_GraphicObject::MaxPriority  )  const [virtual]
 

Reimplemented in Graphic2d_HidingGraphicObject, and V2d_BackgroundGraphicObject.

virtual Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::MinMax Quantity_Length &  Minx,
Quantity_Length &  Maxx,
Quantity_Length &  Miny,
Quantity_Length &  Maxy
const [virtual]
 

Reimplemented in Graphic2d_HidingGraphicObject.

Standard_EXPORT Standard_Integer Graphic2d_GraphicObject::OffSet  )  const
 

Standard_EXPORT Standard_Integer Graphic2d_GraphicObject::OverrideColor  )  const
 

virtual Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::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
[protected, virtual]
 

virtual Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::Pick const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  aPrecision,
const Handle(Graphic2d_Drawer)&  aDrawer
[protected, virtual]
 

Reimplemented in Graphic2d_HidingGraphicObject.

virtual Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::PickByCircle const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  Radius,
const Handle(Graphic2d_Drawer)&  aDrawer
[protected, virtual]
 

Standard_EXPORT Standard_Integer Graphic2d_GraphicObject::PickedIndex  )  const
 

Standard_EXPORT Handle_TColStd_HSequenceOfInteger Graphic2d_GraphicObject::PickList  )  const
 

Standard_EXPORT Handle_Graphic2d_Primitive Graphic2d_GraphicObject::Primitive const Standard_Integer  aRank  )  const
 

Standard_EXPORT Standard_Integer Graphic2d_GraphicObject::Priority  )  const
 

Standard_EXPORT void Graphic2d_GraphicObject::Redraw const Handle(Graphic2d_Drawer)&  aDrawer  )  [private]
 

Standard_EXPORT void Graphic2d_GraphicObject::Remove  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::RemovePrimitive const Handle(Graphic2d_Primitive)&  aPrimitive  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::RemovePrimitives  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::SetIndex const Handle(Graphic2d_Primitive)&  aPrimitive  )  [private]
 

Standard_EXPORT void Graphic2d_GraphicObject::SetLayer const Standard_Integer  aLayer  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::SetOffSet const Standard_Integer  anOffSet  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::SetOverrideColor const Standard_Integer  indColor  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::SetPickedIndex const Standard_Integer  anIndex  )  [protected]
 

Standard_EXPORT void Graphic2d_GraphicObject::SetPriority const Standard_Integer  aPriority  ) 
 

Standard_EXPORT void Graphic2d_GraphicObject::SetTransform const gp_GTrsf2d &  aTrsf,
const Graphic2d_TypeOfComposition  aType = Graphic2d_TOC_REPLACE
 

Standard_EXPORT void Graphic2d_GraphicObject::SetView const Handle(Graphic2d_View)&  aView  ) 
 

Standard_EXPORT const gp_GTrsf2d& Graphic2d_GraphicObject::Transform  )  const
 

Standard_EXPORT void Graphic2d_GraphicObject::Unhighlight  ) 
 

Standard_EXPORT Handle_Graphic2d_View Graphic2d_GraphicObject::View  )  const [private]
 


Field Documentation

Graphic2d_CBitFields8 Graphic2d_GraphicObject::myCBitFields [private]
 

Standard_Integer Graphic2d_GraphicObject::myCurrentIndex [protected]
 

Graphic2d_DisplayStatus Graphic2d_GraphicObject::myDisplayStatus [private]
 

Standard_Boolean Graphic2d_GraphicObject::myIsTransformed [protected]
 

Standard_Boolean Graphic2d_GraphicObject::myIsUpToDate [protected]
 

Standard_Integer Graphic2d_GraphicObject::myLayer [private]
 

Standard_Integer Graphic2d_GraphicObject::myOffSet [protected]
 

Standard_Integer Graphic2d_GraphicObject::myOverrideColor [protected]
 

Standard_Integer Graphic2d_GraphicObject::myPickedIndex [private]
 

Handle_TColStd_HSequenceOfInteger Graphic2d_GraphicObject::myPickIndices [private]
 

TColStd_IndexedMapOfTransient Graphic2d_GraphicObject::myPrimitives [private]
 

Standard_Integer Graphic2d_GraphicObject::myPriority [private]
 

gp_GTrsf2d Graphic2d_GraphicObject::myTrsf [private]
 

Graphic2d_ViewPtr Graphic2d_GraphicObject::myViewPtr [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:55:32 2008 for OpenCASCADE by  doxygen 1.4.1