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

Groups all drawing elements which can be stored
in a graphic object.
Each primitive have a postion in the space model.

#include <Graphic2d_Primitive.hxx>

Inheritance diagram for Graphic2d_Primitive:
Inheritance graph
[legend]

Public Member Functions

void SetColorIndex (const Standard_Integer anIndex)
 Defines the index, in the color map, of the primitive color.
Warning: For an image, this method defines the color of the
boundary rectangle.

Standard_Integer ColorIndex () const
 Returns the index, in the color map, of the primitive color.
Warning: For an image, it is the color of the border.

virtual void Draw (const Handle< Graphic2d_Drawer > &aDrawer)=0
 Draws the primitive <me>.

virtual Standard_Boolean SetElementsSelected ()
 Declares that previously highlighted elements will be selected ones.
Warning: If a descendant redefines this method then it must return <true>!

virtual Standard_Boolean HasSelectedElements ()
virtual void ClearSelectedElements ()
virtual Standard_Integer NumOfElemIndices () const
 Returns number of elements of primitive

virtual Standard_Integer NumOfVertIndices () const
 Returns number of vertices of primitive

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

const TColStd_MapOfIntegerPickedIndices () const
void Highlight (const Standard_Integer anIndex=0)
 Highlights the primitive <me> or a part of the
primitive with the override color of the view.
When <anIndex> is 0 all the primitive is highlighted
>0 only the requested element is highlighted.
<0 only the requested vertex is highlighted.

void Unhighlight ()
 Suppress the highlight on the primitive <me>.

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

Handle_TColStd_HSequenceOfInteger HighlightIndices () const
 Returns the sequence of highlight indices of the primitive <me>

void SetDisplayMode (const Standard_Integer aMode)
 Sets the display mode of primitive

Standard_Integer DisplayMode () const
 Indicates the display mode of primitive

Standard_Boolean MinMax (Standard_ShortReal &Minx, Standard_ShortReal &Maxx, Standard_ShortReal &Miny, Standard_ShortReal &Maxy)
 Returns TRUE and the min max values of <me>.
or FALSE when the primitive is empty.
Called by the method Graphic2d_GraphicObject::MinMax

Standard_Boolean IsInMinMax (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal aPrecision)
 Returns Standard_True if the point <X>, <Y> is in the
rectangle defined by the min max values of <me>.
Warning: If <me> is in a transformed GraphicObject then
the min max values are transformed.

virtual void Save (Aspect_FStream &aFStream) const =0

Protected Member Functions

 Graphic2d_Primitive (const Handle< Graphic2d_GraphicObject > &aGraphicObject)
 Creates a primitive in a graphic object <aGraphicObject>.

virtual void DrawElement (const Handle< Graphic2d_Drawer > &aDrawer, const Standard_Integer anElement)
 Draws the element <anElement> of the primitive <me>.

virtual void DrawPickedElements (const Handle< Graphic2d_Drawer > &aDrawer)
 Draws the all picked elements of the primitive <me>.

virtual void DrawSelectedElements (const Handle< Graphic2d_Drawer > &aDrawer)
 Draws the all picked elements of the primitive <me>.

virtual void DrawVertex (const Handle< Graphic2d_Drawer > &aDrawer, const Standard_Integer aVertex)
 Draws the vertex <aVertex> of the primitive <me>.

virtual Standard_Boolean Pick (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal aPrecision, const Handle< Graphic2d_Drawer > &aDrawer)=0
 Returns Standard_True if the primitive <me> is picked,
Standard_False if not.

virtual Standard_Boolean PickByCircle (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Radius, const Handle< Graphic2d_Drawer > &aDrawer, const Graphic2d_PickMode aPickMode=Graphic2d_PM_INCLUDE)
 Returns Standard_True if the primitive <me> is picked,
Standard_False if not.

