57 std::cout<<
"OutputDDToDDL::beginRun"<<std::endl;
63 DDCompactView::DDCompactView::graph_type gra = pDD->graph();
65 std::set<DDLogicalPart> lpStore;
66 std::set<DDMaterial> matStore;
67 std::set<DDSolid> solStore;
71 std::map<DDsvalues_type, std::set<DDPartSelection*>,
ddsvaluesCmp > specStore;
72 std::set<DDRotation> rotStore;
77 size_t foundLastDot= rn.find_last_of(
'.');
78 size_t foundLastSlash= rn.find_last_of(
'/');
79 if ( foundLastSlash > foundLastDot && foundLastSlash != std::string::npos) {
80 std::cout <<
"What? last . before last / in path for filename... this should die..." << std::endl;
82 if ( foundLastDot != std::string::npos && foundLastSlash != std::string::npos ) {
83 out.
ns_ = rn.substr(foundLastSlash,foundLastDot);
84 }
else if ( foundLastDot != std::string::npos ) {
85 out.
ns_ = rn.substr(0, foundLastDot);
87 std::cout <<
"What? no file name? Attempt at namespace =\"" << out.
ns_ <<
"\" filename was " <<
fname_ << std::endl;
90 std::string ns_ = out.
ns_;
92 (*xos_) << std::fixed << std::setprecision(18);
95 adjl_iterator git = gra.begin();
96 adjl_iterator gend = gra.end();
99 (*xos_) <<
"<PosPartSection label=\"" << ns_ <<
"\">" << std::endl;
101 for (; git != gend; ++git)
104 if ( lpStore.find(ddLP) != lpStore.end() ) {
107 lpStore.insert(ddLP);
114 DDCompactView::graph_type::edge_list::const_iterator cit = git->begin();
115 DDCompactView::graph_type::edge_list::const_iterator cend = git->end();
116 for (; cit != cend; ++cit)
119 if (lpStore.find(ddcurLP) != lpStore.end()) {
122 lpStore.insert(ddcurLP);
125 rotStore.insert(gra.edgeData(cit->second)->rot_);
132 (*xos_) <<
"</PosPartSection>" << std::endl;
134 (*xos_) << std::scientific << std::setprecision(18);
135 std::set<DDMaterial>::const_iterator it(matStore.begin()), ed(matStore.end());
136 (*xos_) <<
"<MaterialSection label=\"" << ns_ <<
"\">" << std::endl;
137 for (; it != ed; ++it) {
138 if (! it->isDefined().second)
continue;
141 (*xos_) <<
"</MaterialSection>" << std::endl;
143 (*xos_) <<
"<RotationSection label=\"" << ns_ <<
"\">" << std::endl;
144 (*xos_) << std::fixed << std::setprecision(18);
145 std::set<DDRotation>::iterator rit(rotStore.begin()),
red(rotStore.end());
146 for (; rit !=
red; ++rit) {
147 if (! rit->isDefined().second)
continue;
148 if ( rit->toString() !=
":" ) {
153 (*xos_) <<
"</RotationSection>" << std::endl;
155 (*xos_) << std::fixed << std::setprecision(18);
156 std::set<DDSolid>::const_iterator sit(solStore.begin()), sed(solStore.end());
157 (*xos_) <<
"<SolidSection label=\"" << ns_ <<
"\">" << std::endl;
158 for (; sit != sed; ++sit) {
159 if (! sit->isDefined().second)
continue;
162 (*xos_) <<
"</SolidSection>" << std::endl;
164 std::set<DDLogicalPart>::iterator lpit(lpStore.begin()), lped(lpStore.end());
165 (*xos_) <<
"<LogicalPartSection label=\"" << ns_ <<
"\">" << std::endl;
166 for (; lpit != lped; ++lpit) {
167 if (! lpit->isDefined().first)
continue;
171 (*xos_) <<
"</LogicalPartSection>" << std::endl;
173 (*xos_) << std::fixed << std::setprecision(18);
174 std::map<DDsvalues_type, std::set<DDPartSelection*> >::const_iterator mit(specStore.begin()), mend (specStore.end());
175 (*xos_) <<
"<SpecParSection label=\"" << ns_ <<
"\">" << std::endl;
176 for (; mit != mend; ++mit) {
179 (*xos_) <<
"</SpecParSection>" << std::endl;
void rotation(DDRotation &rotation, std::ostream &xos, const std::string &rotn="")
void addToMatStore(const DDMaterial &mat, std::set< DDMaterial > &matStore)
void addToSpecStore(const DDLogicalPart &lp, std::map< DDsvalues_type, std::set< DDPartSelection * >, ddsvaluesCmp > &specStore)
void specpar(const DDSpecifics &sp, std::ostream &xos)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double >::size_type index_type
void addToSolStore(const DDSolid &sol, std::set< DDSolid > &solStore, std::set< DDRotation > &rotStore)
Represents a uniquely identifyable rotation matrix.
void position(const DDLogicalPart &parent, const DDLogicalPart &child, DDPosData *edgeToChild, int &rotNameSeed, std::ostream &xos)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
void logicalPart(const DDLogicalPart &lp, std::ostream &xos)
adj_list::const_iterator const_adj_iterator
void material(const DDMaterial &material, std::ostream &xos)
void solid(const DDSolid &solid, std::ostream &xos)
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.