maxnet_job.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // -----------------------
00003 // File ....: maxnet_job.h
00004 // -----------------------
00005 // Author...: Gus J Grubba
00006 // Date ....: March 2000
00007 // O.S. ....: Windows 2000
00008 //
00009 // History .: March, 11 2000 - Created
00010 //
00011 // 3D Studio Max Network Rendering Classes - Job
00012 // 
00013 //-----------------------------------------------------------------------------
00014 
00015 #pragma once
00016 #include <WTypes.h>
00017 #include "strbasic.h"
00018 #include "maxheap.h"
00019 #include "network\MaxNetExport.h"
00020 #include "maxnet_types.h"
00021 
00022 // forward declarations
00023 class MaxNetManagerImp;
00024 
00025 
00026 //-----------------------------------------------------------------------------
00027 //-- Scene Info
00028 
00029 //#define SCENE_SHADOWMAPPED    (1<<0)  Obsolete
00030 //#define SCENE_RAYTRACED       (1<<1)  Obsolete
00031 #define SCENE_VIDEOCOLORCHECK   (1<<2)
00032 #define SCENE_TWOSIDED          (1<<3)
00033 #define SCENE_RENDERHIDEN       (1<<4)
00034 #define SCENE_RENDERATMOSPHER   (1<<5)
00035 #define SCENE_SUPERBLACK        (1<<6)
00036 //#define SCENE_RENDERALPHA     (1<<7)  Obsolete
00037 #define SCENE_SERIALNUMBERING   (1<<8)
00038 #define SCENE_DITHER256         (1<<9)
00039 #define SCENE_DITHERTRUE        (1<<10)
00040 #define SCENE_RENDERFIELDS      (1<<11)
00041 #define SCENE_DISPLACEMENT      (1<<12)
00042 #define SCENE_EFFECTS           (1<<13)
00043 #define SCENE_FIELDORDER        (1<<14)     //-- 0 Even / 1 Odd
00044 
00049 struct SceneInfo: public MaxHeapOperators {
00051     int     objects;
00053     int     faces;
00055     int     lights;
00057     int     start,end;
00084     DWORD   flags;
00085 };
00086 
00087 //-----------------------------------------------------------------------------
00088 //-- Text Info
00089 //
00090 
00091 enum JOB_TEXT_TYPE
00092 {
00093     JOB_TEXT_USER = 64,             
00094     JOB_TEXT_COMPUTER,              
00095     JOB_TEXT_MANAGER_SHARE,         
00096     JOB_TEXT_FRAMES,                
00097     JOB_TEXT_MAX_OUTPUT,            
00098     JOB_TEXT_CMB_OUTPUT,            
00099     JOB_TEXT_RENDER_ELEMENT,        
00100     JOB_TEXT_CAMERA,                
00101     JOB_TEXT_RENDER_SCENE_STATE,    
00102     JOB_TEXT_SCENE_STATES,          
00103     JOB_TEXT_BATCH_RENDER,          
00104     JOB_TEXT_PRE_REND_SCRIPT,       
00105     JOB_TEXT_POST_REND_SCRIPT,      
00106     JOB_TEXT_RESERVED = 9999        
00107 };
00108 
00113 struct TextBufferOutput: public MaxHeapOperators {
00115     bool    device;
00117     float   gamma;
00119     MCHAR   data[256];
00120 };
00121 
00126 struct JobRenderElement: public MaxHeapOperators {
00128     bool    enabled;
00130     bool    filterenabled;
00132     bool    atmosphere_applied;
00134     bool    shadows_applied;
00136     MCHAR   name[128];
00138     MCHAR   output[MAX_PATH];
00139 };
00140 
00145 struct JobText: public MaxHeapOperators {
00147     JOB_TEXT_TYPE type;
00148     union {
00150         MCHAR           text[256];
00152         TextBufferOutput    output;
00154         JobRenderElement    re;
00155     };
00156 };
00157 
00163 class MAXNETEXPORT CJobText: public MaxHeapOperators {
00164     friend class MaxNetManagerImp;
00165     protected:
00166         void*   list;
00167     public:
00168                 CJobText        ( );
00171                 ~CJobText       ( );
00172         
00177         int         Count       ( );
00183         int         Add         (JobText* jt);
00190         void        Delete      (int idx, int count = 1);
00193         void        Reset       ( );
00196         JobText*    Buffer      ( );
00199         int         BufferSize  ( );
00200         
00206         JobText& operator[](const int i);
00207 
00216         int     FindJobText     (JOB_TEXT_TYPE tp, int start = 0);
00230         bool    GetTextItem     (MCHAR* text, JOB_TEXT_TYPE type, int start = 0, int* idx = 0);
00237         bool    GetUser         (MCHAR* user);
00244         bool    GetComputer     (MCHAR* computer);
00252         bool    GetFrames       (MCHAR* frames);
00261         bool    GetShare        (MCHAR* share);
00262 
00263 };
00264 
00265 //---------------------------------------------------------
00266 //-- Alert Notification
00267 //
00268 
00269 #define NOTIFY_FAILURE      (1<<0)
00270 #define NOTIFY_PROGRESS     (1<<1)
00271 #define NOTIFY_COMPLETION   (1<<2)
00272 
00278 struct AlertData: public MaxHeapOperators {
00280     bool        alertEnabled;
00289     DWORD       notifications;
00291     int     nthFrames;              
00292 };
00293 
00294 //---------------------------------------------------------
00295 //-- Job Flags
00296 
00297 #define JOB_VP              (1<<0)      //!< Video Post (otherwise is Render Scene)
00298 #define JOB_NONC            (1<<1)      //!< Non concurrent driver (Accom, AVI, etc.)
00299 #define JOB_MAPS            (1<<2)      //!< Include Maps
00300 #define JOB_NONSTOP         (1<<3)      //!< Uninterruptible Driver (AVI, FCL, etc.)
00301 #define JOB_SKIPEXST        (1<<4)      //!< Skip Existing Frames
00302 #define JOB_ALLSERVERS      (1<<5)      //!< Use All Available Servers
00303 #define JOB_INACTIVE        (1<<6)      //!< Job is Suspended
00304 #define JOB_COMPLETE        (1<<7)      //!< Job is Complete (Read Only)
00305 #define JOB_IGNORESHARE     (1<<8)      //!< Ignore Manager's Job Share - Always request archives
00306 #define JOB_SKIPOUTPUTTST   (1<<9)      //!< Skip output test (Server won't test the output path)
00307 #define JOB_NONSEQFRAMES    (1<<10)     //!< Non sequential frames (1,3,5-10, etc.)
00308 #define JOB_COMBUSTIONJOB   (1<<11)     //!< Combustion Job
00309 #define JOB_NOTARCHIVED     (1<<12)     //!< Uncompressed File (not an archive)
00310 #define JOB_VFB             (1<<13)     //!< Should the VFB be up?
00311 #define JOB_RENDER_CROP     (1<<14)     //!< Partial Render (Crop / Zoom / Region / etc.)
00312 
00313 #define JOB_ASSIGN_VP       JOB_VP      //-- Make compatible with legacy flag
00314 #define JOB_ASSIGN_RND      0           //-- Make compatible with legacy flag
00315 
00316 //---------------------------------------------------------
00317 //-- Priority Level
00318 
00319 #define _JOB_PRIORITY_CRITICAL  0
00320 #define _JOB_DEFAULT_PRIORITY   50
00321 
00322 //---------------------------------------------------------
00323 //-- Job
00324 
00325 #define _JOB_VERSION 399
00326 
00331 struct MaxJobRenderElements: public MaxHeapOperators {
00333     bool        enabled;
00334 };
00335 
00340 struct MaxJob: public MaxHeapOperators {
00342     bool        init;               //-- Is structure valid?
00344     bool        gammacorrection;        //-- Use gamma correction?
00346     float       gammavaluein;           //-- Input Gamma (Maps)
00348     float       gammavalueout;          //-- Output Gamma (Output Image)
00350     float       pixelaspect;            //-- Pixel Aspect Ratio
00352     char        camera[128];            //-- Camera
00354     SceneInfo   sceneInfo;          //-- Scene Info
00356     MaxJobRenderElements    re;         //-- Render Elements
00358     char        reserved[64];
00359 };
00360 
00365 struct CombustionJob: public MaxHeapOperators {
00367     bool        init;
00369     char        reserved[128];
00370 };
00371 
00376 struct Job: public MaxHeapOperators {
00378     DWORD       size;
00380     DWORD       version;
00382     DWORD       server_pid;
00415     DWORD       flags;
00417     HJOB        hJob;
00419     char        name[MAX_PATH];
00421     DWORD       filesize;           
00422 
00423     DWORD       filesizeextracted;      
00424 
00425     SYSTEMTIME  submission;
00427     SYSTEMTIME  startjob;
00429     SYSTEMTIME  endjob;
00431     int     servercount;
00433     AlertData   alerts;
00435     int     jobtextcount;
00437     int     firstframe;
00439     int     lastframe;
00441     int     step;
00443     int     width,height;
00445     int     frames_completed;
00447     char        priority;
00449     char        reserved[32];
00450     union {
00452         MaxJob          maxJob;         //-- MAX Specific
00454         CombustionJob   combustionJob;  //-- Combustion Specific
00455     };
00456 };
00457 
00458 
00459