101 std::cout <<
"OutputDDToDDL::beginRun" << std::endl;
109 const auto& gra = pDD->
graph();
111 std::set<DDLogicalPart> lpStore;
112 std::set<DDMaterial> matStore;
113 std::set<DDSolid> solStore;
117 std::map<const DDsvalues_type, std::set<const DDPartSelection*>, ddsvaluesCmp > specStore;
118 std::set<DDRotation> rotStore;
123 size_t foundLastDot = rn.find_last_of(
'.');
124 size_t foundLastSlash = rn.find_last_of(
'/');
125 if( foundLastSlash > foundLastDot && foundLastSlash != std::string::npos ) {
126 std::cout <<
"What? last . before last / in path for filename... this should die..." << std::endl;
128 if( foundLastDot != std::string::npos && foundLastSlash != std::string::npos ) {
129 out.
ns_ = rn.substr( foundLastSlash, foundLastDot );
130 }
else if( foundLastDot != std::string::npos ) {
131 out.
ns_ = rn.substr(0, foundLastDot);
133 std::cout <<
"What? no file name? Attempt at namespace =\"" << out.
ns_ <<
"\" filename was " <<
m_fname << std::endl;
138 (*m_xos) <<
std::fixed << std::setprecision(18);
144 (*m_xos) <<
"<PosPartSection label=\"" << ns_ <<
"\">" << std::endl;
146 for( ; git != gend; ++git ) {
148 if( lpStore.find( ddLP ) != lpStore.end()) {
151 lpStore.insert( ddLP );
157 auto cit = git->begin();
158 auto cend = git->end();
159 for( ; cit != cend; ++cit ) {
161 if( lpStore.find( ddcurLP ) != lpStore.end()) {
164 lpStore.insert( ddcurLP );
167 rotStore.insert( gra.edgeData( cit->second )->ddrot() );
173 (*m_xos) <<
"</PosPartSection>" << std::endl;
175 (*m_xos) << std::scientific << std::setprecision(18);
177 (*m_xos) <<
"<MaterialSection label=\"" << ns_ <<
"\">" << std::endl;
178 for(
auto it : matStore ) {
179 if( ! it.isDefined().second )
continue;
182 (*m_xos) <<
"</MaterialSection>" << std::endl;
183 (*m_xos) <<
"<RotationSection label=\"" << ns_ <<
"\">" << std::endl;
184 (*m_xos) <<
std::fixed << std::setprecision(18);
185 std::set<DDRotation>::iterator rit( rotStore.begin()),
red( rotStore.end());
186 for( ; rit !=
red; ++rit ) {
187 if( !rit->isDefined().second )
continue;
188 if( rit->toString() !=
":" ) {
193 (*m_xos) <<
"</RotationSection>" << std::endl;
195 (*m_xos) <<
std::fixed << std::setprecision(18);
196 std::set<DDSolid>::const_iterator sit( solStore.begin()), sed( solStore.end());
197 (*m_xos) <<
"<SolidSection label=\"" << ns_ <<
"\">" << std::endl;
198 for( ; sit != sed; ++sit ) {
199 if( !sit->isDefined().second)
continue;
202 (*m_xos) <<
"</SolidSection>" << std::endl;
204 std::set<DDLogicalPart>::iterator lpit( lpStore.begin()), lped( lpStore.end());
205 (*m_xos) <<
"<LogicalPartSection label=\"" << ns_ <<
"\">" << std::endl;
206 for( ; lpit != lped; ++lpit ) {
207 if( !lpit->isDefined().first )
continue;
211 (*m_xos) <<
"</LogicalPartSection>" << std::endl;
213 (*m_xos) <<
std::fixed << std::setprecision(18);
214 std::map<DDsvalues_type, std::set<const DDPartSelection*> >::const_iterator mit( specStore.begin()), mend( specStore.end());
215 (*m_xos) <<
"<SpecParSection label=\"" << ns_ <<
"\">" << std::endl;
216 for( ; mit != mend; ++mit ) {
219 (*m_xos) <<
"</SpecParSection>" << std::endl;
std::vector< double >::size_type index_type
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.
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)
Graph::const_adj_iterator adjl_iterator
const Graph & graph() const
Provides read-only access to the data structure of the compact-view.
void material(const DDMaterial &material, std::ostream &xos)
math::Graph< DDLogicalPart, DDPosData * > Graph
adj_list::const_iterator const_adj_iterator
void rotation(const DDRotation &rotation, std::ostream &xos, const std::string &rotn="")
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.