// $Revision: 1.14 $ // Copyright (C) 1994 Taligent, Inc. All rights reserved. #ifndef Taligent_CANVASPOLYGON #define Taligent_CANVASPOLYGON #ifndef Taligent_GRAFEDIT #include #endif #ifndef Taligent_CANVASINTERACTION #include #endif #ifndef Taligent_MOUSECURSORTOOLS #include #endif #ifndef Taligent_PRIMITIVECLASSES #include #endif // Classes defined in this file: class TCanvasPolygon; class TCanvasPolygonCreationTool; class TCanvasPolygonCreationInteractor; // ******************************************************************************** // class TCanvasPolygon // // description Basic GrafEdit polygon graphic. // // ******************************************************************************** class TCanvasPolygon : public MCanvasGraphic { public: TCanvasPolygon (const TGPolygon&); TCanvasPolygon (const TCanvasPolygon&); virtual ~TCanvasPolygon(); //======================================== // MCollectible overrides //======================================== MCollectibleDeclarationsMacro (TCanvasPolygon); DynamicCastDeclarationsMacro (); // NOTE: MCanvasGraphic subclasses need not implement IsEqual // or Hash since MCanvasGraphic provides implementations based // based on TCanvasGraphicIDs. TCanvasPolygon& operator= (const TCanvasPolygon&); virtual TStream& operator>>= (TStream&) const; virtual TStream& operator<<= (TStream&); //======================================== // TGraphicComponent overrides //======================================== virtual void HandleDraw (TGrafPort&) const; virtual TGRect HandleGetBounds () const; virtual bool HandleHit (const TGPoint&) const; //======================================== // TPolygonComponent methods //======================================== bool GetParametric (const TGPoint&, GCoordinate& u) const; void DragPolygonTo (GCoordinate u, const TGPoint&); protected: // Default constructor for MCollectible cloning and subclasses TCanvasPolygon (); #ifndef NO_Internal private: void* fExtension; TDeleterFor fPolygon; TGRect fBounds; enum Version { kOriginalVersion }; #endif }; // ******************************************************************************** // class TCanvasPolygonCreationTool // // description Tool that creates canvas polygons. // // ******************************************************************************** class TCanvasPolygonCreationTool : public TSimpleMouseTool { public: TCanvasPolygonCreationTool (); TCanvasPolygonCreationTool (const TCanvasPolygonCreationTool&); virtual ~TCanvasPolygonCreationTool (); //======================================== // MCollectible overrides //======================================== MCollectibleDeclarationsMacro (TCanvasPolygonCreationTool); // NOTE: TTool subclasses need not implement IsEqual or // Hash since TTool provides implementations based // on global IDs. TCanvasPolygonCreationTool& operator= (const TCanvasPolygonCreationTool&); virtual TStream& operator>>= (TStream&) const; virtual TStream& operator<<= (TStream&); //======================================== // TTool overrides //======================================== virtual void GetPaletteText (TText&) const; virtual MGraphic* CreatePaletteGraphic () const; virtual MGraphic* CreateCursorGraphic () const; //======================================== // TSimpleMouseTool overrides //======================================== virtual TToolInteractor* CreateInteractor (MToolTarget* target) const; #ifndef NO_Internal private: void* fExtension; enum Version { kOriginalVersion }; #endif }; // ******************************************************************************** // class TCanvasPolygonCreationInteractor // // description An interactor that creates canvas polygons from multiple // click points, terminated with a double-click. // // ******************************************************************************** class TCanvasPolygonCreationInteractor : public TCanvasPolylineMulticlickInteractor { public: TCanvasPolygonCreationInteractor (MCanvasSelection* adoptTarget, MToolHandler*); virtual ~TCanvasPolygonCreationInteractor (); //======================================== // Metadata //======================================== VersionDeclarationsMacro (TCanvasPolygonCreationInteractor); //======================================== // TCanvasInteractor Overrides //======================================== virtual void EndInteraction (); #ifndef NO_Internal private: void* fExtension; TDeleterFor fTarget; #endif }; #endif // Taligent_CANVASPOLYGON