zoukankan      html  css  js  c++  java
  • 最简sop node

    代码
    #include <limits.h>
    #include 
    <UT/UT_DSOVersion.h>
    #include 
    <UT/UT_Math.h>
    #include 
    <UT/UT_Interrupt.h>
    #include 
    <GU/GU_Detail.h>
    #include 
    <GU/GU_PrimPoly.h>
    #include 
    <CH/CH_LocalVariable.h>
    #include 
    <PRM/PRM_Include.h>
    #include 
    <OP/OP_Operator.h>
    #include 
    <OP/OP_OperatorTable.h>


    #include 
    <SOP/SOP_Node.h>
    namespace HDK_Sample {
    class SOP_Star : public SOP_Node
    {
    public:
        
    static OP_Node        *myConstructor(OP_Network*const char *,
                                    OP_Operator 
    *);
        
    static PRM_Template         myTemplateList[];
        
    static CH_LocalVariable     myVariables[];
    protected:
             SOP_Star(OP_Network 
    *net, const char *name, OP_Operator *op): SOP_Node(net, name, op){}
        
    virtual ~SOP_Star(){}
        
    virtual unsigned         disableParms(){return 0;}
        
    virtual OP_ERROR         cookMySop(OP_Context &context);
    };
    }

    using namespace HDK_Sample;

    void
    newSopOperator(OP_OperatorTable 
    *table)
    {
        table
    ->addOperator(
            
    new OP_Operator("hdk_star",            // Internal name
                    "Star",            // UI name
                     SOP_Star::myConstructor,    // How to build the SOP
                     SOP_Star::myTemplateList,    // My parameters
                     0,                // Min # of sources
                     0,                // Max # of sources
                     SOP_Star::myVariables,    // Local variables
                     OP_FLAG_GENERATOR)        // Flag it as generator
            );
    }

    PRM_Template
    SOP_Star::myTemplateList[] 
    = {PRM_Template()};
    enum {    VAR_PT,    VAR_NPT    };
    CH_LocalVariable
    SOP_Star::myVariables[] 
    = {
        { 
    "PT",    VAR_PT, 0 },        // The table provides a mapping
        { "NPT",    VAR_NPT, 0 },        // from text string to integer token
        { 000 },
    };
    OP_Node 
    *
    SOP_Star::myConstructor(OP_Network 
    *net, const char *name, OP_Operator *op)
    {    
    return new SOP_Star(net, name, op);}
    OP_ERROR
    SOP_Star::cookMySop(OP_Context 
    &context){return error();}
     
     
     

     暂存,终于跨出了一步,现在要做的就是加速,再加速。

  • 相关阅读:
    同名的const 成员函数
    模板元编程中的“hello world”
    枚举联合不能用作基类,也不能有基类
    不能重载的操作符
    不同级别成员对应三种继承的结果:
    c++ error: creating array of references( declaration of 'a' as array)
    leetcode 剑指offer 03 数组中重复的数字
    Lintcode 89 K sum
    leetcode 322. Coin Change
    Leetcode 416. Partition Equal Subset Sum
  • 原文地址:https://www.cnblogs.com/houdinime/p/1688573.html
Copyright © 2011-2022 走看看