outlinesEnvironment = contourEnv;
workSpace = new ContourWorkspace(this);//implies a shared workSpace
outlinesEnvironment = contourEnv;
workSpace = new ContourWorkspace(this);//implies a shared workSpace
bool allOK = keyGenerator.addKeyThing("Axes", "Axe");
allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
bool allOK = keyGenerator.addKeyThing("Axes", "Axe");
allOK &= keyGenerator.addKeyThing("Image Sources", "Image source");
* @param theCommand Is the command to execute
* @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
*/
* @param theCommand Is the command to execute
* @param fromRegistration Indicates if the execution is directed from the registration, by default comes from the GUI = false.
*/
bool OutlineModelManager :: executeCommand_OutlineModel(std::string outKName, CommandObject * theCommand, bool fromRegistration)
{
ContourThing * theOutline = *outlinesEnvironment->getThingByName( outKName );
bool OutlineModelManager :: executeCommand_OutlineModel(std::string outKName, CommandObject * theCommand, bool fromRegistration)
{
ContourThing * theOutline = *outlinesEnvironment->getThingByName( outKName );
CommandObject * aCmmand = executionQueue.front();
executedComs &= executeCommand(aCmmand, fromRegistration);
executionQueue.pop_front();
CommandObject * aCmmand = executionQueue.front();
executedComs &= executeCommand(aCmmand, fromRegistration);
executionQueue.pop_front();
* @conceptsScript Is the script for with the concepts descrition
* @return Returns true if successful insert of the given concepts, false otherwise
*/
* @conceptsScript Is the script for with the concepts descrition
* @return Returns true if successful insert of the given concepts, false otherwise
*/
int endSub;
std::string::size_type equalIndex = conceptsScript.find("=", 0);
std::string::size_type nextIndex = 0;
int endSub;
std::string::size_type equalIndex = conceptsScript.find("=", 0);
std::string::size_type nextIndex = 0;
- std::string concept = conceptsScript.substr( 0, endSub );
- conceptsScript.erase( 0, endSub+1 );
- std::cout << "C: " << concept <<std::endl;
+ std::string concept = conceptsScript.substr( 0, endSub );
+ conceptsScript.erase( 0, endSub+1 );
+ std::cout << "C: " << concept <<std::endl;
nextIndex = conceptsScript.find(";", 0);
std::string cSize;
if(nextIndex != std::string::npos)
{
endSub = nextIndex;
nextIndex = conceptsScript.find(";", 0);
std::string cSize;
if(nextIndex != std::string::npos)
{
endSub = nextIndex;
- cSize = conceptsScript.substr( 0, endSub );
- conceptsScript.erase( 0, endSub+1 );
+ cSize = conceptsScript.substr( 0, endSub );
+ conceptsScript.erase( 0, endSub+1 );
- endSub = conceptsScript.size();
- cSize = conceptsScript.substr( 0, endSub );
- conceptsScript.erase( 0, endSub );
- }
- int intReturn = atoi(cSize.c_str());
- std::cout << "SZ: "<<intReturn <<std::endl;
- equalIndex = conceptsScript.find("=", 0);
+ endSub = conceptsScript.size();
+ cSize = conceptsScript.substr( 0, endSub );
+ conceptsScript.erase( 0, endSub );
+ }
+ int intReturn = atoi(cSize.c_str());
+ std::cout << "SZ: "<<intReturn <<std::endl;
+ equalIndex = conceptsScript.find("=", 0);
bool allOK = axesEnvironment->addConcept(theConceptName, conceptSize);
allOK &= imagesSectionEnvironment->addConcept(theConceptName, conceptSize);
allOK &= imageSourceEnvironment->addConcept(theConceptName, conceptSize);
bool allOK = axesEnvironment->addConcept(theConceptName, conceptSize);
allOK &= imagesSectionEnvironment->addConcept(theConceptName, conceptSize);
allOK &= imageSourceEnvironment->addConcept(theConceptName, conceptSize);
this->outlinesEnvironment->removeThingFromInstant(keyName, instant);
} else {
ContourThing **contourthing = staticContourLst[ispartofstaticlist];
this->outlinesEnvironment->removeThingFromInstant(keyName, instant);
} else {
ContourThing **contourthing = staticContourLst[ispartofstaticlist];
std::vector<std::string> kNamesVector;
std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
std::vector<Instant *> lstInstants = getOutlineInstants();
std::vector<std::string> kNamesVector;
std::vector<ContourThing **> outlinesVector; //= new std::vector<ContourThing **>();
std::vector<Instant *> lstInstants = getOutlineInstants();
* Gets the outlines at a specific form the outline's environment
* @param aGroupName The name of the group containing the outlines names to get
* @return The vector to the outlines at the given group
* Gets the outlines at a specific form the outline's environment
* @param aGroupName The name of the group containing the outlines names to get
* @return The vector to the outlines at the given group
std::vector<ContourThing*> OutlineModelManager :: getOutlinesFromGroup(std::string aGroupName)
{
std::vector<ContourThing *> outlinesVector;
std::map< std::string,OutlineGroup * >::iterator iterP = outlineGroups.find(aGroupName);
if ( iterP != outlineGroups.end() )
std::vector<ContourThing*> OutlineModelManager :: getOutlinesFromGroup(std::string aGroupName)
{
std::vector<ContourThing *> outlinesVector;
std::map< std::string,OutlineGroup * >::iterator iterP = outlineGroups.find(aGroupName);
if ( iterP != outlineGroups.end() )
for(int i=0; i<kNamesVector.size();i++)
{
ContourThing * outlineI = getOutlineByKeyName(kNamesVector[i]);
outlinesVector.push_back(outlineI);
for(int i=0; i<kNamesVector.size();i++)
{
ContourThing * outlineI = getOutlineByKeyName(kNamesVector[i]);
outlinesVector.push_back(outlineI);
* Gets the outlines at a specific form the outline's environment
* @param aGroupName The name of the group containing the outlines names to get
* @return The vector to the outlineGroups at the given group
* Gets the outlines at a specific form the outline's environment
* @param aGroupName The name of the group containing the outlines names to get
* @return The vector to the outlineGroups at the given group
- outlineGroups.insert(std::pair <std::string, OutlineGroup *> ( theOutlineName, theGroup ));
- std::map<std::string, OutlineGroup *> :: iterator iter = NULL;
+ outlineGroups.insert(std::pair <std::string, OutlineGroup *> ( theOutlineName, theGroup ));
+// std::map<std::string, OutlineGroup *> :: iterator iter = NULL;
+ std::map<std::string, OutlineGroup *> :: iterator iter;
iter = outlineGroups.find( theOutlineName );
bool ifAdded = iter->first.compare( theOutlineName ) == 0;
return ifAdded;
iter = outlineGroups.find( theOutlineName );
bool ifAdded = iter->first.compare( theOutlineName ) == 0;
return ifAdded;
* @return Returns the key name of the created outline, or ""if it wasn't created
*/
// bool OutlineModelManager :: createOutline(std::string aName, ContourThing * &theOutline)
* @return Returns the key name of the created outline, or ""if it wasn't created
*/
// bool OutlineModelManager :: createOutline(std::string aName, ContourThing * &theOutline)
- std::string OutlineModelManager :: createOutline(manualContourModel * model, std::vector<int> theInstantData, std::string aName)
+ std::string OutlineModelManager :: createOutline(manualBaseModel * model, std::vector<int> theInstantData, std::string aName)
- theOutline->setName(aName);
- return addOutline( theOutline, new Instant( &theInstantData ) );
+ theOutline->setName(aName);
+ return addOutline( theOutline, new Instant( &theInstantData ) );
bool OutlineModelManager :: createAxe(std::string aDescription, Instant * theInstantData)
{
AxeThing * theAxe = new AxeThing ();
bool OutlineModelManager :: createAxe(std::string aDescription, Instant * theInstantData)
{
AxeThing * theAxe = new AxeThing ();
- theAxe->setDescription(aDescription);
- return addAxe(theAxe, theInstantData);
+ theAxe->setDescription(aDescription);
+ return addAxe(theAxe, theInstantData);
//bool OutlineModelManager :: createImageSource(std::string aSource, ImageSourceThing * &imageSource)
bool OutlineModelManager :: createImageSource(std::string aSource, Instant * theInstantData)
{
//bool OutlineModelManager :: createImageSource(std::string aSource, ImageSourceThing * &imageSource)
bool OutlineModelManager :: createImageSource(std::string aSource, Instant * theInstantData)
{
-// imageSource = new ImageSourceThing(aSource);
- //return addImageSource(new ImageSourceThing(aSource), theInstantData);
+// imageSource = new ImageSourceThing(aSource);
+ //return addImageSource(new ImageSourceThing(aSource), theInstantData);
//bool OutlineModelManager :: createImageSection(std::string aSecImageData, ImageSectionThing * &imageSection)
bool OutlineModelManager :: createImageSection(std::string aSecImageData, Instant * theInstantData)
{
//bool OutlineModelManager :: createImageSection(std::string aSecImageData, ImageSectionThing * &imageSection)
bool OutlineModelManager :: createImageSection(std::string aSecImageData, Instant * theInstantData)
{
- //imageSection = new ImageSectionThing(aSecImageData);
-// return addImageSection(new ImageSectionThing(aSecImageData), theInstantData);
+ //imageSection = new ImageSectionThing(aSecImageData);
+// return addImageSection(new ImageSectionThing(aSecImageData), theInstantData);
* @param theOutline The outline/contour (thing)
* @param theInstantData Is the instant for the outline to add
* @return Returns true if the addition of the outline was successful
*/
std::string OutlineModelManager :: addOutline( ContourThing * theOutline, Instant * theInstantData)
* @param theOutline The outline/contour (thing)
* @param theInstantData Is the instant for the outline to add
* @return Returns true if the addition of the outline was successful
*/
std::string OutlineModelManager :: addOutline( ContourThing * theOutline, Instant * theInstantData)
// bool added = keyGenerator.generateKeyOf("Outlines", outlinesEnvironment->getNumberOfThings(),kName);
counterIdKey++;
// bool added = keyGenerator.generateKeyOf("Outlines", outlinesEnvironment->getNumberOfThings(),kName);
counterIdKey++;
* @param theOutline The outline/contour (thing)
*/
void OutlineModelManager :: removeOutline( std::string ss )
* @param theOutline The outline/contour (thing)
*/
void OutlineModelManager :: removeOutline( std::string ss )
std::vector< ContourThing **> thingsVector;
outlinesEnvironment->getThingsOfEnvironment( &thingsVector );
int i,sizeThingVector = thingsVector.size();
std::vector< ContourThing **> thingsVector;
outlinesEnvironment->getThingsOfEnvironment( &thingsVector );
int i,sizeThingVector = thingsVector.size();
* @param thaAxe The axe (thing)
* @param theInstantData Is the instant for the axe to add
* @return Returns true if the addition of the axe was successful
* @param thaAxe The axe (thing)
* @param theInstantData Is the instant for the axe to add
* @return Returns true if the addition of the axe was successful
* @param imgageSource The image source (thing)
* @param theInstantData Is the instant for the source to add
* @return Returns true if the addition of the imageSource was successful
* @param imgageSource The image source (thing)
* @param theInstantData Is the instant for the source to add
* @return Returns true if the addition of the imageSource was successful
* @return Returns true if the addition of the imageSection was successful
*/
bool OutlineModelManager :: addImageSection(ImageSectionThing * imageSection, Instant * theInstantData)
* @return Returns true if the addition of the imageSection was successful
*/
bool OutlineModelManager :: addImageSection(ImageSectionThing * imageSection, Instant * theInstantData)
std::string kName;
bool added = keyGenerator.generateKeyOf("Image Sections", imagesSectionEnvironment->getNumberOfThings(),kName);
added &= imagesSectionEnvironment->addThingWithInstant(kName, imageSection, theInstantData);
std::string kName;
bool added = keyGenerator.generateKeyOf("Image Sections", imagesSectionEnvironment->getNumberOfThings(),kName);
added &= imagesSectionEnvironment->addThingWithInstant(kName, imageSection, theInstantData);
/*
* Annotates the actual outline keyName-real name wrapping at the actual instant
* @param actualKeyOutline The key name to annotate
/*
* Annotates the actual outline keyName-real name wrapping at the actual instant
* @param actualKeyOutline The key name to annotate
void OutlineModelManager :: annotateActualSectionImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
{
actualInstantWrapping -> setActualSectionImageNamesWrapp(actualKeyImage, theRealName);
void OutlineModelManager :: annotateActualSectionImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
{
actualInstantWrapping -> setActualSectionImageNamesWrapp(actualKeyImage, theRealName);
/*
* Annotate the annotateActualSource image keyName-real name wrapping at the actual instant
* @param actualKeyImage The key name to annotate
/*
* Annotate the annotateActualSource image keyName-real name wrapping at the actual instant
* @param actualKeyImage The key name to annotate
*/
void OutlineModelManager :: annotateActualSourceImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
{
actualInstantWrapping -> setActualSourceImageNamesWrapp(actualKeyImage, theRealName);
*/
void OutlineModelManager :: annotateActualSourceImageWrap(std::string actualKeyImage, std::string theRealName)//---BORRAR...
{
actualInstantWrapping -> setActualSourceImageNamesWrapp(actualKeyImage, theRealName);
/*
* Gets the an axe with a given keyName
* @axeKName The axe keyName for searching in the axes environment
/*
* Gets the an axe with a given keyName
* @axeKName The axe keyName for searching in the axes environment
/*
* Method that retorns the name of each concept and the size of it.
* @param conceptNameVect, Vector in which is disposed to be setted the name for each of the included concepts
/*
* Method that retorns the name of each concept and the size of it.
* @param conceptNameVect, Vector in which is disposed to be setted the name for each of the included concepts
{
//if (outlinesEnvironment->getNumberOfThings()>0)
outlinesEnvironment->getConceptsInformation(conceptNameVect, conceptSizeVect);
{
//if (outlinesEnvironment->getNumberOfThings()>0)
outlinesEnvironment->getConceptsInformation(conceptNameVect, conceptSizeVect);
* Update the registered objects in the InstantMemebersNameList, is the one that really changes the instant in the model
*/
void OutlineModelManager :: updateToActualInstant()
* Update the registered objects in the InstantMemebersNameList, is the one that really changes the instant in the model
*/
void OutlineModelManager :: updateToActualInstant()
//getting the sourceAtInstant
std::vector<std::string> kSourceVector;
std::vector<ImageSourceThing **> imSourceVector;
imageSourceEnvironment->getThings(kSourceVector, imSourceVector, shortInstant);
annotateActualSourceImageWrap(kSourceVector[0], (**imSourceVector[0]).getSourceImage());
//getting the sourceAtInstant
std::vector<std::string> kSourceVector;
std::vector<ImageSourceThing **> imSourceVector;
imageSourceEnvironment->getThings(kSourceVector, imSourceVector, shortInstant);
annotateActualSourceImageWrap(kSourceVector[0], (**imSourceVector[0]).getSourceImage());
std::vector<std::string> kAxeVector;
std::vector<AxeThing **> axesVector;
axesEnvironment->getThings(kAxeVector, axesVector, mediumInstant);
std::vector<std::string> kAxeVector;
std::vector<AxeThing **> axesVector;
axesEnvironment->getThings(kAxeVector, axesVector, mediumInstant);
imagesSectionEnvironment->getThings(kSectionVector, imSectionVector, longInstant); if ( !kSectionVector.empty() )
//annotateActualSectionImageWrap(kSectionVector[0], (**imSectionVector[0]).getImageData());
*/
imagesSectionEnvironment->getThings(kSectionVector, imSectionVector, longInstant); if ( !kSectionVector.empty() )
//annotateActualSectionImageWrap(kSectionVector[0], (**imSectionVector[0]).getImageData());
*/
* @return Returns true if successful insert of the automatic concepts, false otherwise
*/
bool OutlineModelManager :: setAutomaticConcepts()
* @return Returns true if successful insert of the automatic concepts, false otherwise
*/
bool OutlineModelManager :: setAutomaticConcepts()
bool allOK = axesEnvironment->addConcept(axeConcept, axeC_size);
allOK &= imagesSectionEnvironment->addConcept(axeConcept, axeC_size);
allOK &= outlinesEnvironment->addConcept(axeConcept, axeC_size);
bool allOK = axesEnvironment->addConcept(axeConcept, axeC_size);
allOK &= imagesSectionEnvironment->addConcept(axeConcept, axeC_size);
allOK &= outlinesEnvironment->addConcept(axeConcept, axeC_size);
allOK &= imagesSectionEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
allOK &= outlinesEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
/*
allOK &= imagesSectionEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
allOK &= outlinesEnvironment->addConcept(axeDepthConcept, axeDepthC_size);
/*
{
std::vector< Instant * > *lstInstants;
lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing );
{
std::vector< Instant * > *lstInstants;
lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing );
fprintf(pFile,"\n");
ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
contourthing->getModel()->Save(pFile);
fprintf(pFile,"\n");
ContourThing *contourthing = *outlinesEnvironment->getThingByName(nameThing);
contourthing->getModel()->Save(pFile);