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 #ifndef __SOP_CopRaster_h__ 00029 #define __SOP_CopRaster_h__ 00030 00031 #include <UT/UT_String.h> 00032 #include <IMG/IMG_Raster.h> 00033 #include <SOP/SOP_Node.h> 00034 00035 namespace HDK_Sample { 00036 class SOP_CopRaster : public SOP_Node 00037 { 00038 public: 00039 virtual unsigned disableParms(); 00040 00041 static OP_Node *myConstructor(OP_Network*, const char *, OP_Operator*); 00042 static PRM_Template myTemplateList[]; 00043 00044 /// This static methods is used to build a menu for the UI. 00045 static void buildColorMenu(void *data, PRM_Name *, int, 00046 const PRM_SpareData *, PRM_Parm *); 00047 00048 protected: 00049 SOP_CopRaster(OP_Network*, const char *, OP_Operator*); 00050 virtual ~SOP_CopRaster(); 00051 00052 virtual OP_ERROR cookMySop(OP_Context &context); 00053 00054 /// Splits a full cop2 path into the net and node portions. 00055 void splitCOP2Path(const char *path, UT_String &net, 00056 UT_String &node); 00057 00058 /// This takes a path relative to this node, and finds the full path 00059 /// that should be sent to the CopResolver. Flag dependent is set if 00060 /// an interest in the flag of the destination should be set. 00061 int getFullCOP2Path(const char *relpath, UT_String &fullpath, 00062 int &flagdependent); 00063 00064 private: 00065 int updateRaster(float t); 00066 00067 UT_String myCurrentName; 00068 IMG_Raster myRaster; 00069 00070 int USEDISK() 00071 { return evalInt("usedisk", 0, 0); } 00072 void COPPATH(UT_String &str, float t) 00073 { evalString(str, "coppath", 0, t); } 00074 void CPLANE(UT_String &str, float t) 00075 { evalString(str, "copcolor", 0, t); } 00076 void FNAME(UT_String &str, float t) 00077 { evalString(str, "file", 0, t); } 00078 float COPFRAME(float t) 00079 { return evalFloat("copframe", 0, t); } 00080 00081 /// This variable is used together with the call to the "checkInputChanged" 00082 /// routine to notify the handles (if any) if the input has changed. 00083 GU_DetailGroupPair myDetailGroupPair; 00084 }; 00085 } // End HDK_Sample namespace 00086 00087 #endif
1.5.9