1 #ifndef __CONTOUR_WORKSPACE__
2 #define __CONTOUR_WORKSPACE__
5 //------------------------------------------------------------------------------------------------------------
7 //------------------------------------------------------------------------------------------------------------
11 #include "ICommandsUser.h"
12 #include "OutlineModelManager.h"
13 #include "OutlineGroup.h"
14 #include "CommandObject.h"
15 #include "CommandsHandler.h"
16 #include "ICommandsUser.h"
18 class OutlineModelManager;
19 class CommandsHandler;
21 class ContourWorkspace : public ICommandsUser{
23 //------------------------------------------------------------------------------------------------------------
24 // Constructors & Destructors
25 //------------------------------------------------------------------------------------------------------------
29 * Constructs the workspace with the corresponding given parent
30 * @param parent Is the parent relation with
31 * @return Returns a pointer to the created ContourWorkspace
33 ContourWorkspace (OutlineModelManager * parent);
36 * Destroys the ContourWorkspace
40 //------------------------------------------------------------------------------------------------------------
41 // Implamented methods from ICommandsUser.h
42 //------------------------------------------------------------------------------------------------------------
45 * Executes a command by resending the received parameters to its parent to do the appropiate interpretation and execution.
46 * @param theCommand Is the command to execute
47 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
49 virtual bool executeCommand(CommandObject * theCommand, bool fromRegistration=false);
52 * Executes a command queue by resending the received parameters to its parent to do the appropiate interpretation and execution.
53 * @param executionQueue Is the command queue to execute
54 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
56 virtual bool executeCommandsQueue(std::deque<CommandObject *> & executionQueue, bool fromRegistration);
58 //------------------------------------------------------------------------------------------------------------
60 //------------------------------------------------------------------------------------------------------------
63 * Method that propagates an outline over the deep concept of the axe
68 * Sets the working group id and pointer
69 * @param theWorkingGroupKey Is the correspondig key (id) of the working group
70 * @param theGroup Is the correspondig group to work with
72 void setWorkingGroup( int theWorkingGroupKey , OutlineGroup * theGroup);
75 * Gets the working group key
76 * @return theGroupKey Is the correspondig key (id) of the working group
78 int getWorkingGroupKey( );
81 * Calls the execution for UNION of the given outlines
82 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate
84 void callOutline_Union_Of( std::vector<std::string> outlinesNamesToCall );
87 * Calls the execution for INTERSECTION of the given outlines
88 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate
90 void callOutline_Intersection_Of( std::vector<std::string> outlinesNamesToCall );
93 * Calls the execution for COMBINATION of the given outlines
94 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate
96 void callOutline_Combination_Of( std::vector<std::string> outlinesNamesToCall );
99 * Calls the execution for FRAGMENTATION of the given outlines
100 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate
102 void callOutline_Fragmentation_Of( std::vector<std::string> outlinesNamesToCall );
105 * Calls the execution for AGRUPATION of the given outlines
106 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate
108 void callOutline_Agrupation_Of( std::vector<std::string> outlinesNamesToCall );
111 * Calls to redo a the actual REDO command.
112 * @return Returns true if the actual command to execute has been executed.
117 * Calls to undo the actual UNDO command.
118 * @return Returns true if the inverse command is executed.
123 * Calls the registration of the given commands (do, undo) in the commands handler
124 * If is the first registered command notifies the posibleUNDO avaliability.
125 * @param doCommand Is the command to register in the redo_commands vector.
126 * @param unDoCommand Is the command to register in the unDo_commands vector.
128 void callRegisterCommand(CommandObject * doCommand, CommandObject * unDoCommand);
131 * Gets the command handler
133 CommandsHandler * getCommandHandler();
135 void setCommandHandler(CommandsHandler * aCommHandler);
137 //------------------------------------------------------------------------------------------------------------
139 //------------------------------------------------------------------------------------------------------------
142 //------------------------------------------------------------------------------------------------------------
144 //------------------------------------------------------------------------------------------------------------
146 std::vector<std::string> selectedOutlineskNames;
148 std::string actualOutlinekName;
152 OutlineModelManager * theModelBoss;
154 CommandsHandler * commHandler;
156 OutlineGroup * actualGroup;