// Canvas.h: interface for the CCanvas class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_CANVAS_H__65E7BECB_087D_4123_941E_BC1077025F51__INCLUDED_) #define AFX_CANVAS_H__65E7BECB_087D_4123_941E_BC1077025F51__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "Panel.h" #include "FileParser.h" class CCanvas : public CPanel { private: Bitmap* bmpBackGround; CompoundCollection** compoundCollections; int countCompoundCollections; /*int countCompounds; OrgCompound **orgCompounds;*/ OrgChain ** orgChains; int countChains; OrgChain ** mainChains; int countMainChains; CFileParser* IUPACParser; OrgChain* getACopy(OrgChain* source); int selectedCompound; Bitmap ** bmpElements; Bitmap ** xbmpElements; Bitmap * bmpLittle; int editingIndex; int compoundSetIndex; /*Entity ** inorgCompounds; int countInorgCompounds; Entity ** conditions; int countConditions;*/ Bitmap **conditonElements; Bitmap **inorgElements; CFileParser* reactionsParser; /*OrgCompound ** resultSet; int countResultSet;*/ POINT *occupiedPoints; int numberOfPoints; POINT addPoints(POINT a,POINT b); bool isEditable; void takeCareCompound(OrgCompound*compound,int collectionIndex); void clearCollection(CompoundCollection* collections); void placeCompoundCollection(); void placeInorgNConditions(CompoundCollection * collection); void FilterTheMain(); void setIUPACName(OrgCompound * compound); void sortLinks(Link**&links,int countLinks); void DrawBond(HDC hDC,int iBondType,POINT ptStart,POINT ptEnd,bool bSelected); void givePosition(OrgCompound *compound,int elementIndex, OrgBond *bond,int earlyX,int earlyY,int xIncrement, int yIncrement,int earlyType); void placeCompoundsPosition(CompoundCollection* collection,bool withInorganics); void DrawSlider(HDC _hLayerDC,int current_processing,int total_processing); public: bool deleteSelected(); bool clearAll(); void clearLastResult(); void clearResults(); bool IsEditable(); void startReaction(); bool addCondition(int iType); bool addInorgCompound(int iType); bool deploySelected(); void MouseMove(int x,int y); void MouseButtonUp(int x,int y,bool bLeft); void MouseButtonDown(int x,int y,bool bLeft); void assingnNumbersForLevelsOfMainChains(OrgCompound * compound); void checkForMain(OrgChain* fromChain,OrgChain * chain,bool reversed,OrgChain ** earlierChains,int nextToFill,int linkElement,OrgCompound *compound); void FillMainChains(OrgCompound * compound); void assignLevels(OrgCompound *compound,OrgChain** chains,int count); int getConnectedElementIndex(int elementIndex, OrgBond* bond); void fillToChains(int elementIndex,OrgChain *chain,int fromElementIndex,OrgCompound* compound); void AddNewCompound(); CCanvas(int ix,int iy,int iLayerWidth,int iLayerHeight,int iwidth,int iheight,UINT uiBG); virtual ~CCanvas(); void DrawScreen(HDC hDC); }; #endif // !defined(AFX_CANVAS_H__65E7BECB_087D_4123_941E_BC1077025F51__INCLUDED_)