Skip to content
Snippets Groups Projects
Commit 932e14d0 authored by Andrea Dell'Acqua's avatar Andrea Dell'Acqua Committed by Walter Lampl
Browse files

Major revision of the GeoModelXml code (Nigel Hessey, spring 2020).

Main changes:
- introduction of new shape (simplepolygonbrep)
- unification of messaging code, with the introduction of an OutputDirector
- consistent utilization of XMLString::transcode() throughout the code
new files:
	GeoModelXml/OutputDirector.h
	GeoModelXml/shape/MakeSimplePolygonBrep.h
	src/MakeSimplePolygonBrep.cxx
deleted file:
	GeoModelXml/translate.h
Please note that data/geomodel.dtd (needed at run time) was modified according to the simplepolygonbrep introduction)
List of modified files (basically all of them!) follows:

	modified:   GeoModelXml/AddbranchProcessor.h
	modified:   GeoModelXml/AssemblyProcessor.h
	modified:   GeoModelXml/AssemblyrefProcessor.h
	modified:   GeoModelXml/Element2GeoItem.h
	modified:   GeoModelXml/ElementProcessor.h
	modified:   GeoModelXml/Gmx2Geo.h
	modified:   GeoModelXml/GmxUtil.h
	modified:   GeoModelXml/IndexProcessor.h
	modified:   GeoModelXml/LogvolProcessor.h
	modified:   GeoModelXml/LogvolrefProcessor.h
	modified:   GeoModelXml/MakeElement.h
	modified:   GeoModelXml/MakeMaterial.h
	modified:   GeoModelXml/MakeRotation.h
	modified:   GeoModelXml/MakeTransformation.h
	modified:   GeoModelXml/MakeTransformationref.h
	modified:   GeoModelXml/MakeTranslation.h
	modified:   GeoModelXml/MulticopyProcessor.h
	modified:   GeoModelXml/StrictErrorHandler.h
	modified:   GeoModelXml/TransformProcessor.h
	modified:   GeoModelXml/TransformrefProcessor.h
	modified:   GeoModelXml/createdomdocument.h
	modified:   GeoModelXml/shape/AddPlane.h
	modified:   GeoModelXml/shape/MakeBox.h
	modified:   GeoModelXml/shape/MakeCons.h
	modified:   GeoModelXml/shape/MakeGenericTrap.h
	modified:   GeoModelXml/shape/MakeIntersection.h
	modified:   GeoModelXml/shape/MakePara.h
	modified:   GeoModelXml/shape/MakePcon.h
	modified:   GeoModelXml/shape/MakePgon.h
	modified:   GeoModelXml/shape/MakeShaperef.h
	modified:   GeoModelXml/shape/MakeSubtraction.h
	modified:   GeoModelXml/shape/MakeTrap.h
	modified:   GeoModelXml/shape/MakeTrd.h
	modified:   GeoModelXml/shape/MakeTube.h
	modified:   GeoModelXml/shape/MakeTubs.h
	modified:   GeoModelXml/shape/MakeUnion.h
	modified:   data/geomodel.dtd
	modified:   src/AddPlane.cxx
	modified:   src/AddbranchProcessor.cxx
	modified:   src/AssemblyProcessor.cxx
	modified:   src/AssemblyrefProcessor.cxx
	modified:   src/Element2GeoItem.cxx
	modified:   src/ElementProcessor.cxx
	modified:   src/Gmx2Geo.cxx
	modified:   src/GmxInterface.cxx
	modified:   src/GmxUtil.cxx
	modified:   src/IndexProcessor.cxx
	modified:   src/LogvolProcessor.cxx
	modified:   src/LogvolrefProcessor.cxx
	modified:   src/MakeBox.cxx
	modified:   src/MakeCons.cxx
	modified:   src/MakeElement.cxx
	modified:   src/MakeGenericTrap.cxx
	modified:   src/MakeIntersection.cxx
	modified:   src/MakeMaterial.cxx
	modified:   src/MakePara.cxx
	modified:   src/MakePcon.cxx
	modified:   src/MakePgon.cxx
	modified:   src/MakeRotation.cxx
	modified:   src/MakeShaperef.cxx
	modified:   src/MakeSubtraction.cxx
	modified:   src/MakeTransformation.cxx
	modified:   src/MakeTransformationref.cxx
	modified:   src/MakeTranslation.cxx
	modified:   src/MakeTrap.cxx
	modified:   src/MakeTrd.cxx
	modified:   src/MakeTube.cxx
	modified:   src/MakeTubs.cxx
	modified:   src/MakeUnion.cxx
	modified:   src/MulticopyProcessor.cxx
	modified:   src/PositionIndex.cxx
	modified:   src/StrictErrorHandler.cxx
	modified:   src/TransformProcessor.cxx
	modified:   src/TransformrefProcessor.cxx
	modified:   src/createdomdocument.cxx
