// 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_Primitive_HeaderFile #define _Graphic2d_Primitive_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_DefineHandle_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Primitive_HeaderFile #include #endif #ifndef _Graphic2d_GOPtr_HeaderFile #include #endif #ifndef _Standard_ShortReal_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _TColStd_MapOfInteger_HeaderFile #include #endif #ifndef _Graphic2d_TypeOfPrimitive_HeaderFile #include #endif #ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile #include #endif #ifndef _MMgt_TShared_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Drawer_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Graphic2d_GraphicObject_HeaderFile #include #endif #ifndef _Handle_Graphic2d_Primitive_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Graphic2d_PickMode_HeaderFile #include #endif #ifndef _Quantity_Length_HeaderFile #include #endif #ifndef _Graphic2d_TransientManager_HeaderFile #include #endif #ifndef _Handle_Graphic2d_GraphicObject_HeaderFile #include #endif #ifndef _Aspect_FStream_HeaderFile #include #endif class TColStd_HSequenceOfInteger; class Graphic2d_Buffer; class Graphic2d_Drawer; class Graphic2d_GraphicObject; class TColStd_MapOfInteger; //! Groups all drawing elements which can be stored
//! in a graphic object.
//! Each primitive have a postion in the space model.
class Graphic2d_Primitive : public MMgt_TShared { public: //! 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_EXPORT void SetColorIndex(const Standard_Integer anIndex) ; //! Returns the index, in the color map, of the primitive color.
//! Warning: For an image, it is the color of the border.
Standard_EXPORT Standard_Integer ColorIndex() const; //! Draws the primitive .
Standard_EXPORT virtual void Draw(const Handle(Graphic2d_Drawer)& aDrawer) = 0; //! Declares that previously highlighted elements will be selected ones.
//! Warning: If a descendant redefines this method then it must return !
Standard_EXPORT virtual Standard_Boolean SetElementsSelected() ; Standard_EXPORT virtual Standard_Boolean HasSelectedElements() ; Standard_EXPORT virtual void ClearSelectedElements() ; //! Returns number of elements of primitive
Standard_EXPORT virtual Standard_Integer NumOfElemIndices() const; //! Returns number of vertices of primitive
Standard_EXPORT virtual Standard_Integer NumOfVertIndices() const; //! Returns the index of the last picked primitive element.
//! Warning: This is available only if the Pick() method has
//! returned Standard_True.
Standard_EXPORT Standard_Integer PickedIndex() const; Standard_EXPORT const TColStd_MapOfInteger& PickedIndices() const; //! Highlights the primitive or a part of the
//! primitive with the override color of the view.
//! When is 0 all the primitive is highlighted
//! >0 only the requested element is highlighted.
//! <0 only the requested vertex is highlighted.
Standard_EXPORT void Highlight(const Standard_Integer anIndex = 0) ; //! Suppress the highlight on the primitive .
Standard_EXPORT void Unhighlight() ; //! Returns Standard_True if the primitive
//! is highlighted, Standard_False if not.
Standard_EXPORT Standard_Boolean IsHighlighted() const; //! Returns the sequence of highlight indices of the primitive
Standard_EXPORT Handle_TColStd_HSequenceOfInteger HighlightIndices() const; //! Sets the display mode of primitive
Standard_EXPORT void SetDisplayMode(const Standard_Integer aMode) ; //! Indicates the display mode of primitive
Standard_EXPORT Standard_Integer DisplayMode() const; //! Returns TRUE and the min max values of .
//! or FALSE when the primitive is empty.
//! Called by the method Graphic2d_GraphicObject::MinMax
Standard_EXPORT Standard_Boolean MinMax(Standard_ShortReal& Minx,Standard_ShortReal& Maxx,Standard_ShortReal& Miny,Standard_ShortReal& Maxy) ; //! Returns Standard_True if the point , is in the
//! rectangle defined by the min max values of .
//! Warning: If is in a transformed GraphicObject then
//! the min max values are transformed.
Standard_EXPORT Standard_Boolean IsInMinMax(const Standard_ShortReal X,const Standard_ShortReal Y,const Standard_ShortReal aPrecision) ; Standard_EXPORT virtual void Save(Aspect_FStream& aFStream) const = 0; friend class Graphic2d_Buffer; friend //! Drawn the last Undrawn primitives managed by the
//! graphic object in the drawer .
//! Called by the methods :
//! - Graphic2d_View::TinyUpdate ()
Standard_EXPORT void Graphic2d_GraphicObject::Draw(const Handle(Graphic2d_Drawer)& aDrawer,const Standard_Boolean Reset) ; friend //! Drawn a primitive managed by the
//! graphic object in the drawer .
//! Called by the method Graphic2d_View::Update (aPrimitive)
Standard_EXPORT void Graphic2d_GraphicObject::Draw(const Handle(Graphic2d_Drawer)& aDrawer,const Handle(Graphic2d_Primitive)& aPrimitive) ; friend //! Returns Standard_True if the graphic object
//! is picked, Standard_False if not.
//! Called by the method Graphic2d_View::Pick
Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::Pick(const Standard_Real X,const Standard_Real Y,const Standard_Real aPrecision,const Handle(Graphic2d_Drawer)& aDrawer) ; friend //! Returns Standard_True if the graphic object
//! is picked, Standard_False if not.
//! Called by the method Graphic2d_View::PickByCircle
Standard_EXPORT Standard_Boolean Graphic2d_GraphicObject::PickByCircle(const Standard_Real X,const Standard_Real Y,const Standard_Real Radius,const Handle(Graphic2d_Drawer)& aDrawer) ; friend //! 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 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) ; friend //! 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 Standard_Boolean Graphic2d_GraphicObject::MinMax(Quantity_Length& Minx,Quantity_Length& Maxx,Quantity_Length& Miny,Quantity_Length& Maxy) const; friend //! 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 Standard_Boolean Graphic2d_GraphicObject::MarkerMinMax(Quantity_Length& Minx,Quantity_Length& Maxx,Quantity_Length& Miny,Quantity_Length& Maxy) const; friend //! Removes the primitive from .
Standard_EXPORT void Graphic2d_GraphicObject::RemovePrimitive(const Handle(Graphic2d_Primitive)& aPrimitive) ; friend //! Drawn the primitive ,
//! with the internal primitive attributes.
Standard_EXPORT void Graphic2d_TransientManager::Draw(const Handle(Graphic2d_Primitive)& aPrimitive) ; friend //! Drawn the element from the primitive ,
//! with the internal primitive attributes.
Standard_EXPORT void Graphic2d_TransientManager::DrawElement(const Handle(Graphic2d_Primitive)& aPrimitive,const Standard_Integer anIndex) ; friend //! Drawn the vertex from the primitive ,
//! with the internal primitive attributes.
Standard_EXPORT void Graphic2d_TransientManager::DrawVertex(const Handle(Graphic2d_Primitive)& aPrimitive,const Standard_Integer anIndex) ; friend //! Draws all picked elements.
Standard_EXPORT void Graphic2d_TransientManager::DrawPickedElements(const Handle(Graphic2d_Primitive)& aPrimitive) ; DEFINE_STANDARD_RTTI(Graphic2d_Primitive) protected: //! Creates a primitive in a graphic object .
Standard_EXPORT Graphic2d_Primitive(const Handle(Graphic2d_GraphicObject)& aGraphicObject); //! Draws the element of the primitive .
Standard_EXPORT virtual void DrawElement(const Handle(Graphic2d_Drawer)& aDrawer,const Standard_Integer anElement) ; //! Draws the all picked elements of the primitive .
Standard_EXPORT virtual void DrawPickedElements(const Handle(Graphic2d_Drawer)& aDrawer) ; //! Draws the all picked elements of the primitive .
Standard_EXPORT virtual void DrawSelectedElements(const Handle(Graphic2d_Drawer)& aDrawer) ; //! Draws the vertex of the primitive .
Standard_EXPORT virtual void DrawVertex(const Handle(Graphic2d_Drawer)& aDrawer,const Standard_Integer aVertex) ; //! Returns Standard_True if the primitive is picked,
//! Standard_False if not.
Standard_EXPORT 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 is picked,
//! Standard_False if not.
Standard_EXPORT 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 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_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) ; //! Sets the index of the picked primitive element if any.
Standard_EXPORT void SetPickedIndex(const Standard_Integer anIndex) ; //! Computes the MinMax of the primitive if possible.
Standard_EXPORT virtual Standard_Boolean ComputeMinMax() ; //! Returns Standard_True if (, ) is closed
//! to the point (, ).
Standard_EXPORT 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 the attached drawer of the view of this Primitive.
Standard_EXPORT Handle_Graphic2d_Drawer Drawer() const; //! Resets the starting traversal index to this primitive.
Standard_EXPORT void ResetIndex() ; //! Sets the family of this primitive.
Standard_EXPORT void SetFamily(const Graphic2d_TypeOfPrimitive aFamily) ; //! Returns the family of this primitive
Standard_EXPORT Graphic2d_TypeOfPrimitive Family() const; 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; private: //! Returns the graphic-object back pointer of this Primitive.
Standard_EXPORT Graphic2d_GOPtr PGraphicObject() const; Standard_Integer myPickedIndex; Graphic2d_TypeOfPrimitive myTypeOfPrimitive; Handle_TColStd_HSequenceOfInteger mySeqOfHighInd; }; // other Inline functions and methods (like "C++: function call" methods) #endif