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);
396 return NULL;//***********************************************************************************************
400 * Creates an imageSectionThing with a given name
401 * @param aSecImageData The name for the imageSectionThing
402 * @return Returns true if the creation of the imageSection was successful
404 //bool OutlineModelManager :: createImageSection(std::string aSecImageData, ImageSectionThing * &imageSection)
405 bool OutlineModelManager :: createImageSection(std::string aSecImageData, Instant * theInstantData)
407 //imageSection = new ImageSectionThing(aSecImageData);
408 // return addImageSection(new ImageSectionThing(aSecImageData), theInstantData);
413 * Adds an outlineThing
414 * @param theOutline The outline/contour (thing)
415 * @param theInstantData Is the instant for the outline to add
416 * @return Returns true if the addition of the outline was successful
418 std::string OutlineModelManager :: addOutline( ContourThing * theOutline, Instant * theInstantData)
423 // bool added = keyGenerator.generateKeyOf("Outlines", outlinesEnvironment->getNumberOfThings(),kName);
426 bool added = keyGenerator.generateKeyOf( "Outlines", counterIdKey , kName );
428 if( theOutline->getName().compare("")==0 )
430 theOutline->setName(kName);
432 added &= outlinesEnvironment->addThingWithInstant(kName,theOutline, theInstantData);
440 int OutlineModelManager::IsPartOfStaticList(std::string ss)
443 int i, size = staticContourLst.size();
444 for( i=0 ; i<size ; i++ )
446 ContourThing **contourthing = staticContourLst[i];
447 if ((*contourthing)->getName() == ss)
457 * Remove an outlineThing
458 * @param theOutline The outline/contour (thing)
460 void OutlineModelManager :: removeOutline( std::string ss )
462 outlinesEnvironment->removeThing( ss );
466 void OutlineModelManager :: removeAllOutlines()
469 staticContourLst.clear();
472 std::vector< ContourThing **> thingsVector;
473 outlinesEnvironment->getThingsOfEnvironment( &thingsVector );
474 int i,sizeThingVector = thingsVector.size();
475 for(i=0;i<sizeThingVector;i++)
477 ContourThing ** contourthing = thingsVector[i];
478 removeOutline( (*contourthing)->getName() );
485 * @param thaAxe The axe (thing)
486 * @param theInstantData Is the instant for the axe to add
487 * @return Returns true if the addition of the axe was successful
489 bool OutlineModelManager :: addAxe( AxeThing * theAxe , Instant * theInstantData)
492 bool added = keyGenerator.generateKeyOf("Axes", axesEnvironment->getNumberOfThings(),kName);
493 added &= axesEnvironment->addThingWithInstant(kName,theAxe, theInstantData);
498 * Adds an imageSourceThing
499 * @param imgageSource The image source (thing)
500 * @param theInstantData Is the instant for the source to add
501 * @return Returns true if the addition of the imageSource was successful
503 bool OutlineModelManager :: addImageSource(ImageSourceThing * imageSource, Instant * theInstantData)
506 bool added = keyGenerator.generateKeyOf("Image Sources", imageSourceEnvironment->getNumberOfThings(),kName);
507 added &= imageSourceEnvironment->addThingWithInstant(kName,imageSource, theInstantData );
512 * Adds an imageSectionThing with a given name, if no name is given it would have an automatic
513 * @param aName The imageSection (thing)
514 * @param theInstantData Is the instant for the imageSection to add
515 * @return Returns true if the addition of the imageSection was successful
517 bool OutlineModelManager :: addImageSection(ImageSectionThing * imageSection, Instant * theInstantData)
520 bool added = keyGenerator.generateKeyOf("Image Sections", imagesSectionEnvironment->getNumberOfThings(),kName);
521 added &= imagesSectionEnvironment->addThingWithInstant(kName, imageSection, theInstantData);
526 * Annotates an outline keyname at the actual instant
527 * @param kOutlineName The key name to annotate
528 * @param theRealName The real name asigned to the outline
530 void OutlineModelManager :: annotateOutlineWrap(std::string kOutlineName, std::string theRealName)
532 actualInstantWrapping -> addOutlineName(kOutlineName, theRealName);
536 * Annotates a set of outline keynames-real names wrapping at the actual instant
537 * @param kNamesVector The key names vector to annotate
538 * @param theOutlinesVector The outlines pointers vector to get the real names from
540 void OutlineModelManager :: annotateOutlinesWrap(std::vector<std::string> kNamesVector, std::vector<ContourThing **> theOutlinesVector)
542 actualInstantWrapping ->clean();
543 for(int i=0; i<kNamesVector.size(); i++)
545 ContourThing * anOutline = *theOutlinesVector[i];
546 actualInstantWrapping -> addOutlineName( kNamesVector[i], anOutline->getName() );
551 * Annotates the actual outline keyName-real name wrapping at the actual instant
552 * @param actualKeyOutline The key name to annotate
553 * @param theRealName The real name asigned to the actual outline
555 void OutlineModelManager :: annotateActualOutlineWrap(std::string actualKeyOutline, std::string theRealName)
557 actualInstantWrapping -> setActualOutline(actualKeyOutline, theRealName);
561 * Annotate the actual axe keyName-real name wrapping at the actual instant
562 * @param actualKeyAxe The key name to annotate
563 * @param theRealName The real name asigned to the actual axe
565 void OutlineModelManager :: annotateActualAxeWrap(std::string actualKeyAxe, std::string theRealName)
567 actualInstantWrapping -> setActualAxeWrap(actualKeyAxe, theRealName);
571 * Annotate the annotateActualSection image keyName-real name wrapping at the actual instant
572 * @param actualKeyImage The key name to annotate
573 * @param theRealName The real name asigned to the annotateActualSection
575 void OutlineModelManager :: annotateActualSectionImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
577 actualInstantWrapping -> setActualSectionImageNamesWrapp(actualKeyImage, theRealName);
581 * Annotate the annotateActualSource image keyName-real name wrapping at the actual instant
582 * @param actualKeyImage The key name to annotate
583 * @param theRealName The real name asigned to the annotateActualSource
585 void OutlineModelManager :: annotateActualSourceImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
587 actualInstantWrapping -> setActualSourceImageNamesWrapp(actualKeyImage, theRealName);
592 * Sets the actual instant and manage the search of the corresponding elements with the specified instant in all the enviornments
593 * @param newActualInstantData Is the instant data
595 void OutlineModelManager :: setInstant(Instant * newActualInstantData)
597 actualInstant = newActualInstantData;
598 updateToActualInstant();
601 Instant* OutlineModelManager :: getInstant()
603 return actualInstant;
607 * Gets the an axe with a given keyName
608 * @axeKName The axe keyName for searching in the axes environment
609 * @return The corresponding axe
611 AxeThing * OutlineModelManager :: getAxeByKeyName(std::string axeKName)
613 return *axesEnvironment->getThingByName(axeKName);
617 * Gets the instants of a specific outline
618 * @param thekName Is the name of the outline
619 * @return The instants set
621 std::vector<Instant *> OutlineModelManager :: getOutlineInstantsByName(std::string thekName)
623 return *outlinesEnvironment->getInstantsOfThing(thekName);
627 * Gets all instants outlines
628 * @return The instants set
630 std::vector<Instant *> OutlineModelManager :: getOutlineInstants()
632 return *outlinesEnvironment->getExistingInstants();
638 * Includes an instant to the specified axe
639 * @param outKName Is outline key name
640 * @param anInstantData Is the instant data
641 * @return Returns if the insertion was successful or not
643 bool OutlineModelManager :: includeOutlineInstant(std::string outKName,Instant * anInstantData)
645 return outlinesEnvironment->addInstantToThing(outKName,anInstantData);
649 * Includes an instant to the specified axe
650 * @param axeKName Is axe key name
651 * @param anInstantData Is the instant data
652 * @return Returns if the insertion was successful or not
654 bool OutlineModelManager :: includeAxeInstant(std::string axeKName,Instant * anInstantData)
656 return axesEnvironment->addInstantToThing( axeKName,anInstantData );
660 * Includes an instant to the specified image section
661 * @param imaKName Is the image section key name
662 * @param anInstantData Is the instant data
663 * @return Returns if the insertion was successful or not
665 bool OutlineModelManager :: includeImageSectionInstant(std::string imaKName,Instant * anInstantData)
667 return imagesSectionEnvironment->addInstantToThing( imaKName,anInstantData );
671 * Includes an instant to the specified image source
672 * @param imaKName Is the image section key name
673 * @param anInstantData Is the instant data
674 * @return Returns if the insertion was successful or not
676 bool OutlineModelManager :: includeImageSourceInstant(std::string imaKName,Instant * anInstantData)
678 return imageSourceEnvironment->addInstantToThing( imaKName,anInstantData );
682 * Method that retorns the name of each concept and the size of it.
683 * @param conceptNameVect, Vector in which is disposed to be setted the name for each of the included concepts
684 * @param conceptSizeVect, Vector in which is disposed to be setted the size for each of the included concepts
686 void OutlineModelManager :: getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect)
688 if( outlinesEnvironment != NULL )
690 //if (outlinesEnvironment->getNumberOfThings()>0)
691 outlinesEnvironment->getConceptsInformation(conceptNameVect, conceptSizeVect);
697 * Gets the contourWorspace
698 * @return Returns the workspace
700 ContourWorkspace * OutlineModelManager :: getContourWorkspace()
707 * Cleans the outline model manager and its dependencies
709 void OutlineModelManager :: clean()
711 /*axesEnvironment->clean();
712 imagesSectionEnvironment->clean();
713 imageSourceEnvironment->clean();
714 outlinesEnvironment->clean();*/
715 outlineGroups.clear();
716 actualInstantWrapping->clean();
717 keyGenerator.clear();
718 //workSpace->clear();
722 * Update the registered objects in the InstantMemebersNameList, is the one that really changes the instant in the model
724 void OutlineModelManager :: updateToActualInstant()
726 Instant * longInstant = actualInstant;
727 /*Instant * mediumInstant = new Instant();
728 Instant * shortInstant = new Instant();
729 std::vector<int>* theInstant = longInstant->getInstant();
730 for(int i=1; i<theInstant->size(); i++)
733 shortInstant->addConcept( (*theInstant)[i] );
734 mediumInstant->addConcept( (*theInstant)[i] );
737 //getting the sourceAtInstant
738 std::vector<std::string> kSourceVector;
739 std::vector<ImageSourceThing **> imSourceVector;
740 imageSourceEnvironment->getThings(kSourceVector, imSourceVector, shortInstant);
741 annotateActualSourceImageWrap(kSourceVector[0], (**imSourceVector[0]).getSourceImage());
743 //getting the aAxeAtInstant
744 std::vector<std::string> kAxeVector;
745 std::vector<AxeThing **> axesVector;
746 axesEnvironment->getThings(kAxeVector, axesVector, mediumInstant);
747 if ( !kAxeVector.empty() )
748 annotateActualAxeWrap(kAxeVector[0], (**axesVector[0]).getDescription());
750 //getting the sectionAtInstant
751 std::vector<std::string> kSectionVector;
752 std::vector<ImageSectionThing **> imSectionVector;
753 imagesSectionEnvironment->getThings(kSectionVector, imSectionVector, longInstant); if ( !kSectionVector.empty() )
754 //annotateActualSectionImageWrap(kSectionVector[0], (**imSectionVector[0]).getImageData());
757 //getting the outlines
759 std::vector<ContourThing ** > vect = getOutlinesAtInstant( longInstant );
764 * Sets the automatic managed concepts including them in the environments. That are at the beginning of the instant vector for the corresponding environments.
765 * @return Returns true if successful insert of the automatic concepts, false otherwise
767 bool OutlineModelManager :: setAutomaticConcepts()
770 axeDepthConcept = "Axe Depth";
772 int axeDepthC_size = INT_MAX;
774 bool allOK = axesEnvironment->addConcept(axeConcept, axeC_size);
775 allOK &= imagesSectionEnvironment->addConcept(axeConcept, axeC_size);
776 allOK &= outlinesEnvironment->addConcept(axeConcept, axeC_size);
778 allOK &= imagesSectionEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
779 allOK &= outlinesEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
781 allOK &= keyGenerator.addKeyThing("Axes", "Axe");
782 allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
783 allOK &= keyGenerator.addKeyThing("Image Sections", "Image section");
784 allOK &= keyGenerator.addKeyThing("Outlines", "Outline");*/
790 std::string OutlineModelManager :: createCopyContourOf( std::string anExistingKName, std::vector<int> &instantNoTouchData )
792 manualBaseModel * manModelContour = getOutlineByKeyName( anExistingKName )->getModel()->Clone();
793 return createOutline( manModelContour, instantNoTouchData );
796 void OutlineModelManager::SaveThingName( FILE *pFile, FILE *pFileData, std::string nameThing )
798 std::vector< Instant * > *lstInstants;
799 lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing );
800 Instant *instant = (*lstInstants)[0];
801 std::vector<int> *vecInst =instant->getInstant();
802 int i,sizeVecInst = vecInst->size();
803 fprintf(pFile,"Instant ");
804 for ( i=0 ; i<sizeVecInst ; i++ )
806 fprintf(pFile,"%d ",(*vecInst)[i]);
809 ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
810 contourthing->getModel()->Save(pFile);
811 contourthing->getModel()->SaveData(pFileData);