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 * TimeCompare SOP 00027 */ 00028 00029 00030 #ifndef __SOP_TimeCompare_h__ 00031 #define __SOP_TimeCompare_h__ 00032 00033 #include <SOP/SOP_Node.h> 00034 00035 namespace HDK_Sample { 00036 /// Compares a point attribute on the two inputs at different times, storing 00037 /// the difference in a new attribute. 00038 class SOP_TimeCompare : public SOP_Node 00039 { 00040 public: 00041 SOP_TimeCompare(OP_Network *net, const char *name, OP_Operator *op); 00042 virtual ~SOP_TimeCompare(); 00043 00044 static PRM_Template myTemplateList[]; 00045 static OP_Node *myConstructor(OP_Network*, const char *, 00046 OP_Operator *); 00047 00048 /// This method is created so that it can be called by handles. It only 00049 /// cooks the input group of this SOP. The geometry in this group is 00050 /// the only geometry manipulated by this SOP. 00051 virtual OP_ERROR cookInputGroups(OP_Context &context, 00052 int alone = 0); 00053 00054 protected: 00055 /// Method to cook geometry for the SOP 00056 virtual OP_ERROR cookMySop(OP_Context &context); 00057 00058 private: 00059 void getGroups(UT_String &str){ evalString(str, "group", 0, 0); } 00060 00061 void ATTRIB(UT_String &str, float t) 00062 { evalString(str, "attrib", 0, t); } 00063 void RESULTATTRIB(UT_String &str, float t) 00064 { evalString(str, "resultattrib", 0, t); } 00065 float FRAME(float t) 00066 { return evalFloat("frame", 0, t); } 00067 00068 /// This variable is used together with the call to the "checkInputChanged" 00069 /// routine to notify the handles (if any) if the input has changed. 00070 GU_DetailGroupPair myDetailGroupPair; 00071 00072 /// This is the group of geometry to be manipulated by this SOP and cooked 00073 /// by the method "cookInputGroups". 00074 const GB_PointGroup *myGroup; 00075 }; 00076 } // End HDK_Sample namespace 00077 00078 #endif
1.5.9