SpherePackingScenarioGenerator
|
00001 /* 00002 * ChannelPrinter.h 00003 * 00004 * Created on: 2011-4-4 00005 * Author: asu, Michael Lieb 00006 */ 00007 00008 #ifndef ChannelPrinter_H_ 00009 #define ChannelPrinter_H_ 00010 #include <vector> 00011 #include <string> 00012 #include <cmath> 00013 #include "tarch/la/Vector.h" 00014 #include "tarch/logging/Log.h" 00015 #include "tarch/xmlwriter/XMLWriter.h" 00016 #include "xml/twoD/ChannelPrinterHelper.h" 00017 00018 00019 00020 namespace xml { 00021 namespace twoD { 00022 class ChannelPrinter; 00023 }} 00024 00025 namespace algorithms { 00026 namespace geometries { 00027 class Channel; 00028 } /* namespace geometries */ 00029 } /* namespace algorithms */ 00030 00031 class xml::twoD::ChannelPrinter { 00032 public: 00033 ChannelPrinter(); 00034 virtual ~ChannelPrinter(); 00035 00036 void printP1Channels( 00037 const std::vector<algorithms::geometries::Channel*>& channels 00038 ) const; 00039 00040 void rotateAndPrintP1Channels( 00041 const xml::twoD::SubDomain& subDomain, 00042 const std::string& filename, 00043 const double rotationAngleStep=M_PI, 00044 const std::string& maxMeshWidth=std::string("1/3"), 00045 const std::string& minMeshWidth=std::string("1/9") 00046 ) const; 00047 00048 void printP1Channels( 00049 const std::vector<algorithms::geometries::Channel*>& channels, 00050 const std::string& maxMeshWidth, 00051 const std::string& minMeshWidth, 00052 tarch::xmlwriter::XMLWriter& myXml 00053 ) const; 00054 00055 std::string getDate( 00056 ) const; 00057 00058 void printP1DomainAndPrinterInfo( 00059 tarch::xmlwriter::XMLWriter& myXml, 00060 const xml::twoD::SubDomain& subDomain, 00061 const double& rotation 00062 ) const; 00063 00064 void sortChannelsWithRespectToSubdomain( 00065 const std::vector<algorithms::geometries::Channel*>& channels 00066 ) const; 00067 00068 void printSubdomainConfigurations( 00069 const std::vector<algorithms::geometries::Channel*>& channels, 00070 const int numberOfSubdomains) 00071 const; 00072 00073 std::string double2string(const double& number) const; 00074 00075 private: 00076 static tarch::logging::Log _log; 00077 }; 00078 00079 #endif /* ChannelPrinter_H_ */