101 std::cout <<
"OutputDDToDDL::beginRun" << std::endl;
106 DDCompactView::DDCompactView::graph_type gra = pDD->graph();
108 std::set<DDLogicalPart> lpStore;
109 std::set<DDMaterial> matStore;
110 std::set<DDSolid> solStore;
114 std::map<const DDsvalues_type, std::set<const DDPartSelection*>, ddsvaluesCmp > specStore;
115 std::set<DDRotation> rotStore;
120 size_t foundLastDot = rn.find_last_of(
'.');
121 size_t foundLastSlash = rn.find_last_of(
'/');
122 if( foundLastSlash > foundLastDot && foundLastSlash != std::string::npos ) {
123 std::cout <<
"What? last . before last / in path for filename... this should die..." << std::endl;
125 if( foundLastDot != std::string::npos && foundLastSlash != std::string::npos ) {
126 out.
ns_ = rn.substr( foundLastSlash, foundLastDot );
127 }
else if( foundLastDot != std::string::npos ) {
128 out.
ns_ = rn.substr(0, foundLastDot);
130 std::cout <<
"What? no file name? Attempt at namespace =\"" << out.
ns_ <<
"\" filename was " <<
m_fname << std::endl;
135 (*m_xos) << std::fixed << std::setprecision(18);
138 adjl_iterator git = gra.begin();
139 adjl_iterator gend = gra.end();
142 (*m_xos) <<
"<PosPartSection label=\"" << ns_ <<
"\">" << std::endl;
144 for( ; git != gend; ++git ) {
146 if( lpStore.find( ddLP ) != lpStore.end()) {
149 lpStore.insert( ddLP );
155 DDCompactView::graph_type::edge_list::const_iterator cit = git->begin();
156 DDCompactView::graph_type::edge_list::const_iterator cend = git->end();
157 for( ; cit != cend; ++cit ) {
159 if( lpStore.find( ddcurLP ) != lpStore.end()) {
162 lpStore.insert( ddcurLP );
165 rotStore.insert( gra.edgeData( cit->second )->rot_ );
171 (*m_xos) <<
"</PosPartSection>" << std::endl;
173 (*m_xos) << std::scientific << std::setprecision(18);
175 (*m_xos) <<
"<MaterialSection label=\"" << ns_ <<
"\">" << std::endl;
176 for(
auto it : matStore ) {
177 if( ! it.isDefined().second )
continue;
180 (*m_xos) <<
"</MaterialSection>" << std::endl;
181 (*m_xos) <<
"<RotationSection label=\"" << ns_ <<
"\">" << std::endl;
182 (*m_xos) << std::fixed << std::setprecision(18);
183 std::set<DDRotation>::iterator rit( rotStore.begin()),
red( rotStore.end());
184 for( ; rit !=
red; ++rit ) {
185 if( !rit->isDefined().second )
continue;
186 if( rit->toString() !=
":" ) {
191 (*m_xos) <<
"</RotationSection>" << std::endl;
193 (*m_xos) << std::fixed << std::setprecision(18);
194 std::set<DDSolid>::const_iterator sit( solStore.begin()), sed( solStore.end());
195 (*m_xos) <<
"<SolidSection label=\"" << ns_ <<
"\">" << std::endl;
196 for( ; sit != sed; ++sit ) {
197 if( !sit->isDefined().second)
continue;
200 (*m_xos) <<
"</SolidSection>" << std::endl;
202 std::set<DDLogicalPart>::iterator lpit( lpStore.begin()), lped( lpStore.end());
203 (*m_xos) <<
"<LogicalPartSection label=\"" << ns_ <<
"\">" << std::endl;
204 for( ; lpit != lped; ++lpit ) {
205 if( !lpit->isDefined().first )
continue;
209 (*m_xos) <<
"</LogicalPartSection>" << std::endl;
211 (*m_xos) << std::fixed << std::setprecision(18);
212 std::map<DDsvalues_type, std::set<const DDPartSelection*> >::const_iterator mit( specStore.begin()), mend( specStore.end());
213 (*m_xos) <<
"<SpecParSection label=\"" << ns_ <<
"\">" << std::endl;
214 for( ; mit != mend; ++mit ) {
217 (*m_xos) <<
"</SpecParSection>" << std::endl;
void rotation(DDRotation &rotation, std::ostream &xos, const std::string &rotn="")
void addToSpecStore(const DDLogicalPart &lp, std::map< const DDsvalues_type, std::set< const DDPartSelection * >, ddsvaluesCmp > &specStore)
void addToMatStore(const DDMaterial &mat, std::set< DDMaterial > &matStore)
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.