00001 00002 //---------------------------------------------------------------------------------------------------------------- 00003 // Class definition include 00004 //---------------------------------------------------------------------------------------------------------------- 00005 #include "ContourWorkspace.h" 00006 00007 //---------------------------------------------------------------------------------------------------------------- 00008 // Class implementation 00009 //---------------------------------------------------------------------------------------------------------------- 00012 //------------------------------------------------------------------------------------------------------------ 00013 // Constructors & Destructors 00014 //------------------------------------------------------------------------------------------------------------ 00015 00016 /* 00017 * Constructs the workspace with the corresponding given parent 00018 * @param parent Is the parent relation with 00019 * @return Returns a pointer to the created ContourWorkspace 00020 */ 00021 ContourWorkspace :: ContourWorkspace (OutlineModelManager * parent) 00022 { 00023 theModelBoss = parent; 00024 commHandler = new CommandsHandler(); 00025 commHandler->setModelBoss(this); 00026 } 00027 00028 /* 00029 * Destroys the ContourWorkspace 00030 */ 00031 ContourWorkspace :: ~ ContourWorkspace() 00032 { 00033 00034 } 00035 00036 //------------------------------------------------------------------------------------------------------------ 00037 // Methods 00038 //------------------------------------------------------------------------------------------------------------ 00039 00040 /* 00041 * Executes a command by resending the received parameters to its parent to do the appropiate interpretation and execution. 00042 * @param theCommand Is the command to execute 00043 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false. 00044 */ 00045 bool ContourWorkspace :: executeCommand(CommandObject * theCommand, bool fromRegistration) 00046 { 00047 return theModelBoss->executeCommand(theCommand, fromRegistration); 00048 } 00049 00050 /* 00051 * Executes a command queue by resending the received parameters to its parent to do the appropiate interpretation and execution. 00052 * @param executionQueue Is the command queue to execute 00053 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false. 00054 */ 00055 bool ContourWorkspace :: executeCommandsQueue(std::deque<CommandObject *> & executionQueue, bool fromRegistration) 00056 { 00057 return theModelBoss->executeCommandsQueue(executionQueue, fromRegistration); 00058 } 00059 00063 void ContourWorkspace :: spreadInDepth() 00064 { 00065 //Getting the vector of the actual instant 00066 00067 //Getting the basic object name and patter to create the spreaded outlines 00068 00069 //Variating (i) the depth in the current axe, previously getting the axe size as maxmimum value conditioned by the imageSource deep in the axe direction 00070 00071 //Calling the creation of the section or plane and including it in the correspondig enviroment using the outlineManager for that 00072 00073 //Creating the (i-th) outline and including it in the correspondig enviroment using the outlineManager for that 00074 00075 //Including the (i-th) outline in a new propagation group calling the outlineManager 00076 00077 } 00078 00079 /* 00080 * Sets the working group id and pointer 00081 * @param theWorkingGroupKey Is the correspondig key (id) of the working group 00082 * @param theGroup Is the correspondig group to work with 00083 */ 00084 void ContourWorkspace :: setWorkingGroup( int theWorkingGroupKey , OutlineGroup * theGroup) 00085 { 00086 workingGroupKey = theWorkingGroupKey; 00087 actualGroup = theGroup; 00088 } 00089 00090 /* 00091 * Gets the working group key 00092 * @return theGroupKey Is the correspondig key (id) of the working group 00093 */ 00094 int ContourWorkspace :: getWorkingGroupKey( ) 00095 { 00096 return workingGroupKey; 00097 } 00098 00099 /* 00100 * Calls the execution for UNION of the given outlines 00101 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate 00102 */ 00103 void ContourWorkspace :: callOutline_Union_Of( std::vector<std::string> outlinesNamesToCall ) 00104 { 00105 00106 } 00107 00108 /* 00109 * Calls the execution for INTERSECTION of the given outlines 00110 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate 00111 */ 00112 void ContourWorkspace :: callOutline_Intersection_Of( std::vector<std::string> outlinesNamesToCall ) 00113 { 00114 00115 } 00116 00117 00118 /* 00119 * Calls the execution for COMBINATION of the given outlines 00120 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate 00121 */ 00122 void ContourWorkspace :: callOutline_Combination_Of( std::vector<std::string> outlinesNamesToCall ) 00123 { 00124 00125 } 00126 00127 00128 /* 00129 * Calls the execution for FRAGMENTATION of the given outlines 00130 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate 00131 */ 00132 void ContourWorkspace :: callOutline_Fragmentation_Of( std::vector<std::string> outlinesNamesToCall ) 00133 { 00134 00135 } 00136 00137 /* 00138 * Calls the execution for AGRUPATION of the given outlines 00139 * @param outlinesNamesToCall Is the correspondig vector with the names of the outlines to operate 00140 */ 00141 void ContourWorkspace :: callOutline_Agrupation_Of( std::vector<std::string> outlinesNamesToCall ) 00142 { 00143 00144 } 00145 00146 /* 00147 * Calls to redo a the actual REDO command. 00148 * @return Returns true if the actual command to execute has been executed. 00149 */ 00150 bool ContourWorkspace :: callREDO() 00151 { 00152 return commHandler->redo(); 00153 } 00154 00155 /* 00156 * Calls to undo the actual UNDO command. 00157 * @return Returns true if the inverse command is executed. 00158 */ 00159 bool ContourWorkspace :: callUNDO() 00160 { 00161 return commHandler->undo(); 00162 } 00163 00164 /* 00165 * Calls the registration of the given commands (do, undo) in the commands handler 00166 * If is the first registered command notifies the posibleUNDO avaliability. 00167 * @param doCommand Is the command to register in the redo_commands vector. 00168 * @param unDoCommand Is the command to register in the unDo_commands vector. 00169 */ 00170 void ContourWorkspace :: callRegisterCommand(CommandObject * doCommand, CommandObject * unDoCommand) 00171 { 00172 commHandler->registerCommand( doCommand, unDoCommand ); 00173 } 00174 00175 /* 00176 * Gets the command handler 00177 */ 00178 CommandsHandler * ContourWorkspace :: getCommandHandler() 00179 { 00180 return commHandler; 00181 } 00182 00183 void ContourWorkspace :: setCommandHandler(CommandsHandler * aCommHandler) 00184 { 00185 commHandler = aCommHandler; 00186 }