00001 #ifndef __SEFactory__ 00002 #define __SEFactory__ 00003 00004 00005 00024 #include <stdio.h> 00025 00026 #include "StructuredElement.hpp" 00027 00028 #define NUMBER_SE_CONTEXT 2 00029 #define NUMBER_SE_MODELS 6 00030 00031 class SEFactory 00032 { 00033 public: 00034 00035 const static char context[NUMBER_SE_CONTEXT][64]; 00036 const static char model[NUMBER_SE_MODELS][64]; 00037 const static int modelContext[NUMBER_SE_MODELS]; 00038 00039 protected: 00040 00041 StructuredElement* createCircle(int x0); 00042 StructuredElement* createRectangle(int l1, int l2); 00043 00044 StructuredElement* createHLine(int x0, int y0, int l1, int l2); 00045 StructuredElement* createVLine(int x0, int y0, int l1, int l2); 00046 00047 StructuredElement* createDubLine(int x0, int y0, int l1, int l2); 00048 StructuredElement* createDbuLine(int x0, int y0, int l1, int l2); 00049 00050 public: 00051 00052 SEFactory(){} 00053 virtual ~SEFactory(){} 00054 00055 static int numberOfContexts(){ return NUMBER_SE_CONTEXT; } 00056 static int numberOfModels(){ return NUMBER_SE_MODELS; } 00057 00058 static const char* getContext(int i){ return SEFactory::context[getModelContext(i)]; } 00059 static const char* getModel(int i){ return SEFactory::model[i]; } 00060 static const int getModelContext(int i){ return SEFactory::modelContext[i]; } 00061 00062 StructuredElement* createModel(int indexModel, int x0=0, int y0=0, int l1=1, int l2=1); 00063 00064 virtual void report(FILE* file){} 00065 }; 00066 00067 00068 00069 #endif