// $Revision: 1.3 $ // Copyright (C) 1994 Taligent, Inc. All rights reserved. #ifndef Taligent_CANVASCONVENIENCEFILTERS #define Taligent_CANVASCONVENIENCEFILTERS #ifndef Taligent_GRAFEDIT #include #endif #ifndef Taligent_CANVASGRAPHICMANIPULATION #include #endif // Classes defined in this file: class TCanvasSelectionFilter; class TCanvasTopSelectionDrawingFilter; class TCanvasTopSelectionHitDetectionFilter; // Classes defined elsewhere (but needed here): class TSRTFeedbacker; // ******************************************************************************** // class TCanvasSelectionFilter // // description TCanvasGraphicFilter abstract subclass that is used by filters wishing // to deal with selections. For instance, the TCanvasTopSelectionDrawingFilter // and the TCanvasTopSelectionHitDetectionFilter subclass from this // class. The main functionality provided by this level of abstraction // are the two virtual CreateFeedbacker methods. // // ******************************************************************************** class TCanvasSelectionFilter : public TCanvasGraphicFilter { public: TCanvasSelectionFilter (TSRTFeedbacker* defaultFeedbacker = NIL); virtual ~TCanvasSelectionFilter (); //========================================= // Unidirectional Iteration //========================================= virtual const MCanvasGraphic* First () = 0; virtual const MCanvasGraphic* Next () = 0; virtual void SetCanvasFeedbacker (const TSRTFeedbacker&); protected: virtual MCanvasGraphic* GetCanvasFeedbacker (const MCanvasGraphic&); virtual MCanvasGraphic* GetGraphicFeedbacker (const MCanvasGraphic&); #ifndef NO_Internal private: void* fExtension; TSRTFeedbacker* fCanvasFeedbacker; #endif }; // ******************************************************************************** // class TCanvasTopSelectionDrawingFilter // // description This class is provided to demonstrate the basic flavor of // using filters and funnels to accomplish various selection // strategies. Filters will be changed to support linking // and a set of linkable filters for managing direction, selection // strategies, filtering out unwanted graphics, etc. will be // provided. // // ******************************************************************************** class TCanvasTopSelectionDrawingFilter : public TCanvasSelectionFilter { public: TCanvasTopSelectionDrawingFilter (const MCanvasSelection* referenceSelection); virtual ~TCanvasTopSelectionDrawingFilter (); // ======================================== // Iteration from back to front // ======================================== virtual const MCanvasGraphic* First (); virtual const MCanvasGraphic* Next (); #ifndef NO_Internal private: void* fExtension; const MCanvasSelection* fSelection; // not owned bool fSelectionPass; MCanvasGraphic* fCurrentFeedbacker; // not owned #endif }; // ******************************************************************************** // class TCanvasTopSelectionHitDetectionFilter // // description This class is provided to demonstrate the basic flavor of // using filters and funnels to accomplish various selection // strategies. Filters will be changed to support linking // and a set of linkable filters for managing direction, selection // strategies, filtering out unwanted graphics, etc. will be // provided. // // ******************************************************************************** class TCanvasTopSelectionHitDetectionFilter : public TCanvasSelectionFilter { public: TCanvasTopSelectionHitDetectionFilter (const MCanvasSelection* referenceSelection); virtual ~TCanvasTopSelectionHitDetectionFilter (); // ======================================== // Iteration from back to front // ======================================== virtual const MCanvasGraphic* First (); virtual const MCanvasGraphic* Next (); #ifndef NO_Internal private: void* fExtension; const MCanvasSelection* fSelection; // not owned bool fSelectionPass; MCanvasGraphic* fCurrentFeedbacker; // not owned #endif }; #endif // Taligent_CANVASCONVENIENCEFILTERS