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

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

  • 相关阅读:
    ArcGIS Engine 常用方法(转)
    正则表达式 C#System.Text.RegularExpressions.Regex
    ae中栅格数据转为矢量数据 (转)
    ArcEngine 渲染的使用 (转)
    C#字符串分割成数组,中间多空格
    <C++ GUI Programming with Qt4 ,Second Edition> 学习笔记
    perl module and its package
    static_cast reinterpret_cast
    阅读<inside the c++ object modle > 有感
    C++ virtual table
  • 原文地址:https://www.cnblogs.com/houdinime/p/1688573.html
Copyright © 2011-2022 走看看