/** * \file CMMWriter.cpp * \brief XXXX. * * Copyright 2007-2010 IMP Inventors. All rights reserved. * */ #include "IMP/display/CMMWriter.h" IMPDISPLAY_BEGIN_NAMESPACE void CMMWriter::on_open() { get_stream() << ""<" << std::endl; } bool CMMWriter::process(SphereGeometry *g, Color color, std::string name) { get_stream() << "get_center()[0] << "\"" << " y=\"" << g->get_center()[1] << "\"" << " z=\"" << g->get_center()[2] << "\"" << " radius=\"" << g->get_radius() << "\"" << " r=\"" << color.get_red() << "\"" << " g=\"" << color.get_green() << "\"" << " b=\"" << color.get_blue() << "\"" << " note=\"" << name << "\"/>" << std::endl; return true; } bool CMMWriter::process(PointGeometry *g, Color color, std::string name) { get_stream() << "operator[](0) << "\"" << " y=\"" << g->operator[](1) << "\"" << " z=\"" << g->operator[](2) << "\"" << " radius=\"" << 1 << "\"" << " r=\"" << color.get_red() << "\"" << " g=\"" << color.get_green() << "\"" << " b=\"" << color.get_blue() << "\"" << " note=\"" << name << "\"/>" << std::endl; return true; } IMP_REGISTER_WRITER(CMMWriter, ".cmm") IMPDISPLAY_END_NAMESPACE