creaContours_lib
OutlineModelManager Class Reference

#include <OutlineModelManager.h>

Collaboration diagram for OutlineModelManager:

Public Member Functions

 OutlineModelManager (SomeEnvironment< ImageSourceThing * > *imSourceEnv, SomeEnvironment< ImageSectionThing * > *imSectionEnv, SomeEnvironment< AxeThing * > *axesEnv, SomeEnvironment< ContourThing * > *contourEnv)
 
 ~OutlineModelManager ()
 
ContourWorkspacecreateWorkSpace ()
 
void setWorkSpace (ContourWorkspace *aWorkSpace)
 
bool executeCommand_OutlineModel (std::string outKName, CommandObject *theCommand, bool fromRegistration)
 
bool executeCommand (CommandObject *theCommand, bool fromRegistration=false)
 
bool executeCommandsQueue (std::deque< CommandObject * > executionQueue, bool fromRegistration=false)
 
bool setUserConcepts (std::string conceptsScript)
 
bool addUserConcept (std::string theConceptName, int conceptSize)
 
std::vector< NameWrapper * > getActualInstantOutlines ()
 
std::vector< ContourThing ** > getOutlinesAtInstant (Instant *anInstant, bool ifAnnotate=true)
 
std::vector< std::string > GetLstNameThings ()
 
std::vector< std::string > GetLstNameThingsStatic ()
 
std::vector< ContourThing * > getOutlinesFromGroup (std::string aGroupName)
 
bool addOutlinesGroup (std::string theOutlineName, OutlineGroup *theGroup)
 
ContourThinggetOutlineByKeyName (std::string outKName)
 
ImageSourceThinggetImageSourceThingByKeyName (std::string iSeourceKName)
 
ImageSectionThinggetImageSectionThingByKeyName (std::string iSectionName)
 
std::string createOutline (manualBaseModel *model, std::vector< int > theInstantData, std::string aName="")
 
bool createAxe (std::string aDescription, Instant *theInstantData)
 
bool createImageSource (std::string aSource, Instant *theInstantData)
 
bool createImageSection (std::string aSecImageData, Instant *theInstantData)
 
std::string addOutline (ContourThing *theOutline, Instant *theInstantData)
 
void removeOutline (std::string ss)
 
bool addAxe (AxeThing *thaAxe, Instant *theInstantData)
 
bool addImageSource (ImageSourceThing *imageSource, Instant *theInstantData)
 
bool addImageSection (ImageSectionThing *imageSection, Instant *theInstantData)
 
void annotateOutlineWrap (std::string kOutlineName, std::string theRealName)
 
void annotateOutlinesWrap (std::vector< std::string > keyNames, std::vector< ContourThing ** > theOutlinesVector)
 
void annotateActualOutlineWrap (std::string actualKeyOutline, std::string theRealName)
 
void annotateActualAxeWrap (std::string actualKeyAxe, std::string theRealName)
 
void annotateActualSectionImageWrap (std::string actualKeyImage, std::string theRealName)
 
void annotateActualSourceImageWrap (std::string actualKeyImage, std::string theRealName)
 
void setInstant (Instant *newActualInstantData)
 
AxeThinggetAxeByKeyName (std::string axeKName)
 
std::vector< Instant * > getOutlineInstantsByName (std::string thekName)
 
std::vector< Instant * > getOutlineInstants ()
 
bool includeOutlineInstant (std::string outKName, Instant *anInstantData)
 
bool includeAxeInstant (std::string axeKName, Instant *anInstantData)
 
bool includeImageSectionInstant (std::string imaKName, Instant *anInstantData)
 
bool includeImageSourceInstant (std::string imaKName, Instant *anInstantData)
 
void getConceptsInformation (std::vector< std::string > &conceptNameVect, std::vector< int > &conceptSizeVect)
 
ContourWorkspacegetContourWorkspace ()
 
int getGroupsCount ()
 
void clean ()
 
void removeAllOutlines ()
 
std::string createCopyContourOf (std::string anExistingKName, std::vector< int > &instantNoTouchData)
 
void SaveThingName (FILE *pFile, FILE *pFileData, std::string nameThing)
 
void ChangeContourOfList (std::string keyName, Instant *instant)
 
int IsPartOfStaticList (std::string ss)
 
Instant * getInstant ()
 

Private Member Functions

void updateToActualInstant ()
 
