#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/PatternRec/DataSet/Designer.hh" // This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2002, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here #ifndef RAVL_DESIGNER_HEADER #define RAVL_DESIGNER_HEADER 1 //! rcsid="$Id: Designer.hh,v 1.4 2002/08/08 16:03:21 craftit Exp $" //! author="Charles Galambos" //! docentry="Ravl.Pattern Recognition.Functions" //! lib=RavlPatternRec //! file="Ravl/PatternRec/DataSet/Designer.hh" #include "Ravl/RCHandleV.hh" #include "Ravl/Vector.hh" namespace RavlN { //! userlevel=Develop //: Designer base class. // Abstract Function designer. This is provided to allow the tweeking // of design paramiters to be automated class DesignerBodyC : public RCBodyVC { public: DesignerBodyC() {} //: Default constructor. DesignerBodyC(istream &strm); //: Load from stream. DesignerBodyC(BinIStreamC &strm); //: Load from binary stream. virtual bool Save (ostream &out) const; //: Writes object to stream. virtual bool Save (BinOStreamC &out) const; //: Writes object to binary stream. virtual VectorC Paramiters(); //: Get the current paramiters. virtual VectorC Paramiters(const VectorC ¶ms); //: Set the current paramiters. // Returns the current paramiters, which may not be exactly those // set in 'params', but will be the closest legal values. }; //! userlevel=Normal //: Designer base class. // Abstract Function designer. This is provided to allow the tweeking // of design paramiters to be automated class DesignerC : public RCHandleVC { public: DesignerC() {} //: Default constructor. // Creates an invalid handle. DesignerC(istream &strm); //: Load from stream. DesignerC(BinIStreamC &strm); //: Load from binary stream. protected: DesignerC(DesignerBodyC &bod) : RCHandleVC(bod) {} //: Body constructor. DesignerC(DesignerBodyC *bod) : RCHandleVC(bod) {} //: Body ptr constructor. DesignerBodyC &Body() { return RCHandleVC::Body(); } //: Access body. const DesignerBodyC &Body() const { return RCHandleVC::Body(); } //: Access body. public: VectorC Paramiters() { return Body().Paramiters(); } //: Get the current paramiters. // Returns the current paramiters, which may not be exactly those // set in 'params', but will be the closest legal values. VectorC Paramiters(const VectorC ¶ms) { return Body().Paramiters(params); } //: Set the current paramiters. // Returns the current paramiters, which may not be exactly those // set in 'params', but will be the closest legal values. }; inline istream &operator>>(istream &strm,DesignerC &obj) { obj = DesignerC(strm); return strm; } //: Load from a stream. // Uses virtual constructor. inline ostream &operator<<(ostream &out,const DesignerC &obj) { obj.Save(out); return out; } //: Save to a stream. // Uses virtual constructor. inline BinIStreamC &operator>>(BinIStreamC &strm,DesignerC &obj) { obj = DesignerC(strm); return strm; } //: Load from a binary stream. // Uses virtual constructor. inline BinOStreamC &operator<<(BinOStreamC &out,const DesignerC &obj) { obj.Save(out); return out; } //: Save to a stream. // Uses virtual constructor. } #endif