00001 /* 00002 * Copyright (c) 2012 00003 * Side Effects Software Inc. All rights reserved. 00004 * 00005 * Redistribution and use of Houdini Development Kit samples in source and 00006 * binary forms, with or without modification, are permitted provided that the 00007 * following conditions are met: 00008 * 1. Redistributions of source code must retain the above copyright notice, 00009 * this list of conditions and the following disclaimer. 00010 * 2. The name of Side Effects Software may not be used to endorse or 00011 * promote products derived from this software without specific prior 00012 * written permission. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS 00015 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00016 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00017 * NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, 00018 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00019 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00020 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00021 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00022 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00023 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 * 00025 *---------------------------------------------------------------------------- 00026 */ 00027 00028 /* 00029 * The simplest network to see something working with this... 00030 * 00031 * RBD Object EmptyObject 00032 * \ | 00033 * \ HairSolver 00034 * \ | 00035 * \__ Gravity 00036 * \ / 00037 * Merge 00038 * 00039 * The gravity node should be set to have a non-zero X velocity. 00040 * The HairSolver node should have the name of the rbd object 00041 * (default rbdobject1) as its Source Object. 00042 */ 00043 00044 00045 #ifndef __SIM_SolverHair_h__ 00046 #define __SIM_SolverHair_h__ 00047 00048 #include <SIM/SIM_SingleSolver.h> 00049 #include <SIM/SIM_OptionsUser.h> 00050 #include <SIM/SIM_Utils.h> 00051 00052 #define SIM_NAME_SOURCEOBJECTS "sourceobjects" 00053 00054 class SIM_ObjectArray; 00055 class SIM_GeometryCopy; 00056 00057 namespace HDK_Sample { 00058 00059 // This class implemented a computational fluid dynamics solver. 00060 class SIM_SolverHair : public SIM_SingleSolver, 00061 public SIM_OptionsUser 00062 { 00063 protected: 00064 explicit SIM_SolverHair(const SIM_DataFactory *factory); 00065 virtual ~SIM_SolverHair(); 00066 00067 virtual SIM_Result solveSingleObjectSubclass(SIM_Engine &engine, 00068 SIM_Object &object, 00069 SIM_ObjectArray &feedbacktoobjects, 00070 const SIM_Time ×tep, 00071 bool newobject); 00072 00073 // These virtual functions can be overridden to create new hair 00074 // solvers that are based on this solver. 00075 virtual void createHairFromSource(SIM_GeometryCopy &hairgeo, 00076 const SIM_ObjectArray &srcobjs) const; 00077 virtual void solveHair(SIM_GeometryCopy &hairgeo, 00078 const SIM_ObjectArray &srcobjs, 00079 const SIM_Object &object, 00080 const SIM_Time ×tep) const; 00081 00082 private: 00083 static const SIM_DopDescription *getSolverHairDopDescription(); 00084 00085 DECLARE_STANDARD_GETCASTTOTYPE(); 00086 DECLARE_DATAFACTORY(SIM_SolverHair, 00087 SIM_SingleSolver, 00088 "Hair Solver", 00089 getSolverHairDopDescription()); 00090 }; 00091 00092 } // End HDK_Sample namespace 00093 00094 #endif 00095
1.5.9