bool setAutomaticConcepts ()
 

Private Attributes

std::string actualGruopID
 
SomeEnvironment< AxeThing * > * axesEnvironment
 
SomeEnvironment
< ImageSectionThing * > * 
imagesSectionEnvironment
 
SomeEnvironment
< ImageSourceThing * > * 
imageSourceEnvironment
 
SomeEnvironment< ContourThing * > * outlinesEnvironment
 
std::map< std::string,
OutlineGroup * > 
outlineGroups
 
ContourWorkspaceworkSpace
 
InstantMembersNameListactualInstantWrapping
 
bool changeSourceImage
 
int counterIdKey
 
PrefixMaxKeyGenerator keyGenerator
 
std::string axeConcept
 
std::string axeDepthConcept
 
Instant * actualInstant
 
std::vector< ContourThing ** > staticContourLst
 

Detailed Description

Definition at line 60 of file OutlineModelManager.h.

Constructor & Destructor Documentation

OutlineModelManager::OutlineModelManager ( SomeEnvironment< ImageSourceThing * > *  imSourceEnv,
SomeEnvironment< ImageSectionThing * > *  imSectionEnv,
SomeEnvironment< AxeThing * > *  axesEnv,
SomeEnvironment< ContourThing * > *  contourEnv 
)

Definition at line 43 of file OutlineModelManager.cxx.

References actualInstant, actualInstantWrapping, PrefixMaxKeyGenerator::addKeyThing(), axesEnvironment, changeSourceImage, counterIdKey, imageSourceEnvironment, imagesSectionEnvironment, keyGenerator, outlinesEnvironment, and workSpace.

44  {
45  actualInstant = NULL;
46  imageSourceEnvironment = imSourceEnv;
47  imagesSectionEnvironment = imSectionEnv;
48  axesEnvironment = axesEnv;
49  outlinesEnvironment = contourEnv;
50 
51  workSpace = new ContourWorkspace(this);//implies a shared workSpace
53  counterIdKey = 0;
54 
56  changeSourceImage = true;
57 
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();
63  }

Here is the call graph for this function:

OutlineModelManager::~OutlineModelManager ( )

Definition at line 68 of file OutlineModelManager.cxx.

References actualInstant, actualInstantWrapping, clean(), and workSpace.

69  {
70  clean();
71  delete actualInstant;
72  delete workSpace;
73  delete actualInstantWrapping;
74  }

Here is the call graph for this function:

Member Function Documentation

bool OutlineModelManager::addAxe ( AxeThing thaAxe,
Instant *  theInstantData 
)

Definition at line 489 of file OutlineModelManager.cxx.

References axesEnvironment, PrefixMaxKeyGenerator::generateKeyOf(), and keyGenerator.

Referenced by createAxe().

