The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

visualobject.cpp

Go to the documentation of this file.
00001 /* 
00002  *  VISUALOBJECT.cpp
00003  *
00004  *  Created by Bret Fortenberry on Aug 27, 2003.
00005  *  Fixes: 
00006  * 
00007  *  Copyright (c) 2003 Machine Perception Laboratory 
00008  *  University of California San Diego.
00009  * 
00010  * Please read the disclaimer and notes about redistribution 
00011  * at the end of this file.
00012  *  
00013  */
00014 
00015 #include "visualobject.h"
00016 
00017 
00018 
00019 VisualObject::VisualObject():listFlag(true) {}
00020 VisualObject::VisualObject(feature_type feature_in)
00021 :x(0), y(0), xSize(0), ySize(0), scale(0), activation(0.0),
00022 listFlag(true), feature(feature_in) {}
00023 
00024 VisualObject::VisualObject(float x_in, float y_in, float xSize_in, float scale_in, feature_type feature_in, float ySize_in)
00025 :x(x_in), y(y_in), xSize(xSize_in), ySize(ySize_in),  
00026 scale(scale_in), listFlag(true), feature(feature_in) {}
00027 
00028 
00029 VisualObject::VisualObject(VisualObject &thelist)
00030 :objects(thelist.objects){}
00031 
00032 VisualObject::VisualObject(TSquare<float> &square, feature_type feature_in)
00033 :x(square.x), y(square.y), xSize(square.size), ySize(square.size), scale(square.scale), 
00034 feature(feature_in) {}
00035 
00036 VisualObject::~VisualObject() {
00037   clear();
00038 };
00039 
00040 void VisualObject::clear(){
00041   list< VisualObject* >::iterator it = objects.begin();
00042   if(objects.size())
00043     {
00044       for(; it != objects.end(); ++it)
00045         {
00046           (*it)->clear();
00047           delete (*it);
00048         }
00049     }
00050   objects.clear();
00051 }
00052 
00053 /*
00054  * 
00055  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
00056  * 
00057  *    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
00058  *    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
00059  *    3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
00060  * 
00061  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00062  * 
00063  */
00064 

Generated on Mon Nov 8 17:07:52 2004 for MPT by  doxygen 1.3.9.1