Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

sxy_graph_simple.h

Go to the documentation of this file.
00001 #ifndef simple_graph_h
00002 #define simple_graph_h
00003 
00004 // =======================================================================
00005 
00006 extern "C" {
00007 #include <iup.h>
00008 #include <cd.h>
00009 }
00010 
00011 #include <xy.h>
00012 
00013 #include "sxy_graph.h"
00014 #include "sxy_chart.h"
00015 
00016 class SXYAxis;
00017 class SXYChart;
00018 class SXYCurve;
00019 
00020 typedef enum {
00021    LINEAR_SIMPLE_GRAPH = 0,
00022    SEMILOG_SIMPLE_GRAPH,
00023    LOG_SIMPLE_GRAPH,
00024    TIME_LINEAR_SIMPLE_GRAPH,
00025    TIME_LOG_SIMPLE_GRAPH
00026 } SXYSimpleGraphType;
00027 
00028 typedef enum {
00029    HALF_CROSS_LAYOUT = 0,
00030    QUARTER_CROSS_LAYOUT,
00031    TYPICAL_LAYOUT,
00032    DEPTH_LAYOUT
00033 } SXYSimpleGraphLayout;
00034 
00035 // =======================================================================
00036 //
00037 //* Define um gráfico genérico simplificado, onde só vai aparecer um
00038 //  único chart (com um eixo horizontal e vertical) no canvas.
00039 
00040 class SXYSimpleGraph : public SXYGraph {
00041    
00042    SXYSimpleGraphType type;
00043 
00044  protected:
00045 
00046    void adaptGrid(SXYAxis* ax);
00047    void inferGridType(SXYGridType* xtype, SXYGridType* ytype);
00048    void inferAxisType(SXYAxisType* xtype, SXYAxisType* ytype);
00049 
00050  public:
00051 
00052    void setType(SXYSimpleGraphType typ);
00053    SXYSimpleGraphType getType(void);
00054 
00055    SXYChart* getTheChart(void);
00056    SXYAxis*  getVerticalAxis(void);
00057    SXYAxis*  getHorizontalAxis(void);
00058 
00059    void remountGraph(void);
00060 
00061    // Métodos de conveniência
00062    void getScales(double& xmin, double& xmax, double& ymin, double& ymax);
00063    void setScales(double xmin, double xmax, double ymin, double ymax);
00064    void setGridScales(double xmin, double xmax, double ymin, double ymax);
00065    void getGridScales(double& xmin, double& xmax, double& ymin, double& ymax);
00066 
00067    void fitHorizontalScale(void);
00068    void fitVerticalScale(void);
00069    void fitAllScales(void);
00070 
00071    void revertHorizontalAxis(void);
00072    void revertVerticalAxis(void);
00073    void setAxesLayout(SXYSimpleGraphLayout new_layout);
00074 
00075    void setHorizontalAxisDirection(SXYAxisDirection direction);
00076    void setVerticalAxisDirection(SXYAxisDirection direction);
00077    SXYAxisDirection getHorizontalAxisDirection(void);
00078    SXYAxisDirection getVerticalAxisDirection(void);
00079 
00080    void setHorizontalAxisPosition(double xp, double yp);
00081    void setVerticalAxisPosition(double xp, double yp);
00082    void getHorizontalAxisPosition(double& xp, double& yp);
00083    void getVerticalAxisPosition(double& xp, double& yp);
00084 
00085    void setVerticalAxisSize(double size);
00086    double getVerticalAxisSize(void);
00087    void setHorizontalAxisSize(double size);
00088    double getHorizontalAxisSize(void);
00089 
00090    void setTheTitle(char* title);
00091    void setTheSubTitle(char* title);
00092 
00093    char* getTheTitle(void);
00094    char* getTheSubTitle(void);
00095 
00096    void setHorizontalAxisTitle(char* title);
00097    void setVerticalAxisTitle(char* title);
00098    char* getHorizontalAxisTitle(void);
00099    char* getVerticalAxisTitle(void);
00100 
00101    void getAxesSteps(double& sx, double& sy);
00102    void setAxesSteps(double sx, double sy);
00103    void getGridsSteps(double& sx, double& sy);
00104    void setGridsSteps(double sx, double sy);
00105    void getGridsAutoMultipleSteps(double& smx, double& smy);
00106    void setGridsAutoMultipleSteps(double smx, double smy);
00107 
00108    void attachCurve(SXYCurve* curve);
00109    void detachCurve(SXYCurve* curve);
00110 
00111    SXYSimpleGraph(Ihandle* iupcnv, SXYSimpleGraphType typ);
00112    virtual ~SXYSimpleGraph();
00113 };
00114 
00115 
00116 #endif
00117 

SXY
Tecgraf / PUC-Rio - Computer Graphics Technology Group