parent b92e1d10
No related branches found
No related tags found
No related merge requests found
Showing
with 89 additions and 17 deletions
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_ADD_BRANCH_PROCESSOR_H
#define GEO_MODEL_XML_ADD_BRANCH_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
//
// Processor for addbranch tags.
//
......
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_ASSEMBLY_PROCESSOR_H
#define GEO_MODEL_XML_ASSEMBLY_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
//
// Processor for assembly tags.
//
......
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_ASSEMBLYREF_PROCESSOR_H
#define GEO_MODEL_XML_ASSEMBLYREF_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
//
// Processor for assemblyref tags.
......
......@@ -9,17 +9,19 @@
//
#ifndef GEO_MODEL_XML_ELEMENT2GEO_ITEM_H
#define GEO_MODEL_XML_ELEMENT2GEO_ITEM_H
#include <xercesc/util/XercesDefs.hpp>
#include <map>
#include <string>
#include <xercesc/dom/DOM.hpp>
class RCBase;
class GmxUtil;
XERCES_CPP_NAMESPACE_BEGIN
class DOMElement;
XERCES_CPP_NAMESPACE_END
class ProcessorRegistry;
namespace HepTool {class Evaluator;}
class Evaluator;
class Element2GeoItem {
......
......@@ -9,10 +9,13 @@
//
#ifndef GEO_MODEL_XML_ELEMENT_PROCESSOR_H
#define GEO_MODEL_XML_ELEMENT_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
#include "GeoModelXml/GeoNodeList.h"
#include <xercesc/dom/DOM.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMElement;
XERCES_CPP_NAMESPACE_END
class GmxUtil;
class ElementProcessor {
......
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_GMX2GEO_H
#define GEO_MODEL_XML_GMX2GEO_H
#include <xercesc/util/XercesDefs.hpp>
/**
* @brief Create a branch of a GeoModel Tree.
......@@ -43,9 +44,12 @@
#include "GeoModelXml/GmxInterface.h"
class GeoPhysVol;
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMLSParser.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMDocument;
XERCES_CPP_NAMESPACE_END
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
XERCES_CPP_NAMESPACE_END
class Evaluator;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef GEO_MODEL_XML_GMXUTIL_H
......@@ -28,7 +28,11 @@
#include "GeoModelXml/MakeTransformationref.h"
#include "GeoModelXml/MakeTranslation.h"
#include "GeoModelXml/MakeRotation.h"
#ifndef GEOMODEL_STANDALONE_GMX
// #include "GeoModelXml/MakeScaling.h"
#endif
#include "GeoModelXml/shape/MakeSimplePolygonBrep.h"
#include "GeoModelXml/shape/MakeBox.h"
#include "GeoModelXml/shape/MakeCons.h"
#include "GeoModelXml/shape/MakeGenericTrap.h"
......@@ -78,6 +82,7 @@ public:
//
MakeElement element;
MakeMaterial material;
MakeSimplePolygonBrep simplepolygonbrep;
MakeBox box;
MakeCons cons;
MakeGenericTrap generictrap;
......@@ -99,6 +104,9 @@ public:
//
MakeTranslation translation;
MakeRotation rotation;
#ifndef GEOMODEL_STANDALONE_GMX
// MakeScaling scaling;
#endif
//
// Other things
//
......
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_INDEX_PROCESSOR_H
#define GEO_MODEL_XML_INDEX_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
//
// Processor for index tags which change the formula for generating a position-index.
//
......
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_LOGVOL_PROCESSOR_H
#define GEO_MODEL_XML_LOGVOL_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
//
// Processor for logvol tags.
//
......
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_LOGVOLREF_PROCESSOR_H
#define GEO_MODEL_XML_LOGVOLREF_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
//
// Processor for logvolref tags.
......
......@@ -7,6 +7,7 @@
//
#ifndef GEO_MODEL_XML_MAKE_ELEMENT_H
#define GEO_MODEL_XML_MAKE_ELEMENT_H
#include <xercesc/util/XercesDefs.hpp>
#include "GeoModelXml/Element2GeoItem.h"
......
......@@ -7,6 +7,7 @@
//
#ifndef GEO_MODEL_XML_MAKE_MATERIAL_H
#define GEO_MODEL_XML_MAKE_MATERIAL_H
#include <xercesc/util/XercesDefs.hpp>
#include "GeoModelXml/Element2GeoItem.h"
......
......@@ -4,17 +4,17 @@
#ifndef GEO_MODEL_XML_MAKE_ROTATION_H
#define GEO_MODEL_XML_MAKE_ROTATION_H
#include <xercesc/util/XercesDefs.hpp>
//
// Create and return a HepRotation3d. Caller must delete it.
//
#include <xercesc/dom/DOM.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMElement;
XERCES_CPP_NAMESPACE_END
#include "GeoModelKernel/GeoDefinitions.h"
//namespace HepGeom {class Rotate3D;}
class GmxUtil;
class MakeRotation {
public:
MakeRotation();
......
......@@ -7,6 +7,7 @@
//
#ifndef GEO_MODEL_XML_MAKE_TRANSFORMATION_H
#define GEO_MODEL_XML_MAKE_TRANSFORMATION_H
#include <xercesc/util/XercesDefs.hpp>
#include "GeoModelXml/Element2GeoItem.h"
......
......@@ -7,6 +7,7 @@
//
#ifndef GEO_MODEL_XML_MAKE_TRANSFORMATIONREF_H
#define GEO_MODEL_XML_MAKE_TRANSFORMATIONREF_H
#include <xercesc/util/XercesDefs.hpp>
#include "GeoModelXml/Element2GeoItem.h"
......
......@@ -4,15 +4,15 @@
#ifndef GEO_MODEL_XML_MAKE_TRANSLATION_H
#define GEO_MODEL_XML_MAKE_TRANSLATION_H
#include <xercesc/util/XercesDefs.hpp>
//
// Create and return a HepRotation3d. Caller must delete it.
//
XERCES_CPP_NAMESPACE_BEGIN
class DOMElement;
XERCES_CPP_NAMESPACE_END
#include "GeoModelKernel/GeoDefinitions.h"
#include <xercesc/dom/DOM.hpp>
//namespace HepGeom {class Translate3D;}
class GmxUtil;
......
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_MULTICOPY_PROCESSOR_H
#define GEO_MODEL_XML_MULTICOPY_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
//
// Processor for multicopy tags.
//
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
//
// Use gaudi messaging service when in Athena; use cout when "stand-alone".
//
#ifndef OUTPUTDIRECTOR_H
#define OUTPUTDIRECTOR_H
#ifdef GEOMODEL_STANDALONE_GMX
#include <iostream>
#include <string>
namespace MSG {
// enum((VERBOSE=1, DEBUG, INFO, WARNING, ERROR, FATAL, ALWAYS))}
const std::string PKG_NAME("GeoModelXML-");
const std::string VERBOSE(PKG_NAME + "VERBOSE: ");
const std::string DEBUG(PKG_NAME + "DEBUG: ");
const std::string INFO(PKG_NAME + "INFO: ");
const std::string WARNING(PKG_NAME + "WARNING: ");
const std::string ERROR(PKG_NAME + "ERROR: ");
const std::string FATAL(PKG_NAME + "FATAL: ");
const std::string ALWAYS(PKG_NAME + "ALWAYS: ");
}
// Consider changing this to a longer, less clashing sort of name, in the code
#define msglog std::cout
#define endmsg std::endl
// Nothing to do for stand-alone output; cout is already available.
#define OUTPUT_STREAM
#else
#include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/IMessageSvc.h"
// Macro OUTPUT_STREAM opens a MsgStream called log; can then write to it.
// Cannot get ServiceHandle directly into the macro; hide it with a typedef...
typedef ServiceHandle<IMessageSvc> SvcHndl;
#define OUTPUT_STREAM SvcHndl msgh("MessageSvc", "GeoModelXml"); MsgStream msglog(&(*msgh), "GeoModelXml")
#endif
#endif // OUTPUTDIRECTOR_H
......@@ -7,6 +7,7 @@
//
#ifndef GEO_MODEL_XML_STRICT_ERROR_HANDLER_H
#define GEO_MODEL_XML_STRICT_ERROR_HANDLER_H
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMErrorHandler.hpp>
#include <xercesc/util/XMLString.hpp>
......@@ -36,4 +37,4 @@ inline bool StrictErrorHandler::getSawErrors() const {
return m_SawErrors;
}
#endif //STRICT_ERROR_HANDLER_H
\ No newline at end of file
#endif //STRICT_ERROR_HANDLER_H
......@@ -4,6 +4,7 @@
#ifndef GEO_MODEL_XML_TRANSFORM_PROCESSOR_H
#define GEO_MODEL_XML_TRANSFORM_PROCESSOR_H
#include <xercesc/util/XercesDefs.hpp>
//
// Processor for transform tags.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment