Changeset 1315 for trunk/source/persistency/gdml/src/G4GDMLReadSolids.cc
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/persistency/gdml/src/G4GDMLReadSolids.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLReadSolids.cc,v 1. 27 2009/12/04 13:58:51gcosmo Exp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4GDMLReadSolids.cc,v 1.31 2010/06/03 14:19:49 gcosmo Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // class G4GDMLReadSolids Implementation … … 52 52 #include "G4SolidStore.hh" 53 53 #include "G4SubtractionSolid.hh" 54 #include "G4GenericTrap.hh" 54 55 #include "G4TessellatedSolid.hh" 55 56 #include "G4Tet.hh" … … 1054 1055 } 1055 1056 1057 void G4GDMLReadSolids:: 1058 GenTrapRead(const xercesc::DOMElement* const gtrapElement) 1059 { 1060 G4String name; 1061 G4double lunit = 1.0; 1062 G4double dz =0.0; 1063 G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0, 1064 v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0, 1065 v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0; 1066 1067 const xercesc::DOMNamedNodeMap* const attributes 1068 = gtrapElement->getAttributes(); 1069 XMLSize_t attributeCount = attributes->getLength(); 1070 1071 for (XMLSize_t attribute_index=0; 1072 attribute_index<attributeCount; attribute_index++) 1073 { 1074 xercesc::DOMNode* attribute_node = attributes->item(attribute_index); 1075 1076 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) 1077 { continue; } 1078 1079 const xercesc::DOMAttr* const attribute 1080 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1081 const G4String attName = Transcode(attribute->getName()); 1082 const G4String attValue = Transcode(attribute->getValue()); 1083 1084 if (attName=="name") { name = GenerateName(attValue); } else 1085 if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else 1086 if (attName=="dz") { dz = eval.Evaluate(attValue); } else 1087 if (attName=="v1x") { v1x = eval.Evaluate(attValue); } else 1088 if (attName=="v1y") { v1y = eval.Evaluate(attValue); } else 1089 if (attName=="v2x") { v2x = eval.Evaluate(attValue); } else 1090 if (attName=="v2y") { v2y = eval.Evaluate(attValue); } else 1091 if (attName=="v3x") { v3x = eval.Evaluate(attValue); } else 1092 if (attName=="v3y") { v3y = eval.Evaluate(attValue); } else 1093 if (attName=="v4x") { v4x = eval.Evaluate(attValue); } else 1094 if (attName=="v4y") { v4y = eval.Evaluate(attValue); } else 1095 if (attName=="v5x") { v5x = eval.Evaluate(attValue); } else 1096 if (attName=="v5y") { v5y = eval.Evaluate(attValue); } else 1097 if (attName=="v6x") { v6x = eval.Evaluate(attValue); } else 1098 if (attName=="v6y") { v6y = eval.Evaluate(attValue); } else 1099 if (attName=="v7x") { v7x = eval.Evaluate(attValue); } else 1100 if (attName=="v7y") { v7y = eval.Evaluate(attValue); } else 1101 if (attName=="v8x") { v8x = eval.Evaluate(attValue); } else 1102 if (attName=="v8y") { v8y = eval.Evaluate(attValue); } 1103 } 1104 1105 dz *= lunit; 1106 std::vector<G4TwoVector> vertices; 1107 vertices.push_back(G4TwoVector(v1x,v1y)); 1108 vertices.push_back(G4TwoVector(v2x,v2y)); 1109 vertices.push_back(G4TwoVector(v3x,v3y)); 1110 vertices.push_back(G4TwoVector(v4x,v4y)); 1111 vertices.push_back(G4TwoVector(v5x,v5y)); 1112 vertices.push_back(G4TwoVector(v6x,v6y)); 1113 vertices.push_back(G4TwoVector(v7x,v7y)); 1114 vertices.push_back(G4TwoVector(v8x,v8y)); 1115 new G4GenericTrap(name,dz,vertices); 1116 } 1117 1056 1118 void G4GDMLReadSolids::TrapRead(const xercesc::DOMElement* const trapElement) 1057 1119 { … … 1555 1617 G4SurfaceType type; 1556 1618 1557 if ( smodel="unified") { model = unified; } else1558 if ( smodel="glisur") { model = glisur; }1619 if ((smodel=="glisur") || (smodel=="0")) { model = glisur; } else 1620 if ((smodel=="unified") || (smodel=="1")) { model = unified; } 1559 1621 else { model = LUT; } 1560 1622 1561 if (sfinish=="polishedfrontpainted") { finish = polishedfrontpainted; } else 1562 if (sfinish=="polishedbackpainted") { finish = polishedbackpainted; } else 1563 if (sfinish=="groundfrontpainted") { finish = groundfrontpainted; } else 1564 if (sfinish=="groundbackpainted") { finish = groundbackpainted; } else 1565 if (sfinish=="ground") { finish = ground; } else 1566 if (sfinish=="polished") { finish = polished; } else 1567 if (sfinish=="polishedlumirrorair") { finish = polishedlumirrorair; } else 1568 if (sfinish=="polishedlumirrorglue") { finish = polishedlumirrorglue; } else 1569 if (sfinish=="polishedair") { finish = polishedair; } else 1570 if (sfinish=="polishedteflonair") { finish = polishedteflonair; } else 1571 if (sfinish=="polishedtioair") { finish = polishedtioair; } else 1572 if (sfinish=="polishedtyvekair") { finish = polishedtyvekair; } else 1573 if (sfinish=="polishedvm2000air") { finish = polishedvm2000air; } else 1574 if (sfinish=="polishedvm2000glue") { finish = polishedvm2000glue; } else 1575 if (sfinish=="etchedlumirrorair") { finish = etchedlumirrorair; } else 1576 if (sfinish=="etchedlumirrorglue") { finish = etchedlumirrorglue; } else 1577 if (sfinish=="etchedair") { finish = etchedair; } else 1578 if (sfinish=="etchedteflonair") { finish = etchedteflonair; } else 1579 if (sfinish=="etchedtioair") { finish = etchedtioair; } else 1580 if (sfinish=="etchedtyvekair") { finish = etchedtyvekair; } else 1581 if (sfinish=="etchedvm2000air") { finish = etchedvm2000air; } else 1582 if (sfinish=="etchedvm2000glue") { finish = etchedvm2000glue; } else 1583 if (sfinish=="groundlumirrorair") { finish = groundlumirrorair; } else 1584 if (sfinish=="groundlumirrorglue") { finish = groundlumirrorglue; } else 1585 if (sfinish=="groundair") { finish = groundair; } else 1586 if (sfinish=="groundteflonair") { finish = groundteflonair; } else 1587 if (sfinish=="groundtioair") { finish = groundtioair; } else 1588 if (sfinish=="groundtyvekair") { finish = groundtyvekair; } else 1589 if (sfinish=="groundvm2000air") { finish = groundvm2000air; } 1623 if ((sfinish=="polished") || (sfinish=="0")) 1624 { finish = polished; } else 1625 if ((sfinish=="polishedfrontpainted") || (sfinish=="1")) 1626 { finish = polishedfrontpainted; } else 1627 if ((sfinish=="polishedbackpainted") || (sfinish=="2")) 1628 { finish = polishedbackpainted; } else 1629 if ((sfinish=="ground") || (sfinish=="3")) 1630 { finish = ground; } else 1631 if ((sfinish=="groundfrontpainted") || (sfinish=="4")) 1632 { finish = groundfrontpainted; } else 1633 if ((sfinish=="groundbackpainted") || (sfinish=="5")) 1634 { finish = groundbackpainted; } else 1635 if ((sfinish=="polishedlumirrorair") || (sfinish=="6")) 1636 { finish = polishedlumirrorair; } else 1637 if ((sfinish=="polishedlumirrorglue") || (sfinish=="7")) 1638 { finish = polishedlumirrorglue; } else 1639 if ((sfinish=="polishedair") || (sfinish=="8")) 1640 { finish = polishedair; } else 1641 if ((sfinish=="polishedteflonair") || (sfinish=="9")) 1642 { finish = polishedteflonair; } else 1643 if ((sfinish=="polishedtioair") || (sfinish=="10")) 1644 { finish = polishedtioair; } else 1645 if ((sfinish=="polishedtyvekair") || (sfinish=="11")) 1646 { finish = polishedtyvekair; } else 1647 if ((sfinish=="polishedvm2000air") || (sfinish=="12")) 1648 { finish = polishedvm2000air; } else 1649 if ((sfinish=="polishedvm2000glue") || (sfinish=="13")) 1650 { finish = polishedvm2000glue; } else 1651 if ((sfinish=="etchedlumirrorair") || (sfinish=="14")) 1652 { finish = etchedlumirrorair; } else 1653 if ((sfinish=="etchedlumirrorglue") || (sfinish=="15")) 1654 { finish = etchedlumirrorglue; } else 1655 if ((sfinish=="etchedair") || (sfinish=="16")) 1656 { finish = etchedair; } else 1657 if ((sfinish=="etchedteflonair") || (sfinish=="17")) 1658 { finish = etchedteflonair; } else 1659 if ((sfinish=="etchedtioair") || (sfinish=="18")) 1660 { finish = etchedtioair; } else 1661 if ((sfinish=="etchedtyvekair") || (sfinish=="19")) 1662 { finish = etchedtyvekair; } else 1663 if ((sfinish=="etchedvm2000air") || (sfinish=="20")) 1664 { finish = etchedvm2000air; } else 1665 if ((sfinish=="etchedvm2000glue") || (sfinish=="21")) 1666 { finish = etchedvm2000glue; } else 1667 if ((sfinish=="groundlumirrorair") || (sfinish=="22")) 1668 { finish = groundlumirrorair; } else 1669 if ((sfinish=="groundlumirrorglue") || (sfinish=="23")) 1670 { finish = groundlumirrorglue; } else 1671 if ((sfinish=="groundair") || (sfinish=="24")) 1672 { finish = groundair; } else 1673 if ((sfinish=="groundteflonair") || (sfinish=="25")) 1674 { finish = groundteflonair; } else 1675 if ((sfinish=="groundtioair") || (sfinish=="26")) 1676 { finish = groundtioair; } else 1677 if ((sfinish=="groundtyvekair") || (sfinish=="27")) 1678 { finish = groundtyvekair; } else 1679 if ((sfinish=="groundvm2000air") || (sfinish=="28")) 1680 { finish = groundvm2000air; } 1590 1681 else { finish = groundvm2000glue; } 1591 1682 1592 if (stype=="dielectric_metal") { type = dielectric_metal; } else 1593 if (stype=="dielectric_dielectric") { type = dielectric_dielectric; } else 1594 if (stype=="dielectric_LUT") { type = dielectric_LUT; } else 1595 if (stype=="x_ray") { type = x_ray; } 1596 else { type = firsov; } 1683 if ((stype=="dielectric_metal") || (stype=="0")) 1684 { type = dielectric_metal; } else 1685 if ((stype=="dielectric_dielectric") || (stype=="1")) 1686 { type = dielectric_dielectric; } else 1687 if ((stype=="dielectric_LUT") || (stype=="2")) 1688 { type = dielectric_LUT; } else 1689 if ((stype=="firsov") || (stype=="3")) 1690 { type = firsov; } 1691 else { type = x_ray; } 1597 1692 1598 1693 new G4OpticalSurface(name,model,finish,type,value); … … 1631 1726 if (tag=="tet") { TetRead(child); } else 1632 1727 if (tag=="torus") { TorusRead(child); } else 1728 if (tag=="arb8") { GenTrapRead(child); } else 1633 1729 if (tag=="trap") { TrapRead(child); } else 1634 1730 if (tag=="trd") { TrdRead(child); } else
Note: See TracChangeset
for help on using the changeset viewer.