📄 povray.h
字号:
/*************************************************************************** povray.h - description ------------------- begin : Sat Dec 8 2001 copyright : (C) 2001 by Rudiger Koch email : rkoch@rkoch.org ***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#ifndef POVRAY_H#define POVRAY_Husing namespace std;#include <stdio.h>#include <string>#include <vector>#include <amygdala/types.h>class Network;class Neuron;/** @class Povray povray.h amygdala/povray.h * @brief Generate a Povray (*.pov) file to visualize a NN. * * This file can then be used with Povray to render an image * in the bitmap formats supported by Povray. * See <A HREF="http://www.povray.org">http://www.povray.org</A> * for more information about Povray. * <p>A good command line to generate a high quality image is:<br> * x-povray +Iid-123.pov +Oamygdala.tga +W1600 +H1200 +V +D +X +FT +Q9 +QR +A0.9 * <p><strong>Note: A Povray object should be destroyed as fast as possible to close the file!</strong> * <p><strong>Note: MP support is not yet implemented!</strong> * @author Rudiger Koch <rkoch@rkoch.org> */class Povray {public: /** Use this constructor if you want a complete network @param an ID, for instance a genome ID @param headline a string that will appear as headline on the image @param dir the directory the povray file will be written to */ Povray(int ID, string headline, string dir=""); /** Make a Povray file of a network instance * @param net A reference to the Network object we're going to work on * @param ID an ID, for instance a genome ID * @param headline a string that will appear as headline on the image * @param dir the directory the povray file will be written to */ Povray(Network *net, int ID, string headline, string dir); ~Povray(); /** Writes the whole network to a file. */ void WriteNetwork(); /** Write the current neuron, and recurse through the tree starting from it, writing all neurons and synapses. * @param currentNeuron the root neuron * @param depth the recursion depth */ void WriteTree(Neuron* rootNeuron, int depth);private: // Private attributes Network * net; FILE* povfile;protected: // Protected methods /** Write one neuron to the current Povray file * @param theNeuron the neuron to write */ void WriteNeuron(Neuron *theNeuron); /** Write a synapse between 2 neurons. * @param pre a pointer to the presynaptic neuron * @param post a pointer to the postsynaptic neuron */ void WriteSynapse(Neuron *pre, Neuron *post); /** Create a header for Povray * @param id the ID of the network. This could be the geneID of a genome */ void mkPovHeader(int Id);private: // Private methods void OutFile(int ID, string headline, string dir); void WriteMpNetwork();};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -