//---------------------------------------------------------------------------------------------------------------- // Class definition include //---------------------------------------------------------------------------------------------------------------- #include "OutlineModelBuilder.h" //---------------------------------------------------------------------------------------------------------------- // Class implementation //---------------------------------------------------------------------------------------------------------------- /** @file OutlineModelBuilder.cxx */ //------------------------------------------------------------------------------------------------------------ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ /** * Creates an OutlineModelBuilder * @ param filesNames Paired set of files with the names of the files to read ConceptsFile, ImageSourcesFile, ImageSectionsFile, AxeThingsFile, ContoursFile * @ param sources Paired set of sourceKeyName-ImageSourceThing * @ param sections Paired set of sectionKeyName-ImageSectionThing * @ param axes Paired set of axeKeyName-AxeThing * @ param outlines Paired set of contoKeyName-ContourThing */ OutlineModelBuilder :: OutlineModelBuilder(std::string theConceptsFile, std::string datadir)//std::map filesNames, std::map * sources, std::map* sections, std::map* axes, std::map* outlines) { conceptsFile = theConceptsFile; imagesSectionEnvOtherConceptsFN = datadir + "/imageSectionOtherConceptsFile.cf";//"C:/Creatis/Maracas/src/interface/wxWindows/NDimension/data/imageSectionOtherConceptsFile.cf"; outlinesEnvOtherConceptsFN = datadir + "/outlinesOtherConceptsFile.cf";//"C:/Creatis/Maracas/src/interface/wxWindows/NDimension/data/outlinesOtherConceptsFile.cf"; axesEnvOtherConceptsFN = datadir + "/axesOtherConceptsFile.cf";//"C:/Creatis/Maracas/src/interface/wxWindows/NDimension/data/axesOtherConceptsFile.cf"; axesEnv_Reader = NULL; imagesSectionEnv_Reader = NULL; imageSourceEnv_Reader = NULL; outlinesEnv_Reader = NULL; } /** * Destroys an AxeThing */ OutlineModelBuilder :: ~OutlineModelBuilder() { delete axesEnv_Reader; delete imagesSectionEnv_Reader; delete imageSourceEnv_Reader; delete outlinesEnv_Reader; } //------------------------------------------------------------------------------------------------------------ // Methods //------------------------------------------------------------------------------------------------------------ /** * Gets the ImageSourceThing environment *@param ImSourceEnv */ SomeEnvironment * OutlineModelBuilder :: getImSourceEnv() { return ( imageSourceEnv_Reader!= NULL ) ? imageSourceEnv_Reader->getEnvironment() : new SomeEnvironment(); } /** * Gets the ImageSectionThing environment *@param imSectionEnv */ SomeEnvironment * OutlineModelBuilder :: getImSectionEnv() { return ( imagesSectionEnv_Reader!= NULL ) ? imagesSectionEnv_Reader->getEnvironment() : new SomeEnvironment(); } /* * Gets the AxeThing environment *@param AxesEnv */ SomeEnvironment * OutlineModelBuilder :: getAxesEnv() { return ( axesEnv_Reader!= NULL ) ? axesEnv_Reader->getEnvironment() : new SomeEnvironment(); } /** * Gets the ContourThing environment *@param ContourEnv */ SomeEnvironment * OutlineModelBuilder :: getContourEnv() { return ( outlinesEnv_Reader!= NULL ) ? outlinesEnv_Reader->getEnvironment() : new SomeEnvironment(); } /** * Builds the ImageSourceThing * environment * @param sourcesFile File path with the object key names and specific instants for each one * @param sources The sources to include in the enivorment */ void OutlineModelBuilder :: buildImageSource_Envornment( std::string sourcesFile, std::map * sources ) { if( !conceptsFile.empty() ) imageSourceEnv_Reader = new ReaderEnvironment (conceptsFile, sourcesFile, sources); } /** * Builds the ImageSectionThing * environment * @param sectionsFile File path with the object key names and specific instants for each one * @param sections The sections to include in the enivorment */ void OutlineModelBuilder :: buildImageSection_Envornment( std::string sectionsFile, std::map* sections ) { if( !conceptsFile.empty() ) imagesSectionEnv_Reader = new ReaderEnvironment ( imagesSectionEnvOtherConceptsFN, conceptsFile, sectionsFile, sections); } /** * Builds the AxeThing * environment * @param axesFile File path with the object key names and specific instants for each one * @param axes The axes to include in the enivorment */ void OutlineModelBuilder :: buildAxe_Envornment( std::string axesFile, std::map* axes ) { if( !conceptsFile.empty() ) axesEnv_Reader = new ReaderEnvironment ( axesEnvOtherConceptsFN, conceptsFile, axesFile, axes); } /** * Builds the CountourThing * environment * @param outlinesFile File path with the object key names and specific instants for each one * @param outlines The outlines to include in the enivorment */ void OutlineModelBuilder :: buildCountour_Envornment( std::string outlinesFile, std::map* outlines ) { if( !conceptsFile.empty() ) outlinesEnv_Reader = new ReaderEnvironment< ContourThing *> ( outlinesEnvOtherConceptsFN, conceptsFile, outlinesFile, outlines); }