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 std::map<std::string, OutlineGroup *> :: iterator iter;
300 iter = outlineGroups.find( theOutlineName );
301 bool ifAdded = iter->first.compare( theOutlineName ) == 0;
305 * Gets the an outline given the keyName used to be indexed in the outlines's environment
306 * @param outKName Is the outline keyName to search
307 * @return The corresponding unique outline with the given key name
309 ContourThing* OutlineModelManager :: getOutlineByKeyName(std::string outKName)
311 return *(outlinesEnvironment->getThingByName(outKName));
315 * Gets the an imageSourceThing given the keyName used to be indexed in the ImageSourceThing's environment
316 * @param outKName Is the imageSourceThing keyName to search
317 * @return The corresponding unique outline with the given key name
319 ImageSourceThing* OutlineModelManager ::getImageSourceThingByKeyName(std::string iSeourceKName)
321 return *(imageSourceEnvironment->getThingByName(iSeourceKName));
325 * Gets the an imageSectionThing given the keyName used to be indexed in the ImageSectionThing's environment
326 * @param outISectionName Is the imageSectionThing keyName to search
327 * @return The corresponding unique outline with the given key name
329 ImageSectionThing* OutlineModelManager ::getImageSectionThingByKeyName(std::string iSectionName)
331 return *(imagesSectionEnvironment->getThingByName(iSectionName));
335 * Creates an outlineThing with a given name, if no name is given it would have an automatic
336 * @param aName The name for the outlineThing
337 * @return Returns the key name of the created outline, or ""if it wasn't created
339 // bool OutlineModelManager :: createOutline(std::string aName, ContourThing * &theOutline)
340 std::string OutlineModelManager :: createOutline(manualContourModel * model, std::vector<int> theInstantData, std::string aName)
342 ContourThing * theOutline = new ContourThing ( model );
343 theOutline->setName(aName);
344 return addOutline( theOutline, new Instant( &theInstantData ) );
348 * Creates an axeThing with a given name
349 * @param aDescription The description for the axeThing
350 * @return Returns true if the creation of the axe was successful
352 //bool OutlineModelManager :: createAxe(std::string aDescription, AxeThing * &theAxe)
353 bool OutlineModelManager :: createAxe(std::string aDescription, Instant * theInstantData)
355 AxeThing * theAxe = new AxeThing ();
356 theAxe->setDescription(aDescription);
357 return addAxe(theAxe, theInstantData);
361 * Creates an imageSourceThing with a given name
362 * @param aSource The name for the imageSourceThing
363 * @return Returns true if the creation of the imageSource was successful
365 //bool OutlineModelManager :: createImageSource(std::string aSource, ImageSourceThing * &imageSource)
366 bool OutlineModelManager :: createImageSource(std::string aSource, Instant * theInstantData)
368 // imageSource = new ImageSourceThing(aSource);
369 //return addImageSource(new ImageSourceThing(aSource), theInstantData);
370 return NULL;//***********************************************************************************************
374 * Creates an imageSectionThing with a given name
375 * @param aSecImageData The name for the imageSectionThing
376 * @return Returns true if the creation of the imageSection was successful
378 //bool OutlineModelManager :: createImageSection(std::string aSecImageData, ImageSectionThing * &imageSection)
379 bool OutlineModelManager :: createImageSection(std::string aSecImageData, Instant * theInstantData)
381 //imageSection = new ImageSectionThing(aSecImageData);
382 // return addImageSection(new ImageSectionThing(aSecImageData), theInstantData);
387 * Adds an outlineThing
388 * @param theOutline The outline/contour (thing)
389 * @param theInstantData Is the instant for the outline to add
390 * @return Returns true if the addition of the outline was successful
392 std::string OutlineModelManager :: addOutline( ContourThing * theOutline, Instant * theInstantData)
397 // bool added = keyGenerator.generateKeyOf("Outlines", outlinesEnvironment->getNumberOfThings(),kName);
400 bool added = keyGenerator.generateKeyOf( "Outlines", counterIdKey , kName );
402 if( theOutline->getName().compare("")==0 )
404 theOutline->setName(kName);
406 added &= outlinesEnvironment->addThingWithInstant(kName,theOutline, theInstantData);
414 int OutlineModelManager::IsPartOfStaticList(std::string ss)
417 int i, size = staticContourLst.size();
418 for( i=0 ; i<size ; i++ )
420 ContourThing **contourthing = staticContourLst[i];
421 if ((*contourthing)->getName() == ss)
431 * Remove an outlineThing
432 * @param theOutline The outline/contour (thing)
434 void OutlineModelManager :: removeOutline( std::string ss )
436 outlinesEnvironment->removeThing( ss );
440 void OutlineModelManager :: removeAllOutlines()
443 staticContourLst.clear();
446 std::vector< ContourThing **> thingsVector;
447 outlinesEnvironment->getThingsOfEnvironment( &thingsVector );
448 int i,sizeThingVector = thingsVector.size();
449 for(i=0;i<sizeThingVector;i++)
451 ContourThing ** contourthing = thingsVector[i];
452 removeOutline( (*contourthing)->getName() );
459 * @param thaAxe The axe (thing)
460 * @param theInstantData Is the instant for the axe to add
461 * @return Returns true if the addition of the axe was successful
463 bool OutlineModelManager :: addAxe( AxeThing * theAxe , Instant * theInstantData)
466 bool added = keyGenerator.generateKeyOf("Axes", axesEnvironment->getNumberOfThings(),kName);
467 added &= axesEnvironment->addThingWithInstant(kName,theAxe, theInstantData);
472 * Adds an imageSourceThing
473 * @param imgageSource The image source (thing)
474 * @param theInstantData Is the instant for the source to add
475 * @return Returns true if the addition of the imageSource was successful
477 bool OutlineModelManager :: addImageSource(ImageSourceThing * imageSource, Instant * theInstantData)
480 bool added = keyGenerator.generateKeyOf("Image Sources", imageSourceEnvironment->getNumberOfThings(),kName);
481 added &= imageSourceEnvironment->addThingWithInstant(kName,imageSource, theInstantData );
486 * Adds an imageSectionThing with a given name, if no name is given it would have an automatic
487 * @param aName The imageSection (thing)
488 * @param theInstantData Is the instant for the imageSection to add
489 * @return Returns true if the addition of the imageSection was successful
491 bool OutlineModelManager :: addImageSection(ImageSectionThing * imageSection, Instant * theInstantData)
494 bool added = keyGenerator.generateKeyOf("Image Sections", imagesSectionEnvironment->getNumberOfThings(),kName);
495 added &= imagesSectionEnvironment->addThingWithInstant(kName, imageSection, theInstantData);
500 * Annotates an outline keyname at the actual instant
501 * @param kOutlineName The key name to annotate
502 * @param theRealName The real name asigned to the outline
504 void OutlineModelManager :: annotateOutlineWrap(std::string kOutlineName, std::string theRealName)
506 actualInstantWrapping -> addOutlineName(kOutlineName, theRealName);
510 * Annotates a set of outline keynames-real names wrapping at the actual instant
511 * @param kNamesVector The key names vector to annotate
512 * @param theOutlinesVector The outlines pointers vector to get the real names from
514 void OutlineModelManager :: annotateOutlinesWrap(std::vector<std::string> kNamesVector, std::vector<ContourThing **> theOutlinesVector)
516 actualInstantWrapping ->clean();
517 for(int i=0; i<kNamesVector.size(); i++)
519 ContourThing * anOutline = *theOutlinesVector[i];
520 actualInstantWrapping -> addOutlineName( kNamesVector[i], anOutline->getName() );
525 * Annotates the actual outline keyName-real name wrapping at the actual instant
526 * @param actualKeyOutline The key name to annotate
527 * @param theRealName The real name asigned to the actual outline
529 void OutlineModelManager :: annotateActualOutlineWrap(std::string actualKeyOutline, std::string theRealName)
531 actualInstantWrapping -> setActualOutline(actualKeyOutline, theRealName);
535 * Annotate the actual axe keyName-real name wrapping at the actual instant
536 * @param actualKeyAxe The key name to annotate
537 * @param theRealName The real name asigned to the actual axe
539 void OutlineModelManager :: annotateActualAxeWrap(std::string actualKeyAxe, std::string theRealName)
541 actualInstantWrapping -> setActualAxeWrap(actualKeyAxe, theRealName);
545 * Annotate the annotateActualSection image keyName-real name wrapping at the actual instant
546 * @param actualKeyImage The key name to annotate
547 * @param theRealName The real name asigned to the annotateActualSection
549 void OutlineModelManager :: annotateActualSectionImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
551 actualInstantWrapping -> setActualSectionImageNamesWrapp(actualKeyImage, theRealName);
555 * Annotate the annotateActualSource image keyName-real name wrapping at the actual instant
556 * @param actualKeyImage The key name to annotate
557 * @param theRealName The real name asigned to the annotateActualSource
559 void OutlineModelManager :: annotateActualSourceImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
561 actualInstantWrapping -> setActualSourceImageNamesWrapp(actualKeyImage, theRealName);
566 * Sets the actual instant and manage the search of the corresponding elements with the specified instant in all the enviornments
567 * @param newActualInstantData Is the instant data
569 void OutlineModelManager :: setInstant(Instant * newActualInstantData)
571 actualInstant = newActualInstantData;
572 updateToActualInstant();
576 * Gets the an axe with a given keyName
577 * @axeKName The axe keyName for searching in the axes environment
578 * @return The corresponding axe
580 AxeThing * OutlineModelManager :: getAxeByKeyName(std::string axeKName)
582 return *axesEnvironment->getThingByName(axeKName);
586 * Gets the instants of a specific outline
587 * @param thekName Is the name of the outline
588 * @return The instants set
590 std::vector<Instant *> OutlineModelManager :: getOutlineInstantsByName(std::string thekName)
592 return *outlinesEnvironment->getInstantsOfThing(thekName);
596 * Gets all instants outlines
597 * @return The instants set
599 std::vector<Instant *> OutlineModelManager :: getOutlineInstants()
601 return *outlinesEnvironment->getExistingInstants();
607 * Includes an instant to the specified axe
608 * @param outKName Is outline key name
609 * @param anInstantData Is the instant data
610 * @return Returns if the insertion was successful or not
612 bool OutlineModelManager :: includeOutlineInstant(std::string outKName,Instant * anInstantData)
614 return outlinesEnvironment->addInstantToThing(outKName,anInstantData);
618 * Includes an instant to the specified axe
619 * @param axeKName Is axe key name
620 * @param anInstantData Is the instant data
621 * @return Returns if the insertion was successful or not
623 bool OutlineModelManager :: includeAxeInstant(std::string axeKName,Instant * anInstantData)
625 return axesEnvironment->addInstantToThing( axeKName,anInstantData );
629 * Includes an instant to the specified image section
630 * @param imaKName Is the image section key name
631 * @param anInstantData Is the instant data
632 * @return Returns if the insertion was successful or not
634 bool OutlineModelManager :: includeImageSectionInstant(std::string imaKName,Instant * anInstantData)
636 return imagesSectionEnvironment->addInstantToThing( imaKName,anInstantData );
640 * Includes an instant to the specified image source
641 * @param imaKName Is the image section key name
642 * @param anInstantData Is the instant data
643 * @return Returns if the insertion was successful or not
645 bool OutlineModelManager :: includeImageSourceInstant(std::string imaKName,Instant * anInstantData)
647 return imageSourceEnvironment->addInstantToThing( imaKName,anInstantData );
651 * Method that retorns the name of each concept and the size of it.
652 * @param conceptNameVect, Vector in which is disposed to be setted the name for each of the included concepts
653 * @param conceptSizeVect, Vector in which is disposed to be setted the size for each of the included concepts
655 void OutlineModelManager :: getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect)
657 if( outlinesEnvironment != NULL )
659 //if (outlinesEnvironment->getNumberOfThings()>0)
660 outlinesEnvironment->getConceptsInformation(conceptNameVect, conceptSizeVect);
666 * Gets the contourWorspace
667 * @return Returns the workspace
669 ContourWorkspace * OutlineModelManager :: getContourWorkspace()
676 * Cleans the outline model manager and its dependencies
678 void OutlineModelManager :: clean()
680 /*axesEnvironment->clean();
681 imagesSectionEnvironment->clean();
682 imageSourceEnvironment->clean();
683 outlinesEnvironment->clean();*/
684 outlineGroups.clear();
685 actualInstantWrapping->clean();
686 keyGenerator.clear();
687 //workSpace->clear();
691 * Update the registered objects in the InstantMemebersNameList, is the one that really changes the instant in the model
693 void OutlineModelManager :: updateToActualInstant()
695 Instant * longInstant = actualInstant;
696 /*Instant * mediumInstant = new Instant();
697 Instant * shortInstant = new Instant();
698 std::vector<int>* theInstant = longInstant->getInstant();
699 for(int i=1; i<theInstant->size(); i++)
702 shortInstant->addConcept( (*theInstant)[i] );
703 mediumInstant->addConcept( (*theInstant)[i] );
706 //getting the sourceAtInstant
707 std::vector<std::string> kSourceVector;
708 std::vector<ImageSourceThing **> imSourceVector;
709 imageSourceEnvironment->getThings(kSourceVector, imSourceVector, shortInstant);
710 annotateActualSourceImageWrap(kSourceVector[0], (**imSourceVector[0]).getSourceImage());
712 //getting the aAxeAtInstant
713 std::vector<std::string> kAxeVector;
714 std::vector<AxeThing **> axesVector;
715 axesEnvironment->getThings(kAxeVector, axesVector, mediumInstant);
716 if ( !kAxeVector.empty() )
717 annotateActualAxeWrap(kAxeVector[0], (**axesVector[0]).getDescription());
719 //getting the sectionAtInstant
720 std::vector<std::string> kSectionVector;
721 std::vector<ImageSectionThing **> imSectionVector;
722 imagesSectionEnvironment->getThings(kSectionVector, imSectionVector, longInstant); if ( !kSectionVector.empty() )
723 //annotateActualSectionImageWrap(kSectionVector[0], (**imSectionVector[0]).getImageData());
726 //getting the outlines
728 std::vector<ContourThing ** > vect = getOutlinesAtInstant( longInstant );
733 * Sets the automatic managed concepts including them in the environments. That are at the beginning of the instant vector for the corresponding environments.
734 * @return Returns true if successful insert of the automatic concepts, false otherwise
736 bool OutlineModelManager :: setAutomaticConcepts()
739 axeDepthConcept = "Axe Depth";
741 int axeDepthC_size = INT_MAX;
743 bool allOK = axesEnvironment->addConcept(axeConcept, axeC_size);
744 allOK &= imagesSectionEnvironment->addConcept(axeConcept, axeC_size);
745 allOK &= outlinesEnvironment->addConcept(axeConcept, axeC_size);
747 allOK &= imagesSectionEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
748 allOK &= outlinesEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
750 allOK &= keyGenerator.addKeyThing("Axes", "Axe");
751 allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
752 allOK &= keyGenerator.addKeyThing("Image Sections", "Image section");
753 allOK &= keyGenerator.addKeyThing("Outlines", "Outline");*/
759 std::string OutlineModelManager :: createCopyContourOf( std::string anExistingKName, std::vector<int> &instantNoTouchData )
761 manualContourModel * manModelContour = getOutlineByKeyName( anExistingKName )->getModel()->Clone();
762 return createOutline( manModelContour, instantNoTouchData );
765 void OutlineModelManager::SaveThingName( FILE *pFile, std::string nameThing )
767 std::vector< Instant * > *lstInstants;
768 lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing );
769 Instant *instant = (*lstInstants)[0];
770 std::vector<int> *vecInst =instant->getInstant();
771 int i,sizeVecInst = vecInst->size();
772 fprintf(pFile,"Instant ");
773 for ( i=0 ; i<sizeVecInst ; i++ )
775 fprintf(pFile,"%d ",(*vecInst)[i]);
778 ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
779 contourthing->getModel()->Save(pFile);