virtual Standard_Boolean Pick (const Standard_ShortReal Xmin, const Standard_ShortReal Ymin, const Standard_ShortReal Xmax, const Standard_ShortReal 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.

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

virtual Standard_Boolean ComputeMinMax ()
 Computes the MinMax of the primitive if possible.

Handle_Graphic2d_Drawer Drawer () const
 Returns the attached drawer of the view of this Primitive.

void ResetIndex ()
 Resets the starting traversal index to this primitive.

void SetFamily (const Graphic2d_TypeOfPrimitive aFamily)
 Sets the family of this primitive.

Graphic2d_TypeOfPrimitive Family () const
 Returns the family of this primitive

Static Protected Member Functions

static Standard_Boolean IsOn (const Standard_ShortReal aX1, const Standard_ShortReal aY1, const Standard_ShortReal aX2, const Standard_ShortReal aY2, const Standard_ShortReal aPrecision)
 Returns Standard_True if (<aX1>, <aY1>) is closed
to the point (<aX2>, <aY2>).

Protected Attributes

Graphic2d_GOPtr myGOPtr
Standard_ShortReal myMinX
Standard_ShortReal myMinY
Standard_ShortReal myMaxX
Standard_ShortReal myMaxY
Standard_Integer myColorIndex
TColStd_MapOfInteger myPickedIndices
Standard_Integer myNumOfElem
Standard_Integer myNumOfVert
Standard_Integer myDisplayMode

Friends

void Graphic2d_GraphicObject::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 :

void Graphic2d_GraphicObject::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)

Standard_Boolean Graphic2d_GraphicObject::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

Standard_Boolean Graphic2d_GraphicObject::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

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)
 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 Graphic2d_GraphicObject::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 ()

Standard_Boolean Graphic2d_GraphicObject::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 ()

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

void Graphic2d_TransientManager::Draw (const Handle< Graphic2d_Primitive > &aPrimitive)
 Drawn the primitive <aPrimitive>,
with the internal primitive attributes.

void Graphic2d_TransientManager::DrawElement (const Handle< Graphic2d_Primitive > &aPrimitive, const Standard_Integer anIndex)
 Drawn the element <anIndex> from the primitive <aPrimitive>,
with the internal primitive attributes.

void Graphic2d_TransientManager::DrawVertex (const Handle< Graphic2d_Primitive > &aPrimitive, const Standard_Integer anIndex)
 Drawn the vertex <anIndex> from the primitive <aPrimitive>,
with the internal primitive attributes.

void Graphic2d_TransientManager::DrawPickedElements (const Handle< Graphic2d_Primitive > &aPrimitive)
 Draws all picked elements.


Constructor & Destructor Documentation


Member Function Documentation

Reimplemented in Graphic2d_SetOfMarkers.

virtual Standard_Boolean Graphic2d_Primitive::ComputeMinMax ( ) [protected, virtual]

Reimplemented in Graphic2d_Paragraph, and Graphic2d_Text.

virtual void Graphic2d_Primitive::Draw ( const Handle< Graphic2d_Drawer > &  aDrawer) [pure virtual]
virtual void Graphic2d_Primitive::DrawElement ( const Handle< Graphic2d_Drawer > &  aDrawer,
const Standard_Integer  anElement 
) [protected, virtual]
Handle_Graphic2d_Drawer Graphic2d_Primitive::Drawer ( ) const [protected]
virtual void Graphic2d_Primitive::DrawPickedElements ( const Handle< Graphic2d_Drawer > &  aDrawer) [protected, virtual]

Reimplemented in Graphic2d_SetOfMarkers.

virtual void Graphic2d_Primitive::DrawSelectedElements ( const Handle< Graphic2d_Drawer > &  aDrawer) [protected, virtual]

Reimplemented in Graphic2d_SetOfMarkers.

virtual void Graphic2d_Primitive::DrawVertex ( const Handle< Graphic2d_Drawer > &  aDrawer,
const Standard_Integer  aVertex 
) [protected, virtual]

Reimplemented in Graphic2d_SetOfMarkers.

Handle_TColStd_HSequenceOfInteger Graphic2d_Primitive::HighlightIndices ( ) const

Reimplemented in Graphic2d_SetOfMarkers.

Reimplemented in Graphic2d_SetOfMarkers.

virtual void Graphic2d_Primitive::Save ( Aspect_FStream aFStream) const [pure virtual]

Reimplemented in Graphic2d_SetOfMarkers.


Friends And Related Function Documentation


Field Documentation


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