cloneface.cc

Go to the documentation of this file.
00001 
00003 
00004 //
00005 // Copyright (c) 1999-2004 California Institute of Technology
00006 // Copyright (c) 2004-2007 University of Southern California
00007 // Rob Peters <rjpeters at usc dot edu>
00008 //
00009 // created: Thu Apr 29 09:19:26 1999
00010 // commit: $Id: cloneface.cc 10065 2007-04-12 05:54:56Z rjpeters $
00011 // $HeadURL: file:///lab/rjpeters/svnrepo/code/trunk/groovx/src/visx/cloneface.cc $
00012 //
00013 // --------------------------------------------------------------------
00014 //
00015 // This file is part of GroovX.
00016 //   [http://ilab.usc.edu/rjpeters/groovx/]
00017 //
00018 // GroovX is free software; you can redistribute it and/or modify it
00019 // under the terms of the GNU General Public License as published by
00020 // the Free Software Foundation; either version 2 of the License, or
00021 // (at your option) any later version.
00022 //
00023 // GroovX is distributed in the hope that it will be useful, but
00024 // WITHOUT ANY WARRANTY; without even the implied warranty of
00025 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00026 // General Public License for more details.
00027 //
00028 // You should have received a copy of the GNU General Public License
00029 // along with GroovX; if not, write to the Free Software Foundation,
00030 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00031 //
00033 
00034 #ifndef GROOVX_VISX_CLONEFACE_CC_UTC20050626084017_DEFINED
00035 #define GROOVX_VISX_CLONEFACE_CC_UTC20050626084017_DEFINED
00036 
00037 #include "visx/cloneface.h"
00038 
00039 #include "io/ioproxy.h"
00040 #include "io/readutils.h"
00041 #include "io/writeutils.h"
00042 
00043 #include "rutz/trace.h"
00044 #include "rutz/debug.h"
00045 GVX_DBG_REGISTER
00046 
00047 namespace
00048 {
00049   const int CLONEFACE_SVID = 0;
00050 }
00051 
00053 //
00054 // CloneFace member functions
00055 //
00057 
00058 const FieldMap& CloneFace::classFields()
00059 {
00060   static const Field FIELD_ARRAY[] =
00061   {
00062     Field("eyeAspect", &CloneFace::itsEyeAspect, 0.0, 0.0, 1.0, 0.05,
00063           Field::NEW_GROUP),
00064     Field("vertOffset", &CloneFace::itsVertOffset, 0.0, -0.1, 0.1, 0.01)
00065   };
00066 
00067   static FieldMap CLONEFACE_FIELDS(FIELD_ARRAY, &Face::classFields());
00068 
00069   return CLONEFACE_FIELDS;
00070 }
00071 
00072 CloneFace* CloneFace::make()
00073 {
00074 GVX_TRACE("CloneFace::make");
00075   return new CloneFace;
00076 }
00077 
00078 CloneFace::CloneFace () :
00079   Face(), itsEyeAspect(0.0), itsVertOffset(0.0)
00080 {
00081 GVX_TRACE("CloneFace::CloneFace()");
00082 
00083   setFieldMap(CloneFace::classFields());
00084 
00085   // Copy Face's control points into CloneFace's itsCtrlPnts member,
00086   // so that the default behavior of CloneFace is to mimic Face.
00087   const double* const face_pnts = Face::getCtrlPnts();
00088   for (int i = 0; i < 24; ++i)
00089     {
00090       itsCtrlPnts[i] = face_pnts[i];
00091     }
00092 }
00093 
00094 CloneFace::~CloneFace () throw()
00095 {
00096 GVX_TRACE("CloneFace::~CloneFace");
00097 }
00098 
00099 io::version_id CloneFace::class_version_id() const
00100 {
00101 GVX_TRACE("CloneFace::class_version_id");
00102   return CLONEFACE_SVID;
00103 }
00104 
00105 void CloneFace::read_from(io::reader& reader)
00106 {
00107 GVX_TRACE("CloneFace::read_from");
00108 
00109   io::read_utils::read_value_seq<double>(reader, "ctrlPnts",
00110                                          itsCtrlPnts, 24);
00111 
00112   readFieldsFrom(reader, classFields());
00113 
00114   reader.read_base_class("Face", io::make_proxy<Face>(this));
00115 }
00116 
00117 void CloneFace::write_to(io::writer& writer) const
00118 {
00119 GVX_TRACE("CloneFace::write_to");
00120 
00121   io::write_utils::write_value_seq(writer, "ctrlPnts",
00122                                    itsCtrlPnts, itsCtrlPnts+24, true);
00123 
00124   writeFieldsTo(writer, classFields(), CLONEFACE_SVID);
00125 
00126   writer.write_base_class("Face", io::make_const_proxy<Face>(this));
00127 }
00128 
00129 const double* CloneFace::getCtrlPnts() const
00130 {
00131 GVX_TRACE("CloneFace::getCtrlPnts");
00132   return itsCtrlPnts;
00133 }
00134 
00135 double CloneFace::getEyeAspect() const
00136 {
00137 GVX_TRACE("CloneFace::getEyeAspect");
00138   return itsEyeAspect;
00139 }
00140 
00141 double CloneFace::getVertOffset() const
00142 {
00143 GVX_TRACE("CloneFace::getVertOffset");
00144   return itsVertOffset;
00145 }
00146 
00147 static const char __attribute__((used)) vcid_groovx_visx_cloneface_cc_utc20050626084017[] = "$Id: cloneface.cc 10065 2007-04-12 05:54:56Z rjpeters $ $HeadURL: file:
00148 #endif // !GROOVX_VISX_CLONEFACE_CC_UTC20050626084017_DEFINED

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:49:41 2008 by Doxygen version 1.5.5.