#ifndef IdbCanvasData_HH #define IdbCanvasData_HH //////////////////////////////////////////////////////////////////////////// //! author="Kieron J Messer" //! lib=Browser //! date="4/4/99" //! lib=Browser //! docentry="Applications.Image Database" //! rcsid="$Id: IdbCanvasData.hh,v 1.3 2000/03/13 11:27:31 ees1cg Exp $" //! file="amma/VisualDb/Browser/IdbCanvasData.hh" #include "amma/RCHandleA.hh" #include "amma/ImageRec.hh" #include "amma/RGBImage.hh" #include "amma/DList.hh" #include "amma/Array1d.hh" #include "amma/GUI/TextEntry.hh" #include "amma/visualdb/ImageDb.hh" #include "amma/Image/BiLinearInt.hh" #include "amma/ImgPIter.hh" #include "amma/DP/FileFormatIO.hh" extern void InitDPImageIO(void); class istream; class ostream; // -------------------------------------------------------------------------- // ********** IdbCanvasDataC ************************************************** // -------------------------------------------------------------------------- /////////////////////////////////////////// //! userlevel=Develop //: Put a brief description of your class body here // // Put a more detailed description of your class here. You use embedded html // to make it clearer in the html documentation. // // This documentation should be aimed at people who might what to extend // your class. class IdbCanvasDataBodyC : public BodyRefCounterVC { public: //: Constructors, copies, assigment, and destructor //: ----------------------------------------------- IdbCanvasDataBodyC(); //: Constructor IdbCanvasDataBodyC(RGBImageC &disp, DListCimagelist, Array1dC &inRectangles, Array1dC&inInfo, GUITextEntryC &inText); //: Constructor IdbCanvasDataBodyC(istream &in); //: Stream constructor // This creates a new instance of the class from an input stream. //: Operators //: --------- virtual BodyRefCounterVC &Copy() const; //: Creat a copy of this object. virtual BooleanT Save(ostream &out) const; //: Save to ostream. // This allows a streaming from base class without knowing // what the full class type is. //: Methods //: ------- void InsertImage(IntT num, RGBImageC &image); //: Insert an image into canvas. void Update(); //: Update the images held in array void LoadDatabase(const FilenameC &dbFile); //: List of images to load into canvas Array1dCLocations() const; //: Access to array of image rectangles Array1dCInfo() const; //: Access to array of information about images GUITextEntryC Text() const; //: Access to text. void SetText(StringC &str); //: Set Text //: Friends //: ------- friend ostream &operator<<(ostream &s, const IdbCanvasDataBodyC &out); //: output stream operator friend istream &operator>>(istream &s, IdbCanvasDataBodyC &in); //: input stream operator private: RGBImageC display; //: major image holding current thumbnails DListCdbimages; //: List of all the images stored in the database Array1dCloc; //: array rectangles of where images should be displayed in the main canvas Array1dCinfo; //: array of images currently on display GUITextEntryC text; //: The current information displayed on the text window }; ostream &operator<<(ostream &s, const IdbCanvasDataBodyC &out); //: output stream operator istream &operator>>(istream &s, IdbCanvasDataBodyC &in); //: input stream operator /////////////////////////////////////////////////////////// //! userlevel=Normal //: Put a brief description of your class here // // Put a more detailed description of your class handle here. // You use embedded html to make it clearer in the html documentation class IdbCanvasDataC : public RCHandleAC { public: //: Constructors, copies, assigment, and destructor //: ----------------------------------------------- IdbCanvasDataC() {} //: Default constructor // This creates an invalid handle. // You can remove this if you always want to create a full object. IdbCanvasDataC(istream &in); //: Stream constructor // This creates a new instance of the class from an input stream. IdbCanvasDataC(RGBImageC &im, DListCimlist, Array1dC &loc, Array1dC &info, GUITextEntryC &inText) : RCHandleAC(* new IdbCanvasDataBodyC(im, imlist, loc, info, inText)) {} //: Constructor // This creates an invalid handle. // userArg should be changed to the real arguments. protected: IdbCanvasDataC(IdbCanvasDataBodyC &bod) : RCHandleAC(bod) {} //: Body Constructor // This creates a new handle to a body class, it can be usefull if // you wish to return handles to the class from within a body function. inline IdbCanvasDataBodyC &Body() { return RCHandleAC::Body(); } //: Access body. // This isn't really needed, they're just to ensure // all derived classes work properly. inline const IdbCanvasDataBodyC &Body() const { return RCHandleAC::Body(); } //: Constant access body. // This isn't really needed, they're just to ensure // all derived classes work properly. public: //: Operators //: --------- //: Methods //: ------- inline void InsertImage(IntT n, RGBImageC &im) { Body().InsertImage(n, im); } //: Insert image into canvas. inline void Update() { Body().Update(); } //: Insert image into canvas. inline void LoadDatabase(const FilenameC &fn) { Body().LoadDatabase(fn); } //: Insert image into canvas. inline Array1dC Locations() const { return Body().Locations(); } //: Access to image locations. inline Array1dC Info() const { return Body().Info(); } //: Access to image information. inline GUITextEntryC Text() const { return Body().Text(); } //: Dummy function. inline void SetText(StringC & str) { Body().SetText(str); } //: Dummy function. //: Friends //: ------- friend ostream &operator<<(ostream &s, const IdbCanvasDataC &out); //: output stream operator friend istream &operator>>(istream &s, IdbCanvasDataC &in); //: input stream operator }; inline ostream &operator<<(ostream &s, const IdbCanvasDataC &out) { out.Save(s); return s; } //: output stream operator inline istream &operator>>(istream &s, IdbCanvasDataC &in) { in = IdbCanvasDataC(s); return s; } //: input stream operator #endif