// This is not useful as the tubes take too long to render in POV-Ray void PovRayGen::writeMesh(QList<qglviewer::Vec> const& edges, QColor const& color, bool clip) { QString id("Mesh_"); id += QString::number(m_meshCount); ++m_meshCount; m_stream << "#declare " << id << "=\n"; m_stream << "union {\n"; for (int i = 0; i < edges.size(); i += 2) { m_stream << " cylinder {" << formatVector(edges[i]) << ", " << formatVector(edges[i+1]) << ", 0.01}\n"; } m_stream << "}\n\n"; m_stream << "object {\n"; m_stream << " " << id << "\n"; m_stream << " texture {\n"; m_stream << " pigment {\n"; m_stream << " color rgbt " << formatColor(color) << "\n"; m_stream << " } \n"; m_stream << " }\n"; if (clip) m_stream << " clipped_by { Clipping_Plane }\n"; m_stream << "}\n"; }
void PovRayGen::writeMesh(QList<qglviewer::Vec> const& vertices, QList<qglviewer::Vec> const& normals, QList<int> const& faces, QColor const& color, bool clip) { unsigned nVertices(vertices.size()); unsigned nFaces(faces.size()/3); QString id("Mesh_"); id += QString::number(m_meshCount); ++m_meshCount; m_stream << "#declare " << id << "=\n"; m_stream << "mesh2 {\n"; m_stream << " vertex_vectors {\n"; m_stream << " " << nVertices; for (unsigned i = 0; i < nVertices; ++i) { m_stream << ",\n " << formatVector(vertices.at(i)); } m_stream << "\n }\n\n"; m_stream << " normal_vectors {\n"; m_stream << " " << nVertices; for (unsigned i = 0; i < nVertices; ++i) { Vec n(normals.at(i)); //m_stream << ",\n " << formatVector(normals.at(i)); m_stream << ",\n " << formatVector(Vec(n.x, n.y, -n.z)); } m_stream << "\n }\n\n"; m_stream << " face_indices{\n"; m_stream << " " << nFaces; for (int i = 0; i < faces.size(); i += 3) { m_stream << ",\n <" << faces.at(i) << ", " << faces.at(i+1) << ", " << faces.at(i+2) << ">"; } m_stream << "\n }\n\n"; m_stream << "\n}\n\n"; if (clip) { m_stream << "ClippedSurface(" << id << ", " << formatColor(color) << ")\n"; }else { m_stream << "Surface(" << id << ", " << formatColor(color) << ")\n"; } }
void PovRayGen::setBackground(QColor const& iqmolBackground) { QString color(m_settings.value("background").toString()); m_stream << "background {\n"; if (color == "Black") { m_stream << " color Black\n"; }else if (color == "White") { m_stream << " color White\n"; }else if (color == "None") { m_stream << " color Clear\n"; }else { m_stream << " color " << formatColor(iqmolBackground) << "\n"; } m_stream << "}\n\n"; }
std::string WindowsColorConsoleChannel::getProperty(const std::string& name) const { if (name == "enableColors") { return _enableColors ? "true" : "false"; } else if (name == "traceColor") { return formatColor(_colors[Message::PRIO_TRACE]); } else if (name == "debugColor") { return formatColor(_colors[Message::PRIO_DEBUG]); } else if (name == "informationColor") { return formatColor(_colors[Message::PRIO_INFORMATION]); } else if (name == "noticeColor") { return formatColor(_colors[Message::PRIO_NOTICE]); } else if (name == "warningColor") { return formatColor(_colors[Message::PRIO_WARNING]); } else if (name == "errorColor") { return formatColor(_colors[Message::PRIO_ERROR]); } else if (name == "criticalColor") { return formatColor(_colors[Message::PRIO_CRITICAL]); } else if (name == "fatalColor") { return formatColor(_colors[Message::PRIO_FATAL]); } else { return Channel::getProperty(name); } }
bool KmlColorStyleTagWriter::write( const Marble::GeoNode *node, GeoWriter &writer ) const { GeoDataColorStyle const *colorStyle = static_cast<const GeoDataColorStyle*>(node); if ( colorStyle->id().isEmpty() && colorStyle->targetId().isEmpty() && colorStyle->color() == defaultColor() && colorStyle->colorMode() == GeoDataColorStyle::Normal && isEmpty( node ) ) { return true; } writer.writeStartElement( m_elementName ); KmlObjectTagWriter::writeIdentifiers( writer, colorStyle); writer.writeOptionalElement( kml::kmlTag_color, formatColor( colorStyle->color() ), formatColor( defaultColor() ) ); QString const colorMode = colorStyle->colorMode() == GeoDataColorStyle::Random ? "random" : "normal"; writer.writeOptionalElement( kml::kmlTag_colorMode, colorMode, "normal" ); bool const result = writeMid( node, writer ); writer.writeEndElement(); return result; }
void PovRayGen::writeAtom(Vec const& pos, QColor const& col, double const rad) { m_stream << "Atom(" << formatVector(pos) << ", " << formatColor(col) << ", " << rad << ")\n"; }
void PovRayGen::writeBond(qglviewer::Vec const& begin, qglviewer::Vec const& end, QColor const& col, double const radius) { m_stream << "Bond(" << formatVector(begin) << ", " << formatVector(end) << ", " << formatColor(col) << ", " << radius << ")\n"; }