2 //----------------------------------------------------------------------------------------------------------------
3 // Class definition include
4 //----------------------------------------------------------------------------------------------------------------
5 #include "OutlineModelManager.h"
7 //----------------------------------------------------------------------------------------------------------------
8 // Class implementation
9 //----------------------------------------------------------------------------------------------------------------
10 /** @file OutlineModelManager.cxx */
12 //------------------------------------------------------------------------------------------------------------
13 // Constructors & Destructors
14 //------------------------------------------------------------------------------------------------------------
16 * Creates the outline manager
18 OutlineModelManager :: OutlineModelManager( SomeEnvironment<ImageSourceThing *> *imSourceEnv, SomeEnvironment<ImageSectionThing *> *imSectionEnv, SomeEnvironment<AxeThing *> *axesEnv, SomeEnvironment<ContourThing *> *contourEnv )
21 imageSourceEnvironment = imSourceEnv;
22 imagesSectionEnvironment = imSectionEnv;
23 axesEnvironment = axesEnv;
24 outlinesEnvironment = contourEnv;
26 workSpace = new ContourWorkspace(this);//implies a shared workSpace
27 keyGenerator = * new PrefixMaxKeyGenerator();
30 actualInstantWrapping = new InstantMembersNameList();
31 changeSourceImage = true;
33 bool allOK = keyGenerator.addKeyThing("Axes", "Axe");
34 allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
35 allOK &= keyGenerator.addKeyThing("Image Sections", "Image section");
36 allOK &= keyGenerator.addKeyThing("Outlines", "Outline");
37 //setAutomaticConcepts();
41 * Destroys the outline manager
43 OutlineModelManager :: ~OutlineModelManager()
48 delete actualInstantWrapping;
51 //------------------------------------------------------------------------------------------------------------
53 //------------------------------------------------------------------------------------------------------------
57 * Creates and sets a workSpace object
58 * @return Retourns the created workSpace
60 ContourWorkspace * OutlineModelManager :: createWorkSpace()
62 workSpace = new ContourWorkspace(this);
67 * Sets the workSpace object
68 * @param aWorkSpace The workSpace to set
70 void OutlineModelManager :: setWorkSpace( ContourWorkspace * aWorkSpace )
72 workSpace = aWorkSpace;
76 * Executes a command over an outline object
77 * @param imaKName Is the key name of the outline
78 * @param theCommand Is the command to execute
79 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
81 bool OutlineModelManager :: executeCommand_OutlineModel(std::string outKName, CommandObject * theCommand, bool fromRegistration)
83 ContourThing * theOutline = *outlinesEnvironment->getThingByName( outKName );
86 CommandObject * undoCommand = theOutline->getUndoCommandOf( theCommand );
87 workSpace->callRegisterCommand(theCommand, undoCommand);
89 return theOutline->executeCommand( theCommand );
93 * Executes a command identifying which actions have to realize before executing it.
94 * @param theCommand Is the command to execute
95 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
97 bool OutlineModelManager :: executeCommand(CommandObject * theCommand, bool fromRegistration)
99 bool executedCom = true;
100 //TODO**********************************************************************************************************************************************
101 //Interpreting who is the one that executes the command
103 //Modifiying the command in necessary for detaching interpreted information
105 //If is an outline, sending the command to execute the specific command
111 * Executes a command queue identifying which actions have to realize before executing it, using FIFO for each.
112 * @param executionQueue Is the command queue to execute
113 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
115 bool OutlineModelManager :: executeCommandsQueue(std::deque<CommandObject *> executionQueue, bool fromRegistration)
117 bool executedComs = executionQueue.size()>0 ? true : false;
118 while( executionQueue.size()>0 )
120 CommandObject * aCmmand = executionQueue.front();
121 executedComs &= executeCommand(aCmmand, fromRegistration);
122 executionQueue.pop_front();
129 * Sets the concepts of the environments and includes the concepts managed by the program
130 * @conceptsScript Is the script for with the concepts descrition
131 * @return Returns true if successful insert of the given concepts, false otherwise
133 bool OutlineModelManager :: setUserConcepts(std::string conceptsScript)
137 std::string::size_type equalIndex = conceptsScript.find("=", 0);
138 std::string::size_type nextIndex = 0;
139 while( equalIndex != std::string::npos && allOK)
142 std::string concept = conceptsScript.substr( 0, endSub );
143 conceptsScript.erase( 0, endSub+1 );
144 std::cout << "C: " << concept <<std::endl;
145 nextIndex = conceptsScript.find(";", 0);
147 if(nextIndex != std::string::npos)
150 cSize = conceptsScript.substr( 0, endSub );
151 conceptsScript.erase( 0, endSub+1 );
155 endSub = conceptsScript.size();
156 cSize = conceptsScript.substr( 0, endSub );
157 conceptsScript.erase( 0, endSub );
159 int intReturn = atoi(cSize.c_str());
160 std::cout << "SZ: "<<intReturn <<std::endl;
161 equalIndex = conceptsScript.find("=", 0);
163 allOK &= addUserConcept(concept, intReturn);
171 * Add a concept to all the environments
172 * @param theConceptName Is the name of the new concept
173 * @param conceptSize Is the size of the concept, that represent the ammount of concept posible instances
174 * @return Returns true if successful insert of concept, false otherwise
176 bool OutlineModelManager :: addUserConcept(std::string theConceptName, int conceptSize)
178 bool allOK = axesEnvironment->addConcept(theConceptName, conceptSize);
179 allOK &= imagesSectionEnvironment->addConcept(theConceptName, conceptSize);
180 allOK &= imageSourceEnvironment->addConcept(theConceptName, conceptSize);
181 allOK &= outlinesEnvironment->addConcept(theConceptName, conceptSize);
186 * Gets the outlines at an instant form the outline's environment
187 * @param anInstant The instant wondered to get outlines at
188 * @param ifAnnotate Indicates if it is needed to annotate the searched outlines
189 * @return The vector to the outlines at the given instance
191 std::vector<NameWrapper *> OutlineModelManager :: getActualInstantOutlines ()
193 return actualInstantWrapping->getOutlinesNamesVector();
197 void OutlineModelManager :: ChangeContourOfList(std::string keyName, Instant *instant)
199 int ispartofstaticlist = IsPartOfStaticList(keyName);
200 if (ispartofstaticlist==-1)
202 staticContourLst.push_back( this->outlinesEnvironment->getThingByName(keyName) );
203 this->outlinesEnvironment->removeThingFromInstant(keyName, instant);
205 ContourThing **contourthing = staticContourLst[ispartofstaticlist];
206 this->outlinesEnvironment->addInstantToThing ( keyName , instant );
207 staticContourLst.erase( staticContourLst.begin()+ispartofstaticlist );
213 * Gets the outlines at an instant form the outline's environment
214 * @param anInstant The instant wondered to get outlines at
215 * @param ifAnnotate Indicates if it is needed to annotate the searched outlines
216 * @return The vector to the outlines at the given instance
218 std::vector<ContourThing**> OutlineModelManager :: getOutlinesAtInstant(Instant * anInstant, bool ifAnnotate)
220 std::vector<std::string> kNamesVector;
221 std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
222 outlinesEnvironment->getThings( kNamesVector, outlinesVector, anInstant);
225 int i,sizeStaticContourLst = staticContourLst.size();
226 for ( i=0 ; i<sizeStaticContourLst ; i++ )
228 ContourThing **contourthing = staticContourLst[i];
229 outlinesVector.push_back( contourthing );
230 kNamesVector.push_back( (*contourthing)->getName() );
235 annotateOutlinesWrap(kNamesVector, outlinesVector);
237 return outlinesVector;
241 std::vector<std::string> OutlineModelManager :: GetLstNameThingsStatic()
243 std::vector<std::string> result;
244 int i,sizeStaticContourLst = staticContourLst.size();
245 for ( i=0 ; i<sizeStaticContourLst ; i++ )
247 ContourThing **contourthing = staticContourLst[i];
248 result.push_back( (*contourthing)->getName() );
253 std::vector<std::string> OutlineModelManager :: GetLstNameThings()
255 std::vector<std::string> kNamesVector;
256 std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
257 std::vector<Instant *> lstInstants = getOutlineInstants();
258 int i,sizeLstInstants = lstInstants.size();
260 for ( i=0 ; i<sizeLstInstants ; i++ )
262 instant = lstInstants[i];
263 outlinesEnvironment->getThings( kNamesVector, outlinesVector, instant);
270 * Gets the outlines at a specific form the outline's environment
271 * @param aGroupName The name of the group containing the outlines names to get
272 * @return The vector to the outlines at the given group
274 std::vector<ContourThing*> OutlineModelManager :: getOutlinesFromGroup(std::string aGroupName)
276 std::vector<ContourThing *> outlinesVector;
277 std::map< std::string,OutlineGroup * >::iterator iterP = outlineGroups.find(aGroupName);
278 if ( iterP != outlineGroups.end() )
280 std::vector<std::string> kNamesVector = iterP->second->getGroupOutlinesNames();
281 for(int i=0; i<kNamesVector.size();i++)
283 ContourThing * outlineI = getOutlineByKeyName(kNamesVector[i]);
284 outlinesVector.push_back(outlineI);
287 return outlinesVector;
291 * Gets the outlines at a specific form the outline's environment
292 * @param aGroupName The name of the group containing the outlines names to get
293 * @return The vector to the outlineGroups at the given group
295 bool OutlineModelManager :: addOutlinesGroup( std::string theOutlineName, OutlineGroup * theGroup )
297 outlineGroups.insert(std::pair <std::string, OutlineGroup *> ( theOutlineName, theGroup ));
298 std::map<std::string, OutlineGroup *> :: iterator iter = NULL;
299 iter = outlineGroups.find( theOutlineName );
300 bool ifAdded = iter->first.compare( theOutlineName ) == 0;
304 * Gets the an outline given the keyName used to be indexed in the outlines's environment
305 * @param outKName Is the outline keyName to search
306 * @return The corresponding unique outline with the given key name
308 ContourThing* OutlineModelManager :: getOutlineByKeyName(std::string outKName)
310 return *(outlinesEnvironment->getThingByName(outKName));
314 * Gets the an imageSourceThing given the keyName used to be indexed in the ImageSourceThing's environment
315 * @param outKName Is the imageSourceThing keyName to search
316 * @return The corresponding unique outline with the given key name
318 ImageSourceThing* OutlineModelManager ::getImageSourceThingByKeyName(std::string iSeourceKName)
320 return *(imageSourceEnvironment->getThingByName(iSeourceKName));
324 * Gets the an imageSectionThing given the keyName used to be indexed in the ImageSectionThing's environment
325 * @param outISectionName Is the imageSectionThing keyName to search
326 * @return The corresponding unique outline with the given key name
328 ImageSectionThing* OutlineModelManager ::getImageSectionThingByKeyName(std::string iSectionName)
330 return *(imagesSectionEnvironment->getThingByName(iSectionName));
334 * Creates an outlineThing with a given name, if no name is given it would have an automatic
335 * @param aName The name for the outlineThing
336 * @return Returns the key name of the created outline, or ""if it wasn't created
338 // bool OutlineModelManager :: createOutline(std::string aName, ContourThing * &theOutline)
339 std::string OutlineModelManager :: createOutline(manualContourModel * model, std::vector<int> theInstantData, std::string aName)
341 ContourThing * theOutline = new ContourThing ( model );
342 theOutline->setName(aName);
343 return addOutline( theOutline, new Instant( &theInstantData ) );
347 * Creates an axeThing with a given name
348 * @param aDescription The description for the axeThing
349 * @return Returns true if the creation of the axe was successful
351 //bool OutlineModelManager :: createAxe(std::string aDescription, AxeThing * &theAxe)
352 bool OutlineModelManager :: createAxe(std::string aDescription, Instant * theInstantData)
354 AxeThing * theAxe = new AxeThing ();
355 theAxe->setDescription(aDescription);
356 return addAxe(theAxe, theInstantData);
360 * Creates an imageSourceThing with a given name
361 * @param aSource The name for the imageSourceThing
362 * @return Returns true if the creation of the imageSource was successful
364 //bool OutlineModelManager :: createImageSource(std::string aSource, ImageSourceThing * &imageSource)
365 bool OutlineModelManager :: createImageSource(std::string aSource, Instant * theInstantData)
367 // imageSource = new ImageSourceThing(aSource);
368 //return addImageSource(new ImageSourceThing(aSource), theInstantData);
369 return NULL;//***********************************************************************************************
373 * Creates an imageSectionThing with a given name
374 * @param aSecImageData The name for the imageSectionThing
375 * @return Returns true if the creation of the imageSection was successful
377 //bool OutlineModelManager :: createImageSection(std::string aSecImageData, ImageSectionThing * &imageSection)
378 bool OutlineModelManager :: createImageSection(std::string aSecImageData, Instant * theInstantData)
380 //imageSection = new ImageSectionThing(aSecImageData);
381 // return addImageSection(new ImageSectionThing(aSecImageData), theInstantData);
386 * Adds an outlineThing
387 * @param theOutline The outline/contour (thing)
388 * @param theInstantData Is the instant for the outline to add
389 * @return Returns true if the addition of the outline was successful
391 std::string OutlineModelManager :: addOutline( ContourThing * theOutline, Instant * theInstantData)
396 // bool added = keyGenerator.generateKeyOf("Outlines", outlinesEnvironment->getNumberOfThings(),kName);
399 bool added = keyGenerator.generateKeyOf( "Outlines", counterIdKey , kName );
401 if( theOutline->getName().compare("")==0 )
403 theOutline->setName(kName);
405 added &= outlinesEnvironment->addThingWithInstant(kName,theOutline, theInstantData);
413 int OutlineModelManager::IsPartOfStaticList(std::string ss)
416 int i, size = staticContourLst.size();
417 for( i=0 ; i<size ; i++ )
419 ContourThing **contourthing = staticContourLst[i];
420 if ((*contourthing)->getName() == ss)
430 * Remove an outlineThing
431 * @param theOutline The outline/contour (thing)
433 void OutlineModelManager :: removeOutline( std::string ss )
435 outlinesEnvironment->removeThing( ss );
439 void OutlineModelManager :: removeAllOutlines()
442 staticContourLst.clear();
445 std::vector< ContourThing **> thingsVector;
446 outlinesEnvironment->getThingsOfEnvironment( &thingsVector );
447 int i,sizeThingVector = thingsVector.size();
448 for(i=0;i<sizeThingVector;i++)
450 ContourThing ** contourthing = thingsVector[i];
451 removeOutline( (*contourthing)->getName() );
458 * @param thaAxe The axe (thing)
459 * @param theInstantData Is the instant for the axe to add
460 * @return Returns true if the addition of the axe was successful
462 bool OutlineModelManager :: addAxe( AxeThing * theAxe , Instant * theInstantData)
465 bool added = keyGenerator.generateKeyOf("Axes", axesEnvironment->getNumberOfThings(),kName);
466 added &= axesEnvironment->addThingWithInstant(kName,theAxe, theInstantData);
471 * Adds an imageSourceThing
472 * @param imgageSource The image source (thing)
473 * @param theInstantData Is the instant for the source to add
474 * @return Returns true if the addition of the imageSource was successful
476 bool OutlineModelManager :: addImageSource(ImageSourceThing * imageSource, Instant * theInstantData)
479 bool added = keyGenerator.generateKeyOf("Image Sources", imageSourceEnvironment->getNumberOfThings(),kName);
480 added &= imageSourceEnvironment->addThingWithInstant(kName,imageSource, theInstantData );
485 * Adds an imageSectionThing with a given name, if no name is given it would have an automatic
486 * @param aName The imageSection (thing)
487 * @param theInstantData Is the instant for the imageSection to add
488 * @return Returns true if the addition of the imageSection was successful
490 bool OutlineModelManager :: addImageSection(ImageSectionThing * imageSection, Instant * theInstantData)
493 bool added = keyGenerator.generateKeyOf("Image Sections", imagesSectionEnvironment->getNumberOfThings(),kName);
494 added &= imagesSectionEnvironment->addThingWithInstant(kName, imageSection, theInstantData);
499 * Annotates an outline keyname at the actual instant
500 * @param kOutlineName The key name to annotate
501 * @param theRealName The real name asigned to the outline
503 void OutlineModelManager :: annotateOutlineWrap(std::string kOutlineName, std::string theRealName)
505 actualInstantWrapping -> addOutlineName(kOutlineName, theRealName);
509 * Annotates a set of outline keynames-real names wrapping at the actual instant
510 * @param kNamesVector The key names vector to annotate
511 * @param theOutlinesVector The outlines pointers vector to get the real names from
513 void OutlineModelManager :: annotateOutlinesWrap(std::vector<std::string> kNamesVector, std::vector<ContourThing **> theOutlinesVector)
515 actualInstantWrapping ->clean();
516 for(int i=0; i<kNamesVector.size(); i++)
518 ContourThing * anOutline = *theOutlinesVector[i];
519 actualInstantWrapping -> addOutlineName( kNamesVector[i], anOutline->getName() );
524 * Annotates the actual outline keyName-real name wrapping at the actual instant
525 * @param actualKeyOutline The key name to annotate
526 * @param theRealName The real name asigned to the actual outline
528 void OutlineModelManager :: annotateActualOutlineWrap(std::string actualKeyOutline, std::string theRealName)
530 actualInstantWrapping -> setActualOutline(actualKeyOutline, theRealName);
534 * Annotate the actual axe keyName-real name wrapping at the actual instant
535 * @param actualKeyAxe The key name to annotate
536 * @param theRealName The real name asigned to the actual axe
538 void OutlineModelManager :: annotateActualAxeWrap(std::string actualKeyAxe, std::string theRealName)
540 actualInstantWrapping -> setActualAxeWrap(actualKeyAxe, theRealName);
544 * Annotate the annotateActualSection image keyName-real name wrapping at the actual instant
545 * @param actualKeyImage The key name to annotate
546 * @param theRealName The real name asigned to the annotateActualSection
548 void OutlineModelManager :: annotateActualSectionImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
550 actualInstantWrapping -> setActualSectionImageNamesWrapp(actualKeyImage, theRealName);
554 * Annotate the annotateActualSource image keyName-real name wrapping at the actual instant
555 * @param actualKeyImage The key name to annotate
556 * @param theRealName The real name asigned to the annotateActualSource
558 void OutlineModelManager :: annotateActualSourceImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
560 actualInstantWrapping -> setActualSourceImageNamesWrapp(actualKeyImage, theRealName);
565 * Sets the actual instant and manage the search of the corresponding elements with the specified instant in all the enviornments
566 * @param newActualInstantData Is the instant data
568 void OutlineModelManager :: setInstant(Instant * newActualInstantData)
570 actualInstant = newActualInstantData;
571 updateToActualInstant();
575 * Gets the an axe with a given keyName
576 * @axeKName The axe keyName for searching in the axes environment
577 * @return The corresponding axe
579 AxeThing * OutlineModelManager :: getAxeByKeyName(std::string axeKName)
581 return *axesEnvironment->getThingByName(axeKName);
585 * Gets the instants of a specific outline
586 * @param thekName Is the name of the outline
587 * @return The instants set
589 std::vector<Instant *> OutlineModelManager :: getOutlineInstantsByName(std::string thekName)
591 return *outlinesEnvironment->getInstantsOfThing(thekName);
595 * Gets all instants outlines
596 * @return The instants set
598 std::vector<Instant *> OutlineModelManager :: getOutlineInstants()
600 return *outlinesEnvironment->getExistingInstants();
606 * Includes an instant to the specified axe
607 * @param outKName Is outline key name
608 * @param anInstantData Is the instant data
609 * @return Returns if the insertion was successful or not
611 bool OutlineModelManager :: includeOutlineInstant(std::string outKName,Instant * anInstantData)
613 return outlinesEnvironment->addInstantToThing(outKName,anInstantData);
617 * Includes an instant to the specified axe
618 * @param axeKName Is axe key name
619 * @param anInstantData Is the instant data
620 * @return Returns if the insertion was successful or not
622 bool OutlineModelManager :: includeAxeInstant(std::string axeKName,Instant * anInstantData)
624 return axesEnvironment->addInstantToThing( axeKName,anInstantData );
628 * Includes an instant to the specified image section
629 * @param imaKName Is the image section key name
630 * @param anInstantData Is the instant data
631 * @return Returns if the insertion was successful or not
633 bool OutlineModelManager :: includeImageSectionInstant(std::string imaKName,Instant * anInstantData)
635 return imagesSectionEnvironment->addInstantToThing( imaKName,anInstantData );
639 * Includes an instant to the specified image source
640 * @param imaKName Is the image section key name
641 * @param anInstantData Is the instant data
642 * @return Returns if the insertion was successful or not
644 bool OutlineModelManager :: includeImageSourceInstant(std::string imaKName,Instant * anInstantData)
646 return imageSourceEnvironment->addInstantToThing( imaKName,anInstantData );
650 * Method that retorns the name of each concept and the size of it.
651 * @param conceptNameVect, Vector in which is disposed to be setted the name for each of the included concepts
652 * @param conceptSizeVect, Vector in which is disposed to be setted the size for each of the included concepts
654 void OutlineModelManager :: getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect)
656 if( outlinesEnvironment != NULL )
658 //if (outlinesEnvironment->getNumberOfThings()>0)
659 outlinesEnvironment->getConceptsInformation(conceptNameVect, conceptSizeVect);
665 * Gets the contourWorspace
666 * @return Returns the workspace
668 ContourWorkspace * OutlineModelManager :: getContourWorkspace()
675 * Cleans the outline model manager and its dependencies
677 void OutlineModelManager :: clean()
679 /*axesEnvironment->clean();
680 imagesSectionEnvironment->clean();
681 imageSourceEnvironment->clean();
682 outlinesEnvironment->clean();*/
683 outlineGroups.clear();
684 actualInstantWrapping->clean();
685 keyGenerator.clear();
686 //workSpace->clear();
690 * Update the registered objects in the InstantMemebersNameList, is the one that really changes the instant in the model
692 void OutlineModelManager :: updateToActualInstant()
694 Instant * longInstant = actualInstant;
695 /*Instant * mediumInstant = new Instant();
696 Instant * shortInstant = new Instant();
697 std::vector<int>* theInstant = longInstant->getInstant();
698 for(int i=1; i<theInstant->size(); i++)
701 shortInstant->addConcept( (*theInstant)[i] );
702 mediumInstant->addConcept( (*theInstant)[i] );
705 //getting the sourceAtInstant
706 std::vector<std::string> kSourceVector;
707 std::vector<ImageSourceThing **> imSourceVector;
708 imageSourceEnvironment->getThings(kSourceVector, imSourceVector, shortInstant);
709 annotateActualSourceImageWrap(kSourceVector[0], (**imSourceVector[0]).getSourceImage());
711 //getting the aAxeAtInstant
712 std::vector<std::string> kAxeVector;
713 std::vector<AxeThing **> axesVector;
714 axesEnvironment->getThings(kAxeVector, axesVector, mediumInstant);
715 if ( !kAxeVector.empty() )
716 annotateActualAxeWrap(kAxeVector[0], (**axesVector[0]).getDescription());
718 //getting the sectionAtInstant
719 std::vector<std::string> kSectionVector;
720 std::vector<ImageSectionThing **> imSectionVector;
721 imagesSectionEnvironment->getThings(kSectionVector, imSectionVector, longInstant); if ( !kSectionVector.empty() )
722 //annotateActualSectionImageWrap(kSectionVector[0], (**imSectionVector[0]).getImageData());
725 //getting the outlines
727 std::vector<ContourThing ** > vect = getOutlinesAtInstant( longInstant );
732 * Sets the automatic managed concepts including them in the environments. That are at the beginning of the instant vector for the corresponding environments.
733 * @return Returns true if successful insert of the automatic concepts, false otherwise
735 bool OutlineModelManager :: setAutomaticConcepts()
738 axeDepthConcept = "Axe Depth";
740 int axeDepthC_size = INT_MAX;
742 bool allOK = axesEnvironment->addConcept(axeConcept, axeC_size);
743 allOK &= imagesSectionEnvironment->addConcept(axeConcept, axeC_size);
744 allOK &= outlinesEnvironment->addConcept(axeConcept, axeC_size);
746 allOK &= imagesSectionEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
747 allOK &= outlinesEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
749 allOK &= keyGenerator.addKeyThing("Axes", "Axe");
750 allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
751 allOK &= keyGenerator.addKeyThing("Image Sections", "Image section");
752 allOK &= keyGenerator.addKeyThing("Outlines", "Outline");*/
758 std::string OutlineModelManager :: createCopyContourOf( std::string anExistingKName, std::vector<int> &instantNoTouchData )
760 manualContourModel * manModelContour = getOutlineByKeyName( anExistingKName )->getModel()->Clone();
761 return createOutline( manModelContour, instantNoTouchData );
764 void OutlineModelManager::SaveThingName( FILE *pFile, std::string nameThing )
766 std::vector< Instant * > *lstInstants;
767 lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing );
768 Instant *instant = (*lstInstants)[0];
769 std::vector<int> *vecInst =instant->getInstant();
770 int i,sizeVecInst = vecInst->size();
771 fprintf(pFile,"Instant ");
772 for ( i=0 ; i<sizeVecInst ; i++ )
774 fprintf(pFile,"%d ",(*vecInst)[i]);
777 ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
778 contourthing->getModel()->Save(pFile);