ResultLayer.h

00001 
00006 #ifndef _ResultLayer_h
00007 #define _ResultLayer_h
00008 
00009 // SYSTEM INCLUDES
00010 //
00011 
00012 // PROJECT INCLUDES
00013 //
00014 
00015 // LOCAL INCLUDES
00016 //
00017 #include "../Result.h"
00018 #include "AttributeDatabase.h"
00019 #include "PlotLayer.h"
00020 
00021 // FORWARD REFERENCES
00022 //
00023 
00024 
00025 class ResultLayer
00026     : public PlotLayer
00027 {
00028 public:
00029     typedef std::auto_ptr<ResultLayer>(*Creator)(
00030             const PlotControl&          plotControl,
00031             const Result&               result,
00032             CountedPtr<PlotLayer>       cpFunctionLayer);
00033 
00034     enum SymbolType
00035     {
00036         CIRCLE,
00037         SQUARE,
00038         SMALL_CIRCLE,
00039         SMALL_SQUARE
00040     };
00041 
00042 // LIFECYCLE
00043 
00051     ResultLayer(const PlotControl&      plotControl,
00052                 const Result&           result,
00053                 CountedPtr<PlotLayer>   cpFunctionLayer);
00054 
00057     ResultLayer(const ResultLayer& from);
00058 
00061     ~ResultLayer(void);
00062 
00063 
00064 // OPERATORS
00065 // OPERATIONS
00066 
00071     virtual Region IterationBoundingBox(unsigned iterationNumber) const = 0;
00072 
00073     virtual Region BoundingBox() const;
00074 
00075 // ACCESS
00076 
00079     void            Highlight(unsigned iterationNumber);
00080 
00081 // INQUIRY
00082 
00085     unsigned        HighlightedIterationNumber() const;
00086 
00087 protected:
00089     struct ColourPointType
00090     {
00091     public:
00092         ColourPointType(wxPoint                             point,
00093                         AttributeDatabase::AttributeType    attribute,
00094                         SymbolType                          symbol = CIRCLE)
00095             : mPoint(point), mAttribute(attribute), mSymbol(symbol)
00096         {
00097         };
00098 
00099         wxPoint                             mPoint;
00100         AttributeDatabase::AttributeType    mAttribute;
00101         SymbolType                          mSymbol;
00102     };
00103 
00105     typedef list<ColourPointType> PointList;
00106 
00108     class PointPainter
00109     {
00110     public:
00111         PointPainter(const ResultLayer& layer, wxDC& dc);
00112 
00113         void operator()(const ColourPointType& point) const;
00114     private:
00115         const ResultLayer&  mLayer;
00116         wxDC&               mrDc;
00117     };
00118 
00119 
00120     void            DrawBigPoint(
00121                         wxDC&                               dc,
00122                         wxPoint                             point,
00123                         AttributeDatabase::AttributeType    attribute,
00124                         SymbolType                          symbol = CIRCLE)
00125                     const;
00126 
00127 
00128 
00129     const Result&               mResult;
00130     CountedPtr<const PlotLayer> mcpFunctionLayer;
00131 
00132     unsigned        mHighlightedIteration;
00133 
00134 private:
00135 };
00136 
00137 // INLINE METHODS
00138 //
00139 
00140 // EXTERNAL REFERENCES
00141 //
00142 
00143 #endif  // _ResultLayer_h

Wygenerowano Fri Sep 29 21:04:49 2006 dla EduOptim2 programem  doxygen 1.4.6