#pragma once #include #include #include "RecipeModel.h" #include "RecipeMarker.h" #include "RecipeFormula.h" #include "RecipeModel.h" #include "RecipeMarker.h" #include "RecipeFormula.h" class AFX_EXT_CLASS CRecipeTriangle { public: CRecipeTriangle(void); CRecipeTriangle(const CString& strFilename); ~CRecipeTriangle(void); // reset void Reset() { m_vectorRecipeModel.clear(); m_vectorRecipeMarker.clear(); m_vectorRecipeFormula.clear(); } // read & write BOOL ReadRecipe(const CString& strFilename); BOOL WriteRecipe(const CString& strFilename); // getter VectorRecipeModel* GetRecipeModel() { return &m_vectorRecipeModel; } VectorRecipeMarker* GetRecipeMarker() { return &m_vectorRecipeMarker; } VectorRecipeFormula* GetRecipeFormula() { return &m_vectorRecipeFormula; } CRecipeModel* GetRecipeModel(UINT nIndex) { return (nIndex>=m_vectorRecipeModel.size()) ? NULL: &m_vectorRecipeModel[nIndex]; } CRecipeMarker* GetRecipeMarker(UINT nIndex) { return (nIndex>=m_vectorRecipeMarker.size()) ? NULL: &m_vectorRecipeMarker[nIndex]; } CRecipeFormula* GetRecipeFormula(UINT nIndex) { return (nIndex>=m_vectorRecipeFormula.size()) ? NULL: &m_vectorRecipeFormula[nIndex]; } // setter void SetRecipeModel(const VectorRecipeModel& vectorRecipeModel) { m_vectorRecipeModel = vectorRecipeModel; } void SetRecipeMarker(const VectorRecipeMarker& vectorRecipeMarker) { m_vectorRecipeMarker = vectorRecipeMarker; } void SetRecipeFormula(const VectorRecipeFormula& vectorRecipeFormula) { m_vectorRecipeFormula = vectorRecipeFormula; } // adder void AddRecipeModel(const CRecipeModel& recipeModel) { m_vectorRecipeModel.push_back(recipeModel); } void AddRecipeMarker(const CRecipeMarker& recipeMarker) { m_vectorRecipeMarker.push_back(recipeMarker); } void AddRecipeFormula(const CRecipeFormula& recipeFormula) { m_vectorRecipeFormula.push_back(recipeFormula); } // counter UINT GetRecipeModelCount() const { return static_cast(m_vectorRecipeModel.size()); } UINT GetRecipeMarkerCount() const { return static_cast(m_vectorRecipeMarker.size()); } UINT GetRecipeFormulaCount() const { return static_cast(m_vectorRecipeFormula.size()); } // deleter void DelRecipeModel(UINT nIndex); void DelRecipeMarker(UINT nIndex); void DelRecipeFormula(UINT nIndex); // reset void ResetRecipeModel() { m_vectorRecipeModel.clear(); } void ResetRecipeMarker() { m_vectorRecipeMarker.clear(); } void ResetRecipeFormula() { m_vectorRecipeFormula.clear(); } protected: VectorRecipeModel m_vectorRecipeModel; VectorRecipeMarker m_vectorRecipeMarker; VectorRecipeFormula m_vectorRecipeFormula; }; typedef std::vector VectorRecipeTriangle; typedef std::vector::iterator VectorRecipeTriangleIt; class AFX_EXT_CLASS CResultTriangle { public: CResultTriangle(void); ~CResultTriangle(void); void Reset() { m_vectorResultModel.clear(); m_vectorResultMarker.clear(); m_vectorResultFormula.clear(); } // getter VectorResultModel* GetResultModel() { return &m_vectorResultModel; } VectorResultMarker* GetResultMarker() { return &m_vectorResultMarker; } VectorResultFormula* GetResultFormula() { return &m_vectorResultFormula; } CResultModel* GetResultModel(UINT nIndex) { return (nIndex>=m_vectorResultModel.size()) ? NULL: &m_vectorResultModel[nIndex]; } CResultMarker* GetResultMarker(UINT nIndex) { return (nIndex>=m_vectorResultMarker.size()) ? NULL: &m_vectorResultMarker[nIndex]; } CResultFormula* GetResultFormula(UINT nIndex) { return (nIndex>=m_vectorResultFormula.size()) ? NULL: &m_vectorResultFormula[nIndex]; } // setter void SetResultModel(const VectorResultModel& vectorResultModel) { m_vectorResultModel = vectorResultModel; } void SetResultMarker(const VectorResultMarker& vectorResultMarker) { m_vectorResultMarker = vectorResultMarker; } void SetResultFormula(const VectorResultFormula& vectorResultFormula) { m_vectorResultFormula = vectorResultFormula; } // adder void AddResultModel(const CResultModel& resultModel) { m_vectorResultModel.push_back(resultModel); } void AddResultMarker(const CResultMarker& resultMarker) { m_vectorResultMarker.push_back(resultMarker); } void AddResultFormula(const CResultFormula& resultFormula) { m_vectorResultFormula.push_back(resultFormula); } // counter UINT GetResultModelCount() const { return static_cast(m_vectorResultModel.size()); } UINT GetResultMarkerCount() const { return static_cast(m_vectorResultMarker.size()); } UINT GetResultFormulaCount() const { return static_cast(m_vectorResultFormula.size()); } // reset void ResetResultModel() { m_vectorResultModel.clear(); } void ResetResultMarker() { m_vectorResultMarker.clear(); } void ResetResultFormula() { m_vectorResultFormula.clear(); } protected: VectorResultModel m_vectorResultModel; VectorResultMarker m_vectorResultMarker; VectorResultFormula m_vectorResultFormula; }; typedef std::vector VectorResultTriangle; typedef std::vector::iterator VectorResultTriangleIt;