2 //----------------------------------------------------------------------------------------------------------------
3 // Class definition include
4 //----------------------------------------------------------------------------------------------------------------
5 #include "OutlineModelBuilder.h"
7 //----------------------------------------------------------------------------------------------------------------
8 // Class implementation
9 //----------------------------------------------------------------------------------------------------------------
10 /** @file OutlineModelBuilder.cxx */
12 //------------------------------------------------------------------------------------------------------------
13 // Constructors & Destructors
14 //------------------------------------------------------------------------------------------------------------
17 * Creates an OutlineModelBuilder
18 * @ param filesNames Paired set of files with the names of the files to read ConceptsFile, ImageSourcesFile, ImageSectionsFile, AxeThingsFile, ContoursFile
19 * @ param sources Paired set of sourceKeyName-ImageSourceThing
20 * @ param sections Paired set of sectionKeyName-ImageSectionThing
21 * @ param axes Paired set of axeKeyName-AxeThing
22 * @ param outlines Paired set of contoKeyName-ContourThing
24 OutlineModelBuilder :: OutlineModelBuilder(std::string theConceptsFile, std::string datadir)//std::map<std::string, std::string> filesNames, std::map<std::string, ImageSourceThing *> * sources, std::map<std::string, ImageSectionThing *>* sections, std::map<std::string, AxeThing *>* axes, std::map<std::string, ContourThing *>* outlines)
26 conceptsFile = theConceptsFile;
27 imagesSectionEnvOtherConceptsFN = datadir + "/imageSectionOtherConceptsFile.cf";//"C:/Creatis/Maracas/src/interface/wxWindows/NDimension/data/imageSectionOtherConceptsFile.cf";
28 outlinesEnvOtherConceptsFN = datadir + "/outlinesOtherConceptsFile.cf";//"C:/Creatis/Maracas/src/interface/wxWindows/NDimension/data/outlinesOtherConceptsFile.cf";
29 axesEnvOtherConceptsFN = datadir + "/axesOtherConceptsFile.cf";//"C:/Creatis/Maracas/src/interface/wxWindows/NDimension/data/axesOtherConceptsFile.cf";
30 axesEnv_Reader = NULL;
31 imagesSectionEnv_Reader = NULL;
32 imageSourceEnv_Reader = NULL;
33 outlinesEnv_Reader = NULL;
37 * Destroys an AxeThing
39 OutlineModelBuilder :: ~OutlineModelBuilder()
41 delete axesEnv_Reader;
42 delete imagesSectionEnv_Reader;
43 delete imageSourceEnv_Reader;
44 delete outlinesEnv_Reader;
46 //------------------------------------------------------------------------------------------------------------
48 //------------------------------------------------------------------------------------------------------------
51 * Gets the ImageSourceThing environment
54 SomeEnvironment<ImageSourceThing *> * OutlineModelBuilder :: getImSourceEnv()
56 return ( imageSourceEnv_Reader!= NULL ) ? imageSourceEnv_Reader->getEnvironment() : new SomeEnvironment<ImageSourceThing *>();
59 * Gets the ImageSectionThing environment
62 SomeEnvironment<ImageSectionThing *> * OutlineModelBuilder :: getImSectionEnv()
64 return ( imagesSectionEnv_Reader!= NULL ) ? imagesSectionEnv_Reader->getEnvironment() : new SomeEnvironment<ImageSectionThing *>();
67 * Gets the AxeThing environment
70 SomeEnvironment<AxeThing *> * OutlineModelBuilder :: getAxesEnv()
72 return ( axesEnv_Reader!= NULL ) ? axesEnv_Reader->getEnvironment() : new SomeEnvironment<AxeThing *>();
75 * Gets the ContourThing environment
78 SomeEnvironment<ContourThing *> * OutlineModelBuilder :: getContourEnv()
80 return ( outlinesEnv_Reader!= NULL ) ? outlinesEnv_Reader->getEnvironment() : new SomeEnvironment<ContourThing *>();
85 * Builds the ImageSourceThing * environment
86 * @param sourcesFile File path with the object key names and specific instants for each one
87 * @param sources The sources to include in the enivorment
89 void OutlineModelBuilder :: buildImageSource_Envornment( std::string sourcesFile, std::map<std::string, ImageSourceThing *> * sources )
91 if( !conceptsFile.empty() )
92 imageSourceEnv_Reader = new ReaderEnvironment<ImageSourceThing *> (conceptsFile, sourcesFile, sources);
96 * Builds the ImageSectionThing * environment
97 * @param sectionsFile File path with the object key names and specific instants for each one
98 * @param sections The sections to include in the enivorment
100 void OutlineModelBuilder :: buildImageSection_Envornment( std::string sectionsFile, std::map<std::string, ImageSectionThing *>* sections )
102 if( !conceptsFile.empty() )
103 imagesSectionEnv_Reader = new ReaderEnvironment<ImageSectionThing *> ( imagesSectionEnvOtherConceptsFN, conceptsFile, sectionsFile, sections);
108 * Builds the AxeThing * environment
109 * @param axesFile File path with the object key names and specific instants for each one
110 * @param axes The axes to include in the enivorment
112 void OutlineModelBuilder :: buildAxe_Envornment( std::string axesFile, std::map<std::string, AxeThing *>* axes )
114 if( !conceptsFile.empty() )
115 axesEnv_Reader = new ReaderEnvironment<AxeThing *> ( axesEnvOtherConceptsFN, conceptsFile, axesFile, axes);
119 * Builds the CountourThing * environment
120 * @param outlinesFile File path with the object key names and specific instants for each one
121 * @param outlines The outlines to include in the enivorment
123 void OutlineModelBuilder :: buildCountour_Envornment( std::string outlinesFile, std::map<std::string, ContourThing *>* outlines )
125 if( !conceptsFile.empty() )
126 outlinesEnv_Reader = new ReaderEnvironment< ContourThing *> ( outlinesEnvOtherConceptsFN, conceptsFile, outlinesFile, outlines);