123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #ifndef LINKBRUSH_H
- #define LINKBRUSH_H
- /*************************************************************************************************\
- LinkBrush.h : Interface for the LinkBrush component.
- //---------------------------------------------------------------------------//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- \*************************************************************************************************/
- #ifndef BRUSH_H
- #include "Brush.h"
- #endif
- #ifndef ACTION_H
- #include "Action.h"
- #endif
- #ifndef BUILDINGLINK_H
- #include "BuildingLink.h"
- #endif
- #include "mclib.h"
- class EditorObject;
- //*************************************************************************************************
- /**************************************************************************************************
- CLASS DESCRIPTION
- LinkBrush:
- **************************************************************************************************/
- class LinkBrush: public Brush
- {
- public:
- LinkBrush( bool bLink );
- virtual ~LinkBrush();
- virtual bool beginPaint();
- virtual Action* endPaint();
- virtual bool paint( Stuff::Vector3D& worldPos, int screenX, int screenY );
- virtual bool canPaint( Stuff::Vector3D& worldPos, int screenX, int screenY, int flags );
- virtual bool canPaintSelection( ){ return false; }
- virtual void render( int screenX, int screenY );
- const EditorObject* parent;
- Stuff::Vector3D parentPos;
- bool bLink;
- bool unPaint( Stuff::Vector3D& worldPos, int screenX, int screenY );
- bool canUnPaint( Stuff::Vector3D& worldPos, int screenX, int screenY, int flags );
- struct LinkInfo
- {
-
- enum TYPE
- {
- ADD = 0,
- REMOVE,
- EDIT
- };
- LinkInfo( BuildingLink* m_pOriginal, TYPE type = EDIT );
-
- BuildingLink m_LinkCopy; // copy of link
- int type;
- };
-
- class LinkAction : public Action
- {
-
- public:
-
-
- LinkAction();
- ~LinkAction( ){}
-
- virtual bool redo();
- virtual bool undo();
- EList< LinkInfo, const LinkInfo& > changedLinks;
- AddToListOnce( const LinkAction::LinkInfo& info );
- };
- LinkAction* pAction;
- };
- //*************************************************************************************************
- #endif // end of file ( LinkBrush.h )
|