Import Geant4 6.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:41:53 +02:00
parent 4aea781e80
commit 96686e0c8f
6560 changed files with 153347 additions and 238155 deletions
+926
View File
@@ -0,0 +1,926 @@
# Doxyfile 1.2.14
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = G4visualization
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = vis-V05-01-01
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY =
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French,
# German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish,
# Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish.
OUTPUT_LANGUAGE = English
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = NO
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these class will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
# members of a class in the documentation of that class as if those members were
# ordinary class members. Constructors, destructors and assignment operators of
# the base classes will not be shown.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = NO
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. It is allowed to use relative paths in the argument list.
STRIP_FROM_PATH =
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
# file names in lower case letters. If set to YES upper case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# users are adviced to set this option to NO.
CASE_SENSE_NAMES = YES
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
# (but less readable) file names. This can be useful is your file systems
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explict @brief command for a brief description.
JAVADOC_AUTOBRIEF = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# reimplements.
INHERIT_DOCS = YES
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
# will sort the (detailed) documentation of file and class members
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable (YES) or
# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = YES
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
# the initial value of a variable or define consist of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
# The appearance of the initializer of individual variables and defines in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 30
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C.
# For instance some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = \
management/include management/src \
modeling/include modeling/src \
../intercoms/include/G4VGraphicsScene.hh \
../intercoms/include/G4VVisManager.hh \
../intercoms/src/G4VVisManager.cc
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
# *.h++ *.idl *.odl
FILE_PATTERNS =
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = NO
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
# that are symbolic links (a Unix filesystem feature) are excluded from the input.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
EXCLUDE_PATTERNS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command <filter> <input-file>, where <filter>
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output.
INPUT_FILTER =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse.
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
# If the REFERENCED_BY_RELATION tag is set to YES (the default)
# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES (the default)
# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = NO
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet
HTML_STYLESHEET =
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = NO
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = NO
# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the Html help documentation and to the tree view.
TOC_EXPAND = NO
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
ENUM_VALUES_PER_LINE = 4
# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
# generated containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+,
# or Internet explorer 4.0+). Note that for large projects the tree generation
# can take a very long time. In such cases it is better to disable this feature.
# Windows users are probably better off using the HTML help feature.
GENERATE_TREEVIEW = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
# The RTF output is optimised for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using WORD or other
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assigments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
# then it will generate one additional man file for each entity
# documented in the real man page(s). These additional files
# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES Doxygen will
# generate an XML file that captures the structure of
# the code including all documentation. Note that this
# feature is still experimental and incomplete at the
# moment.
GENERATE_XML = NO
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
# generate an AutoGen Definitions (see autogen.sf.net) file
# that captures the structure of the code including all
# documentation. Note that this feature is still experimental
# and incomplete at the moment.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
# on a line and do not end with a semicolon. Such function macros are typically
# used for boiler-plate code, and will confuse the parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tagfiles.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
# in the modules index. If set to NO, only the current project's groups will
# be listed.
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
# super classes. Setting the tag to NO turns the diagrams off. Note that this
# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
# recommended to install and use dot, since it yield more powerful graphs.
CLASS_DIAGRAMS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = YES
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are gif, jpg, and png
# If left blank gif will be used.
DOT_IMAGE_FORMAT = gif
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found on the path.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the
# \dotfile command).
DOTFILE_DIRS =
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermedate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
# The SEARCHENGINE tag specifies whether or not a search engine should be
# used. If set to NO the values of all tags below this one will be ignored.
SEARCHENGINE = NO
# The CGI_NAME tag should be the name of the CGI script that
# starts the search engine (doxysearch) with the correct parameters.
# A script with this name will be generated by doxygen.
CGI_NAME = search.cgi
# The CGI_URL tag should be the absolute URL to the directory where the
# cgi binaries are located. See the documentation of your http daemon for
# details.
CGI_URL =
# The DOC_URL tag should be the absolute URL to the directory where the
# documentation is located. If left blank the absolute path to the
# documentation, with file:// prepended to it, will be used.
DOC_URL =
# The DOC_ABSPATH tag should be the absolute path to the directory where the
# documentation is located. If left blank the directory on the local machine
# will be used.
DOC_ABSPATH =
# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
# is installed.
BIN_ABSPATH = /usr/local/bin/
# The EXT_DOC_PATHS tag can be used to specify one or more paths to
# documentation generated for other projects. This allows doxysearch to search
# the documentation for these projects as well.
EXT_DOC_PATHS =
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.3 2000/04/07 13:32:40 gcosmo Exp $
# $Id: GNUmakefile,v 1.4 2003/10/03 15:21:20 gcosmo Exp $
name := G4FR
@@ -19,6 +19,5 @@ CPPFLAGS += -I$(G4BASE)/global/HEPGeometry/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/CSG/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/specific/include
CPPFLAGS += -I$(G4BASE)/geometry/management/include
CPPFLAGS += -I$(G4BASE)/geometry/volumes/include
include $(G4INSTALL)/config/common.gmk
@@ -1,3 +1,28 @@
$Id: History,v 1.17 2003/10/03 15:21:20 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
History file for visualization/FukuiRenderer sub-category
---------------------------------------------------------
4th October 2003 Gabriele Cosmo (vis-V05-02-01)
- Simplified GNUmakefile.
DAWN-V04-01-01 Satoshi TANAKA Sept 01, 2002
- Precision control with "setenv G4DAWNFILE_PRECISION number".
@@ -22,7 +22,7 @@
//
//
// $Id: G4DAWNFILE.hh,v 1.8 2001/07/27 22:32:55 johna Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA
// DAWNFILE driver factory.
@@ -22,7 +22,7 @@
//
//
// $Id: G4DAWNFILESceneHandler.hh,v 1.12 2002/12/11 15:58:02 johna Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA
@@ -22,7 +22,7 @@
//
//
// $Id: G4DAWNFILEViewer.hh,v 1.9 2003/06/16 17:13:27 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA
// DAWNFILE viewer - opens window, hard copy, etc.
@@ -22,7 +22,7 @@
//
//
// $Id: G4FRClientServer.hh,v 1.6 2001/07/11 10:08:44 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA, Wed Jul 3 14:13:52 JST 1996
////////////////////////////////
@@ -22,7 +22,7 @@
//
//
// $Id: G4FRConst.hh,v 1.6 2001/07/11 10:08:44 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA, Tue Jul 2 15:30:49 JST 1996
///////////////////////////////////
@@ -22,7 +22,7 @@
//
//
// $Id: G4FRFeatures.hh,v 1.5 2001/07/11 10:08:44 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
#if !defined G4_FR_FEATURES_HH
#define G4_FR_FEATURES_HH
@@ -22,7 +22,7 @@
//
//
// $Id: G4FRSceneFunc.icc,v 1.3 2003/05/30 13:01:19 johna Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4FRofstream.hh,v 1.6 2003/06/16 17:13:28 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
#include <fstream>
@@ -22,7 +22,7 @@
//
//
// $Id: G4FukuiRenderer.hh,v 1.7 2001/07/11 10:08:44 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// Satoshi TANAKA
@@ -22,7 +22,7 @@
//
//
// $Id: G4FukuiRendererSceneHandler.hh,v 1.11 2002/12/11 15:58:02 johna Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 11:19:19 JST 1996
@@ -22,7 +22,7 @@
//
//
// $Id: G4FukuiRendererViewer.hh,v 1.7 2001/07/11 10:08:44 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 12:10:14 JST 1996
@@ -22,7 +22,7 @@
//
//
// $Id: G4DAWNFILE.cc,v 1.9 2001/07/27 22:32:59 johna Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA
// DAWNFILE factory.
@@ -22,7 +22,7 @@
//
//
// $Id: G4DAWNFILESceneHandler.cc,v 1.13 2003/06/16 17:13:29 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA
// DAWNFILE scene.
@@ -22,7 +22,7 @@
//
//
// $Id: G4DAWNFILEViewer.cc,v 1.14 2003/06/16 17:13:30 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA
// DAWNFILE view - opens window, hard copy, etc.
@@ -22,7 +22,7 @@
//
//
// $Id: G4FRClientServer.cc,v 1.5 2001/07/11 10:08:45 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
// Satoshi TANAKA, Wed Jul 3 14:14:29 JST 1996
////////////////////////////////
@@ -22,7 +22,7 @@
//
//
// $Id: G4FukuiRenderer.cc,v 1.7 2001/07/11 10:08:46 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// Satoshi TANAKA
@@ -22,7 +22,7 @@
//
//
// $Id: G4FukuiRendererSceneHandler.cc,v 1.10 2003/06/16 17:13:31 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 11:34:24 JST 1996
@@ -22,7 +22,7 @@
//
//
// $Id: G4FukuiRendererViewer.cc,v 1.7 2001/07/11 10:08:46 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// Satoshi TANAKA, Fri Jun 28 12:09:11 JST 1996
+1 -8
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.13 2001/11/06 12:50:20 johna Exp $
# $Id: GNUmakefile,v 1.15 2003/11/06 14:53:11 johna Exp $
# -----------------------------------------------------------------------
# GNUmakefile for visualization and modeling. John Allison, 5/7/95.
# Modeling is always made. Others by environment. John Allison 4/7/98.
@@ -16,9 +16,6 @@ include $(G4INSTALL)/config/architecture.gmk
include $(G4INSTALL)/config/G4VIS_BUILD.gmk
include $(G4INSTALL)/config/interactivity.gmk
G4LIBDIR := $(G4LIB)/$(G4SYSTEM)
G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(name)
SUBDIRS := modeling
SUBLIBS := G4modeling
@@ -39,10 +36,6 @@ ifdef G4VIS_BUILD
SUBDIRS += XXX
SUBLIBS += G4visXXX
ifdef G4VIS_BUILD_OPACS_DRIVER
SUBDIRS += OPACS
SUBLIBS += G4OPACS
endif
ifdef G4VIS_BUILD_OPENGL_DRIVER
SUBDIRS += OpenGL
SUBLIBS += G4OpenGL
+7 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.4 2002/11/20 16:37:26 duns Exp $
# $Id: GNUmakefile,v 1.15 2003/11/17 23:13:01 duns Exp $
name := G4visHepRep
@@ -10,7 +10,12 @@ include $(G4INSTALL)/config/architecture.gmk
include $(G4INSTALL)/config/G4VIS_BUILD.gmk
include $(G4INSTALL)/config/interactivity.gmk
CPPFLAGS += -I$(G4BASE)/digits+hits/hits/include
CPPFLAGS += -DDEBUG -DZ_PREFIX
CPPFLAGS += -I$(G4BASE)/visualization/HepRep/include/ref
CPPFLAGS += -I$(G4BASE)/visualization/HepRep/include/zipios++
CPPFLAGS += -I$(G4BASE)/visualization/HepRep/include/zlib
CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
CPPFLAGS += -I$(G4BASE)/tracking/include
CPPFLAGS += -I$(G4BASE)/visualization/management/include
CPPFLAGS += -I$(G4BASE)/visualization/modeling/include
+80 -3
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.25.2.2 2003/05/30 13:14:50 johna Exp $
.$Id: History,v 1.55 2003/12/05 23:53:19 perl Exp $
-------------------------------------------------------------------
=========================================================
@@ -18,11 +18,88 @@ committal in the CVS repository !
----------------------------------------------------------
History file for visualization/HepRep sub-category
---------------------------------------------------------------------------
--------------------------------------------------
05 December 2003 Joseph Perl (vis-HepRep-V05-02-09)
- Fix bug with CalHits by moving faces to separate HepRepType
19 November 2003 Joseph Perl (vis-HepRep-V05-02-07)
- Set two additional attributes to get correct pick response within client,
PickParent and ShowParentAttributes.
Fixes GEANT-38
17 November 2003 Mark Donszelmann (vis-HepRep-V05-02-06)
- Removed dependency on sstream which made compilation fail on Linux-g++2.95.2
and on Solaris 5.2.
- Added flags for zipios++ to compile OutputStringStream using sstream only on
g++ 3.x (Linux/MacOS X) and on WIN32.
- Added include to OutputStringStream.h to make it work on Solaris.
- Removed our own sstream since it is no longer used.
- Fixed GEANT-34
14 November 2003 Mark Donszelmann
- Fixed GEANT-25, GEANT-35 and GEANT-36 (vis-HepRep-V05-02-05)
see http://bugs.freehep.org/secure/BrowseProject.jspa?id=10041
14 November 2003 Joseph Perl
- Fixed GEANT-30
14 November 2003 Mark Donszelmann and Joseph Perl (vis-HepRep-05-02-03)
- Fixed GEANT-32
13 November 2003 Mark Donszelmann
- Fixed GEANT-29, GEANT-33
12 November 2003 Joseph Perl
- Added G4HepRepFileSceneHandler::ClearTransientStore to make geometry
be properly included with each event of a /run/beamOn n.
12 November 2003 Mark Donszelmann
- Fixed GEANT-18, GEANT-19, GEANT-28
11 November 2003 Mark Donszelmann
- Fixed GEANT-23, GEANT-26, GEANT-27
10 November 2003 Mark Donszelmann
- Fixed GEANT-22, GEANT-24
6 November 2003 Mark Donszelmann
- Fixed GEANT-14, GEANT-20
5 November 2003 Mark Donszelmann
- Fixed GEANT-16
4 November 2003 Mark Donszelmann
- Fixed GEANT-15
30 October 2003 Mark Donszelmann
- Fixed GEANT-10, WIRED-170
28 October 2003 Mark Donszelmann
- Several fixes (GEANT-11, GEANT-12, GEANT-3 and GEANT-13)
24 October 2003 Mark Donszelmann
- Several fixes (GEANT-2, GEANT-4, GEANT-8 and GEANT-9)
22 October 2003 Mark Donszelmann
- Added latest HepRep2 driver.
12th July 2003 Mark Donszelmann
- Renamed XMLHepRepWriter to G4HepRepFileXMLWriter and moved its header to include.
Fixed initialization of some variabled in G4HepRep and G4HepRepSceneHandler, found
by valgrind. Removed dependency in gzio.cc of fdopen (platform specific).
11th July 2003 Mark Donszelmann
- Removed the HepRepStreamer and replaced it by a fully functional HepRep implementation
in C++. Added compression using ZLIB and ZIPIOS++. Moved private header files to
subdirectories of include so that they do not get copied by the "gmake includes"
command.
The current HepRep files are invalid, but we first need to get rid of some memory
leaks, using Linux, so we check this in.
30th May 2003 John Allison
- Eliminated pedantic warnings at head (johna-030530) and on
geant4-05-01-ref-02 (vis-V05-01-00).
geant4-05-01-ref-02 (vis-V05-00-02).
29th May 2003 Mark Donszelmann and Joseph Perl (mark-joseph-050329)
- Modified G4HepRepSceneHandler (HEPREP2) to write more complete heprep, including
+69 -16
View File
@@ -5,7 +5,7 @@ The HepRep graphics format is further described at
http://heprep.freehep.org
Two different drivers area available for either HepRep1 or HepRep2.
Two different drivers are available for either HepRep1 or HepRep2.
Driver: HepRepFile
@@ -30,31 +30,84 @@ Driver: HepRepXML
-----------------
The version of HepRep produced by this driver is HepRep Version 2.
To set the base part of the filename (filename = basefilename-seqno.heprep):
/vis/scene/create basefilename
It uses ZLIB and ZIPIOS (included in the HepRep driver) to
compress the files if necessary. ZLIB and ZIPIOS are included in the
zlib and zipios++ include directories and further licensed and described there.
HepRep XML files can contain multiple HepRep events/geometries.
If the file contains more than one HepRep it is not strictly XML anymore.
Files can be written in .heprep.zip .heprep.gz or .heprep format.
The .heprep.zip is the default for file output, the .heprep is the default
for stdout and stderr.
(Optional) To set the filename, where the extension should be .heprep.zip
.heprep.gz or .heprep (.zip and .gz will compress), use:
/vis/scene/create filename.heprep.zip
(Optional) To create separate files for each event, you can set a suffix such as
"-0001" to start writing files from filename-0001.heprep.zip to
filename-9999.heprep.zip (or up), while "-55-sub" will start write files
filename-55-sub.heprep.zip to filename-99-sub.heprep.zip (or up).
/vis/heprep/setEventNumberSuffix -0001
(Note: suffix has to contain at least one digit)
(Optional) To route the HepRep XML output to stdout (or stderr),
by default uncompressed, use:
To route the HepRep XML output to stdout (or stderr) use:
/vis/scene/create stdout
To select the driver
To select the driver, where the file if not create by scene is set to
G4HepRepOutput.heprep.zip, use:
/vis/open HepRepXML
Any call to draw part of an event will open the file and start writing.
Each file, apart from stdin/stderr, is closed by:
(Optional) To write a geometry, use:
/vis/viewer/flush
(WARNING: files will not contain geometry if not flushed. G4 exit will only
close file)
Multiple events can be written by:
/vis/scene/endOfSceneAction accumulate
(Optional) To signal a change in geometry (to be written with the next event), use:
/vis/viewer/refresh
To write 10 events (and geometries), use:
/run/beamOn 10
(Optional) To accumulate multiple (5) G4 events into one HepRep event, use:
/vis/scene/endOfEventAction accumulate
/run/beamOn 5
/vis/viewer/update
(Optional) To add attributes to each point on a trajectory, use:
/vis/heprep/addPointAttributes 1
Be aware that this may increase the size of the output dramatically.
(Optional) To close the file, remove the SceneHandler, use:
/vis/sceneHandler/remove scene-handler-0
View the file using the WIRED Event Display, available from:
http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/
or in future
http://wired.freehep.org
9 Dec 2002
Mark Donszelmann
Limitations:
Only one SceneHandler can exist at any time, connected to a single Viewer.
Since the HepRep format is a model rather than a view this is not a real
limitation. In WIRED you can create as many views (SceneHandlers) as you like.
4 November 2003
Mark.Donszelmann@slac.stanford.edu
+32 -9
View File
@@ -1,10 +1,33 @@
export HEPREP=$FREEHEP/hep/graphics/heprep
cp $FREEHEP/org/freehep/jni/FreeHepTypes.h include
cp $HEPREP/geant4/*.hh include
cp $HEPREP/streamer-c++/include/*.h include
cp $HEPREP/include/HEPREP/*.h include/HEPREP
cp $HEPREP/geant4/*.cc src
cp $HEPREP/streamer-c++/*.cc src
rm src/HepRepStreamerExample.cc
rm src/HepRepStreamerTest.cc
cp $FREEHEP/org/freehep/jni/FreeHepTypes.h include/ref
cp $FREEHEP/org/freehep/zip/zipios++/*.h include/zipios++
cp $FREEHEP/org/freehep/zip/*.h include/zipios++
cp $FREEHEP/org/freehep/zip/*.cpp src
mv src/appendzip.cpp src/appendzip.cc
mv src/basicentry.cpp src/basicentry.cc
mv src/collcoll.cpp src/collcoll.cc
mv src/deflateoutputstreambuf.cpp src/deflateoutputstreambuf.cc
mv src/fcoll.cpp src/fcoll.cc
mv src/fcollexceptions.cpp src/fcollexceptions.cc
mv src/fileentry.cpp src/fileentry.cc
mv src/filepath.cpp src/filepath.cc
mv src/filterinputstreambuf.cpp src/filterinputstreambuf.cc
mv src/filteroutputstreambuf.cpp src/filteroutputstreambuf.cc
mv src/inflateinputstreambuf.cpp src/inflateinputstreambuf.cc
mv src/zipfile.cpp src/zipfile.cc
mv src/ziphead.cpp src/ziphead.cc
mv src/zipheadio.cpp src/zipheadio.cc
mv src/zipinputstream.cpp src/zipinputstream.cc
mv src/zipinputstreambuf.cpp src/zipinputstreambuf.cc
mv src/zipoutputstream.cpp src/zipoutputstream.cc
mv src/zipoutputstreambuf.cpp src/zipoutputstreambuf.cc
cp $HEPREP/geant4/include/*.hh include
cp $HEPREP/c++/include/*.h include/ref
cp $HEPREP/include/HEPREP/*.h include/HEPREP
cp $HEPREP/geant4/*.cc src
cp $HEPREP/c++/*.cc src
rm src/MultiWriteTest.cc
rm src/HepRepTest.cc
rm src/HepRepExample.cc
rm src/test_zipoutputstream.cpp
rm src/test_gzipoutputstream.cpp
+14 -8
View File
@@ -1,9 +1,15 @@
set HEPREP=%FREEHEP%\hep\graphics\heprep
copy %FREEHEP%\org\freehep\jni\FreeHepTypes.h include
copy %HEPREP%\geant4\include\*.hh include
copy "%HEPREP%\streamer-c++\include\*.h" include
copy %HEPREP%\include\HEPREP\*.h include\HEPREP
copy %HEPREP%\geant4\*.cc src
copy "%HEPREP%\streamer-c++\*.cc" src
del src\HepRepStreamerExample.cc
del src\HepRepStreamerTest.cc
copy "%FREEHEP%\org\freehep\jni\FreeHepTypes.h" "include\ref"
copy "%FREEHEP%\org\freehep\zip\zipios++\*.h" "include\zipios++"
copy "%FREEHEP%\org\freehep\zip\*.h" "include\zipios++"
copy "%FREEHEP%\org\freehep\zip\*.cpp" "src\*.cc"
copy "%HEPREP%\geant4\include\*.hh" "include"
copy "%HEPREP%\c++\include\*.h" "include\ref"
copy "%HEPREP%\include\HEPREP\*.h" "include\HEPREP"
copy "%HEPREP%\geant4\*.cc" "src"
copy "%HEPREP%\c++\*.cc" "src"
del src\MultiWriteTest.cc
del src\HepRepTest.cc
del src\HepRepExample.cc
del src\test_zipoutputstream.cc
del src\test_gzipoutputstream.cc
@@ -1,55 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef DEFAULTHEPREPTREEID_H
#define DEFAULTHEPREPTREEID_H 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepTreeID : public virtual HEPREP::HepRepTreeID {
private:
std::string name;
std::string version;
std::string qualifier;
public:
DefaultHepRepTreeID(std::string name, std::string version, std::string qualifier = "top_level");
~DefaultHepRepTreeID();
std::string getQualifier();
void setQualifier(std::string qualifier);
std::string getName();
std::string getVersion();
HEPREP::HepRepTreeID* copy();
};
#endif
@@ -1,32 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef FREEHEPTYPES_H
#define FREEHEPTYPES_H
#ifdef WIN32
// Disable warning C4786: identifier was truncated to '255' characters in the debug information
#pragma warning ( disable : 4786 )
#endif
#endif
@@ -31,13 +31,22 @@
//G4
#include "G4VGraphicsSystem.hh"
class G4HepRepMessenger;
class G4HepRep: public G4VGraphicsSystem {
public:
G4HepRep ();
virtual ~G4HepRep ();
G4VSceneHandler* CreateSceneHandler (const G4String& name = "");
G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name = "");
G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name = "");
void removeSceneHandler();
void removeViewer();
private:
G4VSceneHandler* sceneHandler;
G4VViewer* viewer;
G4HepRepMessenger* messenger;
};
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4HepRepFile.hh,v 1.6 2003/06/25 10:19:50 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// $Id: G4HepRepFile.hh,v 1.7 2003/07/12 19:48:15 duns Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// John Allison 5th April 2001
@@ -34,7 +34,7 @@
#include "G4VGraphicsSystem.hh"
// HepRep
#include "HepRepXMLWriter.hh"
#include "G4HepRepFileXMLWriter.hh"
class G4HepRepFile: public G4VGraphicsSystem {
public:
@@ -43,7 +43,7 @@ public:
G4VSceneHandler* CreateSceneHandler(const G4String& name = "");
G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name = "");
HepRepXMLWriter *GetHepRepXMLWriter();
G4HepRepFileXMLWriter *GetHepRepXMLWriter();
};
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4HepRepFileSceneHandler.hh,v 1.12 2003/06/25 10:19:51 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// $Id: G4HepRepFileSceneHandler.hh,v 1.14 2003/11/13 01:11:41 perl Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// Joseph Perl 27th January 2002
@@ -47,7 +47,7 @@
#include "G4Polyhedra.hh"
// HepRep
#include "HepRepXMLWriter.hh"
#include "G4HepRepFileXMLWriter.hh"
class G4VPhysicalVolume;
class G4LogicalVolume;
@@ -111,12 +111,18 @@ public:
void BeginModeling();
void EndModeling();
//////////////////////////////////////////////////////////////
// Administration functions.
//void ClearStore ();
void ClearTransientStore ();
////////////////////////////////////////////////////////////////
// Required...
static G4int GetSceneCount() {return fSceneCount;}
HepRepXMLWriter *GetHepRepXMLWriter();
G4HepRepFileXMLWriter *GetHepRepXMLWriter();
protected:
static G4int fSceneIdCount; // Counter for HepRep scene handlers.
@@ -126,7 +132,7 @@ protected:
G4LogicalVolume* fpCurrentLV; // Current logical volume.
private:
HepRepXMLWriter *hepRepXMLWriter;
G4HepRepFileXMLWriter *hepRepXMLWriter;
void AddHepRepInstance(const char* primName,
const G4Visible visible);
void CheckFileOpen();
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4HepRepFileViewer.hh,v 1.7 2003/06/25 10:19:52 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// $Id: G4HepRepFileViewer.hh,v 1.8 2003/07/12 19:48:15 duns Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
//
// John Allison 5th April 2001
@@ -35,7 +35,7 @@
#include "G4VViewer.hh"
#include "HepRepXMLWriter.hh"
#include "G4HepRepFileXMLWriter.hh"
#include "G4HepRepFileSceneHandler.hh"
class G4HepRepFileViewer: public G4VViewer {
@@ -48,7 +48,7 @@ public:
void ShowView();
private:
HepRepXMLWriter *hepRepXMLWriter;
G4HepRepFileXMLWriter *hepRepXMLWriter;
};
#endif
@@ -23,7 +23,7 @@
//
//--------------------------------------------------------------------------
// File and Version Information:
// $Id: HepRepXMLWriter.hh,v 1.12 2003/06/25 10:19:56 gunter Exp $
// $Id: G4HepRepFileXMLWriter.hh,v 1.1 2003/07/12 19:48:15 duns Exp $
//
// Description:
// Create a HepRep XML File (HepRep version 1).
@@ -37,18 +37,18 @@
// Copyright Information:
// Copyright (C) 2001 Stanford Linear Accelerator Center
//------------------------------------------------------------------------
#ifndef HepRepXMLWriter_hh
#define HepRepXMLWriter_hh
#ifndef G4HepRepFileXMLWriter_hh
#define G4HepRepFileXMLWriter_hh
//#define G4HEPREPFILEDEBUG // Comment this out to suppress debug code.
#include "globals.hh"
#include <fstream>
class HepRepXMLWriter
class G4HepRepFileXMLWriter
{
public:
HepRepXMLWriter();
G4HepRepFileXMLWriter();
void addType(const char* name, int newTypeDepth);
void addInstance();
@@ -20,32 +20,42 @@
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef DEFAULTHEPREPACTION_H
#define DEFAULTHEPREPACTION_H 1
//
//
#ifndef G4HepRepMessenger_HH
#define G4HepRepMessenger_HH 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepAction.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepAction : public virtual HEPREP::HepRepAction {
private:
std::string name;
std::string expression;
#include "G4UImessenger.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithABool.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcommand.hh"
class G4HepRepMessenger : public G4UImessenger {
public:
DefaultHepRepAction(std::string name, std::string expression);
~DefaultHepRepAction();
G4HepRepMessenger();
virtual ~G4HepRepMessenger();
std::string getName();
std::string getExpression();
HEPREP::HepRepAction* copy();
virtual G4String GetCurrentValue(G4UIcommand * command);
virtual void SetNewValue(G4UIcommand * command, G4String newValue);
virtual G4String getEventNumberSuffix();
virtual G4bool appendGeometry();
virtual G4bool addPointAttributes();
private:
G4UIdirectory* heprepDirectory;
G4String suffix;
G4UIcmdWithAString* setEventNumberSuffixCommand;
G4bool geometry;
// G4UIcmdWithABool* appendGeometryCommand;
G4bool pointAttributes;
G4UIcmdWithABool* addPointAttributesCommand;
};
#endif
@@ -31,6 +31,9 @@
#include "globals.hh"
#include <iostream>
#include <stack>
#include <map>
#include <vector>
// HepRep
#include "HEPREP/HepRep.h"
@@ -43,30 +46,29 @@
#include "G4LogicalVolume.hh"
#include "G4PhysicalVolumeModel.hh"
//class G4HepRep;
#include "G4HepRepMessenger.hh"
class G4HepRepSceneHandler: public G4VSceneHandler {
public:
G4HepRepSceneHandler (G4VGraphicsSystem& system, const G4String& name = "");
G4HepRepSceneHandler (G4VGraphicsSystem& system, G4HepRepMessenger& messenger, const G4String& name = "");
virtual ~G4HepRepSceneHandler ();
void AddThis (const G4Box&);
void AddThis (const G4Cons&);
void AddThis (const G4Tubs&);
void AddThis (const G4Trd&);
void AddThis (const G4Trap&);
void AddThis (const G4Sphere&);
void AddThis (const G4Para&);
void AddThis (const G4Torus&);
void AddThis (const G4Polycone&);
void AddThis (const G4Polyhedra&);
void AddThis (const G4VSolid&);
void AddThis (const G4Box& box) { G4VSceneHandler::AddThis (box); }
void AddThis (const G4Cons& cons) { G4VSceneHandler::AddThis (cons); }
void AddThis (const G4Tubs& tubs) { G4VSceneHandler::AddThis (tubs); }
void AddThis (const G4Trd& trd) { G4VSceneHandler::AddThis (trd); }
void AddThis (const G4Trap& trap) { G4VSceneHandler::AddThis (trap); }
void AddThis (const G4Sphere& sphere) { G4VSceneHandler::AddThis (sphere); }
void AddThis (const G4Para& para) { G4VSceneHandler::AddThis (para); }
void AddThis (const G4Torus& torus) { G4VSceneHandler::AddThis (torus); }
void AddThis (const G4Polycone& polycone) { G4VSceneHandler::AddThis (polycone); }
void AddThis (const G4Polyhedra& polyhedra) { G4VSceneHandler::AddThis (polyhedra); }
void AddThis (const G4VSolid& solid) { G4VSceneHandler::AddThis(solid); }
void AddThis (const G4VTrajectory&);
void AddThis (const G4VHit&);
void AddThis (const G4VHit& hit) { G4VSceneHandler::AddThis(hit); }
void PreAddThis (const G4Transform3D& objectTransformation,
const G4VisAttributes& visAttribs);
void PreAddThis (const G4Transform3D& objectTransformation, const G4VisAttributes& visAttribs);
void PostAddThis ();
void EstablishSpecials(G4PhysicalVolumeModel&);
@@ -79,54 +81,112 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
void AddPrimitive (const G4NURBS&);
void AddPrimitive (const G4Polymarker&);
void AddPrimitive (const G4Scale& scale) {
G4VSceneHandler::AddPrimitive(scale);
}
void AddPrimitive (const G4Scale& scale) { G4VSceneHandler::AddPrimitive(scale); }
void BeginPrimitives (const G4Transform3D& objectTransformation);
void EndPrimitives ();
void BeginModeling ();
void EndModeling ();
static G4int GetSceneCount () { return sceneCount; }
static G4int getSceneCount () { return sceneCount; }
HEPREP::HepRep *GetHepRep() { return heprep; }
HEPREP::HepRepWriter *GetHepRepWriter() { return writer; }
HEPREP::HepRepFactory *GetHepRepFactory();
void open();
void close();
protected:
// void RequestPrimitives (const G4VSolid& solid);
void openHepRep();
bool closeHepRep(bool final = false);
void openFile(G4String name);
void closeFile();
private:
static G4int sceneCount; // No. of extanct scenes.
static G4int sceneIdCount; // static counter for scenes.
G4int fileNo; // file sequence number
G4int currentDepth;
G4VPhysicalVolume* currentPV;
G4LogicalVolume* currentLV;
static G4int sceneCount;
const G4ModelingParameters* originalMP; // Keeps pointer to original.
G4ModelingParameters* nonCullingMP; // For temporary non-culling.
G4Transform3D transform;
void SetColour (HEPREP::HepRepAttribute *attribute, const G4Colour& color,const G4String& key = G4String("Color"));
void SetLine (HEPREP::HepRepInstance *instance, const G4Visible& visible);
void SetMarker (HEPREP::HepRepInstance *instance, const G4VMarker& marker);
HEPREP::HepRepInstance* CreateInstance(HEPREP::HepRepInstance* p, HEPREP::HepRepType* altType);
bool IsEventData ();
std::ostream* out;
HEPREP::HepRepFactory* heprepFactory;
HEPREP::HepRepFactory* factory;
HEPREP::HepRepWriter* writer;
HEPREP::HepRepInstance *parent;
HEPREP::HepRep *heprep;
HEPREP::HepRepType *geometryType;
HEPREP::HepRepType *eventType;
HEPREP::HepRepType *trackType;
HEPREP::HepRepType *calHitType;
HEPREP::HepRepType *hitType;
// Methods
void setColor (HEPREP::HepRepAttribute *attribute, const G4Color& color,
const G4String& key = G4String("Color"));
G4Color getColor (G4double charge);
void setVisibility (HEPREP::HepRepAttribute *attribute, const G4Visible& visible);
void setLine (HEPREP::HepRepAttribute *attribute, const G4Visible& visible);
void setMarker (HEPREP::HepRepAttribute *attribute, const G4VMarker& marker);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, G4String value);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, bool value);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, double value);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, int value);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, double red, double green, double blue, double alpha);
bool isEventData ();
void open(G4String name);
void close();
void addAttDefs(HEPREP::HepRepDefinition* definition, const std::map<G4String,G4AttDef>* attDefs);
void addAttVals(HEPREP::HepRepAttribute* attribute, const std::map<G4String,G4AttDef>* attDefs, std::vector<G4AttValue>* attValues);
// Returns the particular instance/type or if not created, creates them and adds them to the HepRep
HEPREP::HepRep* getHepRep();
HEPREP::HepRepInstanceTree* getGeometryInstanceTree();
HEPREP::HepRepInstance* getGeometryInstance(G4LogicalVolume* volume, int depth);
HEPREP::HepRepInstance* getGeometryInstance(G4String volumeName, int depth);
HEPREP::HepRepInstance* getGeometryRootInstance();
HEPREP::HepRepTypeTree* getGeometryTypeTree();
HEPREP::HepRepType* getGeometryType(G4String volumeName, int depth);
HEPREP::HepRepType* getGeometryRootType();
HEPREP::HepRepInstanceTree* getEventInstanceTree();
HEPREP::HepRepInstance* getEventInstance();
HEPREP::HepRepTypeTree* getEventTypeTree();
HEPREP::HepRepType* getEventType();
HEPREP::HepRepType* getTrajectoryType ();
HEPREP::HepRepType* getHitType ();
HEPREP::HepRepType* getCalHitType ();
HEPREP::HepRepType* getCalHitFaceType ();
G4String getFullTypeName(G4String volumeName, int depth);
G4String getParentTypeName(int currentDepth);
// initialized Member Variables
G4HepRepMessenger& messenger;
G4String geometryLayer, eventLayer, calHitLayer;
G4String trajectoryLayer, hitLayer;
G4String rootVolumeName;
G4String baseName;
G4String eventNumberPrefix;
G4String eventNumberSuffix;
G4int eventNumber;
G4int eventNumberWidth;
G4String extension;
G4bool writeMultipleFiles;
G4int currentDepth;
G4VPhysicalVolume* currentPV;
G4LogicalVolume* currentLV;
// DO NOT USE member vars directly, use get methods.
HEPREP::HepRep* _heprep;
HEPREP::HepRepInstanceTree* _geometryInstanceTree;
std::vector<HEPREP::HepRepInstance*> _geometryInstance;
HEPREP::HepRepInstance* _geometryRootInstance;
HEPREP::HepRepTypeTree* _geometryTypeTree;
std::vector<G4String> _geometryTypeName;
std::map<G4String, HEPREP::HepRepType*> _geometryType;
HEPREP::HepRepType* _geometryRootType;
HEPREP::HepRepInstanceTree* _eventInstanceTree;
HEPREP::HepRepInstance* _eventInstance;
HEPREP::HepRepTypeTree* _eventTypeTree;
HEPREP::HepRepType* _eventType;
HEPREP::HepRepType* _trajectoryType;
HEPREP::HepRepType* _hitType;
HEPREP::HepRepType* _calHitType;
HEPREP::HepRepType* _calHitFaceType;
std::map<int, G4String> materialState;
};
#endif
@@ -46,7 +46,7 @@ class G4HepRepViewer: public G4VViewer {
void FinishView ();
private:
bool drawn;
bool geometryIncluded;
};
#endif
@@ -0,0 +1,34 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HASHEPREP_H
#define HEPREP_HASHEPREP_H 1
// Copyright 2000-2003, FreeHEP.
namespace HEPREP {
class HepRep;
/**
* The HasHepRep interface.
*
* @author Mark Donszelmann
*/
class HasHepRep {
public:
/// Destructor.
virtual ~HasHepRep() { /* nop */; }
/**
* Returns the associated HepRep to this object.
*
*/
virtual HepRep getHepRep() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HASHEPREP_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -29,12 +7,13 @@
#ifndef HEPREP_HEPREP_H
#define HEPREP_HEPREP_H 1
// Copyright 2000-2002, FreeHEP.
// Copyright 2000-2003, FreeHEP.
#include <string>
#include <vector>
// Include all other HepRep header files here for convenience
#include "HEPREP/HasHepRep.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttribute.h"
@@ -139,6 +118,13 @@ public:
*/
virtual bool addInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Overlays an instancetree to this heprep, overriding attributes and adding children.
*
* @param instanceTree to be overlaid.
*/
virtual void overlayInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Remove an instanectree from this heprep.
*
@@ -223,5 +209,5 @@ public:
*/
virtual HepRep * copy(HepRepSelectFilter * filter = NULL) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREP_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -67,5 +45,5 @@ public:
*/
virtual HepRepAction * copy() = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPACTION_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -88,5 +66,5 @@ public:
*/
virtual HepRepAttDef * copy() = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTDEF_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -89,6 +67,13 @@ public:
*/
virtual std::string getString() = 0;
/**
* Returns value as lowercase string.
*
* @return value as string (if type is string).
*/
virtual std::string getLowerCaseString() = 0;
/**
* Returns value as string.
*
@@ -138,5 +123,5 @@ public:
*/
virtual HepRepAttValue * copy() = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTVALUE_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -62,7 +40,7 @@ public:
/**
* Adds a char* attValue as a String.
* This call is mapped to addAttValue(std::string, std::string, int); and necessary
* This call should be mapped to addAttValue(std::string, std::string, int); and necessary
* because C++ converts char* into bool and would thus call addAttValue(std::string, bool, int)
* for a call such as addAttValue("drawAs", "Cylinder", 0);
*
@@ -71,10 +49,7 @@ public:
* @param showLabel show this as label
* @return false if an IOException was created.
*/
bool addAttValue(std::string key, char* value, int showLabel = HepRepConstants::SHOW_NONE) {
return addAttValue(key, std::string(value), showLabel);
}
virtual bool addAttValue(std::string key, char* value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
@@ -170,5 +145,5 @@ public:
*/
virtual HepRepAttValue * getAttValueFromNode(std::string lowerCaseName) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTRIBUTE_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -54,5 +32,5 @@ public:
*/
enum { SHOW_NONE = 0x0000, SHOW_NAME = 0x0001, SHOW_DESC = 0x0002, SHOW_VALUE = 0x0004, SHOW_EXTRA = 0x0008 };
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPCONSTANTS_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -94,5 +72,5 @@ public:
*/
virtual HepRepAttDef * getAttDefFromNode(std::string lowerCaseName) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPDEFINITION_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -41,6 +19,7 @@ class HepRepAction;
class HepRepInstance;
class HepRepInstanceTree;
class HepRepPoint;
class HepRepReader;
class HepRepTreeID;
class HepRepType;
class HepRepTypeTree;
@@ -57,12 +36,28 @@ public:
/// Destructor.
virtual ~HepRepFactory() { /* nop */; }
/**
* Creates a HepRepReader from a stream.
*
* @param in input stream.
*/
virtual HepRepReader * createHepRepReader(std::istream * in) = 0;
/**
* Creates a HepRepReader from a file name.
*
* @param inputFileName file name.
*/
virtual HepRepReader * createHepRepReader(std::string inputFileName) = 0;
/**
* Creates a HepRepWriter.
*
* @param out output stream.
* @param randomAccess create a writer in a format that will allow random access (may be ignored).
* @param compress create a writer that uses compression (may be ignored).
*/
virtual HepRepWriter * createHepRepWriter(std::ostream * out) = 0;
virtual HepRepWriter * createHepRepWriter(std::ostream * out, bool randomAccess, bool compress) = 0;
/**
* Creates a HepRepPoint.
@@ -141,5 +136,5 @@ public:
*/
virtual HepRep * createHepRep() = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPFACTORY_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -54,6 +32,15 @@ public:
/// Destructor.
virtual ~HepRepInstance() { /* nop */; }
/**
* Overlays the instance on the current instance.
*
* Attributes of the instance override or are added to the current instance.
* Sub-instances of the instance are added only if the current instance has no sub-instances.
* Points of the instance are added only if the current instance has no points.
*/
virtual void overlay(HepRepInstance * instance) = 0;
/**
* Adds an sub-instance to this instance.
*
@@ -118,5 +105,5 @@ public:
*/
virtual HepRepInstance * copy(HepRep * heprep, HepRepInstanceTree * parent, HepRepSelectFilter * filter = NULL) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPINSTANCE_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -53,6 +31,13 @@ public:
/// Destructor.
virtual ~HepRepInstanceTree() { /* nop */; }
/**
* Overlays the instance tree on the current tree.
*
* The list of instances of the instanceTree has to be the same as the current tree.
*/
virtual void overlay(HepRepInstanceTree * instanceTree) = 0;
/**
* Adds an instance to this instancetree.
*
@@ -86,9 +71,9 @@ public:
/**
* Returns a collection of associated instance trees.
*
* @return collection of HepRepInstanceTrees.
* @return collection of HepRepTreeIDs.
*/
virtual std::vector<HepRepInstanceTree *> * getInstanceTrees() = 0;
virtual std::vector<HepRepTreeID *> * getInstanceTrees() = 0;
/**
* Returns the associated typetree.
@@ -108,5 +93,5 @@ public:
virtual HepRepTreeID * copy() = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPINSTANCETREE_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -69,7 +47,7 @@ public:
*
* @param listener to be added.
*/
virtual void addHepRepIteratorListener(HepRepIteratorListener * listener) = 0;
virtual bool addHepRepIteratorListener(HepRepIteratorListener * listener) = 0;
/**
* Removes a listener.
@@ -86,5 +64,5 @@ public:
*/
virtual HepRepAttValue * getAttValue(std::string key) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPITERATOR_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -40,6 +18,8 @@ namespace HEPREP {
* HepRepIteratorListener interface. The implementor is called back for changes
* of attributes while using the HepRepIterator to iterate over all the HepRepInstances.
*
* All names are lowercased.
*
* @author Mark Donszelmann
*/
class HepRepIteratorListener {
@@ -53,9 +33,10 @@ public:
*
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(std::string key, std::string value, int showLabel) = 0;
virtual void setAttribute(std::string key, std::string value, std::string lowerCaseValue, int showLabel) = 0;
/**
* Called if attribute key changes its value.
@@ -109,5 +90,5 @@ public:
*/
virtual void removeAttribute(std::string key) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPITERATORLISTENER_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -186,5 +164,5 @@ public:
*/
virtual HepRepPoint * copy(HepRepInstance * parent) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPPOINT_H */
@@ -0,0 +1,80 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPREADER_H
#define HEPREP_HEPREPREADER_H 1
// Copyright 2002-2003, Freehep.
#include <string>
namespace HEPREP {
class HepRep;
/**
* HepRepReader interface.
*
* @author Mark Donszelmann
*/
class HepRepReader {
public:
/// Destructor.
virtual ~HepRepReader() { /* nop */; }
/**
* Closes the reader and its underlying stream.
*
* @return false in case of a stream problem.
*/
virtual bool close() = 0;
/**
* Allows random access.
*
* @return true if this reader provides random access
*/
virtual bool hasRandomAccess() = 0;
/**
* Reads a HepRep by name (random access only).
*
* @param name for the heprep to be read.
* @return heprep.
*/
virtual HepRep * read(std::string name) = 0;
/**
* Allows for sequential access.
*
* @return true if sequential access is possible.
*/
virtual bool hasSequentialAccess() = 0;
/**
* Resets a sequential HepRep reader.
*
* @return false in case of a stream problem.
*/
virtual bool reset() = 0;
/**
* Is there a next heprep.
*
* @return true if the next heprep is available.
*/
virtual bool hasNext() = 0;
/**
* Reads the next HepRep from the Reader.
*
* @return heprep.
*/
virtual HepRep * next() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPREADER_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -54,5 +32,5 @@ public:
*/
virtual bool select(HepRepInstance * instance) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPSELECTFILTER_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -81,5 +59,5 @@ public:
*/
virtual HepRepTreeID * copy() = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTREEID_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -61,11 +39,25 @@ public:
/**
* Returns the name of this type.
* This is the full name if one uses flat-types, and the node name if one
* uses hierarchical typenames. It is the name supplied at construction of the type.
*
* @return name of type.
* @see #getFullName()
*/
virtual std::string getName() = 0;
/**
* Returns the full name of this type.
* The full name is constructed from the root of the typeTree (without the typeTreeName)
* by concatenating all the node names separated by slashes "/". For example:
* Geometry/InnerDetector/Sector24/Wire20
*
* @return full name of type.
* @see #getName()
*/
virtual std::string getFullName() = 0;
/**
* Returns the description of this type.
*
@@ -103,5 +95,5 @@ public:
*/
virtual HepRepType * copy(HepRep * heprep, HepRepType * parent) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTYPE_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -80,5 +58,5 @@ public:
// To be disabled in g++ 3.0
virtual HepRepTreeID * copy() = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTYPETREE_H */
@@ -0,0 +1,34 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPVIEWER_H
#define HEPREP_HEPREPVIEWER_H 1
// Copyright 2000-2003, FreeHEP.
namespace HEPREP {
class HepRep;
/**
* The HepRepViewer interface.
*
* @author Mark Donszelmann
*/
class HepRepViewer {
public:
/// Destructor.
virtual ~HepRepViewer() { /* nop */; }
/**
* Display a heprep
*
*/
virtual void display(HepRep heprep) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPVIEWER_H */
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
@@ -31,6 +9,9 @@
// Copyright 2002, Freehep.
#include <string>
#include <vector>
namespace HEPREP {
class HepRep;
@@ -68,9 +49,18 @@ public:
* Writes a HepRep.
*
* @param heprep to be written.
* @param name for the heprep to be written (for tagged access), may be ommited.
* @return false in case of a stream problem.
*/
virtual bool write(HepRep * heprep) = 0;
virtual bool write(HepRep * heprep, std::string name) = 0;
/**
* Writes the layerOrder.
*
* @param layerOrder to be written.
* @return false in case of a stream problem.
*/
virtual bool write(std::vector<std::string> * layerOrder) = 0;
/**
* Writes a HepRepTypeTree.
@@ -160,5 +150,5 @@ public:
*/
virtual bool write(HepRepAttDef * attDef) = 0;
}; // class
}; // namespace HEPREP
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPWRITER_H */
@@ -1,69 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef INDENTPRINTWRITER_H
#define INDENTPRINTWRITER_H 1
#include "FreeHepTypes.h"
#include <iostream>
#include <string>
/**
* A PrintWriter that keeps track of an indentation level
* and indents the output appropriately.
*
* <b>Warning:</b> Only print and println methods taking strings have been overriden,
* print, println methods taking other arguments may not be indented properly.
*
* @author Mark Donszelmann
*/
class IndentPrintWriter {
public:
IndentPrintWriter(std::ostream* out, int level = 0);
virtual ~IndentPrintWriter();
void close();
IndentPrintWriter& operator<< (const char *s);
IndentPrintWriter& operator<< (std::ostream& (*pf)(std::ostream&));
void println(std::string s);
void print(std::string s);
void println();
void indent();
void outdent();
int getIndent();
void setIndent(int level);
std::string getIndentString();
void setIndentString(std::string indentString);
private:
void doIndent();
std::ostream* out;
int indentLevel;
bool indented;
std::string indentString;
};
#endif
+7 -3
View File
@@ -3,14 +3,18 @@ Apart from the heprep1 files:
G4HepRepFile.hh
G4HepRepFileSceneHandler.hh
G4HepRepFileViewer.hh
HepRepXMLWriter.hh
ref/HepRepXMLWriter.hh
and the zlib headers
zlib/*.h
the other sources (heprep2) are copies from the FreeHEP library
(java.freehep.org) and are maintained there.
(java.freehep.org) and are maintained there.
The files starting with G4 are geant4 compliant, the others may not be.
Changes made here may be overwritten.
12 Nov 2002
11 July 2003
Mark Donszelmann
@@ -1,62 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef STREAMERHEPREPATTRIBUTE_H
#define STREAMERHEPREPATTRIBUTE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRepAttribute.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepWriter.h"
/**
*
* @author M.Donszelmann
*/
class StreamerHepRepAttribute : public virtual HEPREP::HepRepAttribute {
private:
HEPREP::HepRepWriter* streamer;
public:
StreamerHepRepAttribute(HEPREP::HepRepWriter* streamer);
~StreamerHepRepAttribute();
std::vector<HEPREP::HepRepAttValue*>* getAttValuesFromNode();
bool addAttValue(HEPREP::HepRepAttValue* hepRepAttValue);
bool addAttValue(std::string key, std::string value, int showLabel);
bool addAttValue(std::string key, int value, int showLabel);
bool addAttValue(std::string key, double value, int showLabel);
bool addAttValue(std::string key, bool value, int showLabel);
bool addAttValue(std::string key, std::vector<double> value, int showLabel);
bool addAttValue(std::string key, double red, double green, double blue, double alpha, int showLabel);
HEPREP::HepRepAttValue* getAttValueFromNode(std::string lowerCaseName);
HEPREP::HepRepAttValue* removeAttValue(std::string key);
HEPREP::HepRepAttValue* getAttValue(std::string name);
};
#endif
@@ -1,56 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef STREAMERHEPREPDEFINITION_H
#define STREAMERHEPREPDEFINITION_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRepDefinition.h"
#include "HEPREP/HepRepWriter.h"
#include "StreamerHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class StreamerHepRepDefinition : public StreamerHepRepAttribute, public virtual HEPREP::HepRepDefinition {
private:
HEPREP::HepRepWriter* streamer;
public:
StreamerHepRepDefinition(HEPREP::HepRepWriter* streamer);
~StreamerHepRepDefinition();
bool addAttDef(HEPREP::HepRepAttDef* hepRepAttDef);
bool addAttDef(std::string name, std::string desc, std::string type, std::string extra);
HEPREP::HepRepAttDef* getAttDef(std::string name);
std::vector<HEPREP::HepRepAttDef *>* getAttDefsFromNode();
HEPREP::HepRepAttDef* getAttDefFromNode(std::string lowerCaseName);
};
#endif
@@ -1,70 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef STREAMERHEPREPINSTANCE_H
#define STREAMERHEPREPINSTANCE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepAttValue.h"
#include "StreamerHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class StreamerHepRepInstance : public StreamerHepRepAttribute, public virtual HEPREP::HepRepInstance {
private:
void* parent;
HEPREP::HepRepType* type;
public:
StreamerHepRepInstance(HEPREP::HepRepWriter* streamer, HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
StreamerHepRepInstance(HEPREP::HepRepWriter* streamer, HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
~StreamerHepRepInstance();
HEPREP::HepRepInstance* copy(HEPREP::HepRep* heprep, HEPREP::HepRepInstance* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepInstance* copy(HEPREP::HepRep* heprep, HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepType* getType();
bool addPoint(HEPREP::HepRepPoint* point);
std::vector<HEPREP::HepRepPoint *>* getPoints();
bool addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance *>* getInstances();
HEPREP::HepRepAttValue* getAttValue(std::string name);
void *getParent() { return parent; }
};
#endif
@@ -1,64 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef STREAMERHEPREPINSTANCETREE_H
#define STREAMERHEPREPINSTANCETREE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepTreeID.h"
#include "DefaultHepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class StreamerHepRepInstanceTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepInstanceTree {
private:
HEPREP::HepRepWriter* streamer;
HEPREP::HepRepTreeID* typeTree;
public:
StreamerHepRepInstanceTree(HEPREP::HepRepWriter* streamer, std::string name, std::string version, HEPREP::HepRepTreeID* typeTree);
~StreamerHepRepInstanceTree();
HEPREP::HepRepInstanceTree* copy(HEPREP::HepRep* heprep, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepTreeID* copy();
bool addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance*>* getInstances();
bool addInstanceTree(HEPREP::HepRepTreeID* treeID);
HEPREP::HepRepTreeID* getTypeTree();
std::vector<HEPREP::HepRepInstanceTree*>* getInstanceTrees();
};
#endif
@@ -1,78 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef STREAMERHEPREPPOINT_H
#define STREAMERHEPREPPOINT_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepPoint.h"
#include "StreamerHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class StreamerHepRepPoint : public StreamerHepRepAttribute, public virtual HEPREP::HepRepPoint {
private:
HEPREP::HepRepInstance* instance;
protected:
double x, y, z;
public:
StreamerHepRepPoint(HEPREP::HepRepWriter* streamer, HEPREP::HepRepInstance* instance, double x, double y, double z);
~StreamerHepRepPoint();
HEPREP::HepRepInstance* getInstance();
HEPREP::HepRepAttValue* getAttValue(std::string lowerCaseName);
HEPREP::HepRepPoint* copy(HEPREP::HepRepInstance* parent);
double getX();
double getY();
double getZ();
std::vector<double>* getXYZ(std::vector<double>* xyz);
double getRho();
double getPhi();
double getTheta();
double getR();
double getEta();
double getX(double xVertex, double yVertex, double zVertex);
double getY(double xVertex, double yVertex, double zVertex);
double getZ(double xVertex, double yVertex, double zVertex);
double getRho(double xVertex, double yVertex, double zVertex);
double getPhi(double xVertex, double yVertex, double zVertex);
double getTheta(double xVertex, double yVertex, double zVertex);
double getR(double xVertex, double yVertex, double zVertex);
double getEta(double xVertex, double yVertex, double zVertex);
};
#endif
@@ -1,68 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef STREAMERHEPREPTYPE_H
#define STREAMERHEPREPTYPE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepWriter.h"
#include "StreamerHepRepDefinition.h"
/**
*
* @author M.Donszelmann
*/
class StreamerHepRepType : public StreamerHepRepDefinition, public virtual HEPREP::HepRepType {
private:
HEPREP::HepRepType* parent;
std::string name;
std::string description;
std::string infoURL;
public:
StreamerHepRepType(HEPREP::HepRepWriter* streamer, HEPREP::HepRepType* parent, std::string name);
~StreamerHepRepType();
HEPREP::HepRepType* getSuperType();
HEPREP::HepRepAttDef* getAttDef(std::string name);
HEPREP::HepRepAttValue* getAttValue(std::string name);
HEPREP::HepRepType* copy(HEPREP::HepRep* heprep, HEPREP::HepRepType* parent);
std::string getName();
std::string getDescription();
void setDescription(std::string description);
std::string getInfoURL();
void setInfoURL(std::string infoURL);
bool addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType*>* getTypes();
};
#endif
@@ -1,55 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef STREAMERHEPREPTYPETREE_H
#define STREAMERHEPREPTYPETREE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepTreeID.h"
#include "DefaultHepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class StreamerHepRepTypeTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepTypeTree {
public:
StreamerHepRepTypeTree(HEPREP::HepRepWriter* streamer, HEPREP::HepRepTreeID* typeTree);
~StreamerHepRepTypeTree();
HEPREP::HepRepTypeTree* copy(HEPREP::HepRep* heprep);
HEPREP::HepRepTreeID* copy();
bool addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType* >* getTypes();
};
#endif
@@ -1,80 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef XMLHEPREPSTREAMER_H
#define XMLHEPREPSTREAMER_H 1
#include "FreeHepTypes.h"
#include <iostream>
#include <string>
#include <stack>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepAttribute.h"
#include "XMLWriter.h"
/**
*
* @author M.Donszelmann
*/
class XMLHepRepStreamer : public XMLWriter, public virtual HEPREP::HepRepWriter {
private:
std::string nameSpace;
bool writtenLayers;
std::stack<void *> hepreps;
HEPREP::HepRep *heprep;
HEPREP::HepRepTypeTree *heprepTypeTree;
public:
XMLHepRepStreamer(std::ostream* out);
~XMLHepRepStreamer();
bool close();
bool write(HEPREP::HepRep* heprep);
bool write(HEPREP::HepRepTypeTree* typeTree);
bool write(HEPREP::HepRepType* type);
bool write(HEPREP::HepRepTreeID* treeID);
bool write(HEPREP::HepRepAction* action);
bool write(HEPREP::HepRepInstanceTree* instanceTree);
bool write(HEPREP::HepRepInstance* instance);
bool write(HEPREP::HepRepPoint* point);
bool write(HEPREP::HepRepAttribute* attribute);
bool write(HEPREP::HepRepDefinition* definition);
bool write(HEPREP::HepRepAttValue* attValue);
bool write(HEPREP::HepRepAttDef* attDef);
};
#endif
@@ -1,70 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef XMLHEPREPSTREAMERFACTORY_H
#define XMLHEPREPSTREAMERFACTORY_H 1
#include "FreeHepTypes.h"
#include <string>
#include <iostream>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
/**
*
* @author M.Donszelmann
*/
class XMLHepRepStreamerFactory : public virtual HEPREP::HepRepFactory {
private:
HEPREP::HepRepWriter* streamer;
public:
XMLHepRepStreamerFactory();
~XMLHepRepStreamerFactory();
// static HEPREP::HepRepFactory* create();
HEPREP::HepRepWriter* createHepRepWriter (std::ostream* out);
HEPREP::HepRepPoint* createHepRepPoint (HEPREP::HepRepInstance* instance,
double x, double y, double z);
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
HEPREP::HepRepTreeID* createHepRepTreeID (std::string name, std::string version, std::string qualifier = "top-level");
HEPREP::HepRepAction* createHepRepAction (std::string name, std::string expression);
HEPREP::HepRepInstanceTree* createHepRepInstanceTree (std::string name, std::string version,
HEPREP::HepRepTreeID* typeTreeID);
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepType* parent, std::string name);
HEPREP::HepRepTypeTree* createHepRepTypeTree (HEPREP::HepRepTreeID* treeID);
HEPREP::HepRep* createHepRep ();
};
#endif
@@ -1,27 +1,5 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef STREAMERHEPREP_H
#define STREAMERHEPREP_H 1
#ifndef DEFAULTHEPREP_H
#define DEFAULTHEPREP_H 1
#include "FreeHepTypes.h"
@@ -39,14 +17,16 @@
*
* @author M.Donszelmann
*/
class StreamerHepRep : public virtual HEPREP::HepRep {
class DefaultHepRep : public virtual HEPREP::HepRep {
private:
std::vector<std::string> layers;
std::vector<HEPREP::HepRepTypeTree*> typeTrees;
std::vector<HEPREP::HepRepInstanceTree*> instanceTrees;
public:
StreamerHepRep(HEPREP::HepRepWriter* streamer);
~StreamerHepRep();
DefaultHepRep();
~DefaultHepRep();
HEPREP::HepRep* copy(HEPREP::HepRepSelectFilter* filter);
std::vector<std::string>* getLayerOrder();
@@ -57,6 +37,7 @@ class StreamerHepRep : public virtual HEPREP::HepRep {
std::vector<HEPREP::HepRepTypeTree*>* getTypeTrees();
HEPREP::HepRepType* getType(std::string name);
bool addInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
void overlayInstanceTree(HEPREP::HepRepInstanceTree * instanceTree);
void removeInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
HEPREP::HepRepInstanceTree* getInstanceTreeTop(std::string name, std::string version);
HEPREP::HepRepInstanceTree* getInstances(std::string name, std::string version,
@@ -0,0 +1,29 @@
#ifndef DEFAULTHEPREPACTION_H
#define DEFAULTHEPREPACTION_H 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepAction.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepAction : public virtual HEPREP::HepRepAction {
private:
std::string name;
std::string expression;
public:
DefaultHepRepAction(std::string name, std::string expression);
~DefaultHepRepAction();
std::string getName();
std::string getExpression();
HEPREP::HepRepAction* copy();
};
#endif
@@ -0,0 +1,32 @@
#ifndef DEFAULTHEPREPATTDEF_H
#define DEFAULTHEPREPATTDEF_H 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepAttDef.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepAttDef : public virtual HEPREP::HepRepAttDef {
private:
std::string name, desc, category, extra;
public:
DefaultHepRepAttDef(std::string name, std::string desc, std::string category, std::string extra);
~DefaultHepRepAttDef();
HEPREP::HepRepAttDef* copy();
std::string getName();
std::string getLowerCaseName();
std::string getDescription();
std::string getCategory();
std::string getExtra();
};
#endif
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef DEFAULTHEPREPATTVALUE_H
#define DEFAULTHEPREPATTVALUE_H 1
@@ -71,6 +49,7 @@ class DefaultHepRepAttValue : public virtual HEPREP::HepRepAttValue {
std::string getTypeName();
int showLabel();
std::string getString();
std::string getLowerCaseString();
long getLong();
int getInteger();
double getDouble();
@@ -0,0 +1,44 @@
#ifndef DEFAULTHEPREPATTRIBUTE_H
#define DEFAULTHEPREPATTRIBUTE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <map>
#include <vector>
#include "HEPREP/HepRepAttribute.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepConstants.h"
#include "HEPREP/HepRepWriter.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepAttribute : public virtual HEPREP::HepRepAttribute {
private:
std::map<std::string, HEPREP::HepRepAttValue*> attValues;
std::vector<HEPREP::HepRepAttValue*> attList;
public:
DefaultHepRepAttribute();
~DefaultHepRepAttribute();
std::vector<HEPREP::HepRepAttValue*>* getAttValuesFromNode();
bool addAttValue(HEPREP::HepRepAttValue* hepRepAttValue);
bool addAttValue(std::string key, char *value, int showLabel);
bool addAttValue(std::string key, std::string value, int showLabel);
bool addAttValue(std::string key, int value, int showLabel);
bool addAttValue(std::string key, double value, int showLabel);
bool addAttValue(std::string key, bool value, int showLabel);
bool addAttValue(std::string key, std::vector<double> value, int showLabel);
bool addAttValue(std::string key, double red, double green, double blue, double alpha, int showLabel);
HEPREP::HepRepAttValue* getAttValueFromNode(std::string lowerCaseName);
HEPREP::HepRepAttValue* removeAttValue(std::string key);
HEPREP::HepRepAttValue* getAttValue(std::string name) = 0;
};
#endif
@@ -0,0 +1,37 @@
#ifndef DEFAULTHEPREPDEFINITION_H
#define DEFAULTHEPREPDEFINITION_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRepDefinition.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepDefinition : public DefaultHepRepAttribute, public virtual HEPREP::HepRepDefinition {
private:
std::map<std::string, HEPREP::HepRepAttDef*> attDefs;
std::vector<HEPREP::HepRepAttDef*> attList;
public:
DefaultHepRepDefinition();
~DefaultHepRepDefinition();
bool addAttDef(HEPREP::HepRepAttDef* hepRepAttDef);
bool addAttDef(std::string name, std::string desc, std::string type, std::string extra);
std::vector<HEPREP::HepRepAttDef *>* getAttDefsFromNode();
HEPREP::HepRepAttDef* getAttDefFromNode(std::string lowerCaseName);
HEPREP::HepRepAttDef* getAttDef(std::string name) = 0;
HEPREP::HepRepAttValue* getAttValue(std::string name) = 0;
};
#endif
@@ -0,0 +1,48 @@
#ifndef DEFAULTHEPREPFACTORY_H
#define DEFAULTHEPREPFACTORY_H 1
#include "FreeHepTypes.h"
#include <string>
#include <iostream>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepReader.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepFactory : public virtual HEPREP::HepRepFactory {
public:
DefaultHepRepFactory();
~DefaultHepRepFactory();
// static HEPREP::HepRepFactory* create();
HEPREP::HepRepReader* createHepRepReader (std::istream* in);
HEPREP::HepRepReader* createHepRepReader (std::string filename);
HEPREP::HepRepWriter* createHepRepWriter (std::ostream* out, bool randomAccess, bool compress);
HEPREP::HepRepPoint* createHepRepPoint (HEPREP::HepRepInstance* instance,
double x, double y, double z);
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
HEPREP::HepRepTreeID* createHepRepTreeID (std::string name, std::string version, std::string qualifier = "top-level");
HEPREP::HepRepAction* createHepRepAction (std::string name, std::string expression);
HEPREP::HepRepInstanceTree* createHepRepInstanceTree (std::string name, std::string version,
HEPREP::HepRepTreeID* typeTreeID);
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepType* parent, std::string name);
HEPREP::HepRepTypeTree* createHepRepTypeTree (HEPREP::HepRepTreeID* treeID);
HEPREP::HepRep* createHepRep ();
};
#endif
@@ -0,0 +1,52 @@
#ifndef DEFAULTHEPREPINSTANCE_H
#define DEFAULTHEPREPINSTANCE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepAttValue.h"
#include "DefaultHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepInstance : public DefaultHepRepAttribute, public virtual HEPREP::HepRepInstance {
private:
void* parent;
HEPREP::HepRepType* type;
std::vector<HEPREP::HepRepPoint*> points;
std::vector<HEPREP::HepRepInstance*> instances;
public:
DefaultHepRepInstance(HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
DefaultHepRepInstance(HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
~DefaultHepRepInstance();
void overlay(HEPREP::HepRepInstance * instance);
HEPREP::HepRepInstance* copy(HEPREP::HepRep* heprep, HEPREP::HepRepInstance* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepInstance* copy(HEPREP::HepRep* heprep, HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepType* getType();
bool addPoint(HEPREP::HepRepPoint* point);
std::vector<HEPREP::HepRepPoint *>* getPoints();
bool addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance *>* getInstances();
HEPREP::HepRepAttValue* getAttValue(std::string name);
void *getParent() { return parent; }
};
#endif
@@ -0,0 +1,44 @@
#ifndef DEFAULTHEPREPINSTANCETREE_H
#define DEFAULTHEPREPINSTANCETREE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepTreeID.h"
#include "DefaultHepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepInstanceTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepInstanceTree {
private:
HEPREP::HepRepTreeID* typeTree;
std::vector<HEPREP::HepRepInstance*> instances;
std::vector<HEPREP::HepRepTreeID*> instanceTrees;
public:
DefaultHepRepInstanceTree(std::string name, std::string version, HEPREP::HepRepTreeID* typeTree);
~DefaultHepRepInstanceTree();
void overlay(HEPREP::HepRepInstanceTree * instanceTree);
HEPREP::HepRepInstanceTree* copy(HEPREP::HepRep* heprep, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepTreeID* copy();
bool addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance*>* getInstances();
bool addInstanceTree(HEPREP::HepRepTreeID* treeID);
HEPREP::HepRepTreeID* getTypeTree();
std::vector<HEPREP::HepRepTreeID*>* getInstanceTrees();
};
#endif
@@ -0,0 +1,56 @@
#ifndef DEFAULTHEPREPPOINT_H
#define DEFAULTHEPREPPOINT_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepPoint.h"
#include "DefaultHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepPoint : public DefaultHepRepAttribute, public virtual HEPREP::HepRepPoint {
private:
HEPREP::HepRepInstance* instance;
protected:
double x, y, z;
public:
DefaultHepRepPoint(HEPREP::HepRepInstance* instance, double x, double y, double z);
~DefaultHepRepPoint();
HEPREP::HepRepInstance* getInstance();
HEPREP::HepRepAttValue* getAttValue(std::string lowerCaseName);
HEPREP::HepRepPoint* copy(HEPREP::HepRepInstance* parent);
double getX();
double getY();
double getZ();
std::vector<double>* getXYZ(std::vector<double>* xyz);
double getRho();
double getPhi();
double getTheta();
double getR();
double getEta();
double getX(double xVertex, double yVertex, double zVertex);
double getY(double xVertex, double yVertex, double zVertex);
double getZ(double xVertex, double yVertex, double zVertex);
double getRho(double xVertex, double yVertex, double zVertex);
double getPhi(double xVertex, double yVertex, double zVertex);
double getTheta(double xVertex, double yVertex, double zVertex);
double getR(double xVertex, double yVertex, double zVertex);
double getEta(double xVertex, double yVertex, double zVertex);
};
#endif
@@ -0,0 +1,33 @@
#ifndef DEFAULTHEPREPTREEID_H
#define DEFAULTHEPREPTREEID_H 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepTreeID : public virtual HEPREP::HepRepTreeID {
private:
std::string name;
std::string version;
std::string qualifier;
public:
DefaultHepRepTreeID(std::string name, std::string version, std::string qualifier = "top_level");
~DefaultHepRepTreeID();
std::string getQualifier();
void setQualifier(std::string qualifier);
std::string getName();
std::string getVersion();
HEPREP::HepRepTreeID* copy();
};
#endif
@@ -0,0 +1,48 @@
#ifndef DEFAULTHEPREPTYPE_H
#define DEFAULTHEPREPTYPE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepDefinition.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepType : public DefaultHepRepDefinition, public virtual HEPREP::HepRepType {
private:
HEPREP::HepRepType* parent;
std::vector<HEPREP::HepRepType*> types;
std::string name;
std::string description;
std::string infoURL;
public:
DefaultHepRepType(HEPREP::HepRepType* parent, std::string name);
~DefaultHepRepType();
HEPREP::HepRepType* getSuperType();
HEPREP::HepRepAttDef* getAttDef(std::string name);
HEPREP::HepRepAttValue* getAttValue(std::string name);
HEPREP::HepRepType* copy(HEPREP::HepRep* heprep, HEPREP::HepRepType* parent);
std::string getName();
std::string getFullName();
std::string getDescription();
void setDescription(std::string description);
std::string getInfoURL();
void setInfoURL(std::string infoURL);
bool addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType*>* getTypes();
};
#endif
@@ -0,0 +1,36 @@
#ifndef DEFAULTHEPREPTYPETREE_H
#define DEFAULTHEPREPTYPETREE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepTreeID.h"
#include "DefaultHepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepTypeTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepTypeTree {
private:
std::vector<HEPREP::HepRepType*> types;
public:
DefaultHepRepTypeTree(HEPREP::HepRepTreeID* typeTree);
~DefaultHepRepTypeTree();
HEPREP::HepRepTypeTree* copy(HEPREP::HepRep* heprep);
HEPREP::HepRepTreeID* copy();
bool addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType* >* getTypes();
};
#endif
@@ -0,0 +1,14 @@
#ifndef FREEHEPTYPES_H
#define FREEHEPTYPES_H
#ifdef WIN32
#ifndef GNU_GCC
// Disable warning C4786: identifier was truncated to '255' characters in the debug information
#pragma warning ( disable : 4786 )
// Disable warning C4250: inherits via dominance
#pragma warning ( disable : 4250 )
#endif
#endif
#endif
@@ -0,0 +1,48 @@
#ifndef INDENTPRINTWRITER_H
#define INDENTPRINTWRITER_H 1
#include "FreeHepTypes.h"
#include <iostream>
#include <string>
/**
* A PrintWriter that keeps track of an indentation level
* and indents the output appropriately.
*
* <b>Warning:</b> Only print and println methods taking strings have been overriden,
* print, println methods taking other arguments may not be indented properly.
*
* @author Mark Donszelmann
*/
class IndentPrintWriter {
public:
IndentPrintWriter(std::ostream* out, int level = 0);
virtual ~IndentPrintWriter();
void close();
IndentPrintWriter& operator<< (const std::string & s);
IndentPrintWriter& operator<< (std::ostream& (*pf)(std::ostream&));
void println(const std::string & s);
void print(const std::string & s);
void println();
void indent();
void outdent();
int getIndent() const;
void setIndent(const int level);
std::string getIndentString() const;
void setIndentString(const std::string & indentString);
private:
void doIndent();
std::ostream* out;
bool closed;
int indentLevel;
bool indented;
std::string indentString;
};
#endif
@@ -0,0 +1,27 @@
#ifndef XMLHEPREPFACTORY_H
#define XMLHEPREPFACTORY_H 1
#include <string>
#include <iostream>
#include "HEPREP/HepRepReader.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepFactory.h"
/**
*
* @author M.Donszelmann
*/
class XMLHepRepFactory : public DefaultHepRepFactory {
public:
XMLHepRepFactory();
~XMLHepRepFactory();
HEPREP::HepRepReader* createHepRepReader (std::istream* in);
HEPREP::HepRepReader* createHepRepReader (std::string filename);
HEPREP::HepRepWriter* createHepRepWriter (std::ostream* out, bool randomAccess, bool compress);
};
#endif
@@ -0,0 +1,62 @@
#ifndef XMLHEPREPWRITER_H
#define XMLHEPREPWRITER_H 1
#include "FreeHepTypes.h"
#include <iostream>
#include <string>
#include <stack>
#include <vector>
#include "zipios++/zipoutputstream.h"
#include "zipios++/gzipoutputstream.h"
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepAttribute.h"
#include "XMLWriter.h"
/**
*
* @author M.Donszelmann
*/
class XMLHepRepWriter : public virtual HEPREP::HepRepWriter {
private:
std::string nameSpace;
XMLWriter *xml;
zipios::ZipOutputStream *zip;
zipios::GZIPOutputStream *gz;
public:
XMLHepRepWriter(std::ostream* out, bool randomAccess, bool compress);
~XMLHepRepWriter();
bool close();
bool write(HEPREP::HepRep* heprep, std::string name);
bool write(std::vector<std::string> *layers);
bool write(HEPREP::HepRepTypeTree* typeTree);
bool write(HEPREP::HepRepType* type);
bool write(HEPREP::HepRepTreeID* treeID);
bool write(HEPREP::HepRepAction* action);
bool write(HEPREP::HepRepInstanceTree* instanceTree);
bool write(HEPREP::HepRepInstance* instance);
bool write(HEPREP::HepRepPoint* point);
bool write(HEPREP::HepRepAttribute* attribute);
bool write(HEPREP::HepRepDefinition* definition);
bool write(HEPREP::HepRepAttValue* attValue);
bool write(HEPREP::HepRepAttDef* attDef);
};
#endif
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef XMLWRITER_H
#define XMLWRITER_H 1
@@ -48,8 +26,9 @@ class XMLWriter {
void openDoc(std::string version = "1.0", std::string encoding = "", bool standalone = false);
void referToDTD(std::string name, std::string pid, std::string ref);
void referToDTD(std::string name, std::string system);
void closeDoc();
void closeDoc(bool force = false);
void printComment(std::string comment);
void printPlain(std::string text);
void print(std::string text);
void println(std::string text);
void openTag(std::string ns, std::string name);
@@ -72,7 +51,7 @@ class XMLWriter {
std::string defaultNameSpace;
private:
std::string* dtdName;
std::string dtdName;
std::map<std::string, std::string> attributes;
std::stack<std::string> openTags;
};
@@ -0,0 +1,21 @@
Mark Donszelmann - 07/07/2003
=============================
Files renamed from .cpp to .cc
=====================================================
Main author: Thomas Sondergaard (thomass@deltadata.dk)
FreeBSD port maintainer: Ying-Chieh Liao (ijliao@csie.nctu.edu.tw)
The files zipios++/directory.h and zipios++/directory.cpp originate
from the dir_it library written by Dietmar Kuehl (it's available for
download at http://www.boost.org)
zipios++.spec contributed by Rui Miguel Silva Seabra
libtool/shared library patch contributed by Arkadiusz Miskiewicz (arekm)
Russel Winder (r.winder@180sw.com) did the work of amending the code to
so as to work with GCC 3.2.1.
Ross Burton (r.burton@180sw.com) transformed zipios++.spec into
zipios++.spec.in and made it more RedHat tradition conformant.
@@ -0,0 +1,515 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
^L
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
^L
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
^L
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
^L
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
^L
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
^L
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
^L
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
^L
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
<one line to give the library's name and a brief idea of what it
does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper
mail.
You should also get your employer (if you work as a programmer) or
your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -0,0 +1,117 @@
#ifndef BACKBUFFER_H
#define BACKBUFFER_H
#include "zipios++/zipios-config.h"
#include <algorithm>
#include "zipios++/meta-iostreams.h"
#include <vector>
#include "zipios++/fcollexceptions.h"
#include "zipios++/ziphead.h"
#include "zipios++/zipheadio.h"
#include "zipios++/virtualseeker.h"
#include "zipios_common.h"
namespace zipios {
using std::ios ;
using std::cerr ;
using std::endl ;
/** A BackBuffer instance is useful for reading the last part of a
file in an efficient manner, when it is not known exactly how far
back (towards the front!) to go, to find the start of the desired
data block. BackBuffer is a vector< unsigned char > that fills
itself with data from a file by reading chunks from the end of the
file progressing towards the start. Upon construction the
BackBuffer instance is associated with a file and a chunksize can
be specified. To read a chunk of the file into the BackBuffer call
readChunk(). */
class BackBuffer : public vector< unsigned char > {
public:
/** BackBuffer constructor.
@param is The istream to read the data from. The stream must be seekable,
as BackBuffer will reposition the file position to read chunks from the back
of the file.
@param chunk_size specifies the size of the chunks to read the file into
the BackBuffer in.
@throw FCollException Thrown if the VirtualSeeker vs that has been specified is
invalid for the istream is. */
inline explicit BackBuffer( istream &is, VirtualSeeker vs = VirtualSeeker(),
int chunk_size = 1024 ) ;
/** Reads another chunk and returns the size of the chunk that has
been read. Returns 0 on I/O failure.
@param read_pointer When a new chunk is read in the already
stored bytes change position in the BackBuffer. read_pointer is
assumed by readChunk() to be a pointer into a position in the
BackBuffer, and is updated to point to the same position in the file
as it pointed to before the new chunk was read. */
inline int readChunk( int &read_pointer ) ;
private:
VirtualSeeker _vs ;
int _chunk_size ;
istream &_is ;
streampos _file_pos ;
};
BackBuffer::BackBuffer( istream &is, VirtualSeeker vs, int chunk_size )
: _vs ( vs ),
_chunk_size( chunk_size ),
_is ( is )
{
_vs.vseekg( is, 0, ios::end ) ;
_file_pos = _vs.vtellg( is ) ;
// Only happens if _vs.startOffset() is a position
// in the file that lies after _vs.endOffset(), which
// is clearly not a valid situation.
if ( _file_pos < 0 )
throw FCollException( "Invalid virtual file endings" ) ;
}
int BackBuffer::readChunk( int &read_pointer ) {
// Update chunk_size and file position
_chunk_size = min<int> ( static_cast< int >( _file_pos ), _chunk_size ) ;
_file_pos -= _chunk_size ;
_vs.vseekg( _is, _file_pos, ios::beg ) ;
// Make space for _chunk_size new bytes first in buffer
insert ( begin(), _chunk_size, static_cast< char > ( 0 ) ) ;
// Read in the next _chunk_size of bytes
readByteSeq ( _is, &( (*this)[ 0 ] ), _chunk_size ) ;
read_pointer += _chunk_size ;
if ( _is.good() )
return _chunk_size ;
else
return 0 ;
}
}
#endif
/** \file
The header file for BackBuffer
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,87 @@
#ifndef BASICENTRY_H
#define BASICENTRY_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include "zipios++/fcollexceptions.h"
#include "zipios++/fileentry.h"
#include "zipios++/filepath.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
/** BasicEntry is a FileEntry that is suitable as a base class for
basic entries, that e.g. do not support any form of compression */
class BasicEntry : public FileEntry {
public:
/** Constructor.
@param filename the filename of the entry.
@param comment a comment for the entry.
*/
explicit BasicEntry( const string &filename, const string &comment,
const FilePath &basepath = FilePath() ) ;
virtual string getComment() const ;
virtual uint32 getCompressedSize() const ;
virtual uint32 getCrc() const ;
virtual vector< unsigned char > getExtra() const ;
virtual StorageMethod getMethod() const ;
virtual string getName() const ;
virtual string getFileName() const ;
virtual uint32 getSize() const ;
virtual int getTime() const ;
virtual bool isValid() const ;
// virtual int hashCode() const ;
virtual bool isDirectory() const ;
virtual void setComment( const string &comment ) ;
virtual void setCompressedSize( uint32 size ) ;
virtual void setCrc( uint32 crc ) ;
virtual void setExtra( const vector< unsigned char > &extra ) ;
virtual void setMethod( StorageMethod method ) ;
virtual void setName( const string &name ) ;
virtual void setSize( uint32 size ) ;
virtual void setTime( int time ) ;
virtual string toString() const ;
virtual FileEntry *clone() const ;
virtual ~BasicEntry() ;
protected:
string _filename ;
string _comment ;
int _size ;
bool _valid ;
FilePath _basepath ;
};
}
#endif
/** \file
Header file that defines BasicEntry.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,174 @@
#ifndef COLLCOLL_H
#define COLLCOLL_H
#include "zipios++/zipios-config.h"
#include <string>
#include <vector>
#include "zipios++/fcoll.h"
namespace zipios {
using std::string ;
/** \anchor collcoll_anchor
CollectionCollection is a FileCollection that consists of an
arbitrary number of FileCollections. With a CollectionCollection
the user can use multiple FileCollections transparently, making it
easy for a program to keep some of its files in a zip archive and
others stored in ordinary files. CollectionCollection can be used
to create a simple virtual filesystem, where all collections are
mounted in /. If more than one collection contain a file with
the same path only the one in the first added collection will
be accessible.
*/
class CollectionCollection : public FileCollection {
public:
/** \anchor collcoll_inst_anchor
This static method provides a singleton instance of a CollectionCollection.
The instance is instantiated the first time the method is called.
@return A pointer to a singleton CollectionCollection instance.
*/
static inline CollectionCollection &inst() ;
/** Constructor.
*/
explicit CollectionCollection() ;
/** Copy constructor. */
inline CollectionCollection( const CollectionCollection &src ) ;
/** Copy assignment operator. */
inline const CollectionCollection &operator= ( const CollectionCollection &src ) ;
/** \anchor collcoll_addcoll_anchor
Adds a collection.
@param collection The collection to add.
@return true if the collection was added succesfully and
the added collection is valid.
*/
bool addCollection( const FileCollection &collection ) ;
/** Adds the collection pointed to by collection. The CollectionCollection
will call delete on the pointer when it is destructed, so the caller
should make absolutely sure to only pass in a collection created with new
and be sure to leave it alone after adding it. If the collection is not
added false is returned and the caller remains responsible for the
collection pointed to by collection.
@param collection A pointer to the collection to add.
@return true if the collection was added succesfully and
the added collection is valid. */
bool addCollection( FileCollection *collection ) ;
virtual void close() ;
virtual ConstEntries entries() const ;
virtual ConstEntryPointer getEntry( const string &name,
MatchPath matchpath = MATCH ) const ;
virtual istream *getInputStream( const ConstEntryPointer &entry ) ;
virtual istream *getInputStream( const string &entry_name,
MatchPath matchpath = MATCH ) ;
/** Returns the number in entries in all collections kept by
the CollectionCollection object */
virtual int size() const ;
virtual FileCollection *clone() const ;
virtual ~CollectionCollection() ;
protected:
/** A protected getEntry member function, that not only
finds an entry that match the name, if such an entry exists
in the collection, it also returns, which collection it was found
in.
*/
void getEntry( const string &name,
ConstEntryPointer &cep,
std::vector< FileCollection * >::const_iterator &it,
MatchPath matchpath = MATCH ) const ;
vector< FileCollection * > _collections ;
private:
static CollectionCollection *_inst ;
};
/** Shortcut name for a CollectionCollection. If the static method
inst is used, it is often used a lot, so it's handy with a short name for
CollectionCollection */
typedef CollectionCollection CColl ;
//
// Inline (member) functions
//
CollectionCollection &CollectionCollection::inst() {
if( _inst != 0 )
return *_inst ;
else
return *( _inst = new CollectionCollection ) ;
}
CollectionCollection::CollectionCollection( const CollectionCollection &src )
: FileCollection( src )
{
_collections.reserve( src._collections.size() ) ;
std::vector< FileCollection * >::const_iterator it ;
for ( it = src._collections.begin() ; it != src._collections.end() ; ++it )
_collections.push_back( (*it)->clone() ) ;
}
const CollectionCollection &
CollectionCollection::operator= ( const CollectionCollection &src ) {
this->FileCollection::operator=( src ) ;
// FileCollection::=( static_cast< FileCollection >( src ) ) ;
if ( this != &src ) {
// Destroy current contents.
std::vector< FileCollection * >::const_iterator it ;
for ( it = _collections.begin() ; it != _collections.end() ; ++it )
delete *it ;
// Then copy src's content.
_collections.clear() ;
_collections.reserve( src._collections.size() ) ;
for ( it = src._collections.begin() ; it != src._collections.end() ; ++it )
_collections.push_back( (*it)->clone() ) ;
}
return *this ;
}
} // namespace
#endif
/** \file
Header file that defines CollectionCollection.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,109 @@
#ifndef DEFLATEOUTPUTSTREAMBUF_H
#define DEFLATEOUTPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <vector>
#include <zlib.h>
#include "zipios++/filteroutputstreambuf.h"
#include "zipios++/ziphead.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
using std::vector ;
/** DeflateOutputStreambuf is an output stream filter, that deflates
the data that is written to it before it passes it on to the
output stream it is attached to. Deflation/Inflation is a
compression/decompression method used in gzip and zip. The zlib
library is used to perform the actual deflation, this class only
wraps the functionality in an output stream filter. */
class DeflateOutputStreambuf : public FilterOutputStreambuf {
public:
/** DeflateOutputStreambuf constructor.
@param outbuf the streambuf to use for output.
@param user_init If false user must invoke init() before writing any data.
(ZipOutputStreambuf needs to do this)
@param del_outbuf if true is specified outbuf will be deleted, when
the DeflateOutputStreambuf is destructed. */
explicit DeflateOutputStreambuf( streambuf *outbuf, bool user_init = false,
bool del_outbuf = false ) ;
/** Destructor. */
virtual ~DeflateOutputStreambuf() ;
bool init( int comp_level = 6 ) ;
bool closeStream() ;
/** Returns the CRC32 for the current stream. The returned value is
the CRC for the data that has been compressed already (due to a
call to overflow()). As DeflateOutputStreambuf may buffer an
arbitrary amount of bytes until closeStream() has been invoked,
the returned value is not very useful before closeStream() has
been called. */
uint32 getCrc32() const { return _crc32 ; }
/** Returns the number of bytes written to the streambuf, that has
been processed from the input buffer by the compressor. After
closeStream() has been called this number is the total number of
bytes written to the stream. */
uint32 getCount() const { return _overflown_bytes ; }
protected:
virtual int overflow( int c = EOF ) ;
virtual int sync() ;
/** Flushes _outvec and updates _zs.next_out and _zs.avail_out. */
bool flushOutvec() ;
/** Flushes the remaining data in the zlib buffers, after which the
only possible operations are deflateEnd() or deflateReset(). */
void endDeflation() ;
private:
z_stream _zs ;
bool _zs_initialized ;
protected: // FIXME: reconsider design?
const int _invecsize ;
vector< char > _invec ;
const int _outvecsize ;
vector< char > _outvec ;
uint32 _crc32 ;
uint32 _overflown_bytes ;
};
} // namespace
#endif
/** \file
Header file that defines DeflateOutputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,93 @@
#ifndef DIRCOLL_H
#define DIRCOLL_H
#include "zipios++/zipios-config.h"
#include "zipios++/fcoll.h"
#include "zipios++/basicentry.h"
#include "zipios++/filepath.h"
namespace zipios {
/** DirEntry is a BasicEntry. */
typedef BasicEntry DirEntry ;
/** \anchor dircol_anchor
DirectoryCollection is a FileCollection that obtains its entries
from a directory. */
class DirectoryCollection : public FileCollection {
public:
/** Default Constructor. */
explicit DirectoryCollection()
: _entries_loaded( false ), _recursive( true ) {}
/** Constructor.
@param path A directory path name. If the name is not a valid
directory the created DirectoryCollection will be invalid.
@param load_now Load directory into memory now. Otherwise it will
be done when it is first needed.
*/
explicit DirectoryCollection( const string &path,
bool recursive = true,
bool load_now = false ) ;
/* Default Copy constructor and copy assignment operator are sufficient. */
virtual void close() ;
virtual ConstEntries entries() const ;
virtual ConstEntryPointer getEntry( const string &name,
MatchPath matchpath = MATCH ) const ;
virtual istream *getInputStream( const ConstEntryPointer &entry ) ;
virtual istream *getInputStream( const string &entry_name,
MatchPath matchpath = MATCH ) ;
virtual int size() const ;
virtual FileCollection *clone() const ;
/** Destructor. */
virtual ~DirectoryCollection() ;
protected:
mutable bool _entries_loaded ;
bool _recursive ; // recurse into subdirs.
FilePath _filepath ;
void loadEntries() const ;
void load( bool recursive, const FilePath &subdir = FilePath() ) ;
};
} // namespace
#endif
/** \file
Header file that defines DirectoryCollection.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,307 @@
#ifndef fcoll_H
#define fcoll_H
#include "zipios++/zipios-config.h"
#include <vector>
#include <string>
#include "zipios++/fcollexceptions.h"
#include "zipios++/fileentry.h"
namespace zipios {
using std::vector;
/** \anchor fcoll_anchor
FileCollection is an abstract baseclass that represents a
collection of files. The specializations of FileCollection
represents different origins of file collections, such as
directories, simple filename lists and compressed archives. */
class FileCollection {
public:
/** FileCollection constructor. */
explicit FileCollection()
: _filename( "-" ),
_entries ( 0 ),
_valid ( false ) {}
/** Copy constructor. */
inline FileCollection( const FileCollection &src ) ;
/** Copy assignment operator. */
inline const FileCollection &operator= ( const FileCollection &src ) ;
/** Closes the FileCollection. */
virtual void close() = 0 ;
/** \anchor fcoll_entries_anchor
Returns a vector of const pointers to the entries in the
FileCollection.
@return a ConstEntries
containing the entries of the FileCollection.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual ConstEntries entries() const ;
enum MatchPath { IGNORE, MATCH } ;
/** \anchor fcoll_getentry_anchor
Returns a ConstEntryPointer to a FileEntry object for the entry
with the specified name. To ignore the path part of the filename in search of a
match, specify FileCollection::IGNORE as the second argument.
@param name A string containing the name of the entry to get.
@param matchpath Speficy MATCH, if the path should match as well,
specify IGNORE, if the path should be ignored.
@return A ConstEntryPointer to the found entry. The returned pointer
equals zero if no entry is found.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual ConstEntryPointer getEntry( const string &name,
MatchPath matchpath = MATCH ) const ;
/** \anchor fcoll_getinputstream
Returns a pointer to an opened istream for the specified
FileEntry. It is the callers responsibility to delete the stream
when he is done with it. Returns 0, if there is no such
FileEntry in the FileCollection.
@param entry A ConstEntryPointer to the FileEntry to get an istream to.
@return an open istream for the specified entry. The istream is allocated on
heap and it is the users responsibility to delete it when he is done with it.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual istream *getInputStream( const ConstEntryPointer &entry ) = 0 ;
/** Returns a pointer to an opened istream for the specified
entry name. It is the callers responsibility to delete the stream
when he is done with it. Returns 0, if there is no entry with the specified
name in the FileCollection.
@param matchpath Speficy MATCH, if the path should match as well,
specify IGNORE, if the path should be ignored.
@return an open istream for the specified entry. The istream is allocated on
heap and it is the users responsibility to delete it when he is done with it.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual istream *getInputStream( const string &entry_name,
MatchPath matchpath = MATCH ) = 0 ;
/** Returns the name of the FileCollection.
@return the name of the FileCollection.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual string getName() const ;
/** Returns the number of entries in the FileCollection.
@return the number of entries in the FileCollection.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual int size() const ;
/** The member function returns true if the collection is valid.
@return true if the collection is valid.
*/
bool isValid() const { return _valid ; }
/** Create a heap allocated clone of the object this method is called for. The
caller is responsible for deallocating the clone when he is done with it.
@return A heap allocated copy of the object this method is called for.
*/
virtual FileCollection *clone() const = 0 ;
/** FileCollection destructor. */
virtual ~FileCollection () ;
protected:
string _filename ;
Entries _entries ;
bool _valid ;
};
//
// Inline methods
//
FileCollection::FileCollection( const FileCollection &src )
: _filename( src._filename ),
_valid ( src._valid )
{
_entries.reserve( src._entries.size() ) ;
Entries::const_iterator it ;
for ( it = src._entries.begin() ; it != src._entries.end() ; ++it )
_entries.push_back( (*it)->clone() ) ;
}
const FileCollection &FileCollection::operator= ( const FileCollection &src ) {
if ( this != &src ) {
_filename = src._filename ;
_valid = src._valid ;
_entries.clear() ;
_entries.reserve( src._entries.size() ) ;
Entries::const_iterator it ;
for ( it = src._entries.begin() ; it != src._entries.end() ; ++it )
_entries.push_back( (*it)->clone() ) ;
}
return *this ;
}
inline ostream & operator<< (ostream &os, const FileCollection& collection) {
os << "collection '" << collection.getName() << "' {" ;
ConstEntries entries = collection.entries();
ConstEntries::const_iterator it;
bool isFirst=true;
for (it=entries.begin(); it != entries.end(); ++it) {
if(! isFirst)
os << ", ";
isFirst = false;
os << (*it)->getName();
}
os << "}";
return os;
}
} // namespace
#endif
/**
\mainpage Zipios++
\image html zipios++.jpg
\image latex zipios++.eps width=10cm
\section intro Introduction
Zipios++ is a java.util.zip-like C++ library for reading and
writing Zip files. Access to individual entries is provided through
standard C++ iostreams. A simple read-only virtual file system that
mounts regular directories and zip files is also provided.
The source code is released under the <A
HREF="http://www.gnu.org/copyleft/lesser.html">GNU Lesser General Public
License</A>.
\section status Status
Spanned archives are not supported, and support is not planned.
The library has been tested and appears to be working with
<UL>
<LI><A HREF="http://www.freebsd.org/ports/archivers.html#zipios++-0.1.5">FreeBSD stable and current / gcc 2.95.3</A></LI>
<LI>Red Hat Linux release 7.0 / gcc 2.96</LI>
<LI>Red Hat Linux release 6.2 (Zoot) / egcs-2.91.66</LI>
<LI>Linux Mandrake release 7.0 (Air) / gcc 2.95.2</LI>
<LI>SGI IRIX64 6.5 / gcc 2.95.2</LI>
<LI>SGI IRIX64 6.5 / MIPSpro Compilers: Version 7.30</LI>
</UL>
If you are aware of any other platforms that Zipios++ works on,
please let me know (thomass@deltadata.dk).
\section documentation Documentation
This web page is the front page to the library documentation which
is generated from the source files using <A
HREF="http://www.stack.nl/~dimitri/doxygen/index.html">Doxygen</A>. Use
the links at the top of the page to browse the API
documentation. The documentation is also available in
a printer-friendly format <A HREF="refman.pdf">[pdf]</A>.
\subsection zipfiles Zip file access
The two most important classes are \ref zipfile_anchor "ZipFile" and
\ref ZipInputStream_anchor "ZipInputStream". ZipInputStream is an istream
for reading zipfiles. It can be instantiated directly, without the
use of ZipFile. A new ZipInputStream reads from the first entry, and
the user can skip to the next entry by calling
\ref ZipInputStream_getnextentry_anchor "ZipInputStream::getNextEntry()".
ZipFile scans the central directory of a zipfile and provides an
interface to access that directory. The user may search for entries
with a particular filename using \ref fcoll_getentry_anchor "ZipFile::getEntry()",
or simply get the complete list of entries
with \ref fcoll_entries_anchor "ZipFile::entries()". To get an
istream (ZipInputStream) to a particular entry simply use
\ref fcoll_getinputstream "ZipFile::getInputStream()".
\ref example_zip_anchor "example_zip.cpp" demonstrates the central
elements of Zipios++.
A Zip file appended to another file, e.g. a binary program, with the program
\ref appendzip_anchor "appendzip", can be read with
\ref zipfile_openembeddedzipfile "ZipFile::openEmbeddedZipFile()".
\subsection filecollections FileCollections
A ZipFile is actually just a special kind of
\ref fcoll_anchor "FileCollection" that
obtains its entries from a .zip Zip archive. Zipios++ also implements
a \ref dircol_anchor "DirectoryCollection" that obtains its entries
from a specified directory, and a \ref collcoll_anchor "CollectionCollection"
that obtains its entries from
other collections. Using a single CollectionCollection any number of
other FileCollections can be placed under its control and accessed
through the same single interface that is used to access a ZipFile or
a DirectoryCollection. A singleton (a unique global instance)
CollectionCollection can be obtained through
\ref collcoll_inst_anchor "CollectionCollection::inst()" ;
To save typing CollectionCollection has been typedef'ed to CColl. In
the initialization part of an application FileCollections can be
created, and placed under CColll::inst()'s control using
\ref collcoll_addcoll_anchor "CColl::inst().addCollection()"
and later an istream can be obtained using
\ref fcoll_getinputstream "CColl::inst().getInputStream()".
\section download Download
Go to Zipios++ project page on SourceForge for tar balls and ChangeLog.
<A HREF="http://sourceforge.net/project/?group_id=5418" >
http://sourceforge.net/project/?group_id=5418</A>
\section links Links
<A HREF="ftp://ftp.freesoftware.com/pub/infozip/zlib/zlib.html">zlib</A>.
The compression library that Zipios++ uses to perform the actual
decompression.
<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/index.html">
Java 2 Platform, Standard Edition, v 1.3 API Specification
</A>. Zipios++ is heavily inspired by the java.util.zip package.
<A
HREF="http://www.geocities.com/SiliconValley/Lakes/2160/fformats/files/zip.txt">
PKWARE zip format
</A>. A description of the zip file format.
\section bugs Bugs
Submit bug reports and patches to thomass@deltadata.dk
\htmlonly
Project hosted by <A HREF="http://sourceforge.net">
<img src="http://sourceforge.net/sflogo.php?group_id=5418&type=1" >
</A><p>
Logo created with <A HREF="http://www.webgfx.ch/titlepic.htm">
<img src="webgfx.gif" >
</A>
\endhtmlonly */
/** \file
Header file that defines FileCollection.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,100 @@
#ifndef FCOLLEXCEPTIONS_H
#define FCOLLEXCEPTIONS_H
#include "zipios++/zipios-config.h"
#include <stdexcept>
#include <string>
namespace zipios {
using std::string ;
using std::exception ;
/** An IOException is used to signal an I/O error.
*/
class IOException : public exception {
public:
IOException() throw () ;
explicit IOException( const string &msg ) throw () ;
IOException( const IOException &src ) throw () ;
IOException &operator= ( const IOException &src ) throw () ;
virtual const char *what() const throw () ;
virtual ~IOException() throw () ;
private:
string _what ;
};
/** An FCollException is used to signal a problem with a
FileCollection. */
class FCollException : public exception {
public:
FCollException() throw () ;
explicit FCollException( const string &msg ) throw () ;
FCollException( const FCollException &src ) throw () ;
FCollException &operator= ( const FCollException &src ) throw () ;
virtual const char *what() const throw () ;
virtual ~FCollException() throw () ;
private:
string _what ;
};
/** An object member function may throw this exception, if the
operation it normally performs is inappropriate or impossible to
perform because of the current state of the object. */
class InvalidStateException : public exception {
public:
InvalidStateException() throw () ;
explicit InvalidStateException( const string &msg ) throw () ;
InvalidStateException( const InvalidStateException &src ) throw () ;
InvalidStateException &operator= ( const InvalidStateException &src ) throw () ;
virtual const char *what() const throw () ;
virtual ~InvalidStateException() throw () ;
private:
string _what ;
};
/** Basic exception */
class Exception : public exception {
public:
Exception() throw () ;
explicit Exception( const string &msg ) throw () ;
Exception( const Exception &src ) throw () ;
Exception &operator= ( const Exception &src ) throw () ;
virtual const char *what() const throw () ;
virtual ~Exception() throw () ;
private:
string _what ;
};
} // namespace
#endif
/** \file
Header file that defines a number of exceptions used by FileCollection and
its subclasses.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,240 @@
#ifndef FILEENTRY_H
#define FILEENTRY_H
#include "zipios++/zipios-config.h"
#include <string>
#include <vector>
#include "zipios++/meta-iostreams.h"
#include "zipios++/simplesmartptr.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
using std::vector ;
using std::ostream ;
using std::istream ;
using std::string ;
/** The types used with FileEntry::setMethod and
FileEntry::getMethod. The current entries are the types supported
by the zip format. The numbering also matches the numbering used
in the zip file format, ie STORED is indicated by a 0 in the
method field in a zip file and so on. */
enum StorageMethod { STORED = 0, SHRUNK, REDUCED1, REDUCED2,
REDUCED3, REDUCED4, IMPLODED, RESERVED,
DEFLATED } ;
class FileEntry ;
/** \typedef typedef SimpleSmartPointer< FileEntry > EntryPointer
EntryPointer is a SimpleSmartPointer for FileEntry's. */
typedef SimpleSmartPointer< FileEntry > EntryPointer ;
/** ConstEntryPointer is a SimpleSmartPointer for const FileEntry's. */
typedef SimpleSmartPointer< const FileEntry > ConstEntryPointer ;
/** Entries is a vector of EntryPointer's */
typedef vector< EntryPointer > Entries ;
/** ConstEntries is a vector of ConstEntryPointer's */
typedef vector< EntryPointer > ConstEntries ;
/** A FileEntry represents an entry in a FileCollection. The interface
is a copy of the ZipEntry interface from the java.util.zip
package. The name has been changed to FileEntry, as FileCollection
is a more general abstraction, that covers other types of file
collections than just zip files. */
class FileEntry {
public:
/* Default construcotr, copy constructor and copy assignment
operator are sufficient. */
/** Returns the comment of the entry, if it has one. Otherwise it
returns an empty string.
@return the comment associated with the entry, if there is one.
*/
virtual string getComment() const = 0 ;
/** Returns the compressed size of the entry. If the entry is not
stored in a compressed format, the uncompressed size is
returned.
@return the compressed size of the entry. If the entry is stored without
compression the uncompressed size is returned.
*/
virtual uint32 getCompressedSize() const = 0 ;
/** Returns the Crc for the entry, if it has one. FIXME: what is
returned if it doesn't have one?
@return the Crc for the entry, if it has one.
*/
virtual uint32 getCrc() const = 0 ;
/** Returns a vector of bytes of extra data that may be stored with
the entry.
@return A vector< unsigned char > of extra bytes that may potentially
be associated with an entry.
*/
virtual vector< unsigned char > getExtra() const = 0 ;
/** Returns the method used to store the entry in the FileCollection.
@return the storage method used to store the entry in the collection.
@see StorageMethod.
*/
virtual StorageMethod getMethod() const = 0 ;
/** Returns the full filename of the entry, including a path if the
entry is stored in a subfolder.
@return the filename of the entry, including path if the entry is stored
in a sub-folder.
*/
virtual string getName() const = 0 ;
/** Returns the filename of the entry.
@return Returns the filename of the entry.
*/
virtual string getFileName() const = 0 ;
/** Returns the (uncompressed) size of the entry data.
@return Returns the (uncompressed) size of the entry.
*/
virtual uint32 getSize() const = 0 ;
/** Returns the date and time of FIXME: what?
@return the date and time of the entry.
*/
virtual int getTime() const = 0 ;
/** Any method or operator that initializes a FileEntry may set a
flag, that specifies whether the read entry is valid or not. If
it isn't this method returns false.
@return true if the FileEntry has been parsed succesfully.
*/
virtual bool isValid() const = 0 ;
// virtual int hashCode() const = 0 ;
/** Returns true if the entry is a directory. A directory entry is
an entry which name ends with a separator ('/' for Unix systems,
'\' for Windows and DOS systems.
@return true if the entry is a directory.
*/
virtual bool isDirectory() const = 0 ;
/** Sets the comment field for the FileEntry.
@param comment string with the new comment.
*/
virtual void setComment( const string &comment ) = 0 ;
/** Set the compressed size field of the entry.
@param size value to set the compressed size field of the entry to.
*/
virtual void setCompressedSize( uint32 size ) = 0 ;
/** Sets the crc field.
@param crc value to set the crc field to.
*/
virtual void setCrc( uint32 crc ) = 0 ;
/** Sets the extra field.
@param extra the extra field is set to this value.
*/
virtual void setExtra( const vector< unsigned char > &extra ) = 0 ;
/** Sets the storage method field for the entry.
@param method the method field is set to the specified value.
*/
virtual void setMethod( StorageMethod method ) = 0 ;
/** Sets the name field for the entry.
@param name the name field is set to the specified value.
*/
virtual void setName( const string &name ) = 0 ;
/** Sets the size field for the entry.
@param size the size field is set to this value.
*/
virtual void setSize( uint32 size ) = 0 ;
/** Sets the time field for the entry.
@param time the time field is set to the specified value.
*/
virtual void setTime( int time ) = 0 ;
/** Returns a human-readable string representation of the entry.
@return a human-readable string representation of the entry.
*/
virtual string toString() const = 0 ;
/** Create a heap allocated clone of the object this method is called for. The
caller is responsible for deallocating the clone when he is done with it.
@return A heap allocated copy of the object this method is called for.
*/
virtual FileEntry *clone() const = 0 ;
/** FileEntry destructor. */
virtual ~FileEntry() {}
// protected:
class MatchName ;
class MatchFileName ;
protected:
friend class SimpleSmartPointer< FileEntry > ;
friend class SimpleSmartPointer< const FileEntry > ;
void ref() const { _refcount.ref() ; }
unsigned int unref() const { return _refcount.unref() ; }
ReferenceCount< FileEntry > _refcount ;
};
/** Function object to be used with the STL find_if algorithm to
find a FileEntry in a container, which name (as obtained with
FileEntry::getName()) is identical to the name specified in the
MatchName constructor. */
class FileEntry::MatchName {
public:
explicit MatchName( const string &name ) : _name( name ) {}
bool operator() ( const ConstEntryPointer &entry ) {
return entry->getName() == _name ;
}
private:
string _name ;
};
/** Function object to be used with the STL find_if algorithm to
find a FileEntry in a container, which name (as obtained with
FileEntry::getFileName()) is identical to the name specified in the
MatchName constructor. */
class FileEntry::MatchFileName {
public:
explicit MatchFileName( const string &name ) : _name( name ) {}
bool operator() ( const ConstEntryPointer &entry ) {
return entry->getFileName() == _name ;
}
private:
string _name ;
};
ostream &operator<< ( ostream &os, const FileEntry &entry ) ;
inline ostream &operator<< ( ostream &os, const ConstEntryPointer &entry ) {
os << *entry ;
return os ;
}
} // namespace
#endif
/** \file
Header file that defines FileEntry.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,202 @@
#ifndef FILEPATH_H
#define FILEPATH_H
#include "zipios++/zipios-config.h"
#include <stdexcept>
#include <string>
namespace zipios {
using namespace std ;
/** FilePath represents a path to a file or directory name. FilePath has
member functions to check if the file path is a valid file system entity,
and to check what kind of file system entity it is, e.g. is it a file, a
directory, a pipe etc.
*/
class FilePath {
public:
/** Constructor.
@param path A string representation of the path.
@param check_exists If true is specified the constructor will
check the existence and type of the path immidiately, instead of
deferring that task until it is needed. */
FilePath( const string &path = "", bool check_exists = false ) ;
inline FilePath &operator= ( const string &rhs ) ;
inline operator string() const ;
/** Concatenates FilePath objects. A file separator is inserted
if appropriate. */
inline FilePath operator+ ( const FilePath &name ) const ;
/** Returns filename of the FilePath object by pruning the path
off. */
inline FilePath filename() const ;
/** @return true If the path is a valid file system entity. */
inline bool exists() const ;
/** @return true if the path is a regular file. */
inline bool isRegular() const ;
/** @return true if the path is a directory. */
inline bool isDirectory() const ;
/** @return true if the path is character special (a character
device file). */
inline bool isCharSpecial() const ;
/** @return true if the path is block special (a block device
file). */
inline bool isBlockSpecial() const ;
/** @return true if the path is a socket. */
inline bool isSocket() const ;
/** @return true if the path is a Fifo (a pipe). */
inline bool isFifo() const ;
protected:
/** Prunes the trailing separator of a specified path. */
inline void pruneTrailingSeparator() ;
/** This function sets _checked to true, stats the path, to see if
it exists and to determine what type of file it is. All the query
functions check if _checked is true, and if it isn't they call
check(). This means stat'ing is deferred until it becomes
necessary. */
void check() const ;
static const char _separator;
// FIXME: Should be bitfield
mutable bool _checked ;
mutable bool _exists ;
mutable bool _is_reg ;
mutable bool _is_dir ;
mutable bool _is_char ;
mutable bool _is_block ;
mutable bool _is_socket ;
mutable bool _is_fifo ;
string _path ;
};
//
// Inline member functions
//
FilePath &FilePath::operator= ( const string &rhs ) {
_path = rhs ;
pruneTrailingSeparator() ;
return *this ;
}
void FilePath::pruneTrailingSeparator() {
if ( _path.size() > 0 )
if ( _path[ _path.size() -1 ] == _separator )
_path.erase( _path.size() - 1 ) ;
}
FilePath::operator string() const {
return _path ;
}
FilePath FilePath::operator+ ( const FilePath &name ) const {
if ( _path.size() > 0 )
return _path + _separator + name._path ;
else
return name._path ;
}
FilePath FilePath::filename() const {
string::size_type pos ;
pos = _path.find_last_of( _separator ) ;
if ( pos != string::npos )
return _path.substr( pos + 1);
else
return _path ;
}
bool FilePath::exists() const {
if ( ! _checked )
check() ;
return _exists ;
}
bool FilePath::isRegular() const {
if ( ! _checked )
check() ;
return _is_reg ;
}
bool FilePath::isDirectory() const {
if ( ! _checked )
check() ;
return _is_dir ;
}
bool FilePath::isCharSpecial() const {
if ( ! _checked )
check() ;
return _is_char ;
}
bool FilePath::isBlockSpecial() const {
if ( ! _checked )
check() ;
return _is_block ;
}
bool FilePath::isSocket() const {
if ( ! _checked )
check() ;
return _is_socket ;
}
bool FilePath::isFifo() const {
if ( ! _checked )
check() ;
return _is_fifo ;
}
} // namespace
#endif
/** \file
Header file that defines FilePath.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,66 @@
#ifndef FILTERINPUTSTREAMBUF_H
#define FILTERINPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
namespace zipios {
using std::streambuf ;
/** An input streambuf filter is a streambuf that filters the input it
gets from the streambuf it is attached to. FilterInputStreambuf is a base class to
derive input streambuf filters from. */
class FilterInputStreambuf : public streambuf {
public:
/** Constructor.
@param inbuf the streambuf to use for input.
@param del_inbuf if true is specified inbuf will be deleted, when
the FilterInputStreambuf is destructed.
*/
explicit FilterInputStreambuf( streambuf *inbuf, bool del_inbuf = false ) ;
/** Destructor. */
virtual ~FilterInputStreambuf() ;
protected:
int _s_pos ; // Position in this streambuf - FIXME: is this used?
streambuf *_inbuf ;
bool _del_inbuf ;
private:
/** Copy-constructor is private to prevent copying. */
FilterInputStreambuf( const FilterInputStreambuf &src ) ;
/** Copy-assignment operator is private to prevent copying. */
const FilterInputStreambuf &operator= ( const FilterInputStreambuf &src ) ;
};
} // namespace
#endif
/** \file
Header file that defines FilterInputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -0,0 +1,58 @@
#ifndef FILTEROUTPUTSTREAMBUF_H
#define FILTEROUTPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
namespace zipios {
using std::streambuf ;
/** A FilterOutputStreambuf is a streambuf that filters the data that is written
to it before it passes it on to the output streambuf it is connected to. */
class FilterOutputStreambuf : public streambuf {
public:
/** Constructor.
@param outbuf the streambuf to pass the filtered data on to.
@param del_outbuf if true is specified outbuf will be deleted, when
the FilterOutputStreambuf is destructed. */
explicit FilterOutputStreambuf( streambuf *outbuf, bool del_outbuf = false ) ;
/** Destructor. */
virtual ~FilterOutputStreambuf() ;
protected:
streambuf *_outbuf ;
bool _del_outbuf ;
};
} // namespace
#endif
/** \file
Header file that defines FilterOutputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

Some files were not shown because too many files have changed in this diff Show More