// 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_GraphicObject_HeaderFile #define _Graphic2d_GraphicObject_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_DefineHandle_HeaderFile #include #endif #ifndef _Handle_Graphic2d_GraphicObject_HeaderFile #include #endif #ifndef _Graphic2d_ViewPtr_HeaderFile #include #endif #ifndef _TColStd_IndexedMapOfTransient_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _gp_GTrsf2d_HeaderFile #include #endif #ifndef _Graphic2d_CBitFields8_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile #include #endif #ifndef _Graphic2d_DisplayStatus_HeaderFile #include #endif #ifndef _MMgt_TShared_HeaderFile #include #endif #ifndef _Handle_Graphic2d_View_HeaderFile #include #endif #ifndef _Graphic2d_TypeOfComposition_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Primitive_HeaderFile #include #endif #ifndef _Quantity_Length_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Drawer_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Graphic2d_PickMode_HeaderFile #include #endif class TColStd_HSequenceOfInteger; class Graphic2d_OverrideColorError; class Standard_OutOfRange; class Graphic2d_Primitive; class Graphic2d_View; class Graphic2d_TransientManager; class gp_GTrsf2d; class Graphic2d_Drawer; //! Creates a 2D graphic object in a view.
//! A graphic object is a primitives manager.
class Graphic2d_GraphicObject : public MMgt_TShared { public: //! Creates an unattached graphic object,
//! the attachment will be realized more later
//! using the method SetView().
Standard_EXPORT Graphic2d_GraphicObject(); //! Creates a graphic object in the view .
//! 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 Graphic2d_GraphicObject(const Handle(Graphic2d_View)& aView); //! Attach the graphic object to this view
Standard_EXPORT void SetView(const Handle(Graphic2d_View)& aView) ; //! Sets the transformation applied to
//! the primitives according to the composition type.
Standard_EXPORT void SetTransform(const gp_GTrsf2d& aTrsf,const Graphic2d_TypeOfComposition aType = Graphic2d_TOC_REPLACE) ; //! Returns the transformation applied to
//! the primitives.
Standard_EXPORT const gp_GTrsf2d& Transform() const; //! Returns Standard_True if the associated
//! transformation is not the Identity.
Standard_EXPORT Standard_Boolean IsTransformed() const; //! Modifies the layer of the graphic object .
Standard_EXPORT void SetLayer(const Standard_Integer aLayer) ; //! Returns the layer of the graphic object .
Standard_EXPORT Standard_Integer Layer() const; //! Modifies the drawing priority of the graphic object .
//! of 0 is the lowest priority.
//! of MaxPriority() is the highest priority.
Standard_EXPORT void SetPriority(const Standard_Integer aPriority) ; //! Returns the drawing priority of the graphic object
Standard_EXPORT Standard_Integer Priority() const; //! Returns the max usable relative priority of the
//! "standard" graphic object.
Standard_EXPORT virtual Standard_Integer MaxPriority() const; //! Allows the drawing of graphic object on a plotter.
Standard_EXPORT void EnablePlot() ; //! Forbids the drawing of graphic object on a plotter.
Standard_EXPORT void DisablePlot() ; //! Returns Standard_True if the graphic object
//! is plottable, Standard_False if not.
Standard_EXPORT Standard_Boolean IsPlottable() const; //! Allows the drawing of graphic object .
Standard_EXPORT void EnableDraw() ; //! Forbids the drawing of graphic object .
Standard_EXPORT void DisableDraw() ; //! Returns Standard_True if the graphic object
//! is drawable, Standard_False if not.
Standard_EXPORT Standard_Boolean IsDrawable() const; //! Returns Standard_True if the primitive
//! is in the graphic object , Standard_False if not.
Standard_EXPORT Standard_Boolean IsIn(const Handle(Graphic2d_Primitive)& aPrimitive) const; //! Removes the primitive from .
Standard_EXPORT void RemovePrimitive(const Handle(Graphic2d_Primitive)& aPrimitive) ; //! Removes all the primitives from .
Standard_EXPORT void RemovePrimitives() ; //! Removes from the associated view.
//! If was displayed or highlighted,
//! is removed from the display list of the associated view.
Standard_EXPORT void Remove() ; //! Allows the picking on the graphic object .
Standard_EXPORT void EnablePick() ; //! Forbids the picking on the graphic object .
Standard_EXPORT void DisablePick() ; //! Returns Standard_True if the graphic object
//! is pickable, Standard_False if not.
Standard_EXPORT Standard_Boolean IsPickable() const; //! Allows the drawing of the graphic object .
Standard_EXPORT void Display() ; //! Forbids the drawing of the graphic object .
Standard_EXPORT void Erase() ; //! Returns Standard_True if the graphic object
//! is displayed, Standard_False if not.
Standard_EXPORT Standard_Boolean IsDisplayed() const; //! Highlights the graphic object with the
//! override color of the view.
Standard_EXPORT void Highlight() ; //! Highlights the graphic object with the
//! specified color.
Standard_EXPORT void Highlight(const Standard_Integer aColorIndex) ; //! Suppress the highlight the graphic object .
Standard_EXPORT void Unhighlight() ; //! Returns Standard_True if the graphic object
//! is highlighted, Standard_False if not.
Standard_EXPORT Standard_Boolean IsHighlighted() const; //! 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 = 0.
Standard_EXPORT void SetOffSet(const Standard_Integer anOffSet) ; //! Returns the offset applied to the original color
//! index of all primitives in the graphic object .
Standard_EXPORT Standard_Integer OffSet() const; //! Returns the current overridel color apply to
//! this graphic object.
Standard_EXPORT Standard_Integer OverrideColor() const; //! Sets the current overridel color apply to
//! this graphic object.
Standard_EXPORT void SetOverrideColor(const Standard_Integer indColor) ; //! Returns the number of primitive of the graphic object.
Standard_EXPORT Standard_Integer Length() const; //! Returns the primitive of rank
Standard_EXPORT Handle_Graphic2d_Primitive Primitive(const Standard_Integer aRank) const; //! Returns the min max values of .
//! Warning: All markers are ignored.
//! Warning: If is empty or not displayed or
//! contains markers and nothing else
//! returns FALSE and
//! Minx = Miny = RealFirst ()
//! Maxx = Maxy = RealLast ()
Standard_EXPORT virtual Standard_Boolean MinMax(Quantity_Length& Minx,Quantity_Length& Maxx,Quantity_Length& Miny,Quantity_Length& Maxy) const; //! Returns the min max values of all markers in .
//! Warning: If is empty or not displayed or without markers
//! returns FALSE and
//! Minx = Miny = RealFirst ()
//! Maxx = Maxy = RealLast ()
Standard_EXPORT virtual Standard_Boolean MarkerMinMax(Quantity_Length& Minx,Quantity_Length& Maxx,Quantity_Length& Miny,Quantity_Length& Maxy) const; //! Returns the last picked primitive index in this.
//! Warning: This is available only if the Pick() method has
//! returned Standard_True.
Standard_EXPORT Standard_Integer PickedIndex() const; //! Returns the sequence of picked primitives.
Standard_EXPORT Handle_TColStd_HSequenceOfInteger PickList() const; friend class Graphic2d_Primitive; friend class Graphic2d_View; friend class Graphic2d_TransientManager; DEFINE_STANDARD_RTTI(Graphic2d_GraphicObject) protected: //! Sets the index of the picked primitive if any.
Standard_EXPORT void SetPickedIndex(const Standard_Integer anIndex) ; //! Drawn the last Undrawn primitives managed by the
//! graphic object in the drawer .
//! Called by the methods :
//! - Graphic2d_View::TinyUpdate ()
Standard_EXPORT virtual void Draw(const Handle(Graphic2d_Drawer)& aDrawer,const Standard_Boolean Reset) ; //! Drawn a primitive managed by the
//! graphic object in the drawer .
//! Called by the method Graphic2d_View::Update (aPrimitive)
Standard_EXPORT virtual void Draw(const Handle(Graphic2d_Drawer)& aDrawer,const Handle(Graphic2d_Primitive)& aPrimitive) ; //! Returns Standard_True if the graphic object
//! is picked, Standard_False if not.
//! Called by the method Graphic2d_View::Pick
Standard_EXPORT 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
//! is picked, Standard_False if not.
//! Called by the method Graphic2d_View::PickByCircle
Standard_EXPORT 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 primitive is:
//! included in rectangle (),
//! excluded from rectangle (),
//! intersected by rectangle (),
//! defined by Xmin, Ymin, Xmax, Ymax.
//! Standard_False if not.
Standard_EXPORT 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 TRUE when the graphic object is
//! up to date at screen;
Standard_EXPORT Standard_Boolean IsUpToDate() const; Standard_Integer myOverrideColor; Standard_Integer myCurrentIndex; Standard_Integer myOffSet; Standard_Boolean myIsUpToDate; Standard_Boolean myIsTransformed; private: //! Drawn all the primitives managed by the
//! graphic object in the drawer .
//! Called by the method :
//! - Graphic2d_View::Update (aViewMapping, x, y, scale)
Standard_EXPORT void Redraw(const Handle(Graphic2d_Drawer)& aDrawer) ; //! Returns the view which manages .
//! Called by the constructor of Primitive.
Standard_EXPORT Handle_Graphic2d_View View() const; //! Adds the primitive in .
//! Called by the constructor of Primitive.
Standard_EXPORT void AddPrimitive(const Handle(Graphic2d_Primitive)& aPrimitive) ; //! Sets the current index in the GraphicObject
//! to the index of the primitive .
Standard_EXPORT void SetIndex(const Handle(Graphic2d_Primitive)& aPrimitive) ; //! Returns the min usable absolute priority of the
//! "standard" graphic object.
Standard_EXPORT virtual Standard_Integer BasePriority() const; 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; }; // other Inline functions and methods (like "C++: function call" methods) #endif