1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
27 //----------------------------------------------------------------------------------------------------------------
28 // Class definition include
29 //----------------------------------------------------------------------------------------------------------------
30 #include "OutlineModelManager.h"
32 //----------------------------------------------------------------------------------------------------------------
33 // Class implementation
34 //----------------------------------------------------------------------------------------------------------------
35 /** @file OutlineModelManager.cxx */
37 //------------------------------------------------------------------------------------------------------------
38 // Constructors & Destructors
39 //------------------------------------------------------------------------------------------------------------
41 * Creates the outline manager
43 OutlineModelManager :: OutlineModelManager( SomeEnvironment<ImageSourceThing *> *imSourceEnv, SomeEnvironment<ImageSectionThing *> *imSectionEnv, SomeEnvironment<AxeThing *> *axesEnv, SomeEnvironment<ContourThing *> *contourEnv )
46 imageSourceEnvironment = imSourceEnv;
47 imagesSectionEnvironment = imSectionEnv;
48 axesEnvironment = axesEnv;
49 outlinesEnvironment = contourEnv;
51 workSpace = new ContourWorkspace(this);//implies a shared workSpace
52 keyGenerator = * new PrefixMaxKeyGenerator();
55 actualInstantWrapping = new InstantMembersNameList();
56 changeSourceImage = true;
58 bool allOK = keyGenerator.addKeyThing("Axes", "Axe");
59 allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
60 allOK &= keyGenerator.addKeyThing("Image Sections", "Image section");
61 allOK &= keyGenerator.addKeyThing("Outlines", "Outline");
62 //setAutomaticConcepts();
66 * Destroys the outline manager
68 OutlineModelManager :: ~OutlineModelManager()
73 delete actualInstantWrapping;
76 //------------------------------------------------------------------------------------------------------------
78 //------------------------------------------------------------------------------------------------------------
82 * Creates and sets a workSpace object
83 * @return Retourns the created workSpace
85 ContourWorkspace * OutlineModelManager :: createWorkSpace()
87 workSpace = new ContourWorkspace(this);
92 * Sets the workSpace object
93 * @param aWorkSpace The workSpace to set
95 void OutlineModelManager :: setWorkSpace( ContourWorkspace * aWorkSpace )
97 workSpace = aWorkSpace;
101 * Executes a command over an outline object
102 * @param imaKName Is the key name of the outline
103 * @param theCommand Is the command to execute
104 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
107 bool OutlineModelManager :: executeCommand_OutlineModel(std::string outKName, CommandObject * theCommand, bool fromRegistration)
109 ContourThing * theOutline = *outlinesEnvironment->getThingByName( outKName );
110 if(!fromRegistration)
112 CommandObject * undoCommand = theOutline->getUndoCommandOf( theCommand );
113 workSpace->callRegisterCommand(theCommand, undoCommand);
115 return theOutline->executeCommand( theCommand );
119 * Executes a command identifying which actions have to realize before executing it.
120 * @param theCommand Is the command to execute
121 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
123 bool OutlineModelManager :: executeCommand(CommandObject * theCommand, bool fromRegistration)
125 bool executedCom = true;
126 //TODO**********************************************************************************************************************************************
127 //Interpreting who is the one that executes the command
129 //Modifiying the command in necessary for detaching interpreted information
131 //If is an outline, sending the command to execute the specific command
137 * Executes a command queue identifying which actions have to realize before executing it, using FIFO for each.
138 * @param executionQueue Is the command queue to execute
139 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
141 bool OutlineModelManager :: executeCommandsQueue(std::deque<CommandObject *> executionQueue, bool fromRegistration)
143 bool executedComs = executionQueue.size()>0 ? true : false;
144 while( executionQueue.size()>0 )
146 CommandObject * aCmmand = executionQueue.front();
147 executedComs &= executeCommand(aCmmand, fromRegistration);
148 executionQueue.pop_front();
155 * Sets the concepts of the environments and includes the concepts managed by the program
156 * @conceptsScript Is the script for with the concepts descrition
157 * @return Returns true if successful insert of the given concepts, false otherwise
159 bool OutlineModelManager :: setUserConcepts(std::string conceptsScript)
163 std::string::size_type equalIndex = conceptsScript.find("=", 0);
164 std::string::size_type nextIndex = 0;
165 while( equalIndex != std::string::npos && allOK)
168 std::string concept = conceptsScript.substr( 0, endSub );
169 conceptsScript.erase( 0, endSub+1 );
170 std::cout << "C: " << concept <<std::endl;
171 nextIndex = conceptsScript.find(";", 0);
173 if(nextIndex != std::string::npos)
176 cSize = conceptsScript.substr( 0, endSub );
177 conceptsScript.erase( 0, endSub+1 );
181 endSub = conceptsScript.size();
182 cSize = conceptsScript.substr( 0, endSub );
183 conceptsScript.erase( 0, endSub );
185 int intReturn = atoi(cSize.c_str());
186 std::cout << "SZ: "<<intReturn <<std::endl;
187 equalIndex = conceptsScript.find("=", 0);
189 allOK &= addUserConcept(concept, intReturn);
197 * Add a concept to all the environments
198 * @param theConceptName Is the name of the new concept
199 * @param conceptSize Is the size of the concept, that represent the ammount of concept posible instances
200 * @return Returns true if successful insert of concept, false otherwise
202 bool OutlineModelManager :: addUserConcept(std::string theConceptName, int conceptSize)
204 bool allOK = axesEnvironment->addConcept(theConceptName, conceptSize);
205 allOK &= imagesSectionEnvironment->addConcept(theConceptName, conceptSize);
206 allOK &= imageSourceEnvironment->addConcept(theConceptName, conceptSize);
207 allOK &= outlinesEnvironment->addConcept(theConceptName, conceptSize);
212 * Gets the outlines at an instant form the outline's environment
213 * @param anInstant The instant wondered to get outlines at
214 * @param ifAnnotate Indicates if it is needed to annotate the searched outlines
215 * @return The vector to the outlines at the given instance
217 std::vector<NameWrapper *> OutlineModelManager :: getActualInstantOutlines ()
219 return actualInstantWrapping->getOutlinesNamesVector();
223 void OutlineModelManager :: ChangeContourOfList(std::string keyName, Instant *instant)
225 int ispartofstaticlist = IsPartOfStaticList(keyName);
226 if (ispartofstaticlist==-1)
228 staticContourLst.push_back( this->outlinesEnvironment->getThingByName(keyName) );
229 this->outlinesEnvironment->removeThingFromInstant(keyName, instant);
231 ContourThing **contourthing = staticContourLst[ispartofstaticlist];
232 this->outlinesEnvironment->addInstantToThing ( keyName , instant );
233 staticContourLst.erase( staticContourLst.begin()+ispartofstaticlist );
239 * Gets the outlines at an instant form the outline's environment
240 * @param anInstant The instant wondered to get outlines at
241 * @param ifAnnotate Indicates if it is needed to annotate the searched outlines
242 * @return The vector to the outlines at the given instance
244 std::vector<ContourThing**> OutlineModelManager :: getOutlinesAtInstant(Instant * anInstant, bool ifAnnotate)
246 std::vector<std::string> kNamesVector;
247 std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
248 outlinesEnvironment->getThings( kNamesVector, outlinesVector, anInstant);
251 int i,sizeStaticContourLst = staticContourLst.size();
252 for ( i=0 ; i<sizeStaticContourLst ; i++ )
254 ContourThing **contourthing = staticContourLst[i];
255 outlinesVector.push_back( contourthing );
256 kNamesVector.push_back( (*contourthing)->getName() );
261 annotateOutlinesWrap(kNamesVector, outlinesVector);
263 return outlinesVector;
267 std::vector<std::string> OutlineModelManager :: GetLstNameThingsStatic()
269 std::vector<std::string> result;
270 int i,sizeStaticContourLst = staticContourLst.size();
271 for ( i=0 ; i<sizeStaticContourLst ; i++ )
273 ContourThing **contourthing = staticContourLst[i];
274 result.push_back( (*contourthing)->getName() );
279 std::vector<std::string> OutlineModelManager :: GetLstNameThings()
281 std::vector<std::string> kNamesVector;
282 std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
283 std::vector<Instant *> lstInstants = getOutlineInstants();
284 int i,sizeLstInstants = lstInstants.size();
286 for ( i=0 ; i<sizeLstInstants ; i++ )
288 instant = lstInstants[i];
289 outlinesEnvironment->getThings( kNamesVector, outlinesVector, instant);
296 * Gets the outlines at a specific form the outline's environment
297 * @param aGroupName The name of the group containing the outlines names to get
298 * @return The vector to the outlines at the given group
300 std::vector<ContourThing*> OutlineModelManager :: getOutlinesFromGroup(std::string aGroupName)
302 std::vector<ContourThing *> outlinesVector;
303 std::map< std::string,OutlineGroup * >::iterator iterP = outlineGroups.find(aGroupName);
304 if ( iterP != outlineGroups.end() )
306 std::vector<std::string> kNamesVector = iterP->second->getGroupOutlinesNames();
307 for(int i=0; i<kNamesVector.size();i++)
309 ContourThing * outlineI = getOutlineByKeyName(kNamesVector[i]);
310 outlinesVector.push_back(outlineI);
313 return outlinesVector;
317 * Gets the outlines at a specific form the outline's environment
318 * @param aGroupName The name of the group containing the outlines names to get
319 * @return The vector to the outlineGroups at the given group
321 bool OutlineModelManager :: addOutlinesGroup( std::string theOutlineName, OutlineGroup * theGroup )
323 outlineGroups.insert(std::pair <std::string, OutlineGroup *> ( theOutlineName, theGroup ));
324 // std::map<std::string, OutlineGroup *> :: iterator iter = NULL;
325 std::map<std::string, OutlineGroup *> :: iterator iter;
326 iter = outlineGroups.find( theOutlineName );
327 bool ifAdded = iter->first.compare( theOutlineName ) == 0;
331 * Gets the an outline given the keyName used to be indexed in the outlines's environment
332 * @param outKName Is the outline keyName to search
333 * @return The corresponding unique outline with the given key name
335 ContourThing* OutlineModelManager :: getOutlineByKeyName(std::string outKName)
337 return *(outlinesEnvironment->getThingByName(outKName));
341 * Gets the an imageSourceThing given the keyName used to be indexed in the ImageSourceThing's environment
342 * @param outKName Is the imageSourceThing keyName to search
343 * @return The corresponding unique outline with the given key name
345 ImageSourceThing* OutlineModelManager ::getImageSourceThingByKeyName(std::string iSeourceKName)
347 return *(imageSourceEnvironment->getThingByName(iSeourceKName));
351 * Gets the an imageSectionThing given the keyName used to be indexed in the ImageSectionThing's environment
352 * @param outISectionName Is the imageSectionThing keyName to search
353 * @return The corresponding unique outline with the given key name
355 ImageSectionThing* OutlineModelManager ::getImageSectionThingByKeyName(std::string iSectionName)
357 return *(imagesSectionEnvironment->getThingByName(iSectionName));
361 * Creates an outlineThing with a given name, if no name is given it would have an automatic
362 * @param aName The name for the outlineThing
363 * @return Returns the key name of the created outline, or ""if it wasn't created
365 // bool OutlineModelManager :: createOutline(std::string aName, ContourThing * &theOutline)
366 std::string OutlineModelManager :: createOutline(manualBaseModel * model, std::vector<int> theInstantData, std::string aName)
368 ContourThing * theOutline = new ContourThing ( model );
369 theOutline->setName(aName);
370 return addOutline( theOutline, new Instant( &theInstantData ) );
374 * Creates an axeThing with a given name
375 * @param aDescription The description for the axeThing
376 * @return Returns true if the creation of the axe was successful
378 //bool OutlineModelManager :: createAxe(std::string aDescription, AxeThing * &theAxe)
379 bool OutlineModelManager :: createAxe(std::string aDescription, Instant * theInstantData)
381 AxeThing * theAxe = new AxeThing ();
382 theAxe->setDescription(aDescription);
383 return addAxe(theAxe, theInstantData);
387 * Creates an imageSourceThing with a given name
388 * @param aSource The name for the imageSourceThing
389 * @return Returns true if the creation of the imageSource was successful
391 //bool OutlineModelManager :: createImageSource(std::string aSource, ImageSourceThing * &imageSource)
392 bool OutlineModelManager :: createImageSource(std::string aSource, Instant * theInstantData)
394 // imageSource = new ImageSourceThing(aSource);
395 //return addImageSource(new ImageSourceThing(aSource), theInstantData);
397 // return NULL;//***********************************************************************************************
402 * Creates an imageSectionThing with a given name
403 * @param aSecImageData The name for the imageSectionThing
404 * @return Returns true if the creation of the imageSection was successful
406 //bool OutlineModelManager :: createImageSection(std::string aSecImageData, ImageSectionThing * &imageSection)
407 bool OutlineModelManager :: createImageSection(std::string aSecImageData, Instant * theInstantData)
409 //imageSection = new ImageSectionThing(aSecImageData);
410 // return addImageSection(new ImageSectionThing(aSecImageData), theInstantData);
412 // return NULL;//***********************************************************************************************
417 * Adds an outlineThing
418 * @param theOutline The outline/contour (thing)
419 * @param theInstantData Is the instant for the outline to add
420 * @return Returns true if the addition of the outline was successful
422 std::string OutlineModelManager :: addOutline( ContourThing * theOutline, Instant * theInstantData)
427 // bool added = keyGenerator.generateKeyOf("Outlines", outlinesEnvironment->getNumberOfThings(),kName);
430 bool added = keyGenerator.generateKeyOf( "Outlines", counterIdKey , kName );
432 if( theOutline->getName().compare("")==0 )
434 theOutline->setName(kName);
436 added &= outlinesEnvironment->addThingWithInstant(kName,theOutline, theInstantData);
444 int OutlineModelManager::IsPartOfStaticList(std::string ss)
447 int i, size = staticContourLst.size();
448 for( i=0 ; i<size ; i++ )
450 ContourThing **contourthing = staticContourLst[i];
451 if ((*contourthing)->getName() == ss)
461 * Remove an outlineThing
462 * @param theOutline The outline/contour (thing)
464 void OutlineModelManager :: removeOutline( std::string ss )
466 outlinesEnvironment->removeThing( ss );
470 void OutlineModelManager :: removeAllOutlines()
473 staticContourLst.clear();
476 std::vector< ContourThing **> thingsVector;
477 outlinesEnvironment->getThingsOfEnvironment( &thingsVector );
478 int i,sizeThingVector = thingsVector.size();
479 for(i=0;i<sizeThingVector;i++)
481 ContourThing ** contourthing = thingsVector[i];
482 removeOutline( (*contourthing)->getName() );
489 * @param thaAxe The axe (thing)
490 * @param theInstantData Is the instant for the axe to add
491 * @return Returns true if the addition of the axe was successful
493 bool OutlineModelManager :: addAxe( AxeThing * theAxe , Instant * theInstantData)
496 bool added = keyGenerator.generateKeyOf("Axes", axesEnvironment->getNumberOfThings(),kName);
497 added &= axesEnvironment->addThingWithInstant(kName,theAxe, theInstantData);
502 * Adds an imageSourceThing
503 * @param imgageSource The image source (thing)
504 * @param theInstantData Is the instant for the source to add
505 * @return Returns true if the addition of the imageSource was successful
507 bool OutlineModelManager :: addImageSource(ImageSourceThing * imageSource, Instant * theInstantData)
510 bool added = keyGenerator.generateKeyOf("Image Sources", imageSourceEnvironment->getNumberOfThings(),kName);
511 added &= imageSourceEnvironment->addThingWithInstant(kName,imageSource, theInstantData );
516 * Adds an imageSectionThing with a given name, if no name is given it would have an automatic
517 * @param aName The imageSection (thing)
518 * @param theInstantData Is the instant for the imageSection to add
519 * @return Returns true if the addition of the imageSection was successful
521 bool OutlineModelManager :: addImageSection(ImageSectionThing * imageSection, Instant * theInstantData)
524 bool added = keyGenerator.generateKeyOf("Image Sections", imagesSectionEnvironment->getNumberOfThings(),kName);
525 added &= imagesSectionEnvironment->addThingWithInstant(kName, imageSection, theInstantData);
530 * Annotates an outline keyname at the actual instant
531 * @param kOutlineName The key name to annotate
532 * @param theRealName The real name asigned to the outline
534 void OutlineModelManager :: annotateOutlineWrap(std::string kOutlineName, std::string theRealName)
536 actualInstantWrapping -> addOutlineName(kOutlineName, theRealName);
540 * Annotates a set of outline keynames-real names wrapping at the actual instant
541 * @param kNamesVector The key names vector to annotate
542 * @param theOutlinesVector The outlines pointers vector to get the real names from
544 void OutlineModelManager :: annotateOutlinesWrap(std::vector<std::string> kNamesVector, std::vector<ContourThing **> theOutlinesVector)
546 actualInstantWrapping ->clean();
547 for(int i=0; i<kNamesVector.size(); i++)
549 ContourThing * anOutline = *theOutlinesVector[i];
550 actualInstantWrapping -> addOutlineName( kNamesVector[i], anOutline->getName() );
555 * Annotates the actual outline keyName-real name wrapping at the actual instant
556 * @param actualKeyOutline The key name to annotate
557 * @param theRealName The real name asigned to the actual outline
559 void OutlineModelManager :: annotateActualOutlineWrap(std::string actualKeyOutline, std::string theRealName)
561 actualInstantWrapping -> setActualOutline(actualKeyOutline, theRealName);
565 * Annotate the actual axe keyName-real name wrapping at the actual instant
566 * @param actualKeyAxe The key name to annotate
567 * @param theRealName The real name asigned to the actual axe
569 void OutlineModelManager :: annotateActualAxeWrap(std::string actualKeyAxe, std::string theRealName)
571 actualInstantWrapping -> setActualAxeWrap(actualKeyAxe, theRealName);
575 * Annotate the annotateActualSection image keyName-real name wrapping at the actual instant
576 * @param actualKeyImage The key name to annotate
577 * @param theRealName The real name asigned to the annotateActualSection
579 void OutlineModelManager :: annotateActualSectionImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
581 actualInstantWrapping -> setActualSectionImageNamesWrapp(actualKeyImage, theRealName);
585 * Annotate the annotateActualSource image keyName-real name wrapping at the actual instant
586 * @param actualKeyImage The key name to annotate
587 * @param theRealName The real name asigned to the annotateActualSource
589 void OutlineModelManager :: annotateActualSourceImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
591 actualInstantWrapping -> setActualSourceImageNamesWrapp(actualKeyImage, theRealName);
596 * Sets the actual instant and manage the search of the corresponding elements with the specified instant in all the enviornments
597 * @param newActualInstantData Is the instant data
599 void OutlineModelManager :: setInstant(Instant * newActualInstantData)
601 actualInstant = newActualInstantData;
602 updateToActualInstant();
605 Instant* OutlineModelManager :: getInstant()
607 return actualInstant;
611 * Gets the an axe with a given keyName
612 * @axeKName The axe keyName for searching in the axes environment
613 * @return The corresponding axe
615 AxeThing * OutlineModelManager :: getAxeByKeyName(std::string axeKName)
617 return *axesEnvironment->getThingByName(axeKName);
621 * Gets the instants of a specific outline
622 * @param thekName Is the name of the outline
623 * @return The instants set
625 std::vector<Instant *> OutlineModelManager :: getOutlineInstantsByName(std::string thekName)
627 return *outlinesEnvironment->getInstantsOfThing(thekName);
631 * Gets all instants outlines
632 * @return The instants set
634 std::vector<Instant *> OutlineModelManager :: getOutlineInstants()
636 return *outlinesEnvironment->getExistingInstants();
642 * Includes an instant to the specified axe
643 * @param outKName Is outline key name
644 * @param anInstantData Is the instant data
645 * @return Returns if the insertion was successful or not
647 bool OutlineModelManager :: includeOutlineInstant(std::string outKName,Instant * anInstantData)
649 return outlinesEnvironment->addInstantToThing(outKName,anInstantData);
653 * Includes an instant to the specified axe
654 * @param axeKName Is axe key name
655 * @param anInstantData Is the instant data
656 * @return Returns if the insertion was successful or not
658 bool OutlineModelManager :: includeAxeInstant(std::string axeKName,Instant * anInstantData)
660 return axesEnvironment->addInstantToThing( axeKName,anInstantData );
664 * Includes an instant to the specified image section
665 * @param imaKName Is the image section key name
666 * @param anInstantData Is the instant data
667 * @return Returns if the insertion was successful or not
669 bool OutlineModelManager :: includeImageSectionInstant(std::string imaKName,Instant * anInstantData)
671 return imagesSectionEnvironment->addInstantToThing( imaKName,anInstantData );
675 * Includes an instant to the specified image source
676 * @param imaKName Is the image section key name
677 * @param anInstantData Is the instant data
678 * @return Returns if the insertion was successful or not
680 bool OutlineModelManager :: includeImageSourceInstant(std::string imaKName,Instant * anInstantData)
682 return imageSourceEnvironment->addInstantToThing( imaKName,anInstantData );
686 * Method that retorns the name of each concept and the size of it.
687 * @param conceptNameVect, Vector in which is disposed to be setted the name for each of the included concepts
688 * @param conceptSizeVect, Vector in which is disposed to be setted the size for each of the included concepts
690 void OutlineModelManager :: getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect)
692 if( outlinesEnvironment != NULL )
694 //if (outlinesEnvironment->getNumberOfThings()>0)
695 outlinesEnvironment->getConceptsInformation(conceptNameVect, conceptSizeVect);
701 * Gets the contourWorspace
702 * @return Returns the workspace
704 ContourWorkspace * OutlineModelManager :: getContourWorkspace()
711 * Cleans the outline model manager and its dependencies
713 void OutlineModelManager :: clean()
715 /*axesEnvironment->clean();
716 imagesSectionEnvironment->clean();
717 imageSourceEnvironment->clean();
718 outlinesEnvironment->clean();*/
719 outlineGroups.clear();
720 actualInstantWrapping->clean();
721 keyGenerator.clear();
722 //workSpace->clear();
726 * Update the registered objects in the InstantMemebersNameList, is the one that really changes the instant in the model
728 void OutlineModelManager :: updateToActualInstant()
730 Instant * longInstant = actualInstant;
731 /*Instant * mediumInstant = new Instant();
732 Instant * shortInstant = new Instant();
733 std::vector<int>* theInstant = longInstant->getInstant();
734 for(int i=1; i<theInstant->size(); i++)
737 shortInstant->addConcept( (*theInstant)[i] );
738 mediumInstant->addConcept( (*theInstant)[i] );
741 //getting the sourceAtInstant
742 std::vector<std::string> kSourceVector;
743 std::vector<ImageSourceThing **> imSourceVector;
744 imageSourceEnvironment->getThings(kSourceVector, imSourceVector, shortInstant);
745 annotateActualSourceImageWrap(kSourceVector[0], (**imSourceVector[0]).getSourceImage());
747 //getting the aAxeAtInstant
748 std::vector<std::string> kAxeVector;
749 std::vector<AxeThing **> axesVector;
750 axesEnvironment->getThings(kAxeVector, axesVector, mediumInstant);
751 if ( !kAxeVector.empty() )
752 annotateActualAxeWrap(kAxeVector[0], (**axesVector[0]).getDescription());
754 //getting the sectionAtInstant
755 std::vector<std::string> kSectionVector;
756 std::vector<ImageSectionThing **> imSectionVector;
757 imagesSectionEnvironment->getThings(kSectionVector, imSectionVector, longInstant); if ( !kSectionVector.empty() )
758 //annotateActualSectionImageWrap(kSectionVector[0], (**imSectionVector[0]).getImageData());
761 //getting the outlines
763 std::vector<ContourThing ** > vect = getOutlinesAtInstant( longInstant );
768 * Sets the automatic managed concepts including them in the environments. That are at the beginning of the instant vector for the corresponding environments.
769 * @return Returns true if successful insert of the automatic concepts, false otherwise
771 bool OutlineModelManager :: setAutomaticConcepts()
774 axeDepthConcept = "Axe Depth";
776 int axeDepthC_size = INT_MAX;
778 bool allOK = axesEnvironment->addConcept(axeConcept, axeC_size);
779 allOK &= imagesSectionEnvironment->addConcept(axeConcept, axeC_size);
780 allOK &= outlinesEnvironment->addConcept(axeConcept, axeC_size);
782 allOK &= imagesSectionEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
783 allOK &= outlinesEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
785 allOK &= keyGenerator.addKeyThing("Axes", "Axe");
786 allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
787 allOK &= keyGenerator.addKeyThing("Image Sections", "Image section");
788 allOK &= keyGenerator.addKeyThing("Outlines", "Outline");*/
794 std::string OutlineModelManager :: createCopyContourOf( std::string anExistingKName, std::vector<int> &instantNoTouchData )
796 manualBaseModel * manModelContour = getOutlineByKeyName( anExistingKName )->getModel()->Clone();
797 return createOutline( manModelContour, instantNoTouchData );
800 void OutlineModelManager::SaveThingName( FILE *pFile, FILE *pFileData, std::string nameThing )
802 std::vector< Instant * > *lstInstants;
803 lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing );
804 Instant *instant = (*lstInstants)[0];
805 std::vector<int> *vecInst =instant->getInstant();
806 int i,sizeVecInst = vecInst->size();
807 fprintf(pFile,"Instant ");
808 for ( i=0 ; i<sizeVecInst ; i++ )
810 fprintf(pFile,"%d ",(*vecInst)[i]);
813 ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
814 contourthing->getModel()->Save(pFile);
815 contourthing->getModel()->SaveData(pFileData);