void PovRayGen::writeSurfaceMacro() { m_stream << "#macro Surface(id, col)\n"; m_stream << "object {\n"; m_stream << " id\n"; writeTexture(m_settings.value("surfaceTexture").toString()); m_stream << "}\n"; m_stream << "#end\n\n"; m_stream << "#macro ClippedSurface(id, col)\n"; m_stream << "object {\n"; m_stream << " id\n"; writeTexture(m_settings.value("surfaceTexture").toString()); m_stream << " clipped_by { Clipping_Plane }\n"; m_stream << "}\n"; m_stream << "#end\n\n"; }
void PovRayGen::writeBondMacro() { m_stream << "#macro Bond(beginAtom, endAtom, col, rad)\n"; m_stream << "cylinder {\n"; m_stream << " beginAtom, endAtom, rad\n"; writeTexture(m_settings.value("bondTexture").toString()); m_stream << "}\n"; m_stream << "#end\n\n"; }
void PovRayGen::writeAtomMacro() { m_stream << "#macro Atom(pos, col, rad)\n"; m_stream << "sphere {\n"; m_stream << " pos, rad \n"; writeTexture(m_settings.value("atomTexture").toString()); m_stream << "}\n"; m_stream << "#end\n\n"; }
void Render::writeFramebufferTextures() { for (map<string,GLuint>::iterator i = gl_framebuffer_texs.begin();i!=gl_framebuffer_texs.end();i++) { string s(i->first); s+=".png"; writeTexture(i->second, s.c_str()); } }
void DefaultRenderer::writeColorTexture(GLuint tid,std::string path) { writeTexture(tid,GL_RED,std::string(path).append("Red.ppm")); writeTexture(tid,GL_BLUE,std::string(path).append("Blue.ppm")); writeTexture(tid,GL_GREEN,std::string(path).append("Green.ppm")); }
void saveTexture(const char* filename, const GL::Texture2D& tex) { std::ofstream file(filename, std::ios::out | std::ios::binary); writeTexture(file, tex); }