summaryrefslogtreecommitdiff
path: root/inc/Graphic2d_Line.hxx
blob: 8501229a003d6984247ad68cf3a69b942f72228a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// 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_Line_HeaderFile
#define _Graphic2d_Line_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_Graphic2d_Line_HeaderFile
#include <Handle_Graphic2d_Line.hxx>
#endif

#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Graphic2d_TypeOfPolygonFilling_HeaderFile
#include <Graphic2d_TypeOfPolygonFilling.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Graphic2d_Primitive_HeaderFile
#include <Graphic2d_Primitive.hxx>
#endif
#ifndef _Handle_Graphic2d_GraphicObject_HeaderFile
#include <Handle_Graphic2d_GraphicObject.hxx>
#endif
#ifndef _Handle_Graphic2d_Drawer_HeaderFile
#include <Handle_Graphic2d_Drawer.hxx>
#endif
#ifndef _Standard_ShortReal_HeaderFile
#include <Standard_ShortReal.hxx>
#endif
#ifndef _Aspect_FStream_HeaderFile
#include <Aspect_FStream.hxx>
#endif
#ifndef _Aspect_IFStream_HeaderFile
#include <Aspect_IFStream.hxx>
#endif
class Graphic2d_GraphicObject;
class Graphic2d_Drawer;
class TShort_Array1OfShortReal;


//! Groups all the primitives which behaves like <br>
//!	    geometrical lines. <br>
//!	    for example: Polyline, Circle ... <br>
class Graphic2d_Line : public Graphic2d_Primitive {

public:

  //! Defines the index, in the width map, of the line width. <br>
//!  Warning: Note that the index 0 can be undefined as a WidthMapEntry, <br>
//!	    in this case the default line width of 1 pixel is taken. <br>
  Standard_EXPORT     void SetWidthIndex(const Standard_Integer anIndex) ;
  //! Defines the index, in the type map, of the line type. <br>
//!  Warning: Note that the index 0 can be undefined as a TypeMapEntry, <br>
//!  	    in this case the default line type SOLID is taken. <br>
  Standard_EXPORT     void SetTypeIndex(const Standard_Integer anIndex) ;
  //! Defines the index, in the color map, of the interior <br>
//!	    color. <br>
//!  Warning: The type of polygon filling must be : <br>
//!		Graphic2d_TOPF_FILLED <br>
  Standard_EXPORT     void SetInteriorColorIndex(const Standard_Integer anIndex) ;
  //! Defines if the edges are drawn or not. <br>
//!  Warning: The type of polygon filling must be : <br>
//!		Graphic2d_TOPF_FILLED or <br>
//!		Graphic2d_TOPF_PATTERNED <br>
  Standard_EXPORT     void SetDrawEdge(const Standard_Boolean aDraw) ;
  //! Defines the pattern for closed lines. <br>
//!  Warning: The type of polygon filling must be : <br>
//!		Graphic2d_TOPF_PATTERNED <br>
  Standard_EXPORT     void SetInteriorPattern(const Standard_Integer anIndex) ;
  //! Defines the pattern for closed lines. <br>
//!	TypeOfPolygonFilling is : <br>
//!		- Graphic2d_TOPF_EMPTY <br>
//!		- Graphic2d_TOPF_FILLED <br>
//!		- Graphic2d_TOPF_PATTERNED <br>
  Standard_EXPORT     void SetTypeOfPolygonFilling(const Graphic2d_TypeOfPolygonFilling aType) ;
  //! Returns the interior color used. <br>
  Standard_EXPORT     Standard_Integer InteriorColorIndex() const;
  //! Returns the interior pattern used. <br>
  Standard_EXPORT     Standard_Integer InteriorPattern() const;
  //! Returns the type of polygon filling used. <br>
  Standard_EXPORT     Graphic2d_TypeOfPolygonFilling TypeOfPolygonFilling() const;
  //! Returns the line type index used. <br>
  Standard_EXPORT     Standard_Integer TypeIndex() const;
  //! Returns the line width index used. <br>
  Standard_EXPORT     Standard_Integer WidthIndex() const;
  
  Standard_EXPORT     void Save(Aspect_FStream& aFStream) const;
  
  Standard_EXPORT     void Retrieve(Aspect_IFStream& anIFStream) ;




  DEFINE_STANDARD_RTTI(Graphic2d_Line)

protected:

  //! Defines a line with the following default values : <br>
//!		- Color Index = 1 (the first user defined color) <br>
//!		- Width Index = 0 (default 1 pixel width) <br>
//!		- Type Index = 0  (default solid line) <br>
//!		- Draw Edge = Standard_True <br>
//!		- Type Of Polygon Filling = Graphic2d_TOPF_EMPTY <br>
//!		- Pattern Index = 0 (default solid polygon filling) <br>
//!		- Interior Color Index = 1 (the first user defined color) <br>
  Standard_EXPORT   Graphic2d_Line(const Handle(Graphic2d_GraphicObject)& aGraphicObject);
  //! Sets line attributes and polyline attributes <br>
//!	    in the drawer <aDrawer>. <br>
  Standard_EXPORT     void DrawLineAttrib(const Handle(Graphic2d_Drawer)& aDrawer) const;
  //! Sets marker attributes -in the drawer <aDrawer>. <br>
  Standard_EXPORT     void DrawMarkerAttrib(const Handle(Graphic2d_Drawer)& aDrawer) const;
  //! Returns Standard_True if (<aX>, <aY>) belongs to <br>
//!	    the segment (<aX1>, <aY1>), (<aX2>, <aY2>). <br>
  Standard_EXPORT   static  Standard_Boolean IsOn(const Standard_ShortReal aX,const Standard_ShortReal aY,const Standard_ShortReal aX1,const Standard_ShortReal aY1,const Standard_ShortReal aX2,const Standard_ShortReal aY2,const Standard_ShortReal aPrecision) ;
  //! Returns Standard_True if (<aX>, <aY>) is inside the <br>
//!	    wire defined by the array <X> and <Y>. <br>
  Standard_EXPORT   static  Standard_Boolean IsIn(const Standard_ShortReal aX,const Standard_ShortReal aY,const TShort_Array1OfShortReal& X,const TShort_Array1OfShortReal& Y,const Standard_ShortReal aPrecision) ;

Graphic2d_TypeOfPolygonFilling myTypeOfPolygonFilling;
Standard_Boolean myDrawEdge;


private: 


Standard_Integer myWidthIndex;
Standard_Integer myTypeIndex;
Standard_Integer myPatternIndex;
Standard_Integer myInteriorColorIndex;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif