Changeset 1315 for trunk/source/persistency
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (15 years ago)
- Location:
- trunk/source/persistency/gdml
- Files:
-
- 12 edited
-
History (modified) (2 diffs)
-
include/G4GDMLParser.hh (modified) (2 diffs)
-
include/G4GDMLParser.icc (modified) (9 diffs)
-
include/G4GDMLReadDefine.hh (modified) (1 diff)
-
include/G4GDMLReadSolids.hh (modified) (2 diffs)
-
include/G4GDMLWrite.hh (modified) (2 diffs)
-
include/G4GDMLWriteSolids.hh (modified) (3 diffs)
-
src/G4GDMLReadDefine.cc (modified) (2 diffs)
-
src/G4GDMLReadSolids.cc (modified) (5 diffs)
-
src/G4GDMLWriteMaterials.cc (modified) (3 diffs)
-
src/G4GDMLWriteSolids.cc (modified) (4 diffs)
-
src/G4GDMLWriteStructure.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/persistency/gdml/History
r1228 r1315 1 $Id: History,v 1.1 16 2009/12/04 13:59:05gcosmo Exp $1 $Id: History,v 1.120 2010/06/02 13:55:02 gcosmo Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 02 Jun 2010 Gabriele Cosmo (gdml-V09-03-03) 21 - Added G4GenericTrap among the set of supported solids in both reader and 22 writer, treating as 'arb8' GDML type. 23 24 20 May 2010 Gabriele Cosmo (gdml-V09-03-02) 25 - Corrected dump of division axis in writer. 26 27 18 Feb 2010 Gabriele Cosmo (gdml-V09-03-01) 28 - Added missing reference attribute in G4GDMLWriteMaterials for dumping 29 of materials property vectors. Increased string buffer in G4GDMLWrite. 30 Addressing problem report #1104. 31 - Corrected import of surface properties in G4GDMLReadSolids for the case 32 of recursive read of files. 33 34 17 Feb 2010 Gabriele Cosmo (gdml-V09-03-00) 35 - Added IsValid() method to parser to verify if variable/constant/quantity 36 is defined and is valid. Added const qualifier to reader accessors in parser. 19 37 20 38 04 Dec 2009 Gabriele Cosmo (gdml-V09-02-18) -
trunk/source/persistency/gdml/include/G4GDMLParser.hh
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4GDMLParser.hh,v 1.5 8 2009/04/15 13:29:30gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GDMLParser.hh,v 1.59 2010/02/17 18:06:25 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // … … 91 91 // Methods for Reader 92 92 // 93 inline G4double GetConstant(const G4String& name); 94 inline G4double GetVariable(const G4String& name); 95 inline G4double GetQuantity(const G4String& name); 96 inline G4ThreeVector GetPosition(const G4String& name); 97 inline G4ThreeVector GetRotation(const G4String& name); 98 inline G4ThreeVector GetScale(const G4String& name); 99 inline G4GDMLMatrix GetMatrix(const G4String& name); 100 inline G4LogicalVolume* GetVolume(const G4String& name); 101 inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default"); 93 inline G4bool IsValid(const G4String& name) const; 94 inline G4double GetConstant(const G4String& name) const; 95 inline G4double GetVariable(const G4String& name) const; 96 inline G4double GetQuantity(const G4String& name) const; 97 inline G4ThreeVector GetPosition(const G4String& name) const; 98 inline G4ThreeVector GetRotation(const G4String& name) const; 99 inline G4ThreeVector GetScale(const G4String& name) const; 100 inline G4GDMLMatrix GetMatrix(const G4String& name) const; 101 inline G4LogicalVolume* GetVolume(const G4String& name) const; 102 inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default") const; 102 103 inline G4GDMLAuxListType GetVolumeAuxiliaryInformation(const G4LogicalVolume* const logvol); 103 104 inline void StripNamePointers() const; -
trunk/source/persistency/gdml/include/G4GDMLParser.icc
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4GDMLParser.icc,v 1. 8 2009/01/22 11:02:07gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GDMLParser.icc,v 1.9 2010/02/17 18:06:25 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // … … 84 84 // 85 85 86 inline G4bool G4GDMLParser::IsValid(const G4String& name) const 87 { 88 return reader->IsValidID(name); 89 } 90 86 91 inline 87 G4double G4GDMLParser::GetConstant(const G4String& name) 92 G4double G4GDMLParser::GetConstant(const G4String& name) const 88 93 { 89 94 return reader->GetConstant(name); … … 91 96 92 97 inline 93 G4double G4GDMLParser::GetVariable(const G4String& name) 98 G4double G4GDMLParser::GetVariable(const G4String& name) const 94 99 { 95 100 return reader->GetVariable(name); … … 97 102 98 103 inline 99 G4double G4GDMLParser::GetQuantity(const G4String& name) 104 G4double G4GDMLParser::GetQuantity(const G4String& name) const 100 105 { 101 106 return reader->GetQuantity(name); … … 103 108 104 109 inline 105 G4ThreeVector G4GDMLParser::GetPosition(const G4String& name) 110 G4ThreeVector G4GDMLParser::GetPosition(const G4String& name) const 106 111 { 107 112 return reader->GetPosition(name); … … 109 114 110 115 inline 111 G4ThreeVector G4GDMLParser::GetRotation(const G4String& name) 116 G4ThreeVector G4GDMLParser::GetRotation(const G4String& name) const 112 117 { 113 118 return reader->GetRotation(name); … … 115 120 116 121 inline 117 G4ThreeVector G4GDMLParser::GetScale(const G4String& name) 122 G4ThreeVector G4GDMLParser::GetScale(const G4String& name) const 118 123 { 119 124 return reader->GetScale(name); … … 121 126 122 127 inline 123 G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name) 128 G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name) const 124 129 { 125 130 return reader->GetMatrix(name); … … 127 132 128 133 inline 129 G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name) 134 G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name) const 130 135 { 131 136 return reader->GetVolume(name); 132 137 } 133 138 134 inline 135 G4 VPhysicalVolume* G4GDMLParser::GetWorldVolume(const G4String& setupName)139 inline G4VPhysicalVolume* 140 G4GDMLParser::GetWorldVolume(const G4String& setupName) const 136 141 { 137 142 return reader->GetWorldVolume(setupName); -
trunk/source/persistency/gdml/include/G4GDMLReadDefine.hh
r1228 r1315 72 72 public: 73 73 74 G4bool IsValidID(const G4String&) const; 74 75 G4double GetConstant(const G4String&); 75 76 G4double GetVariable(const G4String&); -
trunk/source/persistency/gdml/include/G4GDMLReadSolids.hh
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4GDMLReadSolids.hh,v 1.1 5 2009/04/24 15:34:20gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GDMLReadSolids.hh,v 1.16 2010/06/02 13:53:04 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // … … 88 88 void TetRead(const xercesc::DOMElement* const); 89 89 void TorusRead(const xercesc::DOMElement* const); 90 void GenTrapRead(const xercesc::DOMElement* const); 90 91 void TrapRead(const xercesc::DOMElement* const); 91 92 void TrdRead(const xercesc::DOMElement* const); -
trunk/source/persistency/gdml/include/G4GDMLWrite.hh
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4GDMLWrite.hh,v 1.4 1 2009/04/24 15:34:20 gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GDMLWrite.hh,v 1.42 2010/02/18 17:39:00 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // … … 124 124 xercesc::DOMDocument* doc; 125 125 xercesc::DOMElement* extElement; 126 XMLCh tempStr[100 ];126 XMLCh tempStr[10000]; 127 127 128 128 }; -
trunk/source/persistency/gdml/include/G4GDMLWriteSolids.hh
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4GDMLWriteSolids.hh,v 1.3 8 2009/04/24 15:34:20gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GDMLWriteSolids.hh,v 1.39 2010/06/02 13:53:04 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // … … 63 63 class G4Tet; 64 64 class G4Torus; 65 class G4GenericTrap; 65 66 class G4Trap; 66 67 class G4Trd; … … 102 103 void TetWrite(xercesc::DOMElement*, const G4Tet* const); 103 104 void TorusWrite(xercesc::DOMElement*, const G4Torus* const); 105 void GenTrapWrite(xercesc::DOMElement*, const G4GenericTrap* const); 104 106 void TrapWrite(xercesc::DOMElement*, const G4Trap* const); 105 107 void TrdWrite(xercesc::DOMElement*, const G4Trd* const); -
trunk/source/persistency/gdml/src/G4GDMLReadDefine.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLReadDefine.cc,v 1.2 4 2009/10/14 13:10:18gcosmo Exp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4GDMLReadDefine.cc,v 1.25 2010/02/17 18:06:25 gcosmo Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // class G4GDMLReadDefine Implementation … … 496 496 } 497 497 498 G4bool G4GDMLReadDefine::IsValidID(const G4String& ref) const 499 { 500 return eval.IsVariable(ref); 501 } 502 498 503 G4double G4GDMLReadDefine::GetConstant(const G4String& ref) 499 504 { -
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 -
trunk/source/persistency/gdml/src/G4GDMLWriteMaterials.cc
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4GDMLWriteMaterials.cc,v 1.2 4 2009/04/27 07:22:36gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GDMLWriteMaterials.cc,v 1.25 2010/02/18 17:38:24 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // class G4GDMLWriteMaterials Implementation … … 195 195 const G4MaterialPropertyVector* const pvec) 196 196 { 197 const G4String matrixref = GenerateName(key, pvec); 197 198 xercesc::DOMElement* matrixElement = NewElement("matrix"); 198 matrixElement->setAttributeNode(NewAttribute("name", key));199 matrixElement->setAttributeNode(NewAttribute("name", matrixref)); 199 200 matrixElement->setAttributeNode(NewAttribute("coldim", "2")); 200 201 std::ostringstream pvalues; … … 227 228 propElement = NewElement("property"); 228 229 propElement->setAttributeNode(NewAttribute("name", mpos->first)); 229 propElement->setAttributeNode(NewAttribute("ref", mpos->first)); 230 propElement->setAttributeNode(NewAttribute("ref", 231 GenerateName(mpos->first, mpos->second))); 230 232 PropertyVectorWrite(mpos->first, mpos->second); 231 233 matElement->appendChild(propElement); -
trunk/source/persistency/gdml/src/G4GDMLWriteSolids.cc
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4GDMLWriteSolids.cc,v 1.6 5 2009/04/24 15:34:20gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GDMLWriteSolids.cc,v 1.68 2010/06/03 14:19:49 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // class G4GDMLWriteSolids Implementation … … 53 53 #include "G4Sphere.hh" 54 54 #include "G4SubtractionSolid.hh" 55 #include "G4GenericTrap.hh" 55 56 #include "G4TessellatedSolid.hh" 56 57 #include "G4Tet.hh" … … 608 609 torusElement->setAttributeNode(NewAttribute("lunit","mm")); 609 610 solidsElement->appendChild(torusElement); 611 } 612 613 void G4GDMLWriteSolids:: 614 GenTrapWrite(xercesc::DOMElement* solidsElement, 615 const G4GenericTrap* const gtrap) 616 { 617 const G4String& name = GenerateName(gtrap->GetName(),gtrap); 618 619 std::vector<G4TwoVector> vertices = gtrap->GetVertices(); 620 621 xercesc::DOMElement* gtrapElement = NewElement("arb8"); 622 gtrapElement->setAttributeNode(NewAttribute("name",name)); 623 gtrapElement->setAttributeNode(NewAttribute("dz", 624 gtrap->GetZHalfLength()/mm)); 625 gtrapElement->setAttributeNode(NewAttribute("v1x", vertices[0].x())); 626 gtrapElement->setAttributeNode(NewAttribute("v1y", vertices[0].y())); 627 gtrapElement->setAttributeNode(NewAttribute("v2x", vertices[1].x())); 628 gtrapElement->setAttributeNode(NewAttribute("v2y", vertices[1].y())); 629 gtrapElement->setAttributeNode(NewAttribute("v3x", vertices[2].x())); 630 gtrapElement->setAttributeNode(NewAttribute("v3y", vertices[2].y())); 631 gtrapElement->setAttributeNode(NewAttribute("v4x", vertices[3].x())); 632 gtrapElement->setAttributeNode(NewAttribute("v4y", vertices[3].y())); 633 gtrapElement->setAttributeNode(NewAttribute("v5x", vertices[4].x())); 634 gtrapElement->setAttributeNode(NewAttribute("v5y", vertices[4].y())); 635 gtrapElement->setAttributeNode(NewAttribute("v6x", vertices[5].x())); 636 gtrapElement->setAttributeNode(NewAttribute("v6y", vertices[5].y())); 637 gtrapElement->setAttributeNode(NewAttribute("v7x", vertices[6].x())); 638 gtrapElement->setAttributeNode(NewAttribute("v7y", vertices[6].y())); 639 gtrapElement->setAttributeNode(NewAttribute("v8x", vertices[7].x())); 640 gtrapElement->setAttributeNode(NewAttribute("v8y", vertices[7].y())); 641 gtrapElement->setAttributeNode(NewAttribute("lunit","mm")); 642 solidsElement->appendChild(gtrapElement); 610 643 } 611 644 … … 893 926 = dynamic_cast<const G4Torus*>(solidPtr)) 894 927 { TorusWrite(solidsElement,torusPtr); } else 928 if (const G4GenericTrap* const gtrapPtr 929 = dynamic_cast<const G4GenericTrap*>(solidPtr)) 930 { GenTrapWrite(solidsElement,gtrapPtr); } else 895 931 if (const G4Trap* const trapPtr 896 932 = dynamic_cast<const G4Trap*>(solidPtr)) -
trunk/source/persistency/gdml/src/G4GDMLWriteStructure.cc
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4GDMLWriteStructure.cc,v 1.8 0 2009/04/24 15:34:20gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GDMLWriteStructure.cc,v 1.81 2010/05/20 12:56:57 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // class G4GDMLWriteStructure Implementation … … 67 67 68 68 divisionvol->GetReplicationData(axis,number,width,offset,consuming); 69 axis = divisionvol->GetDivisionAxis(); 69 70 70 71 G4String unitString("mm");
Note:
See TracChangeset
for help on using the changeset viewer.
