- Timestamp:
- Jun 9, 2009, 5:25:13 PM (15 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/FlowCmd.cpp
r1493 r1497 87 87 {Rappture::SWITCH_CUSTOM, "-position", "number", 88 88 offsetof(FlowParticlesValues, position), 0, 0, &positionSwitch}, 89 {Rappture::SWITCH_FLOAT, "-size", "float", 90 offsetof(FlowParticlesValues, particleSize), 0}, 89 91 {Rappture::SWITCH_END} 90 92 }; … … 155 157 _rendererPtr->setColor(Vector4(_sv.color.r, _sv.color.g, _sv.color.b, 156 158 _sv.color.a)); 159 _rendererPtr->particleSize(_sv.particleSize); 157 160 _rendererPtr->setAxis(_sv.position.axis); 158 161 _rendererPtr->active(!_sv.isHidden); … … 1908 1911 Trace("FLOW started\n"); 1909 1912 1910 Rappture::Outcome result;1913 Rappture::Outcome context; 1911 1914 Rappture::AVTranslate movie(width, height, frameRate, bitRate); 1912 1915 … … 1916 1919 } 1917 1920 1918 movie.init( result, fileName);1921 movie.init(context, fileName); 1919 1922 1920 1923 for (int i = 0; i < numFrames; i++) { … … 1931 1934 // This is done before bmp_write_to_file because bmp_write_to_file 1932 1935 // turns rgb data to bgr 1933 movie.append( result, NanoVis::screen_buffer, pad);1936 movie.append(context, NanoVis::screen_buffer, pad); 1934 1937 // NanoVis::bmp_write_to_file(frame_count, fileName); 1935 1938 } 1936 1939 1937 movie.done( result);1940 movie.done(context); 1938 1941 Trace("FLOW end\n"); 1939 1942 … … 1947 1950 // FIXME: find a way to get the data from the movie object as a void* 1948 1951 Rappture::Buffer data; 1949 if (!data.load( result, fileName)) {1952 if (!data.load(context, fileName)) { 1950 1953 Tcl_AppendResult(interp, "can't load data from temporary movie file \"", 1951 fileName, "\": ", result.remark(), (char *)NULL);1954 fileName, "\": ", context.remark(), (char *)NULL); 1952 1955 return TCL_ERROR; 1953 1956 } 1954 1957 // Build the command string for the client. 1955 1958 char command[200]; 1956 sprintf(command,"nv>image -bytes %lu -type movie -token token\n",1957 (unsigned long)data.size() );1959 sprintf(command,"nv>image -bytes %lu -type movie -token \"%s\"\n", 1960 (unsigned long)data.size(), Tcl_GetString(objv[7])); 1958 1961 1959 1962 NanoVis::sendDataToClient(command, data.bytes(), data.size()); … … 1982 1985 {"next", 2, FlowNextOp, 2, 2, "",}, 1983 1986 {"reset", 1, FlowResetOp, 2, 2, "",}, 1984 {"video", 1, FlowVideoOp, 7, 7,1985 "width height numFrames frameRate bitRate ",},1987 {"video", 1, FlowVideoOp, 8, 8, 1988 "width height numFrames frameRate bitRate token",}, 1986 1989 }; 1987 1990 static int nFlowCmdOps = NumCmdSpecs(flowCmdOps); -
trunk/packages/vizservers/nanovis/FlowCmd.h
r1493 r1497 20 20 int isHidden; /* Indicates if particle injection 21 21 * plane is active or not. */ 22 float particleSize; /* Size of the particles. */ 22 23 }; 23 24 … … 40 41 FlowParticles(const char *name, Tcl_HashEntry *hPtr); 41 42 ~FlowParticles(void); 42 void SetColor(FlowColor &color) {43 _sv.color = color;44 _rendererPtr->setColor(Vector4(color.r, color.g, color.b, color.a));45 }46 43 const char *name(void) { 47 44 return _name; -
trunk/packages/vizservers/nanovis/NvParticleRenderer.cpp
r1482 r1497 45 45 46 46 NvParticleRenderer::NvParticleRenderer(int w, int h, CGcontext context) : 47 _particleSize(1.2), 47 48 scale(1, 1, 1), 48 49 origin(0, 0, 0), 49 _activate(false) 50 _activate(false) 50 51 { 51 52 psys_width = w; … … 446 447 */ 447 448 448 glPointSize( 1.2);449 glPointSize(_particleSize); 449 450 //glColor4f(.2,.2,.8,1.); 450 451 glColor4f(_color.x, _color.y, _color.z, _color.w); -
trunk/packages/vizservers/nanovis/NvParticleRenderer.h
r1478 r1497 34 34 35 35 struct Particle { 36 float x;37 float y;38 float z;39 float aux;36 float x; 37 float y; 38 float z; 39 float aux; 40 40 41 Particle(){};42 Particle(float _x, float _y, float _z, float _life) :43 41 Particle(){}; 42 Particle(float _x, float _y, float _z, float _life) : 43 x(_x), y(_y), z(_z), aux(_life){} 44 44 }; 45 45 … … 76 76 float max_life; 77 77 78 float _particleSize; // Size of the particle: default is 1.2 79 78 80 /** 79 81 * @brief vertex array for display particles … … 81 83 RenderVertexArray* m_vertex_array; 82 84 83 //Nvidia CG shaders and their parameters84 /*85 CGcontext m_g_context;86 CGprogram m_pos_fprog;87 CGparameter m_vel_tex_param, m_pos_tex_param, m_scale_param;88 CGparameter m_pos_timestep_param, m_pos_spherePos_param;89 */85 //Nvidia CG shaders and their parameters 86 /* 87 CGcontext m_g_context; 88 CGprogram m_pos_fprog; 89 CGparameter m_vel_tex_param, m_pos_tex_param, m_scale_param; 90 CGparameter m_pos_timestep_param, m_pos_spherePos_param; 91 */ 90 92 static NvParticleAdvectionShader* _advectionShader; 91 93 … … 132 134 float r, float g, float b, float line_width); 133 135 void initializeDataArray(); 136 void particleSize(float size) { 137 _particleSize = size; 138 } 139 float particleSize(void) { 140 return _particleSize; 141 } 134 142 }; 135 143
Note: See TracChangeset
for help on using the changeset viewer.