490  {
491  std::string kName;
492  bool added = keyGenerator.generateKeyOf("Axes", axesEnvironment->getNumberOfThings(),kName);
493  added &= axesEnvironment->addThingWithInstant(kName,theAxe, theInstantData);
494  return added;
495  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool OutlineModelManager::addImageSection ( ImageSectionThing imageSection,
Instant *  theInstantData 
)

Definition at line 517 of file OutlineModelManager.cxx.

References PrefixMaxKeyGenerator::generateKeyOf(), imagesSectionEnvironment, and keyGenerator.

518  {
519  std::string kName;
520  bool added = keyGenerator.generateKeyOf("Image Sections", imagesSectionEnvironment->getNumberOfThings(),kName);
521  added &= imagesSectionEnvironment->addThingWithInstant(kName, imageSection, theInstantData);
522  return added;
523  }

Here is the call graph for this function:

bool OutlineModelManager::addImageSource ( ImageSourceThing imageSource,
Instant *  theInstantData 
)

Definition at line 503 of file OutlineModelManager.cxx.

References PrefixMaxKeyGenerator::generateKeyOf(), imageSourceEnvironment, and keyGenerator.

504  {
505  std::string kName;
506  bool added = keyGenerator.generateKeyOf("Image Sources", imageSourceEnvironment->getNumberOfThings(),kName);
507  added &= imageSourceEnvironment->addThingWithInstant(kName,imageSource, theInstantData );
508  return added;
509  }

Here is the call graph for this function:

std::string OutlineModelManager::addOutline ( ContourThing theOutline,
Instant *  theInstantData 
)

Definition at line 418 of file OutlineModelManager.cxx.

References counterIdKey, PrefixMaxKeyGenerator::generateKeyOf(), ContourThing::getName(), keyGenerator, outlinesEnvironment, and ContourThing::setName().

Referenced by createOutline().

419  {
420  std::string kName;
421 
422 // EED
423 // bool added = keyGenerator.generateKeyOf("Outlines", outlinesEnvironment->getNumberOfThings(),kName);
424 
425  counterIdKey++;
426  bool added = keyGenerator.generateKeyOf( "Outlines", counterIdKey , kName );
427 
428  if( theOutline->getName().compare("")==0 )
429  {
430  theOutline->setName(kName);
431  }
432  added &= outlinesEnvironment->addThingWithInstant(kName,theOutline, theInstantData);
433  if( added )
434  return kName;
435  else
436  return "";
437  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool OutlineModelManager::addOutlinesGroup ( std::string  theOutlineName,
OutlineGroup theGroup 
)

Adds to storing at (outlineGroups) an outline group given its name and the group

Parameters
theOutlineNameThe name of the group containing the outlines names to add
theGroupThe outlines group to add
Returns
Returns true

Gets the outlines at a specific form the outline's environment

Parameters
aGroupNameThe name of the group containing the outlines names to get
Returns
The vector to the outlineGroups at the given group

Definition at line 321 of file OutlineModelManager.cxx.

References outlineGroups.

322  {
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;
328  return ifAdded;
329  }
bool OutlineModelManager::addUserConcept ( std::string  theConceptName,
int  conceptSize 
)

Definition at line 202 of file OutlineModelManager.cxx.

References axesEnvironment, imageSourceEnvironment, imagesSectionEnvironment, and outlinesEnvironment.

Referenced by setUserConcepts().

203  {
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);
208  return allOK;
209  }

Here is the caller graph for this function:

void OutlineModelManager::annotateActualAxeWrap ( std::string  actualKeyAxe,
std::string  theRealName 
)

Definition at line 565 of file OutlineModelManager.cxx.

References actualInstantWrapping.

566  {
567  actualInstantWrapping -> setActualAxeWrap(actualKeyAxe, theRealName);
568  }
void OutlineModelManager::annotateActualOutlineWrap ( std::string  actualKeyOutline,
std::string  theRealName 
)

Definition at line 555 of file OutlineModelManager.cxx.

References actualInstantWrapping.

556  {
557  actualInstantWrapping -> setActualOutline(actualKeyOutline, theRealName);
558  }
void OutlineModelManager::annotateActualSectionImageWrap ( std::string  actualKeyImage,
std::string  theRealName 
)

Definition at line 575 of file OutlineModelManager.cxx.

References actualInstantWrapping.

576  {
577  actualInstantWrapping -> setActualSectionImageNamesWrapp(actualKeyImage, theRealName);
578  }
void OutlineModelManager::annotateActualSourceImageWrap ( std::string  actualKeyImage,
std::string  theRealName 
)

Definition at line 585 of file OutlineModelManager.cxx.

References actualInstantWrapping.

586  {
587  actualInstantWrapping -> setActualSourceImageNamesWrapp(actualKeyImage, theRealName);
588  }
void OutlineModelManager::annotateOutlinesWrap ( std::vector< std::string >  keyNames,
std::vector< ContourThing ** >  theOutlinesVector 
)

Definition at line 540 of file OutlineModelManager.cxx.

References actualInstantWrapping, InstantMembersNameList::clean(), and ContourThing::getName().

Referenced by getOutlinesAtInstant().

541  {
543  for(int i=0; i<kNamesVector.size(); i++)
544  {
545  ContourThing * anOutline = *theOutlinesVector[i];
546  actualInstantWrapping -> addOutlineName( kNamesVector[i], anOutline->getName() );
547  }
548  }

Here is the call graph for this function:

Here is the caller graph for this function:

void OutlineModelManager::annotateOutlineWrap ( std::string  kOutlineName,
std::string  theRealName 
)

Definition at line 530 of file OutlineModelManager.cxx.

References actualInstantWrapping.

531  {
532  actualInstantWrapping -> addOutlineName(kOutlineName, theRealName);
533  }
void OutlineModelManager::ChangeContourOfList ( std::string  keyName,
Instant *  instant 
)

Definition at line 223 of file OutlineModelManager.cxx.

References IsPartOfStaticList(), outlinesEnvironment, and staticContourLst.

Referenced by KernelManagerContour::changeContourOfManager().

224  {
225  int ispartofstaticlist = IsPartOfStaticList(keyName);
226  if (ispartofstaticlist==-1)
227  {
228  staticContourLst.push_back( this->outlinesEnvironment->getThingByName(keyName) );
229  this->outlinesEnvironment->removeThingFromInstant(keyName, instant);
230  } else {
231  ContourThing **contourthing = staticContourLst[ispartofstaticlist];
232  this->outlinesEnvironment->addInstantToThing ( keyName , instant );
233  staticContourLst.erase( staticContourLst.begin()+ispartofstaticlist );
234  }
235  }

Here is the call graph for this function:

Here is the caller graph for this function:

void OutlineModelManager::clean ( )

Definition at line 709 of file OutlineModelManager.cxx.

References actualInstantWrapping, InstantMembersNameList::clean(), PrefixMaxKeyGenerator::clear(), keyGenerator, and outlineGroups.

Referenced by ~OutlineModelManager().

710  {
711  /*axesEnvironment->clean();
712  imagesSectionEnvironment->clean();
713  imageSourceEnvironment->clean();
714  outlinesEnvironment->clean();*/
715  outlineGroups.clear();
718  //workSpace->clear();
719  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool OutlineModelManager::createAxe ( std::string  aDescription,
Instant *  theInstantData 
)

Definition at line 379 of file OutlineModelManager.cxx.

References addAxe(), and AxeThing::setDescription().

380  {
381  AxeThing * theAxe = new AxeThing ();
382  theAxe->setDescription(aDescription);
383  return addAxe(theAxe, theInstantData);
384  }

Here is the call graph for this function:

std::string OutlineModelManager::createCopyContourOf ( std::string  anExistingKName,
std::vector< int > &  instantNoTouchData 
)

Definition at line 790 of file OutlineModelManager.cxx.

References createOutline(), ContourThing::getModel(), and getOutlineByKeyName().

Referenced by KernelManagerContour::createCopyContourOf().

791  {
792  manualBaseModel * manModelContour = getOutlineByKeyName( anExistingKName )->getModel()->Clone();
793  return createOutline( manModelContour, instantNoTouchData );
794  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool OutlineModelManager::createImageSection ( std::string  aSecImageData,
Instant *  theInstantData 
)

Definition at line 405 of file OutlineModelManager.cxx.

406  {
407  //imageSection = new ImageSectionThing(aSecImageData);
408 // return addImageSection(new ImageSectionThing(aSecImageData), theInstantData);
409  return NULL;
410  }
bool OutlineModelManager::createImageSource ( std::string  aSource,
Instant *  theInstantData 
)

Definition at line 392 of file OutlineModelManager.cxx.

393  {
394 // imageSource = new ImageSourceThing(aSource);
395  //return addImageSource(new ImageSourceThing(aSource), theInstantData);
396  return NULL;//***********************************************************************************************
397  }
std::string OutlineModelManager::createOutline ( manualBaseModel *  model,
std::vector< int >  theInstantData,
std::string  aName = "" 
)

Definition at line 366 of file OutlineModelManager.cxx.

References addOutline(), and ContourThing::setName().

Referenced by createCopyContourOf(), KernelManagerContour::createOutline(), and KernelManagerContour::GetPoints().

367  {
368  ContourThing * theOutline = new ContourThing ( model );
369  theOutline->setName(aName);
370  return addOutline( theOutline, new Instant( &theInstantData ) );
371  }

Here is the call graph for this function:

Here is the caller graph for this function:

ContourWorkspace * OutlineModelManager::createWorkSpace ( )

Definition at line 85 of file OutlineModelManager.cxx.

References workSpace.

86  {
87  workSpace = new ContourWorkspace(this);
88  return workSpace;
89  }
bool OutlineModelManager::executeCommand ( CommandObject theCommand,
bool  fromRegistration = false 
)

Definition at line 123 of file OutlineModelManager.cxx.

Referenced by ContourWorkspace::executeCommand(), and executeCommandsQueue().

124  {
125  bool executedCom = true;
126  //TODO**********************************************************************************************************************************************
127  //Interpreting who is the one that executes the command
128 
129  //Modifiying the command in necessary for detaching interpreted information
130 
131  //If is an outline, sending the command to execute the specific command
132 
133  return executedCom;
134  }

Here is the caller graph for this function:

bool OutlineModelManager::executeCommand_OutlineModel ( std::string  outKName,
CommandObject theCommand,
bool  fromRegistration 
)

Definition at line 107 of file OutlineModelManager.cxx.

References ContourWorkspace::callRegisterCommand(), ContourThing::executeCommand(), ContourThing::getUndoCommandOf(), outlinesEnvironment, and workSpace.

108  {
109  ContourThing * theOutline = *outlinesEnvironment->getThingByName( outKName );
110  if(!fromRegistration)
111  {
112  CommandObject * undoCommand = theOutline->getUndoCommandOf( theCommand );
113  workSpace->callRegisterCommand(theCommand, undoCommand);
114  }
115  return theOutline->executeCommand( theCommand );
116  }

Here is the call graph for this function:

bool OutlineModelManager::executeCommandsQueue ( std::deque< CommandObject * >  executionQueue,
bool  fromRegistration = false 
)

Definition at line 141 of file OutlineModelManager.cxx.

References executeCommand().

Referenced by ContourWorkspace::executeCommandsQueue().

142  {
143  bool executedComs = executionQueue.size()>0 ? true : false;
144  while( executionQueue.size()>0 )
145  {
146  CommandObject * aCmmand = executionQueue.front();
147  executedComs &= executeCommand(aCmmand, fromRegistration);
148  executionQueue.pop_front();
149  }
150  return executedComs;
151  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< NameWrapper * > OutlineModelManager::getActualInstantOutlines ( )

Gets the outlines at an instant form the wrapping reference

Parameters
anInstantThe instant wondered to get outlines at
ifAnnotateIndicates if it is needed to annotate the searched outlines
Returns
The vector to the outlines at the given instance

Gets the outlines at an instant form the outline's environment

Parameters
anInstantThe instant wondered to get outlines at
ifAnnotateIndicates if it is needed to annotate the searched outlines
Returns
The vector to the outlines at the given instance

Definition at line 217 of file OutlineModelManager.cxx.

References actualInstantWrapping, and InstantMembersNameList::getOutlinesNamesVector().

Referenced by KernelManagerContour::getActualInstantOutlines().

218  {
220  }

Here is the call graph for this function:

Here is the caller graph for this function:

AxeThing * OutlineModelManager::getAxeByKeyName ( std::string  axeKName)

Definition at line 611 of file OutlineModelManager.cxx.

References axesEnvironment.

612  {
613  return *axesEnvironment->getThingByName(axeKName);
614  }
void OutlineModelManager::getConceptsInformation ( std::vector< std::string > &  conceptNameVect,
std::vector< int > &  conceptSizeVect 
)

Definition at line 686 of file OutlineModelManager.cxx.

References outlinesEnvironment.

687  {
688  if( outlinesEnvironment != NULL )
689  {
690  //if (outlinesEnvironment->getNumberOfThings()>0)
691  outlinesEnvironment->getConceptsInformation(conceptNameVect, conceptSizeVect);
692  }
693  }
ContourWorkspace * OutlineModelManager::getContourWorkspace ( )

Definition at line 700 of file OutlineModelManager.cxx.

References workSpace.

701  {
702  return workSpace;
703  }
int OutlineModelManager::getGroupsCount ( )
ImageSectionThing * OutlineModelManager::getImageSectionThingByKeyName ( std::string  iSectionName)

Definition at line 355 of file OutlineModelManager.cxx.

References imagesSectionEnvironment.

356  {
357  return *(imagesSectionEnvironment->getThingByName(iSectionName));
358  }
ImageSourceThing * OutlineModelManager::getImageSourceThingByKeyName ( std::string  iSeourceKName)

Definition at line 345 of file OutlineModelManager.cxx.

References imageSourceEnvironment.

Referenced by KernelManagerContour::initializeEnvironment().

346  {
347  return *(imageSourceEnvironment->getThingByName(iSeourceKName));
348  }

Here is the caller graph for this function:

Instant * OutlineModelManager::getInstant ( )

Definition at line 601 of file OutlineModelManager.cxx.

References actualInstant.

Referenced by KernelManagerContour::getCurrentInstant().

602  {
603  return actualInstant;
604  }

Here is the caller graph for this function:

std::vector< std::string > OutlineModelManager::GetLstNameThings ( )

Gets the name of all outlines

Returns
The vector of strings of all outlines

Definition at line 279 of file OutlineModelManager.cxx.

References getOutlineInstants(), and outlinesEnvironment.

Referenced by KernelManagerContour::GetLstNameThings().

280  {
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();
285  Instant *instant;
286  for ( i=0 ; i<sizeLstInstants ; i++ )
287  {
288  instant = lstInstants[i];
289  outlinesEnvironment->getThings( kNamesVector, outlinesVector, instant);
290  } // for i
291  return kNamesVector;
292  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::string > OutlineModelManager::GetLstNameThingsStatic ( )

Definition at line 267 of file OutlineModelManager.cxx.

References staticContourLst.

Referenced by KernelManagerContour::GetLstNameThingsStatic().

268  {
269  std::vector<std::string> result;
270  int i,sizeStaticContourLst = staticContourLst.size();
271  for ( i=0 ; i<sizeStaticContourLst ; i++ )
272  {
273  ContourThing **contourthing = staticContourLst[i];
274  result.push_back( (*contourthing)->getName() );
275  }// for i
276  return result;
277  }

Here is the caller graph for this function:

ContourThing * OutlineModelManager::getOutlineByKeyName ( std::string  outKName)

Definition at line 335 of file OutlineModelManager.cxx.

References outlinesEnvironment.

Referenced by createCopyContourOf(), KernelManagerContour::deleteCModel(), KernelManagerContour::getOutlineByKeyName(), and getOutlinesFromGroup().

336  {
337  return *(outlinesEnvironment->getThingByName(outKName));
338  }

Here is the caller graph for this function:

std::vector< Instant * > OutlineModelManager::getOutlineInstants ( )

Definition at line 630 of file OutlineModelManager.cxx.

References outlinesEnvironment.

Referenced by GetLstNameThings().

631  {
632  return *outlinesEnvironment->getExistingInstants();
633  }

Here is the caller graph for this function:

std::vector< Instant * > OutlineModelManager::getOutlineInstantsByName ( std::string  thekName)

Definition at line 621 of file OutlineModelManager.cxx.

References outlinesEnvironment.

622  {
623  return *outlinesEnvironment->getInstantsOfThing(thekName);
624  }
std::vector< ContourThing ** > OutlineModelManager::getOutlinesAtInstant ( Instant *  anInstant,
bool  ifAnnotate = true 
)

Gets the outlines at an instant form the outline's environment

Parameters
anInstantThe instant wondered to get outlines at
ifAnnotateIndicates if it is needed to annotate the searched outlines
Returns
The vector to the outlines at the given instance

Definition at line 244 of file OutlineModelManager.cxx.

References annotateOutlinesWrap(), outlinesEnvironment, and staticContourLst.

Referenced by KernelManagerContour::getOutlinesAtInstant(), KernelManagerContour::getOutlinesNameAtInstant(), and updateToActualInstant().

245  {
246  std::vector<std::string> kNamesVector;
247  std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
248  outlinesEnvironment->getThings( kNamesVector, outlinesVector, anInstant);
249 
250 //EED01
251  int i,sizeStaticContourLst = staticContourLst.size();
252  for ( i=0 ; i<sizeStaticContourLst ; i++ )
253  {
254  ContourThing **contourthing = staticContourLst[i];
255  outlinesVector.push_back( contourthing );
256  kNamesVector.push_back( (*contourthing)->getName() );
257  }// for i
258 
259  if (ifAnnotate)
260  {
261  annotateOutlinesWrap(kNamesVector, outlinesVector);
262  }
263  return outlinesVector;
264  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< ContourThing * > OutlineModelManager::getOutlinesFromGroup ( std::string  aGroupName)

Gets the outlines at a specific form the outline's environment

Parameters
aGroupNameThe name of the group containing the outlines names to get
Returns
The vector to the outlineGroups at the given group

Gets the outlines at a specific form the outline's environment

Parameters
aGroupNameThe name of the group containing the outlines names to get
Returns
The vector to the outlines at the given group

Definition at line 300 of file OutlineModelManager.cxx.

References getOutlineByKeyName(), and outlineGroups.

301  {
302  std::vector<ContourThing *> outlinesVector;
303  std::map< std::string,OutlineGroup * >::iterator iterP = outlineGroups.find(aGroupName);
304  if ( iterP != outlineGroups.end() )
305  {
306  std::vector<std::string> kNamesVector = iterP->second->getGroupOutlinesNames();
307  for(int i=0; i<kNamesVector.size();i++)
308  {
309  ContourThing * outlineI = getOutlineByKeyName(kNamesVector[i]);
310  outlinesVector.push_back(outlineI);
311  }
312  }
313  return outlinesVector;
314  }

Here is the call graph for this function:

bool OutlineModelManager::includeAxeInstant ( std::string  axeKName,
Instant *  anInstantData 
)

Definition at line 654 of file OutlineModelManager.cxx.

References axesEnvironment.

655  {
656  return axesEnvironment->addInstantToThing( axeKName,anInstantData );
657  }
bool OutlineModelManager::includeImageSectionInstant ( std::string  imaKName,
Instant *  anInstantData 
)

Definition at line 665 of file OutlineModelManager.cxx.

References imagesSectionEnvironment.

666  {
667  return imagesSectionEnvironment->addInstantToThing( imaKName,anInstantData );
668  }
bool OutlineModelManager::includeImageSourceInstant ( std::string  imaKName,
Instant *  anInstantData 
)

Definition at line 676 of file OutlineModelManager.cxx.

References imageSourceEnvironment.

677  {
678  return imageSourceEnvironment->addInstantToThing( imaKName,anInstantData );
679  }
bool OutlineModelManager::includeOutlineInstant ( std::string  outKName,
Instant *  anInstantData 
)

Definition at line 643 of file OutlineModelManager.cxx.

References outlinesEnvironment.

644  {
645  return outlinesEnvironment->addInstantToThing(outKName,anInstantData);
646  }
int OutlineModelManager::IsPartOfStaticList ( std::string  ss)

Definition at line 440 of file OutlineModelManager.cxx.

References staticContourLst.

Referenced by ChangeContourOfList(), and KernelManagerContour::IsPartOfStaticList().

441  {
442  int iBack=-1;
443  int i, size = staticContourLst.size();
444  for( i=0 ; i<size ; i++ )
445  {
446  ContourThing **contourthing = staticContourLst[i];
447  if ((*contourthing)->getName() == ss)
448  {
449  iBack=i;
450  } // getName() == ss
451  }
452  return iBack;
453  }

Here is the caller graph for this function:

void OutlineModelManager::removeAllOutlines ( )

Definition at line 466 of file OutlineModelManager.cxx.

References outlinesEnvironment, removeOutline(), and staticContourLst.

Referenced by KernelManagerContour::removeAllOutlines().

467  {
468  //
469  staticContourLst.clear();
470 
471  //
472  std::vector< ContourThing **> thingsVector;
473  outlinesEnvironment->getThingsOfEnvironment( &thingsVector );
474  int i,sizeThingVector = thingsVector.size();
475  for(i=0;i<sizeThingVector;i++)
476  {
477  ContourThing ** contourthing = thingsVector[i];
478  removeOutline( (*contourthing)->getName() );
479  }
480  }

Here is the call graph for this function:

Here is the caller graph for this function:

void OutlineModelManager::removeOutline ( std::string  ss)

Definition at line 460 of file OutlineModelManager.cxx.

References outlinesEnvironment.

Referenced by KernelManagerContour::deleteCModel(), and removeAllOutlines().

461  {
462  outlinesEnvironment->removeThing( ss );
463  }

Here is the caller graph for this function:

void OutlineModelManager::SaveThingName ( FILE *  pFile,
FILE *  pFileData,
std::string  nameThing 
)

Definition at line 796 of file OutlineModelManager.cxx.

References ContourThing::getModel(), and outlinesEnvironment.

Referenced by KernelManagerContour::SaveThingName().

797  {
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++ )
805  {
806  fprintf(pFile,"%d ",(*vecInst)[i]);
807  }
808  fprintf(pFile,"\n");
809  ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
810  contourthing->getModel()->Save(pFile);
811  contourthing->getModel()->SaveData(pFileData);
812  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool OutlineModelManager::setAutomaticConcepts ( )
private

Definition at line 767 of file OutlineModelManager.cxx.

References axeConcept, axeDepthConcept, axesEnvironment, imagesSectionEnvironment, and outlinesEnvironment.

768  {
769  axeConcept = "Axe";
770  axeDepthConcept = "Axe Depth";
771  int axeC_size = 10;
772  int axeDepthC_size = INT_MAX;
773 
774  bool allOK = axesEnvironment->addConcept(axeConcept, axeC_size);
775  allOK &= imagesSectionEnvironment->addConcept(axeConcept, axeC_size);
776  allOK &= outlinesEnvironment->addConcept(axeConcept, axeC_size);
777 
778  allOK &= imagesSectionEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
779  allOK &= outlinesEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
780 /*
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");*/
785 
786  return allOK;
787  }
void OutlineModelManager::setInstant ( Instant *  newActualInstantData)

Definition at line 595 of file OutlineModelManager.cxx.

References actualInstant, and updateToActualInstant().

Referenced by KernelManagerContour::setInstant().

596  {
597  actualInstant = newActualInstantData;
599  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool OutlineModelManager::setUserConcepts ( std::string  conceptsScript)

Definition at line 159 of file OutlineModelManager.cxx.

References addUserConcept().

160  {
161  bool allOK = true;
162  int endSub;
163  std::string::size_type equalIndex = conceptsScript.find("=", 0);
164  std::string::size_type nextIndex = 0;
165  while( equalIndex != std::string::npos && allOK)
166  {
167  endSub = equalIndex;
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);
172  std::string cSize;
173  if(nextIndex != std::string::npos)
174  {
175  endSub = nextIndex;
176  cSize = conceptsScript.substr( 0, endSub );
177  conceptsScript.erase( 0, endSub+1 );
178  }
179  else
180  {
181  endSub = conceptsScript.size();
182  cSize = conceptsScript.substr( 0, endSub );
183  conceptsScript.erase( 0, endSub );
184  }
185  int intReturn = atoi(cSize.c_str());
186  std::cout << "SZ: "<<intReturn <<std::endl;
187  equalIndex = conceptsScript.find("=", 0);
188  if( intReturn>0 )
189  allOK &= addUserConcept(concept, intReturn);
190  else
191  allOK = false;
192  }
193  return allOK;
194  }

Here is the call graph for this function:

void OutlineModelManager::setWorkSpace ( ContourWorkspace aWorkSpace)

Definition at line 95 of file OutlineModelManager.cxx.

References workSpace.

96  {
97  workSpace = aWorkSpace;
98  }
void OutlineModelManager::updateToActualInstant ( )
private

Definition at line 724 of file OutlineModelManager.cxx.

References actualInstant, and getOutlinesAtInstant().

Referenced by setInstant().

725  {
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++)
731  {
732  if (i>=2)
733  shortInstant->addConcept( (*theInstant)[i] );
734  mediumInstant->addConcept( (*theInstant)[i] );
735  }
736 
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());
742 
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());
749 
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());
755  */
756 
757  //getting the outlines
758 
759  std::vector<ContourThing ** > vect = getOutlinesAtInstant( longInstant );
760 
761  }

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::string OutlineModelManager::actualGruopID
private

Definition at line 426 of file OutlineModelManager.h.

Instant* OutlineModelManager::actualInstant
private
std::string OutlineModelManager::axeConcept
private

Definition at line 492 of file OutlineModelManager.h.

Referenced by setAutomaticConcepts().

std::string OutlineModelManager::axeDepthConcept
private

Definition at line 493 of file OutlineModelManager.h.

Referenced by setAutomaticConcepts().

SomeEnvironment<AxeThing *>* OutlineModelManager::axesEnvironment
private
bool OutlineModelManager::changeSourceImage
private

Definition at line 486 of file OutlineModelManager.h.

Referenced by OutlineModelManager().

int OutlineModelManager::counterIdKey
private

Definition at line 488 of file OutlineModelManager.h.

Referenced by addOutline(), and OutlineModelManager().

SomeEnvironment<ImageSourceThing *>* OutlineModelManager::imageSourceEnvironment
private
SomeEnvironment<ImageSectionThing *>* OutlineModelManager::imagesSectionEnvironment
private
PrefixMaxKeyGenerator OutlineModelManager::keyGenerator
private
std::map< std::string,OutlineGroup * > OutlineModelManager::outlineGroups
private

Definition at line 471 of file OutlineModelManager.h.

Referenced by addOutlinesGroup(), clean(), and getOutlinesFromGroup().

std::vector<ContourThing **> OutlineModelManager::staticContourLst
private

The documentation for this class was generated from the following files: