CoordinateDeformer.h

Go to the documentation of this file.
00001 
00002 //    Copyright 2004, SenseGraphics AB
00003 //
00004 //    This file is part of H3D API.
00005 //
00006 //    H3D API is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    H3D API is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with H3D API; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 //
00020 //    A commercial license is also available. Please contact us at 
00021 //    www.sensegraphics.com for more information.
00022 //
00023 //
00027 //
00029 #ifndef __COORDINATEDEFORMER_H__
00030 #define __COORDINATEDEFORMER_H__
00031 
00032 #include "H3DCoordinateDeformerNode.h"
00033 #include "H3DFunctionNode.h"
00034 #include "SFFloat.h"
00035 #include "MFBool.h"
00036 
00037 namespace H3D {
00038 
00053   class H3DAPI_API CoordinateDeformer : public H3DCoordinateDeformerNode {
00054   public:
00055 
00056     typedef TypedSFNode< H3DFunctionNode > SFFunctionNode;
00057 
00059     CoordinateDeformer( Inst< SFFunctionNode > _distanceToDepth  = 0,
00060                         Inst< SFFloat        > _plasticity       = 0 ):
00061       distanceToDepth( _distanceToDepth ),
00062       plasticity( _plasticity ),
00063       touched_last_time( false ) {
00064 
00065       type_name = "CoordinateDeformer";
00066       database.initFields( this );
00067 
00068       plasticity->setValue( 0 );
00069     }
00070 
00073     virtual void deformPoints( const vector< bool  > &is_touched,
00074                                const vector< Vec3f > &touch_point,
00075                                const vector< Vec3f > &touch_normal,
00076                                const vector< Vec3f > &touch_force,
00077                                const vector< Vec3f > &penetration_points,
00078                                const vector< Vec3f > &orig_points,
00079                                const vector< Vec3f > &resting_points,
00080                                const vector< Vec3f > &deformed__points,
00081                                vector< Vec3f > &new_resting_points,
00082                                vector< Vec3f > &new_deformed_points );
00083 
00091     auto_ptr< SFFunctionNode > distanceToDepth;
00092 
00100     auto_ptr< SFFloat > plasticity;
00101 
00103     static H3DNodeDatabase database;
00104 
00105   protected:
00106     bool touched_last_time;
00107   };
00108 }
00109 
00110 #endif

Generated on Thu Aug 24 12:38:32 2006 for H3D API by  doxygen 1.4.5