CVR-Lib last update 20 Sep 2009

cvrAffineLocation.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1998 - 2005
00003  * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany
00004  *
00005  *
00006  * This file is part of the Computer Vision and Robotics Library (CVR-Lib)
00007  *
00008  * The CVR-Lib is free software; you can redistribute it and/or
00009  * modify it under the terms of the BSD License.
00010  *
00011  * All rights reserved.
00012  *
00013  * Redistribution and use in source and binary forms, with or without
00014  * modification, are permitted provided that the following conditions are met:
00015  *
00016  * 1. Redistributions of source code must retain the above copyright notice,
00017  *    this list of conditions and the following disclaimer.
00018  *
00019  * 2. Redistributions in binary form must reproduce the above copyright notice,
00020  *    this list of conditions and the following disclaimer in the documentation
00021  *    and/or other materials provided with the distribution.
00022  *
00023  * 3. Neither the name of the authors nor the names of its contributors may be
00024  *    used to endorse or promote products derived from this software without
00025  *    specific prior written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00028  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00031  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00032  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00033  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00034  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00035  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00036  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00037  * POSSIBILITY OF SUCH DAMAGE.
00038  */
00039 
00040 
00041 /**
00042  * \file   cvrAffineLocation.h
00043  *         Definition of cvr::affineLocation which extends cvr::location
00044  *         by a transformation matrix.
00045  *         Global read/write methods to iostream and ostream operators are
00046  *         provided as well.
00047  * \author Roland Neul
00048  * \date   07.06.2004
00049  *
00050  * $Id: cvrAffineLocation.h,v 1.2 2006/06/06 11:32:58 doerfler Exp $
00051  */
00052 
00053 
00054 #ifndef _CVR_AFFINE_LOCATION_H_
00055 #define _CVR_AFFINE_LOCATION_H_
00056 
00057 #include <cvrMatrix.h>
00058 #include <cvrLocation.h>
00059 
00060 namespace cvr {
00061   /**
00062    * The %affineLocation class is simply used to store the %parameters
00063    * associated with an affine %location. The only difference between
00064    * cvr::affineLocation and cvr::location is an additional transformation
00065    * Matrix associated with the affine %location.
00066    */
00067   class affineLocation : public location {
00068   public:
00069     /**
00070      * Default constructor.
00071      */
00072     affineLocation();
00073 
00074     /**
00075      * Copy constructor.
00076      * @param other the object to be copied
00077      */
00078     affineLocation(const affineLocation& other);
00079 
00080     /**
00081      * Destructor
00082      */
00083     ~affineLocation();
00084 
00085     /**
00086      * Copy data of "other" functor.
00087      * @param other the functor to be copied
00088      * @return a reference to this functor object
00089      */
00090     affineLocation& copy(const affineLocation& other);
00091 
00092     /**
00093      * Alias for copy member
00094      * @param other the functor to be copied
00095      * @return a reference to this functor object
00096      */
00097     affineLocation& operator=(const affineLocation& other);
00098 
00099     /**
00100      * operator ==
00101      */
00102     bool operator==(const affineLocation& p);
00103 
00104     /**
00105      * operator !=
00106      */
00107     bool operator!=(const affineLocation& p);
00108 
00109     /**
00110      * The affine transformation matrix
00111      *
00112      * Default: identity
00113      */
00114     matrix<float> transMatrix;
00115 
00116     /**
00117      * Return the orientation of the major axis of shape description
00118      * (transMatrix). For a perfect circle 0 is returned. Due to the symmetry
00119      * the range is [0;Pi].
00120      */
00121     float affineOrientation() const;
00122 
00123   };
00124 
00125   /**
00126    * Read a affine %location from the ioHandler
00127    */
00128   bool read(ioHandler& handler,
00129             affineLocation& loc,
00130             const bool complete=true);
00131 
00132   /**
00133    * Write a affine %location into the ioHandler
00134    */
00135   bool write(ioHandler& handler,
00136              const affineLocation& loc,
00137              const bool complete=true);
00138 
00139 }
00140 
00141 namespace std {
00142   ostream& operator<<(ostream& s,
00143                       const cvr::affineLocation& loc);
00144 }
00145 
00146 #endif
00147 

Generated on Sun Sep 20 22:07:58 2009 for CVR-Lib by Doxygen 1.5.8