Salome HOME
NRI : Check if a component-username is already associated with a component-name.
[modules/kernel.git] / src / Plot2d / Plot2d_Curve.h
1 //  File      : Plot2d_Curve.h
2 //  Created   : UI team, 05.09.00
3 //  Descrip   : Curve class
4
5 //  Modified  : Mon Dec 03 15:37:21 2001
6 //  Author    : Vadim SANDLER
7 //  Project   : SALOME
8 //  Module    : Plot2d
9 //  Copyright : Open CASCADE 2001
10 //  $Header$
11
12 #ifndef Plot2d_Curve_h
13 #define Plot2d_Curve_h
14
15 #include <qstring.h>
16 #include <qcolor.h>
17 #include <qmemarray.h>
18 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
19 #include <Handle_SALOME_InteractiveObject.hxx>
20 #endif
21 #include "SALOME_InteractiveObject.hxx"
22
23 typedef QMemArray<double> DoubleArray;
24
25 class Plot2d_Curve 
26 {
27 public:
28   enum MarkerType { None,      Circle,    Rectangle, Diamond,
29                     DTriangle, UTriangle, LTriangle, RTriangle,
30                     Cross, XCross };
31   enum LineType { NoPen, Solid, Dash, Dot, DashDot, DashDotDot };
32
33   Plot2d_Curve();
34   ~Plot2d_Curve();
35   Plot2d_Curve( const Plot2d_Curve& curve );
36   Plot2d_Curve& operator= ( const Plot2d_Curve& curve );
37
38   void        setHorTitle( const QString& title );
39   QString     getHorTitle() const;
40   void        setVerTitle( const QString& title );
41   QString     getVerTitle() const;
42   void        setHorUnits( const QString& units );
43   QString     getHorUnits() const;
44   void        setVerUnits( const QString& units );
45   QString     getVerUnits() const;
46   void        setData( const double* hData, const double* vData, long size );
47   double*     horData() const;
48   double*     verData() const;
49   long        nbPoints() const;
50   bool        isEmpty() const;
51
52   void        setAutoAssign( bool on );
53   bool        isAutoAssign() const;
54   void        setColor( const QColor color );
55   QColor      getColor() const;
56   void        setMarker( MarkerType marker );
57   MarkerType  getMarker() const;
58   void        setLine( LineType line, const int lineWidth = 0 );
59   LineType    getLine() const;
60   int         getLineWidth() const;
61
62   virtual bool                             hasIO() { return !myIO.IsNull(); }
63   virtual Handle(SALOME_InteractiveObject) getIO() { return myIO; }
64   virtual void                             setIO( const Handle(SALOME_InteractiveObject)& io ) { myIO = io; }
65   
66 private:
67   Handle(SALOME_InteractiveObject) myIO;
68
69   bool        myAutoAssign;
70   QString     myHorTitle;
71   QString     myVerTitle;
72   QString     myHorUnits;
73   QString     myVerUnits;
74   QColor      myColor;
75   MarkerType  myMarker;
76   LineType    myLine;
77   int         myLineWidth;
78   DoubleArray myHorData;
79   DoubleArray myVerData;
80 };
81
82 #endif // Plot2d_Curve_h
83
84