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();}
     
     
     

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

  • 相关阅读:
    内存之RAM、SRAM、DRAM、ROM、FLASH、SDRAM、DDR*
    音频接口之AUX、TRS、RCA、SLR、AES/EBU、S/PDIF
    视频接口之AV、S端子、VGA、DVI、HDMI、DP
    选购硬盘HDD、SSD、SSHD、IDE、SATA、SCSI、SAS、PCIe、M.2、USB
    浅析C#中的“==”和Equals
    编写更好的C#代码
    C# 文件下载四方法
    Linq之Lambda表达式初步认识
    .NET逻辑分层架构总结
    理解 .NET 2015
  • 原文地址:https://www.cnblogs.com/houdinime/p/1688573.html
Copyright © 2011-2022 走看看