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.
82 bool OutlineModelManager :: executeCommand_OutlineModel(std::string outKName, CommandObject * theCommand, bool fromRegistration)
84 ContourThing * theOutline = *outlinesEnvironment->getThingByName( outKName );
87 CommandObject * undoCommand = theOutline->getUndoCommandOf( theCommand );
88 workSpace->callRegisterCommand(theCommand, undoCommand);
90 return theOutline->executeCommand( theCommand );
94 * Executes a command identifying which actions have to realize before executing it.
95 * @param theCommand Is the command to execute
96 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
98 bool OutlineModelManager :: executeCommand(CommandObject * theCommand, bool fromRegistration)
100 bool executedCom = true;
101 //TODO**********************************************************************************************************************************************
102 //Interpreting who is the one that executes the command
104 //Modifiying the command in necessary for detaching interpreted information
106 //If is an outline, sending the command to execute the specific command
112 * Executes a command queue identifying which actions have to realize before executing it, using FIFO for each.
113 * @param executionQueue Is the command queue to execute
114 * @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
116 bool OutlineModelManager :: executeCommandsQueue(std::deque<CommandObject *> executionQueue, bool fromRegistration)
118 bool executedComs = executionQueue.size()>0 ? true : false;
119 while( executionQueue.size()>0 )
121 CommandObject * aCmmand = executionQueue.front();
122 executedComs &= executeCommand(aCmmand, fromRegistration);
123 executionQueue.pop_front();
130 * Sets the concepts of the environments and includes the concepts managed by the program
131 * @conceptsScript Is the script for with the concepts descrition
132 * @return Returns true if successful insert of the given concepts, false otherwise
134 bool OutlineModelManager :: setUserConcepts(std::string conceptsScript)
138 std::string::size_type equalIndex = conceptsScript.find("=", 0);
139 std::string::size_type nextIndex = 0;
140 while( equalIndex != std::string::npos && allOK)
143 std::string concept = conceptsScript.substr( 0, endSub );
144 conceptsScript.erase( 0, endSub+1 );
145 std::cout << "C: " << concept <<std::endl;
146 nextIndex = conceptsScript.find(";", 0);
148 if(nextIndex != std::string::npos)
151 cSize = conceptsScript.substr( 0, endSub );
152 conceptsScript.erase( 0, endSub+1 );
156 endSub = conceptsScript.size();
157 cSize = conceptsScript.substr( 0, endSub );
158 conceptsScript.erase( 0, endSub );
160 int intReturn = atoi(cSize.c_str());
161 std::cout << "SZ: "<<intReturn <<std::endl;
162 equalIndex = conceptsScript.find("=", 0);
164 allOK &= addUserConcept(concept, intReturn);
172 * Add a concept to all the environments
173 * @param theConceptName Is the name of the new concept
174 * @param conceptSize Is the size of the concept, that represent the ammount of concept posible instances
175 * @return Returns true if successful insert of concept, false otherwise
177 bool OutlineModelManager :: addUserConcept(std::string theConceptName, int conceptSize)
179 bool allOK = axesEnvironment->addConcept(theConceptName, conceptSize);
180 allOK &= imagesSectionEnvironment->addConcept(theConceptName, conceptSize);
181 allOK &= imageSourceEnvironment->addConcept(theConceptName, conceptSize);
182 allOK &= outlinesEnvironment->addConcept(theConceptName, conceptSize);
187 * Gets the outlines at an instant form the outline's environment
188 * @param anInstant The instant wondered to get outlines at
189 * @param ifAnnotate Indicates if it is needed to annotate the searched outlines
190 * @return The vector to the outlines at the given instance
192 std::vector<NameWrapper *> OutlineModelManager :: getActualInstantOutlines ()
194 return actualInstantWrapping->getOutlinesNamesVector();
198 void OutlineModelManager :: ChangeContourOfList(std::string keyName, Instant *instant)
200 int ispartofstaticlist = IsPartOfStaticList(keyName);
201 if (ispartofstaticlist==-1)
203 staticContourLst.push_back( this->outlinesEnvironment->getThingByName(keyName) );
204 this->outlinesEnvironment->removeThingFromInstant(keyName, instant);
206 ContourThing **contourthing = staticContourLst[ispartofstaticlist];
207 this->outlinesEnvironment->addInstantToThing ( keyName , instant );
208 staticContourLst.erase( staticContourLst.begin()+ispartofstaticlist );
214 * Gets the outlines at an instant form the outline's environment
215 * @param anInstant The instant wondered to get outlines at
216 * @param ifAnnotate Indicates if it is needed to annotate the searched outlines
217 * @return The vector to the outlines at the given instance
219 std::vector<ContourThing**> OutlineModelManager :: getOutlinesAtInstant(Instant * anInstant, bool ifAnnotate)
221 std::vector<std::string> kNamesVector;
222 std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
223 outlinesEnvironment->getThings( kNamesVector, outlinesVector, anInstant);
226 int i,sizeStaticContourLst = staticContourLst.size();
227 for ( i=0 ; i<sizeStaticContourLst ; i++ )
229 ContourThing **contourthing = staticContourLst[i];
230 outlinesVector.push_back( contourthing );
231 kNamesVector.push_back( (*contourthing)->getName() );
236 annotateOutlinesWrap(kNamesVector, outlinesVector);
238 return outlinesVector;
242 std::vector<std::string> OutlineModelManager :: GetLstNameThingsStatic()
244 std::vector<std::string> result;
245 int i,sizeStaticContourLst = staticContourLst.size();
246 for ( i=0 ; i<sizeStaticContourLst ; i++ )
248 ContourThing **contourthing = staticContourLst[i];
249 result.push_back( (*contourthing)->getName() );
254 std::vector<std::string> OutlineModelManager :: GetLstNameThings()
256 std::vector<std::string> kNamesVector;
257 std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
258 std::vector<Instant *> lstInstants = getOutlineInstants();
259 int i,sizeLstInstants = lstInstants.size();
261 for ( i=0 ; i<sizeLstInstants ; i++ )
263 instant = lstInstants[i];
264 outlinesEnvironment->getThings( kNamesVector, outlinesVector, instant);
271 * Gets the outlines at a specific form the outline's environment
272 * @param aGroupName The name of the group containing the outlines names to get
273 * @return The vector to the outlines at the given group
275 std::vector<ContourThing*> OutlineModelManager :: getOutlinesFromGroup(std::string aGroupName)
277 std::vector<ContourThing *> outlinesVector;
278 std::map< std::string,OutlineGroup * >::iterator iterP = outlineGroups.find(aGroupName);
279 if ( iterP != outlineGroups.end() )
281 std::vector<std::string> kNamesVector = iterP->second->getGroupOutlinesNames();
282 for(int i=0; i<kNamesVector.size();i++)
284 ContourThing * outlineI = getOutlineByKeyName(kNamesVector[i]);
285 outlinesVector.push_back(outlineI);
288 return outlinesVector;
292 * Gets the outlines at a specific form the outline's environment
293 * @param aGroupName The name of the group containing the outlines names to get
294 * @return The vector to the outlineGroups at the given group
296 bool OutlineModelManager :: addOutlinesGroup( std::string theOutlineName, OutlineGroup * theGroup )
298 outlineGroups.insert(std::pair <std::string, OutlineGroup *> ( theOutlineName, theGroup ));
299 // std::map<std::string, OutlineGroup *> :: iterator iter = NULL;
300 std::map<std::string, OutlineGroup *> :: iterator iter;
301 iter = outlineGroups.find( theOutlineName );
302 bool ifAdded = iter->first.compare( theOutlineName ) == 0;
306 * Gets the an outline given the keyName used to be indexed in the outlines's environment
307 * @param outKName Is the outline keyName to search
308 * @return The corresponding unique outline with the given key name
310 ContourThing* OutlineModelManager :: getOutlineByKeyName(std::string outKName)
312 return *(outlinesEnvironment->getThingByName(outKName));
316 * Gets the an imageSourceThing given the keyName used to be indexed in the ImageSourceThing's environment
317 * @param outKName Is the imageSourceThing keyName to search
318 * @return The corresponding unique outline with the given key name
320 ImageSourceThing* OutlineModelManager ::getImageSourceThingByKeyName(std::string iSeourceKName)
322 return *(imageSourceEnvironment->getThingByName(iSeourceKName));
326 * Gets the an imageSectionThing given the keyName used to be indexed in the ImageSectionThing's environment
327 * @param outISectionName Is the imageSectionThing keyName to search
328 * @return The corresponding unique outline with the given key name
330 ImageSectionThing* OutlineModelManager ::getImageSectionThingByKeyName(std::string iSectionName)
332 return *(imagesSectionEnvironment->getThingByName(iSectionName));
336 * Creates an outlineThing with a given name, if no name is given it would have an automatic
337 * @param aName The name for the outlineThing
338 * @return Returns the key name of the created outline, or ""if it wasn't created
340 // bool OutlineModelManager :: createOutline(std::string aName, ContourThing * &theOutline)
341 std::string OutlineModelManager :: createOutline(manualBaseModel * model, std::vector<int> theInstantData, std::string aName)
343 ContourThing * theOutline = new ContourThing ( model );
344 theOutline->setName(aName);
345 return addOutline( theOutline, new Instant( &theInstantData ) );
349 * Creates an axeThing with a given name
350 * @param aDescription The description for the axeThing
351 * @return Returns true if the creation of the axe was successful
353 //bool OutlineModelManager :: createAxe(std::string aDescription, AxeThing * &theAxe)
354 bool OutlineModelManager :: createAxe(std::string aDescription, Instant * theInstantData)
356 AxeThing * theAxe = new AxeThing ();
357 theAxe->setDescription(aDescription);
358 return addAxe(theAxe, theInstantData);
362 * Creates an imageSourceThing with a given name
363 * @param aSource The name for the imageSourceThing
364 * @return Returns true if the creation of the imageSource was successful
366 //bool OutlineModelManager :: createImageSource(std::string aSource, ImageSourceThing * &imageSource)
367 bool OutlineModelManager :: createImageSource(std::string aSource, Instant * theInstantData)
369 // imageSource = new ImageSourceThing(aSource);
370 //return addImageSource(new ImageSourceThing(aSource), theInstantData);
371 return NULL;//***********************************************************************************************
375 * Creates an imageSectionThing with a given name
376 * @param aSecImageData The name for the imageSectionThing
377 * @return Returns true if the creation of the imageSection was successful
379 //bool OutlineModelManager :: createImageSection(std::string aSecImageData, ImageSectionThing * &imageSection)
380 bool OutlineModelManager :: createImageSection(std::string aSecImageData, Instant * theInstantData)
382 //imageSection = new ImageSectionThing(aSecImageData);
383 // return addImageSection(new ImageSectionThing(aSecImageData), theInstantData);
388 * Adds an outlineThing
389 * @param theOutline The outline/contour (thing)
390 * @param theInstantData Is the instant for the outline to add
391 * @return Returns true if the addition of the outline was successful
393 std::string OutlineModelManager :: addOutline( ContourThing * theOutline, Instant * theInstantData)
398 // bool added = keyGenerator.generateKeyOf("Outlines", outlinesEnvironment->getNumberOfThings(),kName);
401 bool added = keyGenerator.generateKeyOf( "Outlines", counterIdKey , kName );
403 if( theOutline->getName().compare("")==0 )
405 theOutline->setName(kName);
407 added &= outlinesEnvironment->addThingWithInstant(kName,theOutline, theInstantData);
415 int OutlineModelManager::IsPartOfStaticList(std::string ss)
418 int i, size = staticContourLst.size();
419 for( i=0 ; i<size ; i++ )
421 ContourThing **contourthing = staticContourLst[i];
422 if ((*contourthing)->getName() == ss)
432 * Remove an outlineThing
433 * @param theOutline The outline/contour (thing)
435 void OutlineModelManager :: removeOutline( std::string ss )
437 outlinesEnvironment->removeThing( ss );
441 void OutlineModelManager :: removeAllOutlines()
444 staticContourLst.clear();
447 std::vector< ContourThing **> thingsVector;
448 outlinesEnvironment->getThingsOfEnvironment( &thingsVector );
449 int i,sizeThingVector = thingsVector.size();
450 for(i=0;i<sizeThingVector;i++)
452 ContourThing ** contourthing = thingsVector[i];
453 removeOutline( (*contourthing)->getName() );
460 * @param thaAxe The axe (thing)
461 * @param theInstantData Is the instant for the axe to add
462 * @return Returns true if the addition of the axe was successful
464 bool OutlineModelManager :: addAxe( AxeThing * theAxe , Instant * theInstantData)
467 bool added = keyGenerator.generateKeyOf("Axes", axesEnvironment->getNumberOfThings(),kName);
468 added &= axesEnvironment->addThingWithInstant(kName,theAxe, theInstantData);
473 * Adds an imageSourceThing
474 * @param imgageSource The image source (thing)
475 * @param theInstantData Is the instant for the source to add
476 * @return Returns true if the addition of the imageSource was successful
478 bool OutlineModelManager :: addImageSource(ImageSourceThing * imageSource, Instant * theInstantData)
481 bool added = keyGenerator.generateKeyOf("Image Sources", imageSourceEnvironment->getNumberOfThings(),kName);
482 added &= imageSourceEnvironment->addThingWithInstant(kName,imageSource, theInstantData );
487 * Adds an imageSectionThing with a given name, if no name is given it would have an automatic
488 * @param aName The imageSection (thing)
489 * @param theInstantData Is the instant for the imageSection to add
490 * @return Returns true if the addition of the imageSection was successful
492 bool OutlineModelManager :: addImageSection(ImageSectionThing * imageSection, Instant * theInstantData)
495 bool added = keyGenerator.generateKeyOf("Image Sections", imagesSectionEnvironment->getNumberOfThings(),kName);
496 added &= imagesSectionEnvironment->addThingWithInstant(kName, imageSection, theInstantData);
501 * Annotates an outline keyname at the actual instant
502 * @param kOutlineName The key name to annotate
503 * @param theRealName The real name asigned to the outline
505 void OutlineModelManager :: annotateOutlineWrap(std::string kOutlineName, std::string theRealName)
507 actualInstantWrapping -> addOutlineName(kOutlineName, theRealName);
511 * Annotates a set of outline keynames-real names wrapping at the actual instant
512 * @param kNamesVector The key names vector to annotate
513 * @param theOutlinesVector The outlines pointers vector to get the real names from
515 void OutlineModelManager :: annotateOutlinesWrap(std::vector<std::string> kNamesVector, std::vector<ContourThing **> theOutlinesVector)
517 actualInstantWrapping ->clean();
518 for(int i=0; i<kNamesVector.size(); i++)
520 ContourThing * anOutline = *theOutlinesVector[i];
521 actualInstantWrapping -> addOutlineName( kNamesVector[i], anOutline->getName() );
526 * Annotates the actual outline keyName-real name wrapping at the actual instant
527 * @param actualKeyOutline The key name to annotate
528 * @param theRealName The real name asigned to the actual outline
530 void OutlineModelManager :: annotateActualOutlineWrap(std::string actualKeyOutline, std::string theRealName)
532 actualInstantWrapping -> setActualOutline(actualKeyOutline, theRealName);
536 * Annotate the actual axe keyName-real name wrapping at the actual instant
537 * @param actualKeyAxe The key name to annotate
538 * @param theRealName The real name asigned to the actual axe
540 void OutlineModelManager :: annotateActualAxeWrap(std::string actualKeyAxe, std::string theRealName)
542 actualInstantWrapping -> setActualAxeWrap(actualKeyAxe, theRealName);
546 * Annotate the annotateActualSection image keyName-real name wrapping at the actual instant
547 * @param actualKeyImage The key name to annotate
548 * @param theRealName The real name asigned to the annotateActualSection
550 void OutlineModelManager :: annotateActualSectionImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
552 actualInstantWrapping -> setActualSectionImageNamesWrapp(actualKeyImage, theRealName);
556 * Annotate the annotateActualSource image keyName-real name wrapping at the actual instant
557 * @param actualKeyImage The key name to annotate
558 * @param theRealName The real name asigned to the annotateActualSource
560 void OutlineModelManager :: annotateActualSourceImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
562 actualInstantWrapping -> setActualSourceImageNamesWrapp(actualKeyImage, theRealName);
567 * Sets the actual instant and manage the search of the corresponding elements with the specified instant in all the enviornments
568 * @param newActualInstantData Is the instant data
570 void OutlineModelManager :: setInstant(Instant * newActualInstantData)
572 actualInstant = newActualInstantData;
573 updateToActualInstant();
576 Instant* OutlineModelManager :: getInstant()
578 return actualInstant;
582 * Gets the an axe with a given keyName
583 * @axeKName The axe keyName for searching in the axes environment
584 * @return The corresponding axe
586 AxeThing * OutlineModelManager :: getAxeByKeyName(std::string axeKName)
588 return *axesEnvironment->getThingByName(axeKName);
592 * Gets the instants of a specific outline
593 * @param thekName Is the name of the outline
594 * @return The instants set
596 std::vector<Instant *> OutlineModelManager :: getOutlineInstantsByName(std::string thekName)
598 return *outlinesEnvironment->getInstantsOfThing(thekName);
602 * Gets all instants outlines
603 * @return The instants set
605 std::vector<Instant *> OutlineModelManager :: getOutlineInstants()
607 return *outlinesEnvironment->getExistingInstants();
613 * Includes an instant to the specified axe
614 * @param outKName Is outline key name
615 * @param anInstantData Is the instant data
616 * @return Returns if the insertion was successful or not
618 bool OutlineModelManager :: includeOutlineInstant(std::string outKName,Instant * anInstantData)
620 return outlinesEnvironment->addInstantToThing(outKName,anInstantData);
624 * Includes an instant to the specified axe
625 * @param axeKName Is axe key name
626 * @param anInstantData Is the instant data
627 * @return Returns if the insertion was successful or not
629 bool OutlineModelManager :: includeAxeInstant(std::string axeKName,Instant * anInstantData)
631 return axesEnvironment->addInstantToThing( axeKName,anInstantData );
635 * Includes an instant to the specified image section
636 * @param imaKName Is the image section key name
637 * @param anInstantData Is the instant data
638 * @return Returns if the insertion was successful or not
640 bool OutlineModelManager :: includeImageSectionInstant(std::string imaKName,Instant * anInstantData)
642 return imagesSectionEnvironment->addInstantToThing( imaKName,anInstantData );
646 * Includes an instant to the specified image source
647 * @param imaKName Is the image section key name
648 * @param anInstantData Is the instant data
649 * @return Returns if the insertion was successful or not
651 bool OutlineModelManager :: includeImageSourceInstant(std::string imaKName,Instant * anInstantData)
653 return imageSourceEnvironment->addInstantToThing( imaKName,anInstantData );
657 * Method that retorns the name of each concept and the size of it.
658 * @param conceptNameVect, Vector in which is disposed to be setted the name for each of the included concepts
659 * @param conceptSizeVect, Vector in which is disposed to be setted the size for each of the included concepts
661 void OutlineModelManager :: getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect)
663 if( outlinesEnvironment != NULL )
665 //if (outlinesEnvironment->getNumberOfThings()>0)
666 outlinesEnvironment->getConceptsInformation(conceptNameVect, conceptSizeVect);
672 * Gets the contourWorspace
673 * @return Returns the workspace
675 ContourWorkspace * OutlineModelManager :: getContourWorkspace()
682 * Cleans the outline model manager and its dependencies
684 void OutlineModelManager :: clean()
686 /*axesEnvironment->clean();
687 imagesSectionEnvironment->clean();
688 imageSourceEnvironment->clean();
689 outlinesEnvironment->clean();*/
690 outlineGroups.clear();
691 actualInstantWrapping->clean();
692 keyGenerator.clear();
693 //workSpace->clear();
697 * Update the registered objects in the InstantMemebersNameList, is the one that really changes the instant in the model
699 void OutlineModelManager :: updateToActualInstant()
701 Instant * longInstant = actualInstant;
702 /*Instant * mediumInstant = new Instant();
703 Instant * shortInstant = new Instant();
704 std::vector<int>* theInstant = longInstant->getInstant();
705 for(int i=1; i<theInstant->size(); i++)
708 shortInstant->addConcept( (*theInstant)[i] );
709 mediumInstant->addConcept( (*theInstant)[i] );
712 //getting the sourceAtInstant
713 std::vector<std::string> kSourceVector;
714 std::vector<ImageSourceThing **> imSourceVector;
715 imageSourceEnvironment->getThings(kSourceVector, imSourceVector, shortInstant);
716 annotateActualSourceImageWrap(kSourceVector[0], (**imSourceVector[0]).getSourceImage());
718 //getting the aAxeAtInstant
719 std::vector<std::string> kAxeVector;
720 std::vector<AxeThing **> axesVector;
721 axesEnvironment->getThings(kAxeVector, axesVector, mediumInstant);
722 if ( !kAxeVector.empty() )
723 annotateActualAxeWrap(kAxeVector[0], (**axesVector[0]).getDescription());
725 //getting the sectionAtInstant
726 std::vector<std::string> kSectionVector;
727 std::vector<ImageSectionThing **> imSectionVector;
728 imagesSectionEnvironment->getThings(kSectionVector, imSectionVector, longInstant); if ( !kSectionVector.empty() )
729 //annotateActualSectionImageWrap(kSectionVector[0], (**imSectionVector[0]).getImageData());
732 //getting the outlines
734 std::vector<ContourThing ** > vect = getOutlinesAtInstant( longInstant );
739 * Sets the automatic managed concepts including them in the environments. That are at the beginning of the instant vector for the corresponding environments.
740 * @return Returns true if successful insert of the automatic concepts, false otherwise
742 bool OutlineModelManager :: setAutomaticConcepts()
745 axeDepthConcept = "Axe Depth";
747 int axeDepthC_size = INT_MAX;
749 bool allOK = axesEnvironment->addConcept(axeConcept, axeC_size);
750 allOK &= imagesSectionEnvironment->addConcept(axeConcept, axeC_size);
751 allOK &= outlinesEnvironment->addConcept(axeConcept, axeC_size);
753 allOK &= imagesSectionEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
754 allOK &= outlinesEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
756 allOK &= keyGenerator.addKeyThing("Axes", "Axe");
757 allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
758 allOK &= keyGenerator.addKeyThing("Image Sections", "Image section");
759 allOK &= keyGenerator.addKeyThing("Outlines", "Outline");*/
765 std::string OutlineModelManager :: createCopyContourOf( std::string anExistingKName, std::vector<int> &instantNoTouchData )
767 manualBaseModel * manModelContour = getOutlineByKeyName( anExistingKName )->getModel()->Clone();
768 return createOutline( manModelContour, instantNoTouchData );
771 void OutlineModelManager::SaveThingName( FILE *pFile, FILE *pFileData, std::string nameThing )
773 std::vector< Instant * > *lstInstants;
774 printf("EED OutlineModelManager::SaveThingName %s\n",nameThing.c_str() );
775 lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing );
776 printf("EED OutlineModelManager::SaveThingName %d\n", (*lstInstants).size() );
777 Instant *instant = (*lstInstants)[0];
778 std::vector<int> *vecInst =instant->getInstant();
779 int i,sizeVecInst = vecInst->size();
780 fprintf(pFile,"Instant ");
781 for ( i=0 ; i<sizeVecInst ; i++ )
783 fprintf(pFile,"%d ",(*vecInst)[i]);
786 ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
787 contourthing->getModel()->Save(pFile);
788 contourthing->getModel()->SaveData(pFileData);