Import Geant4 11.1.0.beta source tree
This commit is contained in:
Vendored
+35
-40
@@ -1,10 +1,5 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# CMakeLists.txt
|
||||
# Module : G4externals
|
||||
# Package: Geant4.src.G4externals
|
||||
#------------------------------------------------------------------------------
|
||||
# - Build of external packages, if required
|
||||
|
||||
# - Recurse into subdirectories as needed
|
||||
if(NOT GEANT4_USE_SYSTEM_CLHEP)
|
||||
add_subdirectory(clhep)
|
||||
endif()
|
||||
@@ -17,52 +12,52 @@ if(NOT GEANT4_USE_SYSTEM_ZLIB)
|
||||
add_subdirectory(zlib)
|
||||
endif()
|
||||
|
||||
# - G4tools always built
|
||||
add_subdirectory(g4tools)
|
||||
|
||||
# PTL requires additional pre and post inclusion steps as it's a true subproject
|
||||
if(NOT GEANT4_USE_SYSTEM_PTL)
|
||||
set(CMAKE_INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}/PTL)
|
||||
# We reuse PTL as a true subproject, configure settings before recursion
|
||||
set(PTL_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
||||
set(PTL_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/PTL)
|
||||
set(PTL_INSTALL_HEADERS ON)
|
||||
set(PTL_INSTALL_CONFIG ON)
|
||||
set(PTL_USE_TBB ${GEANT4_USE_TBB})
|
||||
set(PTL_USE_LOCKS ${GEANT4_USE_PTL_LOCKS})
|
||||
|
||||
if(NOT (GEANT4_BUILD_SANITIZER STREQUAL "none"))
|
||||
if(GEANT4_BUILD_SANITIZER AND NOT (GEANT4_BUILD_SANITIZER STREQUAL "none"))
|
||||
set(PTL_USE_SANITIZER ON)
|
||||
set(PTL_SANITIZER_TYPE ${GEANT4_BUILD_SANITIZER})
|
||||
endif()
|
||||
|
||||
set(PTL_USE_LOCKS ${GEANT4_USE_PTL_LOCKS})
|
||||
|
||||
add_subdirectory(ptl)
|
||||
# Needs to be in defined category list for static/shared to be linked correctly.
|
||||
set_property(GLOBAL APPEND PROPERTY GEANT4_DEFINED_CATEGORIES G4ptl)
|
||||
# ... and added to build dir include paths in scripts
|
||||
|
||||
# Ensure include path is available from build dir in scripts
|
||||
set_property(GLOBAL APPEND PROPERTY GEANT4_BUILDTREE_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ptl/include)
|
||||
endif()
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Alias the tasking libraries to Geant4 target naming convention
|
||||
#
|
||||
if(TARGET ptl-shared)
|
||||
add_library(G4ptl INTERFACE)
|
||||
target_link_libraries(G4ptl INTERFACE PTL::ptl-shared)
|
||||
install(TARGETS G4ptl
|
||||
EXPORT Geant4LibraryDepends
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
||||
add_library(Geant4::G4ptl ALIAS G4ptl)
|
||||
endif()
|
||||
# Adapt targets to G4 naming scheme, whether
|
||||
if(TARGET ptl-shared)
|
||||
add_library(G4ptl INTERFACE)
|
||||
target_link_libraries(G4ptl INTERFACE PTL::ptl-shared)
|
||||
install(TARGETS G4ptl
|
||||
EXPORT Geant4LibraryDepends
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
||||
add_library(Geant4::G4ptl ALIAS G4ptl)
|
||||
endif()
|
||||
|
||||
if(TARGET ptl-static)
|
||||
add_library(G4ptl-static INTERFACE)
|
||||
target_link_libraries(G4ptl-static INTERFACE PTL::ptl-static)
|
||||
install(TARGETS G4ptl-static
|
||||
EXPORT Geant4LibraryDepends
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
||||
add_library(Geant4::G4ptl-static ALIAS G4ptl-static)
|
||||
if(TARGET ptl-static)
|
||||
add_library(G4ptl-static INTERFACE)
|
||||
target_link_libraries(G4ptl-static INTERFACE PTL::ptl-static)
|
||||
install(TARGETS G4ptl-static
|
||||
EXPORT Geant4LibraryDepends
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
||||
add_library(Geant4::G4ptl-static ALIAS G4ptl-static)
|
||||
endif()
|
||||
|
||||
geant4_add_external_category(G4ptl)
|
||||
endif()
|
||||
|
||||
Vendored
+18
-15
@@ -1,25 +1,28 @@
|
||||
-------------------------------------------------------------------
|
||||
# Category externals History
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
|
||||
which **must** added in reverse chronological order (newest at the top). It must **not**
|
||||
be used as a substitute for writing good git commit messages!
|
||||
|
||||
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 !
|
||||
## 2022-05-31 Guilherme Amadio (externals-V11-00-03)
|
||||
- Update CMake install directory for PTL to match recent changes
|
||||
in default install directories in Geant4.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
## 2022-03-15 Ben Morgan (externals-V11-00-02)
|
||||
- Rationalize externals builds to decouple them from the core Geant4 module/category
|
||||
definitions.
|
||||
|
||||
11 February 2022 - Ben Morgan (externals-V10-07-08)
|
||||
## 2022-02-11 Ben Morgan (externals-V11-00-01)
|
||||
- Export builtin PTL include directory to build directory include path list
|
||||
- Allows use of geant4-config from build directory
|
||||
|
||||
## 2021-12-10 Ben Morgan (externals-V11-00-00)
|
||||
- Change to new Markdown History format
|
||||
|
||||
---
|
||||
|
||||
# History entries prior to 11.0
|
||||
|
||||
01 September 2021 - G.Cosmo (externals-V10-07-07)
|
||||
- Synchronised with CLHEP-2.4.5.1:
|
||||
o New random engine RANLUX++ and related helper classes (J.Hahnfeld).
|
||||
|
||||
+189
-260
@@ -1,274 +1,203 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# CMakeLists.txt
|
||||
# Module : G4clhep
|
||||
# Package: Geant4.src.G4externals.G4clhep
|
||||
#
|
||||
# CMakeLists.txt for G4clhep. We do not use the usual Geant4 sources.cmake
|
||||
# approach because G4clhep requires a custom install solution for its
|
||||
# headers. These are in a nested structure so this needs to be replicated
|
||||
# when we install, i.e:
|
||||
# <INCLUDE>
|
||||
# +- geant4
|
||||
# +- CLHEP
|
||||
# +- Vector
|
||||
# | +- ThreeVector.h
|
||||
# ...
|
||||
#
|
||||
# Nevertheless, we're able to build the library via the standard
|
||||
# GEANT4_LIBRARY_TARGET macro.
|
||||
#
|
||||
# Created on: 02/06/2011
|
||||
#
|
||||
# $Date$
|
||||
# $Revision$
|
||||
# $Author$
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
# CMakeLists.txt for G4clhep external
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Includes for this modules
|
||||
#
|
||||
include_directories(include)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compile definitions needed
|
||||
#
|
||||
add_definitions(-DCLHEP_EXPORT)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# List the headers and sources
|
||||
#
|
||||
# - Headers
|
||||
set(G4clhep_HEADERS
|
||||
include/CLHEP/Evaluator/Evaluator.h
|
||||
include/CLHEP/Evaluator/hash_map.icc
|
||||
include/CLHEP/Evaluator/stack.icc
|
||||
include/CLHEP/Evaluator/string.icc
|
||||
include/CLHEP/Geometry/BasicVector3D.h
|
||||
include/CLHEP/Geometry/Normal3D.h
|
||||
include/CLHEP/Geometry/Plane3D.h
|
||||
include/CLHEP/Geometry/Point3D.h
|
||||
include/CLHEP/Geometry/Transform3D.h
|
||||
include/CLHEP/Geometry/Vector3D.h
|
||||
include/CLHEP/Random/ranluxpp/helpers.h
|
||||
include/CLHEP/Random/ranluxpp/mulmod.h
|
||||
include/CLHEP/Random/ranluxpp/ranlux_lcg.h
|
||||
include/CLHEP/Random/DoubConv.h
|
||||
include/CLHEP/Random/DualRand.h
|
||||
include/CLHEP/Random/EngineFactory.h
|
||||
include/CLHEP/Random/engineIDulong.h
|
||||
include/CLHEP/Random/JamesRandom.h
|
||||
include/CLHEP/Random/mixmax_skip_N8.icc
|
||||
include/CLHEP/Random/mixmax_skip_N17.icc
|
||||
include/CLHEP/Random/mixmax_skip_N240.icc
|
||||
include/CLHEP/Random/MixMaxRng.h
|
||||
include/CLHEP/Random/MTwistEngine.h
|
||||
include/CLHEP/Random/NonRandomEngine.h
|
||||
include/CLHEP/Random/RandBinomial.h
|
||||
include/CLHEP/Random/RandBinomial.icc
|
||||
include/CLHEP/Random/RandBit.h
|
||||
include/CLHEP/Random/RandBreitWigner.h
|
||||
include/CLHEP/Random/RandBreitWigner.icc
|
||||
include/CLHEP/Random/RandChiSquare.h
|
||||
include/CLHEP/Random/RandChiSquare.icc
|
||||
include/CLHEP/Random/RandExponential.h
|
||||
include/CLHEP/Random/RandExponential.icc
|
||||
include/CLHEP/Random/RandFlat.h
|
||||
include/CLHEP/Random/RandFlat.icc
|
||||
include/CLHEP/Random/RandGamma.h
|
||||
include/CLHEP/Random/RandGamma.icc
|
||||
include/CLHEP/Random/RandGauss.h
|
||||
include/CLHEP/Random/RandGauss.icc
|
||||
include/CLHEP/Random/RandGaussQ.h
|
||||
include/CLHEP/Random/RandGaussQ.icc
|
||||
include/CLHEP/Random/RandGeneral.h
|
||||
include/CLHEP/Random/RandGeneral.icc
|
||||
include/CLHEP/Random/RandLandau.h
|
||||
include/CLHEP/Random/RandLandau.icc
|
||||
include/CLHEP/Random/RandPoisson.h
|
||||
include/CLHEP/Random/RandPoisson.icc
|
||||
include/CLHEP/Random/RandPoissonQ.h
|
||||
include/CLHEP/Random/RandPoissonQ.icc
|
||||
include/CLHEP/Random/RandStudentT.h
|
||||
include/CLHEP/Random/RandStudentT.icc
|
||||
include/CLHEP/Random/Random.h
|
||||
include/CLHEP/Random/Random.icc
|
||||
include/CLHEP/Random/RandomEngine.h
|
||||
include/CLHEP/Random/RandomEngine.icc
|
||||
include/CLHEP/Random/Randomize.h
|
||||
include/CLHEP/Random/RanecuEngine.h
|
||||
include/CLHEP/Random/Ranlux64Engine.h
|
||||
include/CLHEP/Random/RanluxppEngine.h
|
||||
include/CLHEP/Random/RanluxEngine.h
|
||||
include/CLHEP/Random/RanshiEngine.h
|
||||
include/CLHEP/Random/SeedTable.h
|
||||
include/CLHEP/Random/Stat.h
|
||||
include/CLHEP/Random/StaticRandomStates.h
|
||||
include/CLHEP/Random/gaussQTables.cdat
|
||||
include/CLHEP/Random/gaussTables.cdat
|
||||
include/CLHEP/Random/poissonTables.cdat
|
||||
include/CLHEP/Units/PhysicalConstants.h
|
||||
include/CLHEP/Units/SystemOfUnits.h
|
||||
include/CLHEP/Utility/defs.h
|
||||
include/CLHEP/Utility/keywords.h
|
||||
include/CLHEP/Utility/memory.h
|
||||
include/CLHEP/Utility/noncopyable.h
|
||||
include/CLHEP/Utility/use_atomic.h
|
||||
include/CLHEP/Vector/AxisAngle.h
|
||||
include/CLHEP/Vector/AxisAngle.icc
|
||||
include/CLHEP/Vector/Boost.h
|
||||
include/CLHEP/Vector/Boost.icc
|
||||
include/CLHEP/Vector/BoostX.h
|
||||
include/CLHEP/Vector/BoostX.icc
|
||||
include/CLHEP/Vector/BoostY.h
|
||||
include/CLHEP/Vector/BoostY.icc
|
||||
include/CLHEP/Vector/BoostZ.h
|
||||
include/CLHEP/Vector/BoostZ.icc
|
||||
include/CLHEP/Vector/EulerAngles.h
|
||||
include/CLHEP/Vector/EulerAngles.icc
|
||||
include/CLHEP/Vector/LorentzRotation.h
|
||||
include/CLHEP/Vector/LorentzRotation.icc
|
||||
include/CLHEP/Vector/LorentzVector.h
|
||||
include/CLHEP/Vector/LorentzVector.icc
|
||||
include/CLHEP/Vector/Rotation.h
|
||||
include/CLHEP/Vector/Rotation.icc
|
||||
include/CLHEP/Vector/RotationInterfaces.h
|
||||
include/CLHEP/Vector/RotationInterfaces.icc
|
||||
include/CLHEP/Vector/RotationX.h
|
||||
include/CLHEP/Vector/RotationX.icc
|
||||
include/CLHEP/Vector/RotationY.h
|
||||
include/CLHEP/Vector/RotationY.icc
|
||||
include/CLHEP/Vector/RotationZ.h
|
||||
include/CLHEP/Vector/RotationZ.icc
|
||||
include/CLHEP/Vector/ThreeVector.h
|
||||
include/CLHEP/Vector/ThreeVector.icc
|
||||
include/CLHEP/Vector/TwoVector.h
|
||||
include/CLHEP/Vector/TwoVector.icc
|
||||
)
|
||||
include/CLHEP/Evaluator/Evaluator.h
|
||||
include/CLHEP/Evaluator/hash_map.icc
|
||||
include/CLHEP/Evaluator/stack.icc
|
||||
include/CLHEP/Evaluator/string.icc
|
||||
include/CLHEP/Geometry/BasicVector3D.h
|
||||
include/CLHEP/Geometry/Normal3D.h
|
||||
include/CLHEP/Geometry/Plane3D.h
|
||||
include/CLHEP/Geometry/Point3D.h
|
||||
include/CLHEP/Geometry/Transform3D.h
|
||||
include/CLHEP/Geometry/Vector3D.h
|
||||
include/CLHEP/Random/ranluxpp/helpers.h
|
||||
include/CLHEP/Random/ranluxpp/mulmod.h
|
||||
include/CLHEP/Random/ranluxpp/ranlux_lcg.h
|
||||
include/CLHEP/Random/DoubConv.h
|
||||
include/CLHEP/Random/DualRand.h
|
||||
include/CLHEP/Random/EngineFactory.h
|
||||
include/CLHEP/Random/engineIDulong.h
|
||||
include/CLHEP/Random/JamesRandom.h
|
||||
include/CLHEP/Random/mixmax_skip_N8.icc
|
||||
include/CLHEP/Random/mixmax_skip_N17.icc
|
||||
include/CLHEP/Random/mixmax_skip_N240.icc
|
||||
include/CLHEP/Random/MixMaxRng.h
|
||||
include/CLHEP/Random/MTwistEngine.h
|
||||
include/CLHEP/Random/NonRandomEngine.h
|
||||
include/CLHEP/Random/RandBinomial.h
|
||||
include/CLHEP/Random/RandBinomial.icc
|
||||
include/CLHEP/Random/RandBit.h
|
||||
include/CLHEP/Random/RandBreitWigner.h
|
||||
include/CLHEP/Random/RandBreitWigner.icc
|
||||
include/CLHEP/Random/RandChiSquare.h
|
||||
include/CLHEP/Random/RandChiSquare.icc
|
||||
include/CLHEP/Random/RandExponential.h
|
||||
include/CLHEP/Random/RandExponential.icc
|
||||
include/CLHEP/Random/RandFlat.h
|
||||
include/CLHEP/Random/RandFlat.icc
|
||||
include/CLHEP/Random/RandGamma.h
|
||||
include/CLHEP/Random/RandGamma.icc
|
||||
include/CLHEP/Random/RandGauss.h
|
||||
include/CLHEP/Random/RandGauss.icc
|
||||
include/CLHEP/Random/RandGaussQ.h
|
||||
include/CLHEP/Random/RandGaussQ.icc
|
||||
include/CLHEP/Random/RandGeneral.h
|
||||
include/CLHEP/Random/RandGeneral.icc
|
||||
include/CLHEP/Random/RandLandau.h
|
||||
include/CLHEP/Random/RandLandau.icc
|
||||
include/CLHEP/Random/RandPoisson.h
|
||||
include/CLHEP/Random/RandPoisson.icc
|
||||
include/CLHEP/Random/RandPoissonQ.h
|
||||
include/CLHEP/Random/RandPoissonQ.icc
|
||||
include/CLHEP/Random/RandStudentT.h
|
||||
include/CLHEP/Random/RandStudentT.icc
|
||||
include/CLHEP/Random/Random.h
|
||||
include/CLHEP/Random/Random.icc
|
||||
include/CLHEP/Random/RandomEngine.h
|
||||
include/CLHEP/Random/RandomEngine.icc
|
||||
include/CLHEP/Random/Randomize.h
|
||||
include/CLHEP/Random/RanecuEngine.h
|
||||
include/CLHEP/Random/Ranlux64Engine.h
|
||||
include/CLHEP/Random/RanluxppEngine.h
|
||||
include/CLHEP/Random/RanluxEngine.h
|
||||
include/CLHEP/Random/RanshiEngine.h
|
||||
include/CLHEP/Random/SeedTable.h
|
||||
include/CLHEP/Random/Stat.h
|
||||
include/CLHEP/Random/StaticRandomStates.h
|
||||
include/CLHEP/Random/gaussQTables.cdat
|
||||
include/CLHEP/Random/gaussTables.cdat
|
||||
include/CLHEP/Random/poissonTables.cdat
|
||||
include/CLHEP/Units/PhysicalConstants.h
|
||||
include/CLHEP/Units/SystemOfUnits.h
|
||||
include/CLHEP/Utility/defs.h
|
||||
include/CLHEP/Utility/keywords.h
|
||||
include/CLHEP/Utility/memory.h
|
||||
include/CLHEP/Utility/noncopyable.h
|
||||
include/CLHEP/Utility/use_atomic.h
|
||||
include/CLHEP/Vector/AxisAngle.h
|
||||
include/CLHEP/Vector/AxisAngle.icc
|
||||
include/CLHEP/Vector/Boost.h
|
||||
include/CLHEP/Vector/Boost.icc
|
||||
include/CLHEP/Vector/BoostX.h
|
||||
include/CLHEP/Vector/BoostX.icc
|
||||
include/CLHEP/Vector/BoostY.h
|
||||
include/CLHEP/Vector/BoostY.icc
|
||||
include/CLHEP/Vector/BoostZ.h
|
||||
include/CLHEP/Vector/BoostZ.icc
|
||||
include/CLHEP/Vector/EulerAngles.h
|
||||
include/CLHEP/Vector/EulerAngles.icc
|
||||
include/CLHEP/Vector/LorentzRotation.h
|
||||
include/CLHEP/Vector/LorentzRotation.icc
|
||||
include/CLHEP/Vector/LorentzVector.h
|
||||
include/CLHEP/Vector/LorentzVector.icc
|
||||
include/CLHEP/Vector/Rotation.h
|
||||
include/CLHEP/Vector/Rotation.icc
|
||||
include/CLHEP/Vector/RotationInterfaces.h
|
||||
include/CLHEP/Vector/RotationInterfaces.icc
|
||||
include/CLHEP/Vector/RotationX.h
|
||||
include/CLHEP/Vector/RotationX.icc
|
||||
include/CLHEP/Vector/RotationY.h
|
||||
include/CLHEP/Vector/RotationY.icc
|
||||
include/CLHEP/Vector/RotationZ.h
|
||||
include/CLHEP/Vector/RotationZ.icc
|
||||
include/CLHEP/Vector/ThreeVector.h
|
||||
include/CLHEP/Vector/ThreeVector.icc
|
||||
include/CLHEP/Vector/TwoVector.h
|
||||
include/CLHEP/Vector/TwoVector.icc )
|
||||
|
||||
# - Sources
|
||||
set(G4clhep_SOURCES
|
||||
src/AxisAngle.cc
|
||||
src/BasicVector3D.cc
|
||||
src/Boost.cc
|
||||
src/BoostX.cc
|
||||
src/BoostY.cc
|
||||
src/BoostZ.cc
|
||||
src/DoubConv.cc
|
||||
src/DualRand.cc
|
||||
src/EngineFactory.cc
|
||||
src/engineIDulong.cc
|
||||
src/erfQ.cc
|
||||
src/EulerAngles.cc
|
||||
src/Evaluator.cc
|
||||
src/flatToGaussian.cc
|
||||
src/gammln.cc
|
||||
src/JamesRandom.cc
|
||||
src/LorentzRotation.cc
|
||||
src/LorentzRotationC.cc
|
||||
src/LorentzRotationD.cc
|
||||
src/LorentzVectorB.cc
|
||||
src/LorentzVector.cc
|
||||
src/LorentzVectorC.cc
|
||||
src/LorentzVectorK.cc
|
||||
src/LorentzVectorL.cc
|
||||
src/LorentzVectorR.cc
|
||||
src/MixMaxRng.cc
|
||||
src/MTwistEngine.cc
|
||||
src/NonRandomEngine.cc
|
||||
src/Normal3D.cc
|
||||
src/Plane3D.cc
|
||||
src/Point3D.cc
|
||||
src/RandBinomial.cc
|
||||
src/RandBit.cc
|
||||
src/RandBreitWigner.cc
|
||||
src/RandChiSquare.cc
|
||||
src/RandExponential.cc
|
||||
src/RandFlat.cc
|
||||
src/RandGamma.cc
|
||||
src/RandGauss.cc
|
||||
src/RandGaussQ.cc
|
||||
src/RandGeneral.cc
|
||||
src/RandLandau.cc
|
||||
src/Random.cc
|
||||
src/RandomEngine.cc
|
||||
src/RandPoisson.cc
|
||||
src/RandPoissonQ.cc
|
||||
src/RandStudentT.cc
|
||||
src/RanecuEngine.cc
|
||||
src/Ranlux64Engine.cc
|
||||
src/RanluxppEngine.cc
|
||||
src/RanluxEngine.cc
|
||||
src/RanshiEngine.cc
|
||||
src/RotationA.cc
|
||||
src/Rotation.cc
|
||||
src/RotationC.cc
|
||||
src/RotationE.cc
|
||||
src/RotationInterfaces.cc
|
||||
src/RotationIO.cc
|
||||
src/RotationL.cc
|
||||
src/RotationP.cc
|
||||
src/RotationX.cc
|
||||
src/RotationY.cc
|
||||
src/RotationZ.cc
|
||||
src/setStdMath.cc
|
||||
src/setSystemOfUnits.cc
|
||||
src/SpaceVector.cc
|
||||
src/SpaceVectorD.cc
|
||||
src/SpaceVectorP.cc
|
||||
src/SpaceVectorR.cc
|
||||
src/StaticRandomStates.cc
|
||||
src/ThreeVector.cc
|
||||
src/ThreeVectorR.cc
|
||||
src/Transform3D.cc
|
||||
src/TwoVector.cc
|
||||
src/Vector3D.cc
|
||||
src/ZMinput.cc
|
||||
)
|
||||
|
||||
src/AxisAngle.cc
|
||||
src/BasicVector3D.cc
|
||||
src/Boost.cc
|
||||
src/BoostX.cc
|
||||
src/BoostY.cc
|
||||
src/BoostZ.cc
|
||||
src/DoubConv.cc
|
||||
src/DualRand.cc
|
||||
src/EngineFactory.cc
|
||||
src/engineIDulong.cc
|
||||
src/erfQ.cc
|
||||
src/EulerAngles.cc
|
||||
src/Evaluator.cc
|
||||
src/flatToGaussian.cc
|
||||
src/gammln.cc
|
||||
src/JamesRandom.cc
|
||||
src/LorentzRotation.cc
|
||||
src/LorentzRotationC.cc
|
||||
src/LorentzRotationD.cc
|
||||
src/LorentzVectorB.cc
|
||||
src/LorentzVector.cc
|
||||
src/LorentzVectorC.cc
|
||||
src/LorentzVectorK.cc
|
||||
src/LorentzVectorL.cc
|
||||
src/LorentzVectorR.cc
|
||||
src/MixMaxRng.cc
|
||||
src/MTwistEngine.cc
|
||||
src/NonRandomEngine.cc
|
||||
src/Normal3D.cc
|
||||
src/Plane3D.cc
|
||||
src/Point3D.cc
|
||||
src/RandBinomial.cc
|
||||
src/RandBit.cc
|
||||
src/RandBreitWigner.cc
|
||||
src/RandChiSquare.cc
|
||||
src/RandExponential.cc
|
||||
src/RandFlat.cc
|
||||
src/RandGamma.cc
|
||||
src/RandGauss.cc
|
||||
src/RandGaussQ.cc
|
||||
src/RandGeneral.cc
|
||||
src/RandLandau.cc
|
||||
src/Random.cc
|
||||
src/RandomEngine.cc
|
||||
src/RandPoisson.cc
|
||||
src/RandPoissonQ.cc
|
||||
src/RandStudentT.cc
|
||||
src/RanecuEngine.cc
|
||||
src/Ranlux64Engine.cc
|
||||
src/RanluxppEngine.cc
|
||||
src/RanluxEngine.cc
|
||||
src/RanshiEngine.cc
|
||||
src/RotationA.cc
|
||||
src/Rotation.cc
|
||||
src/RotationC.cc
|
||||
src/RotationE.cc
|
||||
src/RotationInterfaces.cc
|
||||
src/RotationIO.cc
|
||||
src/RotationL.cc
|
||||
src/RotationP.cc
|
||||
src/RotationX.cc
|
||||
src/RotationY.cc
|
||||
src/RotationZ.cc
|
||||
src/setStdMath.cc
|
||||
src/setSystemOfUnits.cc
|
||||
src/SpaceVector.cc
|
||||
src/SpaceVectorD.cc
|
||||
src/SpaceVectorP.cc
|
||||
src/SpaceVectorR.cc
|
||||
src/StaticRandomStates.cc
|
||||
src/ThreeVector.cc
|
||||
src/ThreeVectorR.cc
|
||||
src/Transform3D.cc
|
||||
src/TwoVector.cc
|
||||
src/Vector3D.cc
|
||||
src/ZMinput.cc )
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Now add the library targets
|
||||
#
|
||||
include(Geant4MacroLibraryTargets)
|
||||
GEANT4_LIBRARY_TARGET(NAME G4clhep SOURCES ${G4clhep_SOURCES} ${G4clhep_HEADERS})
|
||||
|
||||
# Interface usage requirements (build time clients only)
|
||||
foreach(__g4clhep_target G4clhep G4clhep-static)
|
||||
if(TARGET ${__g4clhep_target})
|
||||
target_include_directories(${__g4clhep_target}
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Ensure the header directory gets added to the list of ones to export
|
||||
#
|
||||
set_property(GLOBAL APPEND PROPERTY GEANT4_BUILDTREE_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
# Build definitions
|
||||
add_definitions(-DCLHEP_EXPORT)
|
||||
geant4_add_external_library(NAME G4clhep SOURCES ${G4clhep_SOURCES} ${G4clhep_HEADERS})
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Install the headers, retaining their nested structure
|
||||
#
|
||||
install(DIRECTORY include/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
|
||||
COMPONENT Development
|
||||
PATTERN ".svn" EXCLUDE
|
||||
PATTERN "*.h"
|
||||
PATTERN ".icc")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
|
||||
COMPONENT Development
|
||||
PATTERN ".svn" EXCLUDE
|
||||
PATTERN "*.h"
|
||||
PATTERN ".icc")
|
||||
|
||||
Vendored
+17
-17
@@ -1,27 +1,27 @@
|
||||
-------------------------------------------------------------------
|
||||
# Category clhep History
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
|
||||
which **must** added in reverse chronological order (newest at the top).
|
||||
It must **not** be used as a substitute for writing good git commit messages!
|
||||
|
||||
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 *
|
||||
----------------------------------------------------------
|
||||
## 2022-03-10 Evgueni Tcherniaev (clhep-V11-00-03)
|
||||
- Fixed compilation warnings in LorentzVector.h when c++20 is enabled
|
||||
|
||||
10 March 2022 - E.Tcherniaev (clhep-V10-07-00)
|
||||
- Fixed compilation warnings in LorentzRotation.h when c++20 is enabled.
|
||||
## 2022-03-10 Ben Morgan (clhep-V11-00-02)
|
||||
- Remove obsolete CMake functionality
|
||||
|
||||
08 February 2022 - G.Cosmo
|
||||
## 2022-02-08 Gabriele Cosmo (clhep-V11-00-01)
|
||||
- Fixed compilation warnings for shadowing data member in RandPoisson.
|
||||
|
||||
## 2021-12-10 Ben Morgan (clhep-V11-00-00)
|
||||
- Change to new Markdown History format
|
||||
|
||||
---
|
||||
|
||||
# History entries prior to 11.0
|
||||
|
||||
01 September 2021 - G.Cosmo
|
||||
- Synchronised with CLHEP-2.4.5.1.
|
||||
* Random (J.Hahnfeld)
|
||||
|
||||
+1
-8
@@ -88,14 +88,12 @@ set(G4expat_SOURCES
|
||||
src/xmltok_impl.h
|
||||
src/xmltok_ns.cc)
|
||||
|
||||
|
||||
# - Create target(s) and set usage requirements
|
||||
geant4_library_target(NAME G4expat SOURCES ${G4expat_SOURCES} ${G4expat_HEADERS})
|
||||
geant4_add_external_library(NAME G4expat SOURCES ${G4expat_SOURCES} ${G4expat_HEADERS})
|
||||
foreach(__g4expat_target G4expat G4expat-static)
|
||||
if(TARGET ${__g4expat_target})
|
||||
target_include_directories(${__g4expat_target}
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
||||
@@ -107,11 +105,6 @@ if(TARGET G4expat-static)
|
||||
target_compile_definitions(G4expat-static PUBLIC XML_STATIC)
|
||||
endif()
|
||||
|
||||
# - Ensure the header directory gets added to the list of ones to export
|
||||
set_property(GLOBAL APPEND PROPERTY GEANT4_BUILDTREE_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
# Install headers alongside Geant4
|
||||
install(FILES ${G4expat_HEADERS}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
|
||||
|
||||
Vendored
+11
-13
@@ -1,19 +1,17 @@
|
||||
# Category expat History
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
|
||||
which **must** added in reverse chronological order (newest at the top). It must **not**
|
||||
be used as a substitute for writing good git commit messages!
|
||||
|
||||
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 *
|
||||
----------------------------------------------------------
|
||||
## 2021-12-10 Ben Morgan (expat-V11-00-00)
|
||||
- Change to new Markdown History format
|
||||
|
||||
---
|
||||
|
||||
# History entries prior to 11.0
|
||||
|
||||
20-October-2020: Ben Morgan (expat-V10-06-00)
|
||||
- Migrate build of G4expat to locally defined targets, allowing
|
||||
cleaner specification of usage requirements. Fixes GitLab Issue #44.
|
||||
|
||||
+14
-18
@@ -1,22 +1,18 @@
|
||||
# - Build for G4tools as an "external"
|
||||
# It can be built as a standard module, but we don't declare the headers
|
||||
# so that their nested structure can be retained on install
|
||||
geant4_add_module(G4tools SOURCES dummy.cc)
|
||||
# - Build for G4tools as an external
|
||||
# As a pure interface, we simply declare and install it as such.
|
||||
# It needs no coupling to the internal/external category system because it is header-only.
|
||||
add_library(G4tools INTERFACE)
|
||||
add_library(Geant4::G4tools ALIAS G4tools)
|
||||
target_compile_features(G4tools INTERFACE ${GEANT4_TARGET_COMPILE_FEATURES})
|
||||
target_include_directories(G4tools
|
||||
INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}> )
|
||||
|
||||
geant4_add_category(G4tools MODULES G4tools)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Custom install of (nested) headers and license
|
||||
# Custom install of target, (nested) headers, license and fonts
|
||||
install(TARGETS G4tools EXPORT Geant4LibraryDepends)
|
||||
install(DIRECTORY include/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
|
||||
COMPONENT Development
|
||||
)
|
||||
|
||||
COMPONENT Development )
|
||||
install(FILES tools.license DESTINATION ${CMAKE_INSTALL_DATADIR})
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Install fonts
|
||||
#
|
||||
if(GEANT4_USE_FREETYPE)
|
||||
install(DIRECTORY fonts/ DESTINATION ${CMAKE_INSTALL_DATADIR}/fonts)
|
||||
endif()
|
||||
install(DIRECTORY fonts/ DESTINATION ${CMAKE_INSTALL_DATADIR}/fonts)
|
||||
|
||||
Vendored
+47
-3
@@ -1,6 +1,50 @@
|
||||
# g4tools Category History
|
||||
# - It is NOT a substitute for good git commit messages!
|
||||
# - All entries must be in reverse time order (most recent data on top)!
|
||||
# Category g4tools History
|
||||
|
||||
See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
|
||||
which **must** added in reverse chronological order (newest at the top). It must **not**
|
||||
be used as a substitute for writing good git commit messages!
|
||||
|
||||
## 2022-06-09 Guy Barrand (g4tools-V11-00-07)
|
||||
- toolx/X11/base_session: show_window(): check that the window is not already mapped. (Else it hangs in the XIfEvent).
|
||||
- tools/version: pass to 6.0.1.
|
||||
|
||||
## 2022-05-18 Guy Barrand (g4tools-V11-00-06)
|
||||
- have code related to "externals" under toolx directory and namespaced with "toolx". It concerns code related to Qt, Windows, X11, Xt, OpenGL, hdf5, expat, mpi, zlib.
|
||||
- tools/version: pass to 6.0.0.
|
||||
|
||||
## 2022-05-03 Guy Barrand (g4tools-V11-00-05)
|
||||
- tools/version: pass to 5.7.1.
|
||||
- gl2ps: gl2psPrintPostScriptPixmap(): pass greyscale, nbit in arguments to avoid a "Logically dead code" issue.
|
||||
- gl2ps: gl2psPDFgroupListInit(): have a gl2psPDFgroupObjectInit(&gro) to avoid an "Uninitialized pointer read" issue.
|
||||
- gl2ps: remove commented out code about a "class gl2ps" at end.
|
||||
- sg/text: corrections in update_sg() about "Copy-paste error".
|
||||
|
||||
## 2022-03-30 Guy Barrand (g4tools-V11-00-04)
|
||||
- tools/version: pass to 5.7.0.
|
||||
- gl2ps, gl2ps_def.h, sg/gl2ps_action: have, use a thread safe version of gl2ps-1.4.2.
|
||||
- gl2ps_begin.icc, gl2ps_end.icc: remove.
|
||||
|
||||
## 2022-03-11 Guy Barrand (g4tools-V11-00-03)
|
||||
- tools/version: pass to 5.6.3.
|
||||
- in a lot of files (see History_tools for a list): for intel compiler: quiet "hides variable" warnings; mainly by renaming "s" to "_s" to avoid a clash with CLHEP::s.
|
||||
|
||||
## 2022-02-11 Guy Barrand (g4tools-V11-00-02)
|
||||
- tools/version: pass to 5.6.2.
|
||||
- tools/gl2ps: in tools_gl2psFindRoot(), have a '*root = 0" initialisation before the first in "if()" return.
|
||||
- tools/gl2ps: in tools_gl2psBuildBspTree(), initialize *prim to NULL.
|
||||
|
||||
## 2022-02-09 Guy Barrand (g4tools-V11-00-01)
|
||||
- tools/version: pass to 5.6.1.
|
||||
- tools/sg/text_hershey: in decode_PAW(), font_type font => font_type hershey_font to quiet "hides variable" warnings with intel compiler.
|
||||
- tools/typedefs: static const char s[] => static const char s_v[] to quiet "hides variable" warnings with intel compiler.
|
||||
- tools/rroot/rall: in find_dir(), have a "delete tdir;" in the "if(!tdir->stream(b)) {}". Seen by Coverity.
|
||||
|
||||
## 2021-12-10 Ben Morgan (g4tools-V11-00-00)
|
||||
- Change to new Markdown History format
|
||||
|
||||
---
|
||||
|
||||
# History entries prior to 11.0
|
||||
|
||||
9 November 2021 I. Hrivnacova (g4tools-V10-07-11)
|
||||
- Restored files for MPI
|
||||
|
||||
+52
@@ -1,3 +1,55 @@
|
||||
6.0.1:
|
||||
- toolx/X11/base_session: show_window(): check that the window is not already mapped. (Else it hangs in the XIfEvent).
|
||||
- tools/version: pass to 6.0.1.
|
||||
|
||||
|
||||
6.0.0: toolx directory and namespace.
|
||||
- have code related to "externals" under toolx directory and namespaced with toolx. It concerns code related to Qt, Windows, X11, Xt, OpenGL, hdf5, expat, mpi, zlib.
|
||||
- tools/version: have 6.0.0.
|
||||
|
||||
5.7.1: patches for Coverity.
|
||||
- gl2ps: gl2psPrintPostScriptPixmap(): pass greyscale, nbit in arguments to avoid a "Logically dead code" issue.
|
||||
- gl2ps: gl2psPDFgroupListInit(): have a gl2psPDFgroupObjectInit(&gro) to avoid an "Uninitialized pointer read" issue.
|
||||
- gl2ps: remove commented out code about a "class gl2ps" at end.
|
||||
- sg/text: corrections in update_sg() about "Copy-paste error".
|
||||
|
||||
5.7.0: have a thread safe gl2ps.
|
||||
- gl2ps, gl2ps_def.h, sg/gl2ps_action: have a thread safe version of gl2ps-1.4.2.
|
||||
- gl2ps_begin.icc, gl2ps_end.icc: remove.
|
||||
- tools/version: have 5.7.0.
|
||||
|
||||
5.6.3: intel: rename some local variables to avoid the 'hidden variable' warnings.
|
||||
- charp_out,long_out,out_error,pointer,sprintf,typedefs,
|
||||
raxml_out,stype,colorf,histo/base_histo,histo/dps,rtausmeui,smatch,tess_contour,
|
||||
columns,get_env,hdf5/T_tools,path,rcsv_ntuple,srep,strip,value,value.icc,
|
||||
args,s2time,tos,waxml/histos,waxml/ntuple,buf2lines,spline,tosu,xml/aidas,
|
||||
lina/MATCOM,lina/vec2,lina/vec3,lina/vec4,lina/geom3,
|
||||
xml/aidas,xml/styles,xml/loader,xml/tree,xml/wrap_viewplot_fonts_google_style
|
||||
mpi/world,mpi/wrmpi,
|
||||
sg/path,sg/style_parser,sg/base_tex,sg/group,sg/node,sg/plotter,sg/f2plot,sg/h2plot,
|
||||
sg/infos_box,sg/style_colormap,
|
||||
rroot/base_leaf,rroot/branch,rroot/buffer,rroot/dummy,
|
||||
rroot/info,rroot/named,rroot/rbuf,
|
||||
rroot/branch_element,rroot/branch_object,rroot/buffer,
|
||||
rroot/graph,rroot/info,
|
||||
rroot/leaf,rroot/matrix,rroot/obj_array,rroot/obj_list,rroot/stl_vector,
|
||||
rroot/streamers rroot/tree rroot/tree_index rroot/vector3,
|
||||
wroot/date,wroot/element,sg/senum,
|
||||
wroot/mpi_ntuple_column_wise,wroot/mpi_ntuple_row_wise,
|
||||
Windows/glarea: rename some local variables (mainly "s" that clashes with CLHEP::s).
|
||||
- tools/version: pass to 5.6.3.
|
||||
|
||||
5.6.2:
|
||||
- tools/version: pass to 5.6.2.
|
||||
- tools/gl2ps: in tools_gl2psFindRoot(), have a '*root = 0" initialisation before the first in "if()" return.
|
||||
- tools/gl2ps: in tools_gl2psBuildBspTree(), initialize *prim to NULL.
|
||||
|
||||
5.6.1:
|
||||
- tools/version: pass to 5.6.1
|
||||
- tools/typedefs: static const char s[] => static const char s_v[] to quiet "hides variable" warnings with intel compiler.
|
||||
- tools/sg/text_hershey: in decode_PAW(), font_type font => font_type hershey_font to quiet "hides variable" warnings with intel compiler.
|
||||
- tools/rroot/rall: in find_dir(), have a "delete tdir;" in the "if(!tdir->stream(b)) {}". Seen by Coverity.
|
||||
|
||||
5.6.0:
|
||||
- tools/tokenize: to help parsing some Geant4 commands "new value".
|
||||
- tools/sg/event_dispatcher,bcbk,ecbk,cbks: classes to have a mechanism in G4/G4ToolsSGSceneHandler
|
||||
|
||||
+25
-25
@@ -39,14 +39,14 @@ public:
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
for(int index=0;index<a_argc;index++) {
|
||||
std::string s(a_argv[index]);
|
||||
std::string::size_type pos = s.find('=');
|
||||
std::string _s(a_argv[index]);
|
||||
std::string::size_type pos = _s.find('=');
|
||||
if(pos==std::string::npos) {
|
||||
m_args.push_back(arg(s,""));
|
||||
m_args.push_back(arg(_s,""));
|
||||
} else {
|
||||
std::string key = s.substr(0,pos);
|
||||
std::string key = _s.substr(0,pos);
|
||||
pos++;
|
||||
std::string value = s.substr(pos,s.size()-pos);
|
||||
std::string value = _s.substr(pos,_s.size()-pos);
|
||||
m_args.push_back(arg(key,value));
|
||||
}
|
||||
}
|
||||
@@ -125,9 +125,9 @@ public:
|
||||
}
|
||||
|
||||
bool find(const std::string& a_string,bool& a_value,const bool& a_def = false) const {
|
||||
std::string s;
|
||||
if(!find(a_string,s)) {a_value = a_def;return false;}
|
||||
return to(s,a_value,a_def);
|
||||
std::string _s;
|
||||
if(!find(a_string,_s)) {a_value = a_def;return false;}
|
||||
return to(_s,a_value,a_def);
|
||||
}
|
||||
template <class aT>
|
||||
bool find(const std::string& a_string,aT& a_value,const aT& a_def = aT()) const {
|
||||
@@ -141,15 +141,15 @@ public:
|
||||
// Return a vector of string <name=value>
|
||||
std::vector<std::string> vec;
|
||||
tools_vforcit(arg,m_args,it) {
|
||||
std::string s;
|
||||
std::string _s;
|
||||
if((*it).second.empty()) {
|
||||
s = (*it).first;
|
||||
_s = (*it).first;
|
||||
} else {
|
||||
s = (*it).first;
|
||||
s += "=";
|
||||
s += (*it).second;
|
||||
_s = (*it).first;
|
||||
_s += "=";
|
||||
_s += (*it).second;
|
||||
}
|
||||
vec.push_back(s);
|
||||
vec.push_back(_s);
|
||||
}
|
||||
return vec;
|
||||
}
|
||||
@@ -157,14 +157,14 @@ public:
|
||||
void to_vector(std::vector<std::string>& a_vec) const {
|
||||
// Return a vector of string <name=value>
|
||||
a_vec.clear();
|
||||
std::string s;
|
||||
std::string _s;
|
||||
tools_vforcit(arg,m_args,it) {
|
||||
s = (*it).first;
|
||||
_s = (*it).first;
|
||||
if((*it).second.size()) {
|
||||
s += "=";
|
||||
s += (*it).second;
|
||||
_s += "=";
|
||||
_s += (*it).second;
|
||||
}
|
||||
a_vec.push_back(s);
|
||||
a_vec.push_back(_s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,11 +279,11 @@ public:
|
||||
|
||||
bool file(std::string& a_file) const {
|
||||
std::string slast;
|
||||
std::string s;
|
||||
std::string _s;
|
||||
if((m_args.size()>1) //first arg is the program name !
|
||||
&& last(slast,s)
|
||||
&& last(slast,_s)
|
||||
&& (slast.find('-')!=0)
|
||||
&& (s.empty()) ) {
|
||||
&& (_s.empty()) ) {
|
||||
a_file = slast; //Last argument is not an option.
|
||||
return true;
|
||||
} else {
|
||||
@@ -294,11 +294,11 @@ public:
|
||||
|
||||
bool file(std::string& a_file,bool a_remove) {
|
||||
std::string slast;
|
||||
std::string s;
|
||||
std::string _s;
|
||||
if((m_args.size()>1) //first arg is the program name !
|
||||
&& last(slast,s)
|
||||
&& last(slast,_s)
|
||||
&& (slast.find('-')!=0)
|
||||
&& (s.empty()) ) {
|
||||
&& (_s.empty()) ) {
|
||||
a_file = slast; //Last argument is not an option.
|
||||
if(a_remove) m_args.erase(m_args.end()-1);
|
||||
return true;
|
||||
|
||||
+9
-9
@@ -81,9 +81,9 @@ inline bool strings2buf(size_t a_number,const char** a_strings,size_t& a_size,ch
|
||||
char* pos = a_buffer;
|
||||
size_t array_size;
|
||||
for(size_t index=0;index<a_number;index++) {
|
||||
const char* s = a_strings[index];
|
||||
array_size = ::strlen(s)+1;
|
||||
::memcpy(pos,s,array_size);
|
||||
const char* _s = a_strings[index];
|
||||
array_size = ::strlen(_s)+1;
|
||||
::memcpy(pos,_s,array_size);
|
||||
pos += array_size;
|
||||
}
|
||||
*pos = '\0';
|
||||
@@ -104,9 +104,9 @@ inline bool strings2buf(const std::vector<std::string>& a_strings,size_t& a_size
|
||||
char* pos = a_buffer;
|
||||
size_t array_size;
|
||||
for(size_t index=0;index<number;index++) {
|
||||
const std::string& s = a_strings[index];
|
||||
array_size = s.size()+1;
|
||||
::memcpy(pos,s.c_str(),array_size);
|
||||
const std::string& _s = a_strings[index];
|
||||
array_size = _s.size()+1;
|
||||
::memcpy(pos,_s.c_str(),array_size);
|
||||
pos += array_size;
|
||||
}
|
||||
*pos = '\0';
|
||||
@@ -124,10 +124,10 @@ inline bool buf2strings(size_t a_size,char* a_buffer,std::vector<std::string>& a
|
||||
for(size_t index=0;index<number;index++) {
|
||||
if((*pos)=='\0') {
|
||||
size_t l = pos - begin;
|
||||
std::string s(l,0);
|
||||
char* data = (char*)s.c_str();
|
||||
std::string _s(l,0);
|
||||
char* data = (char*)_s.c_str();
|
||||
::memcpy(data,begin,l);
|
||||
a_strings.push_back(s);
|
||||
a_strings.push_back(_s);
|
||||
begin = pos+1;
|
||||
}
|
||||
pos++;
|
||||
|
||||
+5
-5
@@ -13,13 +13,13 @@ class charp_out : public std::string {
|
||||
typedef std::string parent;
|
||||
public:
|
||||
charp_out(const char* a_value) {
|
||||
char s[512];
|
||||
char _s[512];
|
||||
if(sizeof(unsigned long)==sizeof(char*)) { //majority of cases.
|
||||
snpf(s,sizeof(s),"%lu",a_value);
|
||||
parent::operator+=(s);
|
||||
snpf(_s,sizeof(_s),"%lu",a_value);
|
||||
parent::operator+=(_s);
|
||||
} else if(sizeof(unsigned long long)==sizeof(char*)) { //majority of cases.
|
||||
snpf(s,sizeof(s),"%llu",a_value);
|
||||
parent::operator+=(s);
|
||||
snpf(_s,sizeof(_s),"%llu",a_value);
|
||||
parent::operator+=(_s);
|
||||
} else {
|
||||
parent::operator+=("charp_out_failed");
|
||||
}
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public:
|
||||
public:
|
||||
//#define tools_stat_colorfs
|
||||
#ifdef tools_stat_colorfs
|
||||
//NOTE : the below are deprecated, use functions in inlib/colorfs.
|
||||
//NOTE : the below are deprecated, use functions in tools/colorfs.
|
||||
// colorf::white() replaced by colorf_white()
|
||||
|
||||
// our forever 65 named colors taken long time ago from X11.
|
||||
|
||||
+13
-13
@@ -73,35 +73,35 @@ public:
|
||||
bool parse(const std::string& a_s){
|
||||
m_top.clear();
|
||||
tree* prev = &m_top;
|
||||
{std::string s;
|
||||
{std::string _s;
|
||||
for(std::string::const_iterator it=a_s.begin();;++it) {
|
||||
if(it==a_s.end()) {
|
||||
if(s.size()) {
|
||||
new tree(prev,s);
|
||||
s.clear();
|
||||
if(_s.size()) {
|
||||
new tree(prev,_s);
|
||||
_s.clear();
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
const char& c = *it;
|
||||
if(c==',') {
|
||||
if(s.size()) {
|
||||
new tree(prev,s);
|
||||
s.clear();
|
||||
if(_s.size()) {
|
||||
new tree(prev,_s);
|
||||
_s.clear();
|
||||
}
|
||||
} else if(c=='{') {
|
||||
tree* _tree = new tree(prev,s);
|
||||
s.clear();
|
||||
tree* _tree = new tree(prev,_s);
|
||||
_s.clear();
|
||||
|
||||
prev = _tree;
|
||||
} else if(c=='}') {
|
||||
if(s.size()) {
|
||||
new tree(prev,s);
|
||||
s.clear();
|
||||
if(_s.size()) {
|
||||
new tree(prev,_s);
|
||||
_s.clear();
|
||||
}
|
||||
prev = prev->m_parent;
|
||||
if(!prev) return false; //should not happen.
|
||||
} else {
|
||||
s += c;
|
||||
_s += c;
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
+44
-44
@@ -56,11 +56,11 @@ inline char* str_from_buffer(const char* a_buffer,size_t a_len
|
||||
mem::increment(s_cstr().c_str());
|
||||
}
|
||||
#endif
|
||||
char* s = (char*)::malloc(a_len+1);
|
||||
if(s==NULL) return NULL;
|
||||
s = ::strncpy(s,a_buffer,a_len);
|
||||
s[a_len] = 0;
|
||||
return s;
|
||||
char* _s = (char*)::malloc(a_len+1);
|
||||
if(_s==NULL) return NULL;
|
||||
_s = ::strncpy(_s,a_buffer,a_len);
|
||||
_s[a_len] = 0;
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline void str_del(char*& a_cstr) {
|
||||
@@ -76,33 +76,33 @@ inline void str_del(char*& a_cstr) {
|
||||
}
|
||||
|
||||
inline char* str_new(size_t a_l = 0,char a_char = ' ') {
|
||||
char* s = (char*)::malloc((a_l+1)*sizeof(char));
|
||||
if(s==NULL) return NULL;
|
||||
char* _s = (char*)::malloc((a_l+1)*sizeof(char));
|
||||
if(_s==NULL) return NULL;
|
||||
#ifdef TOOLS_MEM
|
||||
#ifdef TOOLS_CSTR_DEBUG_MEM
|
||||
::printf("debug : str_new : len %lu\n",a_l);
|
||||
#endif
|
||||
mem::increment(s_cstr().c_str());
|
||||
#endif
|
||||
char* pos = s;
|
||||
char* pos = _s;
|
||||
for(size_t c=0;c<a_l;c++,pos++) *pos = a_char;
|
||||
*(s+a_l) = 0;
|
||||
return s;
|
||||
*(_s+a_l) = 0;
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline bool str_cat(char*& a_1,const char a_c) {
|
||||
size_t l1 = ::strlen(a_1);
|
||||
char* s = (char*)::malloc(l1+1+1);
|
||||
if(!s) return false;
|
||||
char* _s = (char*)::malloc(l1+1+1);
|
||||
if(!_s) return false;
|
||||
#ifdef TOOLS_MEM
|
||||
#ifdef TOOLS_CSTR_DEBUG_MEM
|
||||
::printf("debug : str_cat \"%s\", char %d\n",a_1,a_c);
|
||||
#endif
|
||||
mem::increment(s_cstr().c_str());
|
||||
#endif
|
||||
::memcpy(s,a_1,l1);
|
||||
::memcpy(s+l1,&a_c,1);
|
||||
*(s+l1+1) = 0;
|
||||
::memcpy(_s,a_1,l1);
|
||||
::memcpy(_s+l1,&a_c,1);
|
||||
*(_s+l1+1) = 0;
|
||||
::free(a_1);
|
||||
#ifdef TOOLS_MEM
|
||||
#ifdef TOOLS_CSTR_DEBUG_MEM
|
||||
@@ -110,24 +110,24 @@ inline bool str_cat(char*& a_1,const char a_c) {
|
||||
#endif
|
||||
mem::decrement(s_cstr().c_str());
|
||||
#endif
|
||||
a_1 = s;
|
||||
a_1 = _s;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool str_cat(char*& a_1,const char* a_2) {
|
||||
size_t l1 = ::strlen(a_1);
|
||||
size_t l2 = ::strlen(a_2);
|
||||
char* s = (char*)::malloc(l1+l2+1);
|
||||
if(!s) return false;
|
||||
char* _s = (char*)::malloc(l1+l2+1);
|
||||
if(!_s) return false;
|
||||
#ifdef TOOLS_MEM
|
||||
#ifdef TOOLS_CSTR_DEBUG_MEM
|
||||
::printf("debug : str_cat \"%s\" \"%s\"\n",a_1,a_2);
|
||||
#endif
|
||||
mem::increment(s_cstr().c_str());
|
||||
#endif
|
||||
::memcpy(s,a_1,l1);
|
||||
::memcpy(s+l1,a_2,l2);
|
||||
*(s+l1+l2) = 0;
|
||||
::memcpy(_s,a_1,l1);
|
||||
::memcpy(_s+l1,a_2,l2);
|
||||
*(_s+l1+l2) = 0;
|
||||
::free(a_1);
|
||||
#ifdef TOOLS_MEM
|
||||
#ifdef TOOLS_CSTR_DEBUG_MEM
|
||||
@@ -135,7 +135,7 @@ inline bool str_cat(char*& a_1,const char* a_2) {
|
||||
#endif
|
||||
mem::decrement(s_cstr().c_str());
|
||||
#endif
|
||||
a_1 = s;
|
||||
a_1 = _s;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -163,8 +163,8 @@ inline char* str_sub(const char* a_s,
|
||||
} else {
|
||||
ls = l-a_pos;
|
||||
}
|
||||
char* s = (char*)::malloc(ls+1);
|
||||
if(!s) return 0;
|
||||
char* _s = (char*)::malloc(ls+1);
|
||||
if(!_s) return 0;
|
||||
#ifdef TOOLS_MEM
|
||||
#ifdef TOOLS_CSTR_DEBUG_MEM
|
||||
::printf("debug : str_sub \"%s\"\n",a_s);
|
||||
@@ -173,9 +173,9 @@ inline char* str_sub(const char* a_s,
|
||||
#endif
|
||||
//abcdefgh l=8
|
||||
//0123456789
|
||||
::memcpy(s,a_s+a_pos,ls);
|
||||
*(s+ls) = 0;
|
||||
return s;
|
||||
::memcpy(_s,a_s+a_pos,ls);
|
||||
*(_s+ls) = 0;
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline char* str_rep(const char* a_s,unsigned int a_pos,unsigned int a_sz,const char* a_new) {
|
||||
@@ -190,19 +190,19 @@ inline char* str_rep(const char* a_s,unsigned int a_pos,unsigned int a_sz,const
|
||||
// p
|
||||
size_t le = las-(a_pos+a_sz);
|
||||
size_t ls = a_pos+num+le;
|
||||
char* s = (char*)::malloc(ls+1);
|
||||
if(!s) return 0;
|
||||
char* _s = (char*)::malloc(ls+1);
|
||||
if(!_s) return 0;
|
||||
#ifdef TOOLS_MEM
|
||||
#ifdef TOOLS_CSTR_DEBUG_MEM
|
||||
::printf("debug : str_rep \"%s\"\n",a_s);
|
||||
#endif
|
||||
mem::increment(s_cstr().c_str());
|
||||
#endif
|
||||
::memcpy(s,a_s,a_pos);
|
||||
::memcpy(s+a_pos,a_new,num);
|
||||
if(le) ::memcpy(s+a_pos+num,a_s+a_pos+a_sz,le);
|
||||
*(s+ls) = 0;
|
||||
return s;
|
||||
::memcpy(_s,a_s,a_pos);
|
||||
::memcpy(_s+a_pos,a_new,num);
|
||||
if(le) ::memcpy(_s+a_pos+num,a_s+a_pos+a_sz,le);
|
||||
*(_s+ls) = 0;
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline void str_skip(char*& a_cstr,char a_c) {
|
||||
@@ -280,23 +280,23 @@ inline size_t str_lcpy(char *dst, const char *src, size_t siz) {
|
||||
// Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>.
|
||||
|
||||
/*register*/ char* d = dst;
|
||||
/*register*/ const char* s = src;
|
||||
/*register*/ const char* _s = src;
|
||||
/*register*/ size_t n = siz;
|
||||
|
||||
// Copy as many bytes as will fit :
|
||||
if (n != 0 && --n != 0) {
|
||||
do {
|
||||
if ((*d++ = *s++) == 0) break;
|
||||
if ((*d++ = *_s++) == 0) break;
|
||||
} while (--n != 0);
|
||||
}
|
||||
|
||||
// Not enough room in dst, add NUL and traverse rest of src :
|
||||
if (n == 0) {
|
||||
if (siz != 0) *d = '\0'; // NUL-terminate dst.
|
||||
while (*s++);
|
||||
while (*_s++);
|
||||
}
|
||||
|
||||
return(s - src - 1); // count does not include NUL.
|
||||
return(_s - src - 1); // count does not include NUL.
|
||||
}
|
||||
|
||||
inline size_t str_lcat(char *dst, const char *src, size_t siz) {
|
||||
@@ -312,7 +312,7 @@ inline size_t str_lcat(char *dst, const char *src, size_t siz) {
|
||||
// Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>.
|
||||
|
||||
/*register*/ char* d = dst;
|
||||
/*register*/ const char* s = src;
|
||||
/*register*/ const char* _s = src;
|
||||
/*register*/ size_t n = siz;
|
||||
size_t dlen;
|
||||
|
||||
@@ -321,18 +321,18 @@ inline size_t str_lcat(char *dst, const char *src, size_t siz) {
|
||||
dlen = d - dst;
|
||||
n = siz - dlen;
|
||||
|
||||
if (n == 0) return(dlen + strlen(s));
|
||||
if (n == 0) return(dlen + strlen(_s));
|
||||
|
||||
while (*s != '\0') {
|
||||
while (*_s != '\0') {
|
||||
if (n != 1) {
|
||||
*d++ = *s;
|
||||
*d++ = *_s;
|
||||
n--;
|
||||
}
|
||||
s++;
|
||||
_s++;
|
||||
}
|
||||
*d = '\0';
|
||||
|
||||
return(dlen + (s - src)); // count does not include NUL.
|
||||
return(dlen + (_s - src)); // count does not include NUL.
|
||||
}
|
||||
|
||||
template <class VECTOR>
|
||||
|
||||
+6
-6
@@ -28,15 +28,15 @@ inline bool get_env(const std::string& a_string,std::string& a_value){
|
||||
|
||||
template <class T>
|
||||
inline bool get_env(const std::string& a_string,T& a_v,const T& a_def = T()){
|
||||
std::string s;
|
||||
if(!get_env(a_string,s)) {a_v = a_def;return false;}
|
||||
return to<T>(s,a_v,a_def);
|
||||
std::string _s;
|
||||
if(!get_env(a_string,_s)) {a_v = a_def;return false;}
|
||||
return to<T>(_s,a_v,a_def);
|
||||
}
|
||||
|
||||
inline bool get_env_bool(const std::string& a_string,bool& a_v){
|
||||
std::string s;
|
||||
if(!get_env(a_string,s)) return false;
|
||||
return to(s,a_v);
|
||||
std::string _s;
|
||||
if(!get_env(a_string,_s)) return false;
|
||||
return to(_s,a_v);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1833
-1428
File diff suppressed because it is too large
Load Diff
@@ -1,78 +0,0 @@
|
||||
|
||||
#include "gl2ps_def.h"
|
||||
|
||||
/*----------------------------------------------------------*/
|
||||
/*----------------------------------------------------------*/
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
inline tools_GLboolean tools_dummy_glIsEnabled (tools_GLenum) {return TOOLS_GL_FALSE;}
|
||||
inline void tools_dummy_glBegin (tools_GLenum) {}
|
||||
inline void tools_dummy_glEnd () {}
|
||||
inline void tools_dummy_glGetFloatv (tools_GLenum,tools_GLfloat*) {}
|
||||
inline void tools_dummy_glVertex3f (tools_GLfloat,tools_GLfloat,tools_GLfloat) {}
|
||||
inline void tools_dummy_glGetBooleanv (tools_GLenum,tools_GLboolean*) {}
|
||||
inline void tools_dummy_glGetIntegerv (tools_GLenum,tools_GLint*) {}
|
||||
inline tools_GLint tools_dummy_glRenderMode (tools_GLenum) {return 0;}
|
||||
inline void tools_dummy_glFeedbackBuffer (tools_GLsizei,tools_GLenum,tools_GLfloat*) {}
|
||||
inline void tools_dummy_glPassThrough (tools_GLfloat ) {}
|
||||
|
||||
inline tools_gl2ps_gl_funcs_t& tools_gl2ps_get_s_funcs() {
|
||||
static tools_gl2ps_gl_funcs_t s_gl_funcs = {
|
||||
tools_dummy_glIsEnabled,
|
||||
tools_dummy_glBegin,
|
||||
tools_dummy_glEnd,
|
||||
tools_dummy_glGetFloatv,
|
||||
tools_dummy_glVertex3f,
|
||||
tools_dummy_glGetBooleanv,
|
||||
tools_dummy_glGetIntegerv,
|
||||
tools_dummy_glRenderMode,
|
||||
tools_dummy_glFeedbackBuffer,
|
||||
tools_dummy_glPassThrough
|
||||
};
|
||||
return s_gl_funcs;
|
||||
}
|
||||
|
||||
TOOLS_GL2PSDLL_API void tools_gl2ps_set_gl_funcs(tools_gl2ps_gl_funcs_t* a_funcs) {
|
||||
tools_gl2ps_gl_funcs_t& s_gl_funcs = tools_gl2ps_get_s_funcs();
|
||||
s_gl_funcs.m_glIsEnabled = a_funcs->m_glIsEnabled;
|
||||
s_gl_funcs.m_glBegin = a_funcs->m_glBegin;
|
||||
s_gl_funcs.m_glEnd = a_funcs->m_glEnd;
|
||||
s_gl_funcs.m_glGetFloatv = a_funcs->m_glGetFloatv;
|
||||
s_gl_funcs.m_glVertex3f = a_funcs->m_glVertex3f;
|
||||
s_gl_funcs.m_glGetBooleanv = a_funcs->m_glGetBooleanv;
|
||||
s_gl_funcs.m_glGetIntegerv = a_funcs->m_glGetIntegerv;
|
||||
s_gl_funcs.m_glRenderMode = a_funcs->m_glRenderMode;
|
||||
s_gl_funcs.m_glFeedbackBuffer = a_funcs->m_glFeedbackBuffer;
|
||||
s_gl_funcs.m_glPassThrough = a_funcs->m_glPassThrough;
|
||||
}
|
||||
|
||||
TOOLS_GL2PSDLL_API void tools_gl2ps_reset_gl_funcs() {
|
||||
tools_gl2ps_gl_funcs_t& s_gl_funcs = tools_gl2ps_get_s_funcs();
|
||||
s_gl_funcs.m_glIsEnabled = tools_dummy_glIsEnabled;
|
||||
s_gl_funcs.m_glBegin = tools_dummy_glBegin;
|
||||
s_gl_funcs.m_glEnd = tools_dummy_glEnd;
|
||||
s_gl_funcs.m_glGetFloatv = tools_dummy_glGetFloatv;
|
||||
s_gl_funcs.m_glVertex3f = tools_dummy_glVertex3f;
|
||||
s_gl_funcs.m_glGetBooleanv = tools_dummy_glGetBooleanv;
|
||||
s_gl_funcs.m_glGetIntegerv = tools_dummy_glGetIntegerv;
|
||||
s_gl_funcs.m_glRenderMode = tools_dummy_glRenderMode;
|
||||
s_gl_funcs.m_glFeedbackBuffer = tools_dummy_glFeedbackBuffer;
|
||||
s_gl_funcs.m_glPassThrough = tools_dummy_glPassThrough;
|
||||
}
|
||||
|
||||
#define tools_glIsEnabled (*(tools_gl2ps_get_s_funcs().m_glIsEnabled))
|
||||
#define tools_glBegin (*(tools_gl2ps_get_s_funcs().m_glBegin))
|
||||
#define tools_glEnd (*(tools_gl2ps_get_s_funcs().m_glEnd))
|
||||
#define tools_glGetFloatv (*(tools_gl2ps_get_s_funcs().m_glGetFloatv))
|
||||
#define tools_glVertex3f (*(tools_gl2ps_get_s_funcs().m_glVertex3f))
|
||||
#define tools_glGetBooleanv (*(tools_gl2ps_get_s_funcs().m_glGetBooleanv))
|
||||
#define tools_glGetIntegerv (*(tools_gl2ps_get_s_funcs().m_glGetIntegerv))
|
||||
#define tools_glRenderMode (*(tools_gl2ps_get_s_funcs().m_glRenderMode))
|
||||
#define tools_glFeedbackBuffer (*(tools_gl2ps_get_s_funcs().m_glFeedbackBuffer))
|
||||
#define tools_glPassThrough (*(tools_gl2ps_get_s_funcs().m_glPassThrough))
|
||||
|
||||
/*----------------------------------------------------------*/
|
||||
/*----------------------------------------------------------*/
|
||||
/*----------------------------------------------------------*/
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
+26
-12
@@ -20,14 +20,14 @@ typedef unsigned char tools_GLboolean;
|
||||
|
||||
#define TOOLS_GL2PS_MAJOR_VERSION 1
|
||||
#define TOOLS_GL2PS_MINOR_VERSION 4
|
||||
#define TOOLS_GL2PS_PATCH_VERSION 0
|
||||
#define TOOLS_GL2PS_PATCH_VERSION 2
|
||||
#define TOOLS_GL2PS_EXTRA_VERSION ""
|
||||
|
||||
#define TOOLS_GL2PS_VERSION (TOOLS_GL2PS_MAJOR_VERSION + \
|
||||
0.01 * TOOLS_GL2PS_MINOR_VERSION + \
|
||||
0.0001 * TOOLS_GL2PS_PATCH_VERSION)
|
||||
|
||||
#define TOOLS_GL2PS_COPYRIGHT "(C) 1999-2017 C. Geuzaine"
|
||||
#define TOOLS_GL2PS_COPYRIGHT "(C) 1999-2020 C. Geuzaine"
|
||||
|
||||
/* Output file formats (the values and the ordering are important!) */
|
||||
|
||||
@@ -71,6 +71,7 @@ typedef unsigned char tools_GLboolean;
|
||||
#define TOOLS_GL2PS_NO_BLENDING (1<<11)
|
||||
#define TOOLS_GL2PS_TIGHT_BOUNDING_BOX (1<<12)
|
||||
#define TOOLS_GL2PS_NO_OPENGL_CONTEXT (1<<13)
|
||||
#define TOOLS_GL2PS_NO_TEX_FONTSIZE (1<<14)
|
||||
|
||||
/* Arguments for tools_gl2psEnable/tools_gl2psDisable */
|
||||
|
||||
@@ -181,17 +182,30 @@ typedef struct {
|
||||
/*----------------------------------------------------------*/
|
||||
/*----------------------------------------------------------*/
|
||||
/*----------------------------------------------------------*/
|
||||
typedef struct tools_GL2PScontextRec* tools_GL2PScontextPointer;
|
||||
|
||||
typedef tools_GLboolean (*tools_glIsEnabled_func) (tools_GLenum);
|
||||
typedef void (*tools_glBegin_func) (tools_GLenum);
|
||||
typedef void (*tools_glEnd_func) ();
|
||||
typedef void (*tools_glGetFloatv_func) (tools_GLenum,tools_GLfloat*);
|
||||
typedef void (*tools_glVertex3f_func) (tools_GLfloat,tools_GLfloat,tools_GLfloat);
|
||||
typedef void (*tools_glGetBooleanv_func) (tools_GLenum,tools_GLboolean*);
|
||||
typedef void (*tools_glGetIntegerv_func) (tools_GLenum,tools_GLint*);
|
||||
typedef tools_GLint (*tools_glRenderMode_func) (tools_GLenum);
|
||||
typedef void (*tools_glFeedbackBuffer_func) (tools_GLsizei,tools_GLenum,tools_GLfloat*);
|
||||
typedef void (*tools_glPassThrough_func) (tools_GLfloat);
|
||||
|
||||
typedef struct {
|
||||
tools_GLboolean (*m_glIsEnabled) (tools_GLenum);
|
||||
void (*m_glBegin) (tools_GLenum);
|
||||
void (*m_glEnd) ();
|
||||
void (*m_glGetFloatv) (tools_GLenum,tools_GLfloat*);
|
||||
void (*m_glVertex3f) (tools_GLfloat,tools_GLfloat,tools_GLfloat);
|
||||
void (*m_glGetBooleanv) (tools_GLenum,tools_GLboolean*);
|
||||
void (*m_glGetIntegerv) (tools_GLenum,tools_GLint*);
|
||||
tools_GLint (*m_glRenderMode) (tools_GLenum);
|
||||
void (*m_glFeedbackBuffer) (tools_GLsizei,tools_GLenum,tools_GLfloat*);
|
||||
void (*m_glPassThrough) (tools_GLfloat);
|
||||
tools_glIsEnabled_func m_glIsEnabled;
|
||||
tools_glBegin_func m_glBegin;
|
||||
tools_glEnd_func m_glEnd;
|
||||
tools_glGetFloatv_func m_glGetFloatv;
|
||||
tools_glVertex3f_func m_glVertex3f;
|
||||
tools_glGetBooleanv_func m_glGetBooleanv;
|
||||
tools_glGetIntegerv_func m_glGetIntegerv;
|
||||
tools_glRenderMode_func m_glRenderMode;
|
||||
tools_glFeedbackBuffer_func m_glFeedbackBuffer;
|
||||
tools_glPassThrough_func m_glPassThrough;
|
||||
} tools_gl2ps_gl_funcs_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
|
||||
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psSetBackgroundColor(float a_r,float a_g,float a_b)
|
||||
{
|
||||
if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
|
||||
|
||||
tools_gl2ps_context->bgcolor[0] = a_r;
|
||||
tools_gl2ps_context->bgcolor[1] = a_g;
|
||||
tools_gl2ps_context->bgcolor[2] = a_b;
|
||||
tools_gl2ps_context->bgcolor[3] = 1.0F;
|
||||
|
||||
return TOOLS_GL2PS_SUCCESS;
|
||||
}
|
||||
|
||||
#undef TOOLS_GL2PS_EPSILON
|
||||
#undef TOOLS_GL2PS_ZSCALE
|
||||
#undef TOOLS_GL2PS_ZOFFSET
|
||||
#undef TOOLS_GL2PS_ZOFFSET_LARGE
|
||||
#undef TOOLS_GL2PS_ZERO
|
||||
#undef TOOLS_GL2PS_COINCIDENT
|
||||
#undef TOOLS_GL2PS_IN_FRONT_OF
|
||||
#undef TOOLS_GL2PS_IN_BACK_OF
|
||||
#undef TOOLS_GL2PS_SPANNING
|
||||
#undef TOOLS_GL2PS_POINT_COINCIDENT
|
||||
#undef TOOLS_GL2PS_POINT_INFRONT
|
||||
#undef TOOLS_GL2PS_POINT_BACK
|
||||
#undef TOOLS_GL2PS_BEGIN_OFFSET_TOKEN
|
||||
#undef TOOLS_GL2PS_END_OFFSET_TOKEN
|
||||
#undef TOOLS_GL2PS_BEGIN_BOUNDARY_TOKEN
|
||||
#undef TOOLS_GL2PS_END_BOUNDARY_TOKEN
|
||||
#undef TOOLS_GL2PS_BEGIN_STIPPLE_TOKEN
|
||||
#undef TOOLS_GL2PS_END_STIPPLE_TOKEN
|
||||
#undef TOOLS_GL2PS_POINT_SIZE_TOKEN
|
||||
#undef TOOLS_GL2PS_LINE_CAP_TOKEN
|
||||
#undef TOOLS_GL2PS_LINE_JOIN_TOKEN
|
||||
#undef TOOLS_GL2PS_LINE_WIDTH_TOKEN
|
||||
#undef TOOLS_GL2PS_BEGIN_BLEND_TOKEN
|
||||
#undef TOOLS_GL2PS_END_BLEND_TOKEN
|
||||
#undef TOOLS_GL2PS_SRC_BLEND_TOKEN
|
||||
#undef TOOLS_GL2PS_DST_BLEND_TOKEN
|
||||
#undef TOOLS_GL2PS_IMAGEMAP_TOKEN
|
||||
#undef TOOLS_GL2PS_DRAW_PIXELS_TOKEN
|
||||
#undef TOOLS_GL2PS_TEXT_TOKEN
|
||||
@@ -1,36 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hdf5_h
|
||||
#define tools_hdf5_h
|
||||
|
||||
#ifndef TOOLS_USE_OUREX_HDF5
|
||||
#include <hdf5.h>
|
||||
#else
|
||||
#include <ourex_hdf5.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if (H5_VERS_MAJOR>=1) && (H5_VERS_MINOR<=6)
|
||||
#define tools_H5Dopen H5Dopen
|
||||
#define tools_H5Dcreate H5Dcreate
|
||||
#define tools_H5Acreate H5Acreate
|
||||
#define tools_H5Tarray_create H5Tarray_create
|
||||
#define tools_H5Tget_array_dims H5Tget_array_dims
|
||||
#define tools_H5Gcreate H5Gcreate
|
||||
#define tools_H5Gopen H5Gopen
|
||||
#define tools_H5Aiterate H5Aiterate
|
||||
#define tools_H5free_memory free
|
||||
#else
|
||||
#define tools_H5Dopen H5Dopen1
|
||||
#define tools_H5Dcreate H5Dcreate1
|
||||
#define tools_H5Acreate H5Acreate1
|
||||
#define tools_H5Tarray_create H5Tarray_create1
|
||||
#define tools_H5Tget_array_dims H5Tget_array_dims1
|
||||
#define tools_H5Gcreate H5Gcreate1
|
||||
#define tools_H5Gopen H5Gopen1
|
||||
#define tools_H5Aiterate H5Aiterate1
|
||||
#define tools_H5free_memory H5free_memory
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -276,7 +276,7 @@ public: //histo_data
|
||||
return number;
|
||||
}
|
||||
|
||||
// for inlib/wroot/streamers :
|
||||
// for tools/wroot/streamers :
|
||||
TN get_entries() const {
|
||||
TN number = 0;
|
||||
for(TO ibin=0;ibin<m_bin_number;ibin++) {
|
||||
|
||||
+9
-9
@@ -209,10 +209,10 @@ public:
|
||||
std::vector<data_point>::iterator it;
|
||||
for(it=m_points.begin();it!=m_points.end();++it) {
|
||||
for(unsigned int coord=0;coord<m_dim;coord++) {
|
||||
measurement& m = (*it).coordinate(coord);
|
||||
m.set_value(m.value() * a_scale);
|
||||
m.set_error_plus(m.error_plus() * a_scale);
|
||||
m.set_error_minus(m.error_minus() * a_scale);
|
||||
measurement& _m = (*it).coordinate(coord);
|
||||
_m.set_value(_m.value() * a_scale);
|
||||
_m.set_error_plus(_m.error_plus() * a_scale);
|
||||
_m.set_error_minus(_m.error_minus() * a_scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,8 +221,8 @@ public:
|
||||
std::vector<data_point>::iterator it;
|
||||
for(it=m_points.begin();it!=m_points.end();++it) {
|
||||
for(unsigned int coord=0;coord<m_dim;coord++) {
|
||||
measurement& m = (*it).coordinate(coord);
|
||||
m.set_value(m.value() * a_scale);
|
||||
measurement& _m = (*it).coordinate(coord);
|
||||
_m.set_value(_m.value() * a_scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,9 +231,9 @@ public:
|
||||
std::vector<data_point>::iterator it;
|
||||
for(it=m_points.begin();it!=m_points.end();++it) {
|
||||
for(unsigned int coord=0;coord<m_dim;coord++) {
|
||||
measurement& m = (*it).coordinate(coord);
|
||||
m.set_error_plus(m.error_plus() * a_scale);
|
||||
m.set_error_minus(m.error_minus() * a_scale);
|
||||
measurement& _m = (*it).coordinate(coord);
|
||||
_m.set_error_plus(_m.error_plus() * a_scale);
|
||||
_m.set_error_minus(_m.error_minus() * a_scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -941,7 +941,7 @@ public: /*operators*/\
|
||||
return m_vec[a_r + a_c * dimension()];\
|
||||
}\
|
||||
\
|
||||
T& operator[](size_t a_index) { /*for inlib/sg/sf_vec*/\
|
||||
T& operator[](size_t a_index) { /*for tools/sg/sf_vec*/\
|
||||
/*WARNING : no check on a_index.*/\
|
||||
return m_vec[a_index];\
|
||||
}\
|
||||
@@ -982,7 +982,7 @@ protected:\
|
||||
T* tp = (T*)m_vec;T* ap = (T*)a_m;\
|
||||
for(unsigned int i=0;i<dim2();i++,tp++,ap++) *tp = *ap;\
|
||||
/*{for(unsigned int i=0;i<dim2();i++) m_vec[i] = a_m[i];}*/\
|
||||
/* memcpy does not work with std::complex<> and mat<symbol,4> see inlib/tests/symbolic.cpp */\
|
||||
/* memcpy does not work with std::complex<> and mat<symbol,4> see tools/tests/symbolic.cpp */\
|
||||
/*vec_copy(m_vec,a_m,dim2());*/\
|
||||
}\
|
||||
\
|
||||
|
||||
+4
-4
@@ -50,10 +50,10 @@ public:
|
||||
void get_point(unsigned int a_index,unsigned int a_num,vec3<T>& a_p){
|
||||
//a_index = 0 is a_p0
|
||||
//a_index = a_num-1 is a_p1
|
||||
T s = T(a_index)/T(a_num-1);
|
||||
T s2 = s*s;
|
||||
T s3 = s2*s;
|
||||
a_p = m_a*s3 + m_b*s2 + m_c*s + m_d;
|
||||
T _s = T(a_index)/T(a_num-1);
|
||||
T s2 = _s*_s;
|
||||
T s3 = s2*_s;
|
||||
a_p = m_a*s3 + m_b*s2 + m_c*_s + m_d;
|
||||
}
|
||||
void get_point(unsigned int a_index,unsigned int a_num,T& a_x,T& a_y,T& a_z){
|
||||
//a_index = 0 is a_p0
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ public: //operators
|
||||
bool operator==(const vec2& a_v) const {return equal(a_v);}
|
||||
bool operator!=(const vec2& a_v) const {return !operator==(a_v);}
|
||||
|
||||
public: //for inlib/sg/sf_vec
|
||||
public: //for tools/sg/sf_vec
|
||||
typedef unsigned int size_type;
|
||||
size_type size() const {return 2;}
|
||||
const T* data() const {return m_data;}
|
||||
|
||||
+1
-1
@@ -260,7 +260,7 @@ public: //operators
|
||||
bool operator==(const vec3& a_v) const {return equal(a_v);}
|
||||
bool operator!=(const vec3& a_v) const {return !operator==(a_v);}
|
||||
|
||||
public: //for inlib/sg/sf_vec
|
||||
public: //for tools/sg/sf_vec
|
||||
typedef unsigned int size_type;
|
||||
size_type size() const {return 3;}
|
||||
const T* data() const {return m_data;}
|
||||
|
||||
+1
-1
@@ -254,7 +254,7 @@ public: //operators
|
||||
bool operator==(const vec4& a_v) const {return equal(a_v);}
|
||||
bool operator!=(const vec4& a_v) const {return !operator==(a_v);}
|
||||
|
||||
public: //for inlib/sg/sf_vec
|
||||
public: //for tools/sg/sf_vec
|
||||
typedef unsigned int size_type;
|
||||
size_type size() const {return 4;}
|
||||
const T* data() const {return m_data;}
|
||||
|
||||
+3
-3
@@ -13,9 +13,9 @@ class long_out : public std::string {
|
||||
typedef std::string parent;
|
||||
public:
|
||||
long_out(long a_value) {
|
||||
char s[512];
|
||||
snpf(s,sizeof(s),"%ld",a_value);
|
||||
parent::operator+=(s);
|
||||
char _s[512];
|
||||
snpf(_s,sizeof(_s),"%ld",a_value);
|
||||
parent::operator+=(_s);
|
||||
}
|
||||
public:
|
||||
long_out(const long_out& a_from):parent(a_from){}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_mpi_dummy_mpi_h
|
||||
#define tools_mpi_dummy_mpi_h
|
||||
|
||||
extern "C" {
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
/// to pass hd2mpi ////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
typedef void* MPI_Comm;
|
||||
typedef void* MPI_Datatype;
|
||||
|
||||
#define MPI_UNSIGNED 0
|
||||
#define MPI_FLOAT 0
|
||||
#define MPI_DOUBLE 0
|
||||
#define MPI_UNSIGNED_CHAR 0
|
||||
#define MPI_CHAR 0
|
||||
#define MPI_LONG 0
|
||||
#define MPI_SHORT 0
|
||||
#define MPI_INT 0
|
||||
#define MPI_UNSIGNED_LONG 0
|
||||
#define MPI_LONG_LONG 0
|
||||
#define MPI_UNSIGNED_LONG_LONG 0
|
||||
|
||||
#define MPI_ANY_SOURCE 0
|
||||
|
||||
#define MPI_SUCCESS 1
|
||||
|
||||
#ifdef TOOLS_USE_MPI_PACK_NOT_CONST
|
||||
inline int MPI_Pack(void*,int,MPI_Datatype,void*,int,int*,MPI_Comm){return 0;}
|
||||
inline int MPI_Unpack(void*,int,int*,void*,int,MPI_Datatype,MPI_Comm){return 0;}
|
||||
#else
|
||||
inline int MPI_Pack(const void*,int,MPI_Datatype,void*,int,int*,MPI_Comm){return 0;}
|
||||
inline int MPI_Unpack(const void*,int,int*,void*,int,MPI_Datatype,MPI_Comm){return 0;}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
/// to pass h2mpi, hs2mpi /////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
struct _MPI_Status {
|
||||
int MPI_SOURCE;
|
||||
int MPI_TAG;
|
||||
};
|
||||
typedef _MPI_Status MPI_Status;
|
||||
|
||||
inline int MPI_Probe(int,int,MPI_Comm,MPI_Status*){return 0;}
|
||||
inline int MPI_Get_count(const MPI_Status*,MPI_Datatype,int*){return 0;}
|
||||
inline int MPI_Send(const void*,int,MPI_Datatype,int,int,MPI_Comm){return 0;}
|
||||
inline int MPI_Recv(void*,int,MPI_Datatype,int,int,MPI_Comm,MPI_Status*){return 0;}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
/// to pass examples/cpp/mpi.cpp //////////////////////////////
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
#define MPI_COMM_WORLD 0
|
||||
#define MPI_MAX_PROCESSOR_NAME 100
|
||||
|
||||
inline int MPI_Init(int*,char***){return 0;}
|
||||
inline int MPI_Finalize(void){return 0;}
|
||||
inline int MPI_Comm_size(MPI_Comm,int*){return 0;}
|
||||
inline int MPI_Comm_rank(MPI_Comm,int*){return 0;}
|
||||
inline int MPI_Get_processor_name(char*,int*){return 0;}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
+4
-4
@@ -12,15 +12,15 @@ namespace tools {
|
||||
|
||||
inline void out_error(std::ostream& a_out,
|
||||
const char* location, const char* fmt,...) {
|
||||
char s[1024];
|
||||
char _s[1024];
|
||||
va_list args;
|
||||
va_start(args,fmt);
|
||||
vsnpf(s,sizeof(s),fmt,args);
|
||||
vsnpf(_s,sizeof(_s),fmt,args);
|
||||
va_end(args);
|
||||
if(location) {
|
||||
a_out << location << " : " << s << std::endl;
|
||||
a_out << location << " : " << _s << std::endl;
|
||||
} else {
|
||||
a_out << s << std::endl;
|
||||
a_out << _s << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-18
@@ -25,12 +25,12 @@ inline void nosuffix(const std::string& a_string,std::string& a_value,bool a_bac
|
||||
if(pos==std::string::npos) pos = a_string.rfind('\\');
|
||||
if(pos==std::string::npos) pos = 0;
|
||||
else pos++;
|
||||
std::string s = a_string.substr(pos,a_string.size()-pos);
|
||||
std::string::size_type dot_pos = a_back?s.rfind('.'):s.find('.');
|
||||
std::string _s = a_string.substr(pos,a_string.size()-pos);
|
||||
std::string::size_type dot_pos = a_back?_s.rfind('.'):_s.find('.');
|
||||
if(dot_pos==std::string::npos) {
|
||||
a_value = s;
|
||||
a_value = _s;
|
||||
} else {
|
||||
a_value = s.substr(0,dot_pos);
|
||||
a_value = _s.substr(0,dot_pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,15 +192,15 @@ inline bool path_name_suffix(const std::string& a_string,std::string& a_path,std
|
||||
a_path = a_string.substr(0,pos);
|
||||
pos++;
|
||||
}
|
||||
std::string s = a_string.substr(pos,a_string.size()-pos);
|
||||
pos = s.rfind('.');
|
||||
std::string _s = a_string.substr(pos,a_string.size()-pos);
|
||||
pos = _s.rfind('.');
|
||||
if(pos==std::string::npos) {
|
||||
a_name = s;
|
||||
a_name = _s;
|
||||
a_suffix.clear();
|
||||
} else {
|
||||
a_name = s;
|
||||
a_name = _s;
|
||||
pos++;
|
||||
a_suffix = s.substr(pos,s.size()-pos);
|
||||
a_suffix = _s.substr(pos,_s.size()-pos);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -208,8 +208,8 @@ inline bool path_name_suffix(const std::string& a_string,std::string& a_path,std
|
||||
inline std::string dir_name(const std::string& a_path,unsigned int a_num = 1){
|
||||
std::string path = a_path;
|
||||
for(unsigned int index=0;index<a_num;index++) {
|
||||
std::string p,n,s;
|
||||
path_name_suffix(path,p,n,s);
|
||||
std::string p,n,_s;
|
||||
path_name_suffix(path,p,n,_s);
|
||||
path = p;
|
||||
}
|
||||
return path;
|
||||
@@ -278,11 +278,11 @@ inline bool is_python(const std::string& a_path){
|
||||
namespace tools {
|
||||
|
||||
inline bool url_parse(const std::string& a_url,std::string& a_host,unsigned int& a_port,std::string& a_path) {
|
||||
std::string s;
|
||||
std::string _s;
|
||||
if((a_url.size()>=7)&&(a_url.substr(0,7)=="http://")) {
|
||||
s = a_url.substr(7,a_url.size()-7);
|
||||
_s = a_url.substr(7,a_url.size()-7);
|
||||
} else if((a_url.size()>=8)&&(a_url.substr(0,8)=="https://")) {
|
||||
s = a_url.substr(8,a_url.size()-8);
|
||||
_s = a_url.substr(8,a_url.size()-8);
|
||||
} else {
|
||||
a_host.clear();
|
||||
a_port = 0;
|
||||
@@ -290,13 +290,13 @@ inline bool url_parse(const std::string& a_url,std::string& a_host,unsigned int&
|
||||
return false;
|
||||
}
|
||||
|
||||
{std::string::size_type pos = s.find('/');
|
||||
{std::string::size_type pos = _s.find('/');
|
||||
if(pos==std::string::npos) {
|
||||
a_host = s;
|
||||
a_host = _s;
|
||||
a_path = "/";
|
||||
} else {
|
||||
a_host = s.substr(0,pos);
|
||||
a_path = s.substr(pos,s.size()-pos);
|
||||
a_host = _s.substr(0,pos);
|
||||
a_path = _s.substr(pos,_s.size()-pos);
|
||||
}}
|
||||
|
||||
{std::string::size_type pos = a_host.find(':');
|
||||
|
||||
+18
-18
@@ -40,42 +40,42 @@ inline bool to_pointer(const char* a_string,void*& a_value){
|
||||
}
|
||||
|
||||
inline bool p2s(const void* a_value,std::string& a_s){
|
||||
char s[512];
|
||||
snpf(s,sizeof(s),upointer_format(),(upointer)a_value);
|
||||
a_s = s;
|
||||
char _s[512];
|
||||
snpf(_s,sizeof(_s),upointer_format(),(upointer)a_value);
|
||||
a_s = _s;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool p2sx(const void* a_value,std::string& a_s){
|
||||
char s[512];
|
||||
snpf(s,sizeof(s),upointer_format_x(),(upointer)a_value);
|
||||
a_s = s;
|
||||
char _s[512];
|
||||
snpf(_s,sizeof(_s),upointer_format_x(),(upointer)a_value);
|
||||
a_s = _s;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
inline std::string p2s(const void* a_value){
|
||||
char s[512];
|
||||
snpf(s,sizeof(s),"%lu",(unsigned long)a_value);
|
||||
return s;
|
||||
char _s[512];
|
||||
snpf(_s,sizeof(_s),"%lu",(unsigned long)a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string p2sx(const void* a_value){
|
||||
char s[512];
|
||||
snpf(s,sizeof(s),"0x%lx",(unsigned long)a_value);
|
||||
return s;
|
||||
char _s[512];
|
||||
snpf(_s,sizeof(_s),"0x%lx",(unsigned long)a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string char_p2s(const char* a_value) {
|
||||
char s[512];
|
||||
snpf(s,sizeof(s),"%lu",(unsigned long)a_value);
|
||||
return std::string(s);
|
||||
char _s[512];
|
||||
snpf(_s,sizeof(_s),"%lu",(unsigned long)a_value);
|
||||
return std::string(_s);
|
||||
}
|
||||
|
||||
inline std::string long2s(const long a_value) {
|
||||
char s[512];
|
||||
snpf(s,sizeof(s),"%ld",a_value);
|
||||
return std::string(s);
|
||||
char _s[512];
|
||||
snpf(_s,sizeof(_s),"%ld",a_value);
|
||||
return std::string(_s);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ protected:
|
||||
|
||||
namespace tools {
|
||||
|
||||
//for inlib::holder<raxml_outs>
|
||||
//for tools::holder<raxml_outs>
|
||||
class raxml_outs : public std::vector<raxml_out> {
|
||||
public:
|
||||
static const std::string& s_class() {
|
||||
|
||||
+9
-9
@@ -223,9 +223,9 @@ public:
|
||||
|
||||
std::string _title;
|
||||
if(!read_line(a_reader,sz,_title)) return false;
|
||||
std::string s;
|
||||
if(!read_line(a_reader,sz,s)) return false;
|
||||
if(s.find('\t')==std::string::npos) return false;
|
||||
std::string _s;
|
||||
if(!read_line(a_reader,sz,_s)) return false;
|
||||
if(_s.find('\t')==std::string::npos) return false;
|
||||
|
||||
//std::vector<std::string> labels;
|
||||
//words(s,"\t",false,labels);
|
||||
@@ -344,14 +344,14 @@ public:
|
||||
m_rows = -1;
|
||||
return false;
|
||||
}
|
||||
std::string s;
|
||||
if(!read_line(m_reader,m_sz,s)) {
|
||||
std::string _s;
|
||||
if(!read_line(m_reader,m_sz,_s)) {
|
||||
a_out << "tools::rcsv::ntuple::initialize : (2) read_line() failed." << std::endl;
|
||||
m_sz = 0;
|
||||
m_rows = -1;
|
||||
return false;
|
||||
}
|
||||
words(s,"\t",false,labels); //false for glast.tnt that has a trailing \t.
|
||||
words(_s,"\t",false,labels); //false for glast.tnt that has a trailing \t.
|
||||
} else {
|
||||
while(skip_comment(m_reader,m_sz)){}
|
||||
}
|
||||
@@ -875,7 +875,7 @@ protected:
|
||||
return true;
|
||||
}
|
||||
static bool _read_time(std::istream& a_reader,std::streampos a_sz,char a_sep,time_t& a_v) {
|
||||
std::string s;
|
||||
std::string _s;
|
||||
char c;
|
||||
while(true){
|
||||
if(a_reader.tellg()>=a_sz) break;
|
||||
@@ -884,9 +884,9 @@ protected:
|
||||
a_reader.putback(c);
|
||||
break;
|
||||
}
|
||||
s += c;
|
||||
_s += c;
|
||||
}
|
||||
if(!s2time(s,a_v)) return false;
|
||||
if(!s2time(_s,a_v)) return false;
|
||||
return true;
|
||||
}
|
||||
static bool _read(std::istream& a_reader,std::streampos a_sz,char a_sep,std::string& a_v) {
|
||||
|
||||
+3
-3
@@ -44,8 +44,8 @@ public:
|
||||
bool fIsUnsigned;
|
||||
|
||||
short v;
|
||||
unsigned int s,c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
//FIXME if (v > 1) {
|
||||
//TLeaf::Class()->ReadBuffer(b, this, R__v, R__s, R__c);
|
||||
//FIXME } else {
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
if(created) m_own_leaf_count = true;
|
||||
}}
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TLeaf")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TLeaf")) return false;
|
||||
|
||||
if(!m_length) m_length = 1;
|
||||
/*
|
||||
|
||||
+12
-12
@@ -56,10 +56,10 @@ public:
|
||||
uint32 fMaxBaskets;
|
||||
int fOffset;
|
||||
|
||||
unsigned int s,c;
|
||||
unsigned int _s,_c;
|
||||
//FIXME gROOT->SetReadingObject(kTRUE);
|
||||
short vers;
|
||||
if(!a_buffer.read_version(vers,s,c)) return false;
|
||||
if(!a_buffer.read_version(vers,_s,_c)) return false;
|
||||
|
||||
//::printf("debug : branch::stream : version %d count %d\n",vers,c);
|
||||
|
||||
@@ -338,12 +338,12 @@ public:
|
||||
return false;
|
||||
}
|
||||
for(int i=0;i<n;i++) {
|
||||
seek32 _s;
|
||||
if(!a_buffer.read(_s)) {
|
||||
seek32 _seek;
|
||||
if(!a_buffer.read(_seek)) {
|
||||
_clear();
|
||||
return false;
|
||||
}
|
||||
fBasketSeek[i] = _s;
|
||||
fBasketSeek[i] = _seek;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,12 +389,12 @@ public:
|
||||
}
|
||||
} else {
|
||||
for(uint32 i=0;i<fMaxBaskets;i++) {
|
||||
seek32 _s;
|
||||
if(!a_buffer.read(_s)) {
|
||||
seek32 _seek;
|
||||
if(!a_buffer.read(_seek)) {
|
||||
_clear();
|
||||
return false;
|
||||
}
|
||||
fBasketSeek[i] = _s;
|
||||
fBasketSeek[i] = _seek;
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -458,7 +458,7 @@ public:
|
||||
|
||||
//FIXME if(vers<4) SetAutoDelete(kTRUE);
|
||||
//FIXME gROOT->SetReadingObject(kFALSE);
|
||||
if(!a_buffer.check_byte_count(s, c,"TBranch")) {
|
||||
if(!a_buffer.check_byte_count(_s, _c,"TBranch")) {
|
||||
_clear();
|
||||
return false;
|
||||
}
|
||||
@@ -749,10 +749,10 @@ public:
|
||||
num = mn<uint32>(num,10);
|
||||
if(!num) continue;
|
||||
|
||||
{std::string s;
|
||||
{std::string _s;
|
||||
uint32 len = uint32(bl->name().size())+128;
|
||||
sprintf(s,len," %-15s = ",bl->name().c_str());
|
||||
a_out << s;}
|
||||
sprintf(_s,len," %-15s = ",bl->name().c_str());
|
||||
a_out << _s;}
|
||||
|
||||
for(uint32 i=0;i<num;i++) {
|
||||
if(i) a_out << ", ";
|
||||
|
||||
+16
-16
@@ -39,10 +39,10 @@ public:
|
||||
_clear();
|
||||
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
//::printf("debug : inlib::branch_element::stream : version %d, count %d\n",v,c);
|
||||
//::printf("debug : tools::branch_element::stream : version %d, count %d\n",v,c);
|
||||
|
||||
if(!parent::stream(a_buffer)) {
|
||||
m_out << "tools::rroot::branch_element::stream : parent::stream() failed." << std::endl;
|
||||
@@ -57,34 +57,34 @@ public:
|
||||
if(!a_buffer.read(fStreamerType)) return false;
|
||||
} else { //v>=8
|
||||
if(!a_buffer.read(fClassName)) return false;
|
||||
//::printf("debug : inlib::branch_element::stream : fClassName \"%s\"\n",fClassName.c_str());
|
||||
//::printf("debug : tools::branch_element::stream : fClassName \"%s\"\n",fClassName.c_str());
|
||||
std::string fParentName;
|
||||
if(!a_buffer.read(fParentName)) return false;
|
||||
//::printf("debug : inlib::branch_element::stream : fParentName \"%s\"\n",fParentName.c_str());
|
||||
//::printf("debug : tools::branch_element::stream : fParentName \"%s\"\n",fParentName.c_str());
|
||||
std::string fCloneName;
|
||||
if(!a_buffer.read(fCloneName)) return false;
|
||||
//::printf("debug : inlib::branch_element::stream : fCloneName \"%s\"\n",fCloneName.c_str());
|
||||
//::printf("debug : tools::branch_element::stream : fCloneName \"%s\"\n",fCloneName.c_str());
|
||||
int dummy_int;
|
||||
if(!a_buffer.read(dummy_int)) return false; //fCheckSum
|
||||
//::printf("debug : inlib::branch_element::stream : fCheckSum %d\n",dummy_int);
|
||||
//::printf("debug : tools::branch_element::stream : fCheckSum %d\n",dummy_int);
|
||||
|
||||
if(v>=10) {
|
||||
short dummy_short;
|
||||
if(!a_buffer.read(dummy_short)) return false; //fClassVersion
|
||||
//::printf("debug : inlib::branch_element::stream : fClassVersion %d\n",dummy_short);
|
||||
//::printf("debug : tools::branch_element::stream : fClassVersion %d\n",dummy_short);
|
||||
} else {
|
||||
if(!a_buffer.read(dummy_int)) return false; //fClassVersion
|
||||
}
|
||||
|
||||
if(!a_buffer.read(fID)) return false;
|
||||
//::printf("debug : inlib::branch_element::stream : fID %d\n",fID);
|
||||
//::printf("debug : tools::branch_element::stream : fID %d\n",fID);
|
||||
if(!a_buffer.read(fType)) return false;
|
||||
//::printf("debug : inlib::branch_element::stream : fType %d\n",fType);
|
||||
//::printf("debug : tools::branch_element::stream : fType %d\n",fType);
|
||||
if(!a_buffer.read(fStreamerType)) return false;
|
||||
//::printf("debug : inlib::branch_element::stream : fStreamerType %d\n",fStreamerType);
|
||||
//::printf("debug : tools::branch_element::stream : fStreamerType %d\n",fStreamerType);
|
||||
|
||||
if(!a_buffer.read(dummy_int)) return false; //fMaximum
|
||||
//::printf("debug : inlib::branch_element::stream : fMaximum %d\n",dummy_int);
|
||||
//::printf("debug : tools::branch_element::stream : fMaximum %d\n",dummy_int);
|
||||
|
||||
//TBranchElement* fBranchCount;
|
||||
ifac::args args;
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TBranchElement")) {_clear();return false;}
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TBranchElement")) {_clear();return false;}
|
||||
return true;
|
||||
}
|
||||
public: //branch
|
||||
@@ -607,10 +607,10 @@ public: //branch
|
||||
uint32 n;
|
||||
if(!find_entry(a_file,a_entry,n)) return false;
|
||||
|
||||
{std::string s;
|
||||
{std::string _s;
|
||||
uint32 len = uint32(name().size())+128;
|
||||
sprintf(s,len," %-15s = ",name().c_str());
|
||||
a_out << s;}
|
||||
sprintf(_s,len," %-15s = ",name().c_str());
|
||||
a_out << _s;}
|
||||
|
||||
a_out << m_obj << std::endl;
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@ public:
|
||||
public:
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!parent::stream(a_buffer)) return false;
|
||||
if(!a_buffer.read(fClassName)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,"TBranchObject")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TBranchObject")) return false;
|
||||
return true;
|
||||
}
|
||||
public: //branch
|
||||
|
||||
+6
-6
@@ -139,17 +139,17 @@ protected:
|
||||
if(!parent::read(tag)) return false;
|
||||
|
||||
if(tag==kNewClassTag()) {
|
||||
char s[80];
|
||||
if(!read_string(s, 80)) {
|
||||
char _s[80];
|
||||
if(!read_string(_s, 80)) {
|
||||
m_out << "tools::rroot::read_class_tag :"
|
||||
<< " read string." << std::endl;
|
||||
return false;
|
||||
}
|
||||
//m_out << "tools::rroot::read_class_tag :"
|
||||
// << " tag kNewClassTag"
|
||||
// << " class " << s
|
||||
// << " class " << _s
|
||||
// << std::endl;
|
||||
a_class = s;
|
||||
a_class = _s;
|
||||
return true;
|
||||
|
||||
} else if(tag & kClassMask()) {
|
||||
@@ -661,7 +661,7 @@ inline bool pointer_stream(buffer& a_buffer,
|
||||
a_obj = (T*)obj->cast(a_T_class);
|
||||
if(!a_obj) {
|
||||
a_buffer.out() << "tools::rroot::pointer_stream : "
|
||||
<< " inlib::cast to " << a_T_class << " failed."
|
||||
<< " tools::cast to " << a_T_class << " failed."
|
||||
<< ". Object is a " << obj->s_cls() << "."
|
||||
<< std::endl;
|
||||
if(a_created) delete obj;
|
||||
@@ -691,7 +691,7 @@ inline bool pointer_stream(buffer& a_buffer,
|
||||
a_obj = (T*)obj->cast(a_T_class);
|
||||
if(!a_obj) {
|
||||
a_buffer.out() << "tools::rroot::pointer_stream : "
|
||||
<< " inlib::cast to " << a_T_class << " failed."
|
||||
<< " tools::cast to " << a_T_class << " failed."
|
||||
<< ". Object is a " << obj->s_cls() << "."
|
||||
<< std::endl;
|
||||
if(a_created) delete obj;
|
||||
|
||||
+4
-4
@@ -43,10 +43,10 @@ public:
|
||||
//the below code skips correctly the data in the file.
|
||||
uint32 startpos = a_buffer.length();
|
||||
short v;
|
||||
unsigned int s,c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
a_buffer.set_offset(startpos+c+sizeof(unsigned int));
|
||||
if(!a_buffer.check_byte_count(s,c,"dummy")) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
a_buffer.set_offset(startpos+_c+sizeof(unsigned int));
|
||||
if(!a_buffer.check_byte_count(_s,_c,"dummy")) return false;
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
|
||||
+4
-4
@@ -39,10 +39,10 @@ public:
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
uint32 startpos = a_buffer.length();
|
||||
short v;
|
||||
unsigned int s,c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
a_buffer.set_offset(startpos+c+sizeof(unsigned int));
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
a_buffer.set_offset(startpos+_c+sizeof(unsigned int));
|
||||
if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
|
||||
+13
-13
@@ -38,8 +38,8 @@ public: //iro
|
||||
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!Named_stream(a_buffer,fName,fTitle)) return false;
|
||||
if(!a_buffer.read(fType)) return false;
|
||||
if(!a_buffer.read(fSize)) return false;
|
||||
@@ -47,16 +47,16 @@ public: //iro
|
||||
if(!a_buffer.read(fArrayDim)) return false;
|
||||
if(!a_buffer.read_fast_array<int>(fMaxIndex,5)) return false;
|
||||
if(!a_buffer.read(fTypeName)) return false;
|
||||
return a_buffer.check_byte_count(s,c,s_store_class());
|
||||
return a_buffer.check_byte_count(_s,_c,s_store_class());
|
||||
}
|
||||
public:
|
||||
virtual void out(std::ostream& aOut) const {
|
||||
std::string _fname;
|
||||
fullName(_fname);
|
||||
char s[128];
|
||||
snpf(s,sizeof(s)," %-14s%-15s offset=%3d type=%2d %-20s",
|
||||
char _s[128];
|
||||
snpf(_s,sizeof(_s)," %-14s%-15s offset=%3d type=%2d %-20s",
|
||||
fTypeName.c_str(),_fname.c_str(),fOffset,fType,fTitle.c_str());
|
||||
aOut << s << std::endl;
|
||||
aOut << _s << std::endl;
|
||||
}
|
||||
public:
|
||||
streamer_element()
|
||||
@@ -130,13 +130,13 @@ public: //iro
|
||||
//the below code skips correctly the data in the file.
|
||||
uint32 startpos = a_buffer.length();
|
||||
short v;
|
||||
unsigned int s,c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
if(!parent::stream(a_buffer)) return false;
|
||||
|
||||
a_buffer.set_offset(startpos+c+sizeof(unsigned int));
|
||||
if(!a_buffer.check_byte_count(s,c,"dummy_streamer_element")) return false;
|
||||
a_buffer.set_offset(startpos+_c+sizeof(unsigned int));
|
||||
if(!a_buffer.check_byte_count(_s,_c,"dummy_streamer_element")) return false;
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
@@ -175,8 +175,8 @@ public: //iro
|
||||
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
if(!Named_stream(a_buffer,m_name,m_title)) return false;
|
||||
if(!a_buffer.read(m_check_sum)) return false;
|
||||
@@ -196,7 +196,7 @@ public: //iro
|
||||
if(obj) m_elements.operator=(*obj);
|
||||
if(obj_created) delete obj;}
|
||||
|
||||
return a_buffer.check_byte_count(s,c,s_store_class());
|
||||
return a_buffer.check_byte_count(_s,_c,s_store_class());
|
||||
}
|
||||
public:
|
||||
void out(std::ostream& a_out) const {
|
||||
|
||||
+12
-12
@@ -78,12 +78,12 @@ public:
|
||||
virtual iro* copy() const {return new leaf<T>(*this);}
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
short v;
|
||||
unsigned int s,c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!base_leaf::stream(a_buffer)) return false;
|
||||
if(!a_buffer.read(m_min)) return false;
|
||||
if(!a_buffer.read(m_max)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,leaf_store_class(T()))) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,leaf_store_class(T()))) return false;
|
||||
return true;
|
||||
}
|
||||
public: //base_leaf
|
||||
@@ -230,12 +230,12 @@ public:
|
||||
virtual iro* copy() const {return new leaf_string(*this);}
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
short v;
|
||||
unsigned int s,c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!base_leaf::stream(a_buffer)) return false;
|
||||
if(!a_buffer.read(m_min)) return false;
|
||||
if(!a_buffer.read(m_max)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
|
||||
return true;
|
||||
}
|
||||
public: //base_leaf
|
||||
@@ -337,12 +337,12 @@ public:
|
||||
virtual iro* copy() const {return new leaf_element(*this);}
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
short v;
|
||||
unsigned int s,c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!base_leaf::stream(a_buffer)) return false;
|
||||
if(!a_buffer.read(fID)) return false;
|
||||
if(!a_buffer.read(fType)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
|
||||
return true;
|
||||
}
|
||||
public: //base_leaf
|
||||
@@ -401,11 +401,11 @@ public:
|
||||
virtual iro* copy() const {return new leaf_object(*this);}
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
short v;
|
||||
unsigned int s,c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!base_leaf::stream(a_buffer)) return false;
|
||||
if(!a_buffer.read(fVirtual)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
|
||||
return true;
|
||||
}
|
||||
public: //base_leaf
|
||||
|
||||
+3
-3
@@ -38,9 +38,9 @@ public:
|
||||
}
|
||||
public:
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
//printf("debug : tools::rroot::matrix::stream : version %d\n",v);
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
//Real_t* Elements; //[fNelems]
|
||||
if(!dummy_array_stream<float>(a_buffer,Nelems)) return false;
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+18
-18
@@ -14,34 +14,34 @@ namespace rroot {
|
||||
|
||||
inline bool Named_stream(buffer& a_buffer,std::string& a_name,std::string& a_title) {
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s, _c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
{uint32 id,bits;
|
||||
if(!Object_stream(a_buffer,id,bits)) return false;}
|
||||
if(!a_buffer.read(a_name)) return false;
|
||||
if(!a_buffer.read(a_title)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,"TNamed")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TNamed")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool AttLine_stream(buffer& a_buffer,short& a_color,short& a_style,short& a_width){
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s, _c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!a_buffer.read(a_color)) return false;
|
||||
if(!a_buffer.read(a_style)) return false;
|
||||
if(!a_buffer.read(a_width)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,"TAttLine")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TAttLine")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool AttFill_stream(buffer& a_buffer,short& a_color,short& a_style){
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s, _c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!a_buffer.read(a_color)) return false;
|
||||
if(!a_buffer.read(a_style)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,"TAttFill")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TAttFill")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,30 +50,30 @@ inline bool AttMarker_stream(buffer& a_buffer) {
|
||||
short fMarkerStyle;
|
||||
float fMarkerWidth;
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s, _c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!a_buffer.read(fMarkerColor)) return false;
|
||||
if(!a_buffer.read(fMarkerStyle)) return false;
|
||||
if(!a_buffer.read(fMarkerWidth)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,"TAttMarker")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TAttMarker")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool GeoAtt_stream(buffer& a_buffer) {
|
||||
unsigned int fGeoAtt; // option flags
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s, _c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!a_buffer.read(fGeoAtt)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,"TGeoAtt")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TGeoAtt")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool Att3D_stream(buffer& a_buffer) {
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,"TAtt3D")) return false;
|
||||
unsigned int _s, _c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TAtt3D")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -77,7 +77,7 @@ public:
|
||||
T* obj = safe_cast<iro,T>(*_obj);
|
||||
if(!obj) {
|
||||
m_fac.out() << "tools::rroot::obj_array::obj_array :"
|
||||
<< " inlib::cast failed."
|
||||
<< " tools::cast failed."
|
||||
<< std::endl;
|
||||
delete _obj;
|
||||
parent::push_back(0);
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
T* obj = safe_cast<iro,T>(*_obj);
|
||||
if(!obj) {
|
||||
m_fac.out() << "tools::rroot::obj_array::operator= :"
|
||||
<< " inlib::cast failed."
|
||||
<< " tools::cast failed."
|
||||
<< std::endl;
|
||||
delete _obj;
|
||||
parent::push_back(0);
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
T* to = safe_cast<iro,T>(*obj);
|
||||
if(!to) {
|
||||
a_buffer.out() << "tools::rroot::obj_array::stream :"
|
||||
<< " inlib::cast failed."
|
||||
<< " tools::cast failed."
|
||||
<< " " << obj->s_cls() << " is not a " << T::s_class() << "."
|
||||
<< std::endl;
|
||||
if(created) {
|
||||
|
||||
+3
-3
@@ -48,8 +48,8 @@ public:
|
||||
safe_clear();
|
||||
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
//::printf("debug : obj_list::stream : version %d, byte count %d\n",v,c);
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
return a_buffer.check_byte_count(s,c,s_store_class());
|
||||
return a_buffer.check_byte_count(_s,_c,s_store_class());
|
||||
}
|
||||
public:
|
||||
obj_list(ifac& a_fac)
|
||||
|
||||
@@ -51,6 +51,7 @@ inline TDirectory* find_dir(directory& a_dir,const std::string& a_name) {
|
||||
out << "tools::rroot::find_dir :"
|
||||
<< " can't stream TDirectory."
|
||||
<< std::endl;
|
||||
delete tdir;
|
||||
return 0;
|
||||
}
|
||||
return tdir;
|
||||
|
||||
+3
-3
@@ -248,9 +248,9 @@ public:
|
||||
int n;
|
||||
if(!read(n)) {a_a.clear();return false;}
|
||||
for(int index=0;index<n;index++) {
|
||||
std::string s;
|
||||
if(!read(s)) {a_a.clear();return false;}
|
||||
a_a.push_back(s);
|
||||
std::string _s;
|
||||
if(!read(_s)) {a_a.clear();return false;}
|
||||
a_a.push_back(_s);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+10
-10
@@ -42,8 +42,8 @@ public:
|
||||
std::vector<T>::clear();
|
||||
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
//::printf("debug : stl_vector::stream<%s> : version %d, byte count %d\n",
|
||||
// stype(T()).c_str(),v,c);
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
delete [] vec;
|
||||
}
|
||||
|
||||
return a_buffer.check_byte_count(s,c,s_store_class());
|
||||
return a_buffer.check_byte_count(_s,_c,s_store_class());
|
||||
}
|
||||
public:
|
||||
stl_vector(){
|
||||
@@ -128,8 +128,8 @@ public:
|
||||
std::vector<vec_t>::clear();
|
||||
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
//::printf("debug : stl_vector_vector::stream<%s> : version %d, byte count %d\n",stype(T()).c_str(),v,c);
|
||||
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
return a_buffer.check_byte_count(s,c,s_store_class());
|
||||
return a_buffer.check_byte_count(_s,_c,s_store_class());
|
||||
}
|
||||
public:
|
||||
stl_vector_vector(){
|
||||
@@ -220,8 +220,8 @@ public:
|
||||
//WARNING : not tested yet.
|
||||
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
//::printf("debug : stl_vector_string::stream : version %d, byte count %d\n",v,c);
|
||||
|
||||
@@ -239,9 +239,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
//a_buffer.set_offset(startpos+c+sizeof(unsigned int));
|
||||
//a_buffer.set_offset(startpos+_c+sizeof(unsigned int));
|
||||
|
||||
return a_buffer.check_byte_count(s,c,s_store_class());
|
||||
return a_buffer.check_byte_count(_s,_c,s_store_class());
|
||||
}
|
||||
public:
|
||||
stl_vector_string(){
|
||||
|
||||
+36
-36
@@ -51,8 +51,8 @@ inline bool AttAxis_stream(buffer& a_buffer){
|
||||
|
||||
// Version 4 streaming (ROOT/v3-00-6).
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
if(!a_buffer.read(fNdivisions)) return false;
|
||||
if(!a_buffer.read(fAxisColor)) return false;
|
||||
@@ -66,15 +66,15 @@ inline bool AttAxis_stream(buffer& a_buffer){
|
||||
if(!a_buffer.read(fTitleColor)) return false;
|
||||
if(!a_buffer.read(fTitleFont)) return false;
|
||||
|
||||
if(!a_buffer.check_byte_count(s, c,"TAttAxis")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TAttAxis")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool Axis_stream(buffer& a_buffer,histo::axis<double,unsigned int>& a_fAxis){
|
||||
// Version 6 streaming (ROOT/v3-00-6).
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
std::string name;
|
||||
std::string title;
|
||||
@@ -127,7 +127,7 @@ inline bool Axis_stream(buffer& a_buffer,histo::axis<double,unsigned int>& a_fAx
|
||||
if(!dummy_TXxx_pointer_stream(a_buffer,fac)) return false;
|
||||
}
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TAxis")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TAxis")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -143,9 +143,9 @@ inline bool TH_read_1D(buffer& a_buffer,hd_data& a_data,
|
||||
a_Sxw = 0;
|
||||
a_Sx2w = 0;
|
||||
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short vers;
|
||||
if(!a_buffer.read_version(vers,s,c)) return false;
|
||||
if(!a_buffer.read_version(vers,_s,_c)) return false;
|
||||
|
||||
//::printf("debug : tools::rroot::TH_read_1D : version %d\n",vers);
|
||||
|
||||
@@ -275,7 +275,7 @@ inline bool TH_read_1D(buffer& a_buffer,hd_data& a_data,
|
||||
a_data.m_bin_Sw2.assign(binn,0);
|
||||
}
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TH")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH")) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -284,9 +284,9 @@ inline bool TH_read_1D(buffer& a_buffer,hd_data& a_data,
|
||||
inline bool TH_read_2D(buffer& a_buffer,hd_data& a_data,
|
||||
double& a_entries,double& a_Sw,double& a_Sw2,
|
||||
double& a_Sxw,double& a_Sx2w,double& a_Syw,double& a_Sy2w){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
// Version 3 streaming (ROOT/v3-00-6).
|
||||
|
||||
@@ -306,7 +306,7 @@ inline bool TH_read_2D(buffer& a_buffer,hd_data& a_data,
|
||||
if(!a_buffer.read(Tsumwxy)) return false;
|
||||
a_data.m_in_range_plane_Sxyw[0] = Tsumwxy;
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TH2")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH2")) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -316,9 +316,9 @@ inline bool TH_read_3D(buffer& a_buffer,hd_data& a_data,
|
||||
double& a_Sxw,double& a_Sx2w,
|
||||
double& a_Syw,double& a_Sy2w,
|
||||
double& a_Szw,double& a_Sz2w){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
if(!TH_read_1D(a_buffer,a_data,a_entries,a_Sw,a_Sw2,a_Sxw,a_Sx2w)) return false;
|
||||
if(!Att3D_stream(a_buffer)) return false;
|
||||
@@ -345,15 +345,15 @@ inline bool TH_read_3D(buffer& a_buffer,hd_data& a_data,
|
||||
a_data.m_in_range_plane_Sxyw[1] = Tsumwyz;
|
||||
a_data.m_in_range_plane_Sxyw[2] = Tsumwxz;
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TH3")) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH3")) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
inline histo::h1d* TH1F_stream(buffer& a_buffer){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return 0;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return 0;
|
||||
|
||||
// Version 1 streaming (ROOT/v3-00-6).
|
||||
|
||||
@@ -379,7 +379,7 @@ inline histo::h1d* TH1F_stream(buffer& a_buffer){
|
||||
|
||||
std::vector<float> bins; //fArray TArrayF
|
||||
if(!Array_stream<float>(a_buffer,bins)) return 0;
|
||||
if(!a_buffer.check_byte_count(s,c,"TH1F")) return 0;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH1F")) return 0;
|
||||
|
||||
unsigned int binn = data.m_bin_number;
|
||||
data.m_bin_Sw.resize(binn,0);
|
||||
@@ -407,9 +407,9 @@ inline histo::h1d* TH1F_stream(buffer& a_buffer){
|
||||
}
|
||||
|
||||
inline histo::h1d* TH1D_stream(buffer& a_buffer){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return 0;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return 0;
|
||||
|
||||
// Version 1 streaming (ROOT/v3-00-6).
|
||||
|
||||
@@ -433,7 +433,7 @@ inline histo::h1d* TH1D_stream(buffer& a_buffer){
|
||||
|
||||
std::vector<double> bins; //fArray TArrayD
|
||||
if(!Array_stream<double>(a_buffer,bins)) return 0;
|
||||
if(!a_buffer.check_byte_count(s,c,"TH1D")) return 0;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH1D")) return 0;
|
||||
|
||||
unsigned int binn = data.m_bin_number;
|
||||
data.m_bin_Sw = bins;
|
||||
@@ -459,9 +459,9 @@ inline histo::h1d* TH1D_stream(buffer& a_buffer){
|
||||
}
|
||||
|
||||
inline histo::h2d* TH2F_stream(buffer& a_buffer){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return 0;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return 0;
|
||||
|
||||
// Version 3 streaming (ROOT/v3-00-6).
|
||||
|
||||
@@ -490,7 +490,7 @@ inline histo::h2d* TH2F_stream(buffer& a_buffer){
|
||||
|
||||
std::vector<float> bins; //fArray TArrayF
|
||||
if(!Array_stream<float>(a_buffer,bins)) return 0;
|
||||
if(!a_buffer.check_byte_count(s,c,"TH2F")) return 0;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH2F")) return 0;
|
||||
|
||||
unsigned int binn = data.m_bin_number;
|
||||
data.m_bin_Sw.resize(binn,0);
|
||||
@@ -521,9 +521,9 @@ inline histo::h2d* TH2F_stream(buffer& a_buffer){
|
||||
}
|
||||
|
||||
inline histo::h2d* TH2D_stream(buffer& a_buffer){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return 0;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return 0;
|
||||
|
||||
// Version 3 streaming (ROOT/v3-00-6).
|
||||
|
||||
@@ -552,7 +552,7 @@ inline histo::h2d* TH2D_stream(buffer& a_buffer){
|
||||
|
||||
std::vector<double> bins; //fArray TArrayD
|
||||
if(!Array_stream<double>(a_buffer,bins)) return 0;
|
||||
if(!a_buffer.check_byte_count(s,c,"TH2D")) return 0;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH2D")) return 0;
|
||||
|
||||
unsigned int binn = data.m_bin_number;
|
||||
data.m_bin_Sw = bins;
|
||||
@@ -580,9 +580,9 @@ inline histo::h2d* TH2D_stream(buffer& a_buffer){
|
||||
}
|
||||
|
||||
inline histo::h3d* TH3D_stream(buffer& a_buffer){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return 0;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return 0;
|
||||
|
||||
// Now we have to reconstruct a valid Histogram from a_buffer :
|
||||
hd_data data;
|
||||
@@ -611,7 +611,7 @@ inline histo::h3d* TH3D_stream(buffer& a_buffer){
|
||||
|
||||
std::vector<double> bins; //fArray TArrayD
|
||||
if(!Array_stream<double>(a_buffer,bins)) return 0;
|
||||
if(!a_buffer.check_byte_count(s,c,"TH3D")) return 0;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH3D")) return 0;
|
||||
|
||||
unsigned int binn = data.m_bin_number;
|
||||
data.m_bin_Sw = bins;
|
||||
@@ -641,9 +641,9 @@ inline histo::h3d* TH3D_stream(buffer& a_buffer){
|
||||
}
|
||||
|
||||
inline histo::p1d* TProfile_stream(buffer& a_buffer){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return 0;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return 0;
|
||||
|
||||
// Version 3 streaming (ROOT/v3-00-6).
|
||||
|
||||
@@ -680,7 +680,7 @@ inline histo::p1d* TProfile_stream(buffer& a_buffer){
|
||||
if(!Array_stream<double>(a_buffer,bins_sumw2)) return 0;
|
||||
}
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TProfile")) return 0;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TProfile")) return 0;
|
||||
|
||||
data.m_is_profile = true;
|
||||
data.m_cut_v = true;
|
||||
@@ -710,9 +710,9 @@ inline histo::p1d* TProfile_stream(buffer& a_buffer){
|
||||
}
|
||||
|
||||
inline histo::p2d* TProfile2D_stream(buffer& a_buffer){
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return 0;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return 0;
|
||||
|
||||
// Version 3 streaming (ROOT/v3-00-6).
|
||||
|
||||
@@ -747,7 +747,7 @@ inline histo::p2d* TProfile2D_stream(buffer& a_buffer){
|
||||
std::vector<double> bins_sumw2; //fBinSumw2 TArrayD
|
||||
if(!Array_stream<double>(a_buffer,bins_sumw2)) return 0;
|
||||
}
|
||||
if(!a_buffer.check_byte_count(s,c,"TProfile2D")) return 0;
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TProfile2D")) return 0;
|
||||
|
||||
data.m_is_profile = true;
|
||||
data.m_cut_v = true;
|
||||
|
||||
+3
-3
@@ -133,8 +133,8 @@ public:
|
||||
//uint64 m_saved_bytes;
|
||||
|
||||
short vers;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(vers,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(vers,_s,_c)) return false;
|
||||
|
||||
//::printf("debug : tree::stream : version %d count %d\n",vers,c);
|
||||
|
||||
@@ -385,7 +385,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,TTree_cls())) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,TTree_cls())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+7
-7
@@ -36,9 +36,9 @@ public:
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
uint32 startpos = a_buffer.length();
|
||||
|
||||
unsigned int s,c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
//::printf("debug : tree_index::stream : version %d count %d\n",v,c);
|
||||
|
||||
if(!virtual_index_stream(a_buffer)) return false;
|
||||
@@ -58,9 +58,9 @@ public:
|
||||
|
||||
//FIXME : still problem with this streamer.
|
||||
|
||||
a_buffer.set_offset(startpos+c+sizeof(unsigned int));
|
||||
a_buffer.set_offset(startpos+_c+sizeof(unsigned int));
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
|
||||
|
||||
//::printf("debug : tree_index::stream : ok\n");
|
||||
return true;
|
||||
@@ -88,12 +88,12 @@ protected:
|
||||
}
|
||||
bool virtual_index_stream(buffer& a_buffer){
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
unsigned int _s,_c;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
//::printf("debug : virtual_index::stream : version %d count %d\n",v,c);
|
||||
std::string ds;
|
||||
if(!Named_stream(a_buffer,ds,ds)) return false;
|
||||
if(!a_buffer.check_byte_count(s,c,virtual_index_s_store_class()))
|
||||
if(!a_buffer.check_byte_count(_s,_c,virtual_index_s_store_class()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
+3
-3
@@ -38,9 +38,9 @@ public:
|
||||
}
|
||||
public:
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
unsigned int s, c;
|
||||
unsigned int _s,_c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
if(!a_buffer.read_version(v,_s,_c)) return false;
|
||||
|
||||
//printf("debug : tools::rroot::vector3::stream : version %d\n",v);
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
if(!a_buffer.read(m_y)) return false;
|
||||
if(!a_buffer.read(m_z)) return false;
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
// G.Barrand : not so clear if 0 and tools::uint32_max() are included.
|
||||
// A simple program shows that "if(r.shoot()==tools::uint32_max())" shows hits.
|
||||
// (But we did not see hits for "if(r.shoot()==0)"). (See inlib/tests/rand.cpp).
|
||||
// (But we did not see hits for "if(r.shoot()==0)"). (See tools/tests/rand.cpp).
|
||||
|
||||
// tausme is for Tausworthe maxmally equidistributed.
|
||||
|
||||
|
||||
+3
-3
@@ -11,13 +11,13 @@
|
||||
namespace tools {
|
||||
|
||||
inline bool s2time(const std::string& a_string,time_t& a_time) {
|
||||
int yy, mm, dd, hh, mi, ss;
|
||||
int yy, _mm, dd, hh, mi, ss;
|
||||
if(::sscanf(a_string.c_str(),
|
||||
"%d-%d-%d %d:%d:%d",
|
||||
&yy,&mm,&dd,&hh,&mi,&ss)!=6) {a_time = 0;return false;}
|
||||
&yy,&_mm,&dd,&hh,&mi,&ss)!=6) {a_time = 0;return false;}
|
||||
struct tm tp;
|
||||
tp.tm_year = yy-1900;
|
||||
tp.tm_mon = mm-1;
|
||||
tp.tm_mon = _mm-1;
|
||||
tp.tm_mday = dd;
|
||||
tp.tm_hour = hh;
|
||||
tp.tm_min = mi;
|
||||
|
||||
+3
-3
@@ -90,7 +90,7 @@ protected:
|
||||
}
|
||||
|
||||
//a_out << "debug : tools::sg::tex_rect::update_sg :"
|
||||
// << " this " << inlib::p2s(this)
|
||||
// << " this " << tools::p2s(this)
|
||||
// << std::endl;
|
||||
|
||||
// image must be power of two in width and height.
|
||||
@@ -123,7 +123,7 @@ protected:
|
||||
|
||||
if(!img4.to_texture(expand.value(),pixel,m_img)){
|
||||
a_out << "tools::sg::tex_rect::update_sg :"
|
||||
<< " problem with inlib::tex_rect::to_texture."
|
||||
<< " problem with tools::tex_rect::to_texture."
|
||||
<< std::endl;
|
||||
m_img.make_empty();
|
||||
return;
|
||||
@@ -132,7 +132,7 @@ protected:
|
||||
} else {
|
||||
if(!_img.to_texture(expand.value(),pixel,m_img)){
|
||||
a_out << "tools::sg::tex_rect::update_sg :"
|
||||
<< " problem with inlib::tex_rect::to_texture."
|
||||
<< " problem with tools::tex_rect::to_texture."
|
||||
<< std::endl;
|
||||
m_img.make_empty();
|
||||
return;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#ifndef tools_sg_f2plot
|
||||
#define tools_sg_f2plot
|
||||
|
||||
// Connexion inlib/func to sg/plotter.
|
||||
// Connexion tools/func to sg/plotter.
|
||||
|
||||
#include "plottables"
|
||||
|
||||
|
||||
+67
-22
@@ -163,6 +163,7 @@ public:
|
||||
gl2ps_action(gl2ps_manager& a_mgr,std::ostream& a_out,unsigned int a_ww,unsigned int a_wh)
|
||||
:parent(a_out,a_ww,a_wh)
|
||||
,m_mgr(a_mgr)
|
||||
,m_gl2ps_context(0)
|
||||
,m_FILE(0)
|
||||
,m_pv(get_me())
|
||||
,m_light_color(colorf_white())
|
||||
@@ -193,11 +194,14 @@ public:
|
||||
m_model.set_identity();
|
||||
m_normal_matrix.set_identity();
|
||||
}
|
||||
virtual ~gl2ps_action(){}
|
||||
virtual ~gl2ps_action(){
|
||||
close();
|
||||
}
|
||||
protected:
|
||||
gl2ps_action(const gl2ps_action& a_from)
|
||||
:parent(a_from)
|
||||
,m_mgr(a_from.m_mgr)
|
||||
,m_gl2ps_context(0)
|
||||
,m_FILE(0)
|
||||
|
||||
,m_vp_mtx(a_from.m_vp_mtx)
|
||||
@@ -255,12 +259,23 @@ protected:
|
||||
}
|
||||
public:
|
||||
bool open(const std::string& a_name,int a_format = TOOLS_GL2PS_EPS) {
|
||||
if(m_FILE) return false;
|
||||
close();
|
||||
|
||||
m_gl2ps_context = ::tools_gl2psCreateContext();
|
||||
if(!m_gl2ps_context) {
|
||||
m_out << "tools::sg::gl2ps_action::open :"
|
||||
<< " can't create gl2ps context."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_FILE = ::fopen(a_name.c_str(),"w");
|
||||
if(!m_FILE) {
|
||||
m_out << "tools::sg::gl2ps_action::open :"
|
||||
<< " can't open file " << a_name << "."
|
||||
<< std::endl;
|
||||
::tools_gl2psDeleteContext(m_gl2ps_context);
|
||||
m_gl2ps_context = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -279,12 +294,21 @@ public:
|
||||
vp[3] = m_wh;
|
||||
|
||||
int bufsize = 0;
|
||||
::tools_gl2psBeginPage("","tools_sg_write_gl2ps",
|
||||
if(::tools_gl2psBeginPage(m_gl2ps_context,"","tools_sg_write_gl2ps",
|
||||
vp,a_format,sort,options,
|
||||
TOOLS_GL_RGBA,0, NULL,0,0,0,bufsize,
|
||||
m_FILE,a_name.c_str());
|
||||
|
||||
::tools_gl2psSetBackgroundColor(m_back[0],m_back[1],m_back[2]);
|
||||
m_FILE,a_name.c_str())==TOOLS_GL2PS_ERROR) {
|
||||
m_out << "tools::sg::gl2ps_action::open :"
|
||||
<< " tools_gl2psBeginPage() failed."
|
||||
<< std::endl;
|
||||
::fclose(m_FILE);
|
||||
m_FILE = 0;
|
||||
::tools_gl2psDeleteContext(m_gl2ps_context);
|
||||
m_gl2ps_context = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
::tools_gl2psSetBackgroundColor(m_gl2ps_context,m_back[0],m_back[1],m_back[2]);
|
||||
|
||||
m_vp_mtx.set_identity();
|
||||
m_vp_mtx.mul_translate(float(m_ww)/2,float(m_wh)/2,0);
|
||||
@@ -294,10 +318,19 @@ public:
|
||||
}
|
||||
|
||||
bool close() {
|
||||
if(!m_FILE) return false;
|
||||
::tools_gl2psEndPage();
|
||||
::fclose(m_FILE);
|
||||
m_FILE = 0;
|
||||
tools_GLint _status = 0;
|
||||
if(m_gl2ps_context) {
|
||||
_status = ::tools_gl2psEndPage(m_gl2ps_context);
|
||||
}
|
||||
if(m_FILE) {
|
||||
::fclose(m_FILE);
|
||||
m_FILE = 0;
|
||||
}
|
||||
if(m_gl2ps_context) {
|
||||
::tools_gl2psDeleteContext(m_gl2ps_context);
|
||||
m_gl2ps_context = 0;
|
||||
}
|
||||
if (_status == TOOLS_GL2PS_OVERFLOW) return false;
|
||||
return true;
|
||||
}
|
||||
void set_background(float a_r,float a_g,float a_b) {
|
||||
@@ -349,6 +382,8 @@ protected:
|
||||
return m_this.project_point(a_x,a_y,a_z,a_w);
|
||||
}
|
||||
virtual bool add_point(float a_x,float a_y,float a_z,float) {
|
||||
if(!m_this.m_gl2ps_context) return false;
|
||||
|
||||
float r = m_this.m_color[0];
|
||||
float g = m_this.m_color[1];
|
||||
float b = m_this.m_color[2];
|
||||
@@ -369,13 +404,14 @@ protected:
|
||||
m_this.m_vp_mtx.mul_3f(a_x,a_y,a_z);
|
||||
|
||||
m_this.set_vtx(vertices,0, a_x,a_y,a_z, r,g,b,a);
|
||||
|
||||
::tools_gl2psAddPolyPrimitive(_GL2PS_POINT(),1,vertices,offset,ofactor,ounits,pattern,factor,sz,linecap,linejoin,boundary);
|
||||
::tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_POINT(),1,vertices,offset,ofactor,ounits,pattern,factor,sz,linecap,linejoin,boundary);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool add_point(float a_x,float a_y,float a_z,float,
|
||||
float a_r,float a_g,float a_b,float a_a) {
|
||||
if(!m_this.m_gl2ps_context) return false;
|
||||
|
||||
tools_GLint offset = 0;
|
||||
tools_GLfloat ofactor = 0; //
|
||||
tools_GLfloat ounits = 0; //
|
||||
@@ -392,13 +428,15 @@ protected:
|
||||
|
||||
m_this.set_vtx(vertices,0, a_x,a_y,a_z, a_r,a_g,a_b,a_a);
|
||||
|
||||
//::tools_gl2psAddPolyPrimitive(_GL2PS_POINT(),1,vertices,0,pattern,factor,sz,0);
|
||||
::tools_gl2psAddPolyPrimitive(_GL2PS_POINT(),1,vertices,offset,ofactor,ounits,pattern,factor,sz,linecap,linejoin,boundary);
|
||||
//::tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_POINT(),1,vertices,0,pattern,factor,sz,0);
|
||||
::tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_POINT(),1,vertices,offset,ofactor,ounits,pattern,factor,sz,linecap,linejoin,boundary);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool add_line(float a_bx,float a_by,float a_bz,float,
|
||||
float a_ex,float a_ey,float a_ez,float) {
|
||||
if(!m_this.m_gl2ps_context) return false;
|
||||
|
||||
float r = m_this.m_color[0];
|
||||
float g = m_this.m_color[1];
|
||||
float b = m_this.m_color[2];
|
||||
@@ -422,8 +460,8 @@ protected:
|
||||
m_this.set_vtx(vertices,0, a_bx,a_by,a_bz, r,g,b,a);
|
||||
m_this.set_vtx(vertices,1, a_ex,a_ey,a_ez, r,g,b,a);
|
||||
|
||||
//::tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,vertices,0,pattern,factor,lwidth,0);
|
||||
::tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
|
||||
//::tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_LINE(),2,vertices,0,pattern,factor,lwidth,0);
|
||||
::tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_LINE(),2,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -432,6 +470,7 @@ protected:
|
||||
float a_br,float a_bg,float a_bb,float a_ba,
|
||||
float a_ex,float a_ey,float a_ez,float,
|
||||
float a_er,float a_eg,float a_eb,float a_ea){
|
||||
if(!m_this.m_gl2ps_context) return false;
|
||||
|
||||
tools_GLint offset = 0;
|
||||
tools_GLfloat ofactor = 0; //
|
||||
@@ -451,8 +490,8 @@ protected:
|
||||
m_this.set_vtx(vertices,0, a_bx,a_by,a_bz, a_br,a_bg,a_bb,a_ba);
|
||||
m_this.set_vtx(vertices,1, a_ex,a_ey,a_ez, a_er,a_eg,a_eb,a_ea);
|
||||
|
||||
//tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,vertices,0,pattern,factor,lwidth,0);
|
||||
::tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
|
||||
//tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_LINE(),2,vertices,0,pattern,factor,lwidth,0);
|
||||
::tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_LINE(),2,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -460,6 +499,8 @@ protected:
|
||||
virtual bool add_triangle(float a_p1x,float a_p1y,float a_p1z,float,
|
||||
float a_p2x,float a_p2y,float a_p2z,float,
|
||||
float a_p3x,float a_p3y,float a_p3z,float){
|
||||
if(!m_this.m_gl2ps_context) return false;
|
||||
|
||||
float r = m_this.m_color[0];
|
||||
float g = m_this.m_color[1];
|
||||
float b = m_this.m_color[2];
|
||||
@@ -485,8 +526,8 @@ protected:
|
||||
m_this.set_vtx(vertices,1, a_p2x,a_p2y,a_p2z, r,g,b,a);
|
||||
m_this.set_vtx(vertices,2, a_p3x,a_p3y,a_p3z, r,g,b,a);
|
||||
|
||||
//tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,vertices,0,pattern,factor,lwidth,0);
|
||||
::tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
|
||||
//tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_TRIANGLE(),3,vertices,0,pattern,factor,lwidth,0);
|
||||
::tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_TRIANGLE(),3,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -499,6 +540,8 @@ protected:
|
||||
float a_p3x,float a_p3y,float a_p3z,float,
|
||||
float a_r3,float a_g3,float a_b3,float a_a3){
|
||||
|
||||
if(!m_this.m_gl2ps_context) return false;
|
||||
|
||||
tools_GLint offset = 0;
|
||||
tools_GLfloat ofactor = 0; //
|
||||
tools_GLfloat ounits = 0; //
|
||||
@@ -519,8 +562,8 @@ protected:
|
||||
m_this.set_vtx(vertices,1, a_p2x,a_p2y,a_p2z, a_r2,a_g2,a_b2,a_a2);
|
||||
m_this.set_vtx(vertices,2, a_p3x,a_p3y,a_p3z, a_r3,a_g3,a_b3,a_a3);
|
||||
|
||||
//tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,vertices,0,pattern,factor,lwidth,0);
|
||||
::tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
|
||||
//tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_TRIANGLE(),3,vertices,0,pattern,factor,lwidth,0);
|
||||
::tools_gl2psAddPolyPrimitive(m_this.m_gl2ps_context,_GL2PS_TRIANGLE(),3,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -616,6 +659,8 @@ protected:
|
||||
|
||||
protected:
|
||||
gl2ps_manager& m_mgr;
|
||||
tools_GL2PScontext* m_gl2ps_context;
|
||||
|
||||
FILE* m_FILE;
|
||||
float m_back[3];
|
||||
mat4f m_vp_mtx;
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ public:
|
||||
void clear() {safe_reverse_clear<node>(m_children);}
|
||||
|
||||
void raw_clear() { //used for sg coming from exlib/rroot/vis_volume.
|
||||
tools::raw_clear<node>(m_children); //inlib:: is needed.
|
||||
tools::raw_clear<node>(m_children); //tools:: is needed.
|
||||
}
|
||||
|
||||
//void children_clear() {m_children.clear();} //warning : nodes are not deleted. Used in [hep_]cone_anim.
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#ifndef tools_sg_h2plot
|
||||
#define tools_sg_h2plot
|
||||
|
||||
// Connexion inlib/histo to sg/plotter.
|
||||
// Connexion tools/histo to sg/plotter.
|
||||
|
||||
// Inheritance :
|
||||
#include "plottables"
|
||||
|
||||
+3
-3
@@ -323,17 +323,17 @@ public:
|
||||
/// middle spaces //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
base_text* mtext = 0;
|
||||
{std::string s(num_spaces,' ');
|
||||
{std::string _s(num_spaces,' ');
|
||||
if(font==font_hershey()) {
|
||||
text_hershey* text = new text_hershey;
|
||||
mtext = text;
|
||||
text->strings.add(s);
|
||||
text->strings.add(_s);
|
||||
text->hjust = left;
|
||||
} else {
|
||||
base_freetype* text = base_freetype::create(m_ttf);
|
||||
//TTNODE* text = new TTNODE;
|
||||
mtext = text;
|
||||
text->strings.add(s);
|
||||
text->strings.add(_s);
|
||||
text->hjust = left;
|
||||
text->font = font;
|
||||
text->modeling = font_modeling;
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
} /*else {
|
||||
a_action.out() << "debug : inlib::node::read_fields :"
|
||||
a_action.out() << "debug : tools::node::read_fields :"
|
||||
<< " for node class " << s_cls()
|
||||
<< " : field desc class " << fdesc.cls()
|
||||
<< " : field desc offset " << fdesc.offset()
|
||||
|
||||
+5
-5
@@ -62,14 +62,14 @@ inline CONTAINER* container_container(const path_t& a_path) {
|
||||
|
||||
inline void dump(std::ostream& a_out,const path_t& a_path) {
|
||||
a_out << "tools::sg::dump : path size " << a_path.size() << std::endl;
|
||||
std::string s;
|
||||
std::string _s;
|
||||
path_t::const_iterator it;
|
||||
for(it=a_path.begin();it!=a_path.end();++it){
|
||||
if(!p2s(*it,s)) {}
|
||||
a_out << " " << s << " " << (*it)->s_cls();
|
||||
if(!p2s(*it,_s)) {}
|
||||
a_out << " " << _s << " " << (*it)->s_cls();
|
||||
if(noderef* _ref = safe_cast<node,noderef>(*(*it))) {
|
||||
if(!p2s(&(_ref->node()),s)) {}
|
||||
a_out << ", " << s << " " << _ref->node().s_cls();
|
||||
if(!p2s(&(_ref->node()),_s)) {}
|
||||
a_out << ", " << _s << " " << _ref->node().s_cls();
|
||||
}
|
||||
a_out << std::endl;
|
||||
}
|
||||
|
||||
+27
-27
@@ -1866,7 +1866,7 @@ public: //public
|
||||
float XMGR = right_margin;
|
||||
float wData = XSIZ-XMGL-XMGR;
|
||||
if(XSIZ==0.0F) {
|
||||
//SoDebugError::postInfo("inlib::sg;:plotter::data_frame_2_vp","XSIZ is 0");
|
||||
//SoDebugError::postInfo("tools::sg;:plotter::data_frame_2_vp","XSIZ is 0");
|
||||
return false;
|
||||
}
|
||||
a_vp[0] = (wData*a_pos[0] + XMGL)/XSIZ;}
|
||||
@@ -1876,7 +1876,7 @@ public: //public
|
||||
float YMGU = top_margin;
|
||||
float hData = YSIZ-YMGL-YMGU;
|
||||
if(YSIZ==0.0F) {
|
||||
//SoDebugError::postInfo("inlib::sg;:plotter::data_frame_2_vp","YSIZ is 0");
|
||||
//SoDebugError::postInfo("tools::sg;:plotter::data_frame_2_vp","YSIZ is 0");
|
||||
return false;
|
||||
}
|
||||
a_vp[1] = (hData*a_pos[1] + YMGL)/YSIZ;}
|
||||
@@ -1886,7 +1886,7 @@ public: //public
|
||||
float ZMGU = up_margin;
|
||||
float dData = ZSIZ-ZMGD-ZMGU;
|
||||
if(ZSIZ==0.0F) {
|
||||
//SoDebugError::postInfo("inlib::sg;:plotter::data_frame_2_vp","ZSIZ is 0");
|
||||
//SoDebugError::postInfo("tools::sg;:plotter::data_frame_2_vp","ZSIZ is 0");
|
||||
return false;
|
||||
}
|
||||
a_vp[2] = (dData*a_pos[2] + ZMGD)/ZSIZ;}
|
||||
@@ -1903,7 +1903,7 @@ public: //public
|
||||
float XMGR = right_margin;
|
||||
float wData = XSIZ-XMGL-XMGR;
|
||||
if(wData==0.0F) {
|
||||
//SoDebugError::postInfo("inlib::sg;:plotter::vp_2_data_frame","wData is 0");
|
||||
//SoDebugError::postInfo("tools::sg;:plotter::vp_2_data_frame","wData is 0");
|
||||
return false;
|
||||
}
|
||||
a_pos[0] = (a_vp[0]*XSIZ - XMGL)/wData;}
|
||||
@@ -1913,7 +1913,7 @@ public: //public
|
||||
float YMGU = top_margin;
|
||||
float hData = YSIZ-YMGL-YMGU;
|
||||
if(hData==0.0F) {
|
||||
//SoDebugError::postInfo("inlib::sg;:plotter::vp_2_data_frame","hData is 0");
|
||||
//SoDebugError::postInfo("tools::sg;:plotter::vp_2_data_frame","hData is 0");
|
||||
return false;
|
||||
}
|
||||
a_pos[1] = (a_vp[1]*YSIZ - YMGL)/hData;}
|
||||
@@ -1923,7 +1923,7 @@ public: //public
|
||||
float ZMGU = up_margin;
|
||||
float dData = ZSIZ-ZMGD-ZMGU;
|
||||
if(dData==0.0F) {
|
||||
//SoDebugError::postInfo("inlib::sg;:plotter::vp_2_data_frame","dData is 0");
|
||||
//SoDebugError::postInfo("tools::sg;:plotter::vp_2_data_frame","dData is 0");
|
||||
return false;
|
||||
}
|
||||
a_pos[2] = (a_vp[2]*ZSIZ - ZMGD)/dData;}
|
||||
@@ -1977,19 +1977,19 @@ public: //public
|
||||
float mx = m_x_axis.maximum_value;
|
||||
if(mx==mn) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","x : mn (%g) == mx (%g)",mn,mx);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","x : mn (%g) == mx (%g)",mn,mx);
|
||||
return false;
|
||||
}
|
||||
bool lg = m_x_axis.is_log;
|
||||
if(lg) {
|
||||
if(mn<=0) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","x log but mn (%g) <=0",mn);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","x log but mn (%g) <=0",mn);
|
||||
return false;
|
||||
}
|
||||
if(mx<=0) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","x log but mx (%g) <=0",mx);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","x log but mx (%g) <=0",mx);
|
||||
return false;
|
||||
}
|
||||
mn = flog10(mn);
|
||||
@@ -2001,19 +2001,19 @@ public: //public
|
||||
float mx = m_y_axis.maximum_value;
|
||||
if(mx==mn) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","y : mn (%g) == mx (%g)",mn,mx);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","y : mn (%g) == mx (%g)",mn,mx);
|
||||
return false;
|
||||
}
|
||||
bool lg = m_y_axis.is_log;
|
||||
if(lg) {
|
||||
if(mn<=0) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","y log but mn (%g) <=0",mn);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","y log but mn (%g) <=0",mn);
|
||||
return false;
|
||||
}
|
||||
if(mx<=0) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","y log but mx (%g) <=0",mx);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","y log but mx (%g) <=0",mx);
|
||||
return false;
|
||||
}
|
||||
mn = flog10(mn);
|
||||
@@ -2025,19 +2025,19 @@ public: //public
|
||||
float mx = m_z_axis.maximum_value;
|
||||
if(mx==mn) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","z : mn (%g) == mx (%g)",mn,mx);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","z : mn (%g) == mx (%g)",mn,mx);
|
||||
return false;
|
||||
}
|
||||
bool lg = m_z_axis.is_log;
|
||||
if(lg) {
|
||||
if(mn<=0) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","z log but mn (%g) <=0",mn);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","z log but mn (%g) <=0",mn);
|
||||
return false;
|
||||
}
|
||||
if(mx<=0) {
|
||||
//SoDebugError::postInfo
|
||||
// ("inlib::sg;:plotter::axis_2_data_frame","z log but mx (%g) <=0",mx);
|
||||
// ("tools::sg;:plotter::axis_2_data_frame","z log but mx (%g) <=0",mx);
|
||||
return false;
|
||||
}
|
||||
mn = flog10(mn);
|
||||
@@ -2277,8 +2277,8 @@ protected:
|
||||
rotf r3(vec3f(1,0,0),tau * fdeg2rad());
|
||||
|
||||
rotf r = r1*r2*r3;
|
||||
mat4f m;
|
||||
r.value(m);
|
||||
mat4f _m;
|
||||
r.value(_m);
|
||||
|
||||
float xmn = -0.5F*wData;
|
||||
float ymn = -0.5F*hData;
|
||||
@@ -2291,30 +2291,30 @@ protected:
|
||||
float x,y,z;
|
||||
// zmn face :
|
||||
{x = xmn;y = ymn;z = zmn;
|
||||
m.mul_3f(x,y,z);
|
||||
_m.mul_3f(x,y,z);
|
||||
_box.extend_by(x,y,z);}
|
||||
{x = xmx;y = ymn;z = zmn;
|
||||
m.mul_3f(x,y,z);
|
||||
_m.mul_3f(x,y,z);
|
||||
_box.extend_by(x,y,z);}
|
||||
{x = xmx;y = ymx;z = zmn;
|
||||
m.mul_3f(x,y,z);
|
||||
_m.mul_3f(x,y,z);
|
||||
_box.extend_by(x,y,z);}
|
||||
{x = xmn;y = ymx;z = zmn;
|
||||
m.mul_3f(x,y,z);
|
||||
_m.mul_3f(x,y,z);
|
||||
_box.extend_by(x,y,z);}
|
||||
|
||||
// zmx face :
|
||||
{x = xmn;y = ymn;z = zmx;
|
||||
m.mul_3f(x,y,z);
|
||||
_m.mul_3f(x,y,z);
|
||||
_box.extend_by(x,y,z);}
|
||||
{x = xmx;y = ymn;z = zmx;
|
||||
m.mul_3f(x,y,z);
|
||||
_m.mul_3f(x,y,z);
|
||||
_box.extend_by(x,y,z);}
|
||||
{x = xmx;y = ymx;z = zmx;
|
||||
m.mul_3f(x,y,z);
|
||||
_m.mul_3f(x,y,z);
|
||||
_box.extend_by(x,y,z);}
|
||||
{x = xmn;y = ymx;z = zmx;
|
||||
m.mul_3f(x,y,z);
|
||||
_m.mul_3f(x,y,z);
|
||||
_box.extend_by(x,y,z);}
|
||||
|
||||
float xfac = _box.mx()[0]-_box.mn()[0];
|
||||
@@ -2574,7 +2574,7 @@ public:
|
||||
////////////////////////////////////
|
||||
|
||||
//if(verbose) {
|
||||
// SoDebugError::postInfo("inlib::sg;:plotter::updateChildren",
|
||||
// SoDebugError::postInfo("tools::sg;:plotter::updateChildren",
|
||||
// "%lu : XY : update bins",(unsigned long)this);
|
||||
//}
|
||||
|
||||
@@ -7439,7 +7439,7 @@ protected: //rep
|
||||
const std::vector<rep_bin1D>& a_bins,
|
||||
const rep_box& a_box_x,const rep_box& a_box_y,float a_zz,
|
||||
bool a_bar_chart){
|
||||
//printf("debug : inlib::sg;:plotter::repHatch1D_xy : zz %g barchart %d sw %g\n",a_zz,aBarChart,a_style.stripWidth.getValue());
|
||||
//printf("debug : tools::sg;:plotter::repHatch1D_xy : zz %g barchart %d sw %g\n",a_zz,aBarChart,a_style.stripWidth.getValue());
|
||||
|
||||
separator* _sep = new separator;
|
||||
|
||||
|
||||
+3
-3
@@ -329,9 +329,9 @@ namespace tools {
|
||||
namespace sg {
|
||||
|
||||
inline bool scolor(const colorf& a_col,std::string& a_s){
|
||||
char s[256];
|
||||
snpf(s,sizeof(s),"%g %g %g",a_col[0],a_col[1],a_col[2]);
|
||||
a_s = s;
|
||||
char _s[256];
|
||||
snpf(_s,sizeof(_s),"%g %g %g",a_col[0],a_col[1],a_col[2]);
|
||||
a_s = _s;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -564,17 +564,17 @@ inline bool find_color(const cmaps_t& a_cmaps,const std::string& a_s,colorf& a_c
|
||||
// 1 3 5
|
||||
unsigned long rr,gg,bb;
|
||||
|
||||
{std::string s("0x");
|
||||
s += a_s.substr(1,2);
|
||||
if(!to_ulong(s,rr)) return false;}
|
||||
{std::string _s("0x");
|
||||
_s += a_s.substr(1,2);
|
||||
if(!to_ulong(_s,rr)) return false;}
|
||||
|
||||
{std::string s("0x");
|
||||
s += a_s.substr(3,2);
|
||||
if(!to_ulong(s,gg)) return false;}
|
||||
{std::string _s("0x");
|
||||
_s += a_s.substr(3,2);
|
||||
if(!to_ulong(_s,gg)) return false;}
|
||||
|
||||
{std::string s("0x");
|
||||
s += a_s.substr(5,2);
|
||||
if(!to_ulong(s,bb)) return false;}
|
||||
{std::string _s("0x");
|
||||
_s += a_s.substr(5,2);
|
||||
if(!to_ulong(_s,bb)) return false;}
|
||||
|
||||
a_col = colorf(((float)rr)/255,((float)gg)/255,((float)bb)/255);
|
||||
return true;
|
||||
|
||||
+86
-86
@@ -357,123 +357,123 @@ translation %g %g %g"
|
||||
,m_translation[0],m_translation[1],m_translation[2]);
|
||||
|
||||
std::string lf("\n");
|
||||
std::string s(ss);
|
||||
std::string _s(ss);
|
||||
|
||||
s += lf;
|
||||
s += "smoothing ";
|
||||
s += (m_smoothing?"true":"false");
|
||||
_s += lf;
|
||||
_s += "smoothing ";
|
||||
_s += (m_smoothing?"true":"false");
|
||||
|
||||
s += lf;
|
||||
s += "hinting ";
|
||||
s += (m_hinting?"true":"false");
|
||||
_s += lf;
|
||||
_s += "hinting ";
|
||||
_s += (m_hinting?"true":"false");
|
||||
|
||||
s += lf;
|
||||
s += "enforced ";
|
||||
s += (m_enforced?"true":"false");
|
||||
_s += lf;
|
||||
_s += "enforced ";
|
||||
_s += (m_enforced?"true":"false");
|
||||
|
||||
s += lf;
|
||||
s += "visible ";
|
||||
s += (m_visible?"true":"false");
|
||||
_s += lf;
|
||||
_s += "visible ";
|
||||
_s += (m_visible?"true":"false");
|
||||
|
||||
s += lf;
|
||||
s += "editable ";
|
||||
s += (m_editable?"true":"false");
|
||||
_s += lf;
|
||||
_s += "editable ";
|
||||
_s += (m_editable?"true":"false");
|
||||
|
||||
s += lf;
|
||||
s += "automated ";
|
||||
s += (m_automated?"true":"false");
|
||||
_s += lf;
|
||||
_s += "automated ";
|
||||
_s += (m_automated?"true":"false");
|
||||
|
||||
s += lf;
|
||||
s += "pickable ";
|
||||
s += (m_pickable?"true":"false");
|
||||
_s += lf;
|
||||
_s += "pickable ";
|
||||
_s += (m_pickable?"true":"false");
|
||||
|
||||
s += lf;
|
||||
s += "marker_style ";
|
||||
s += smarker_style(m_marker_style);
|
||||
_s += lf;
|
||||
_s += "marker_style ";
|
||||
_s += smarker_style(m_marker_style);
|
||||
|
||||
s += lf;
|
||||
s += "area_style ";
|
||||
s += sarea_style(m_area_style);
|
||||
_s += lf;
|
||||
_s += "area_style ";
|
||||
_s += sarea_style(m_area_style);
|
||||
|
||||
s += lf;
|
||||
s += "modeling ";
|
||||
s += m_modeling;
|
||||
_s += lf;
|
||||
_s += "modeling ";
|
||||
_s += m_modeling;
|
||||
|
||||
s += lf;
|
||||
s += "coloring ";
|
||||
s += m_coloring;
|
||||
_s += lf;
|
||||
_s += "coloring ";
|
||||
_s += m_coloring;
|
||||
|
||||
s += lf;
|
||||
s += "title ";
|
||||
s += m_title;
|
||||
_s += lf;
|
||||
_s += "title ";
|
||||
_s += m_title;
|
||||
|
||||
s += lf;
|
||||
s += "light_model ";
|
||||
s += m_light_model;
|
||||
_s += lf;
|
||||
_s += "light_model ";
|
||||
_s += m_light_model;
|
||||
|
||||
s += lf;
|
||||
s += "tick_modeling ";
|
||||
s += m_tick_modeling;
|
||||
_s += lf;
|
||||
_s += "tick_modeling ";
|
||||
_s += m_tick_modeling;
|
||||
|
||||
s += lf;
|
||||
s += "encoding ";
|
||||
s += m_encoding;
|
||||
_s += lf;
|
||||
_s += "encoding ";
|
||||
_s += m_encoding;
|
||||
|
||||
s += lf;
|
||||
s += "cut ";
|
||||
s += m_cut;
|
||||
_s += lf;
|
||||
_s += "cut ";
|
||||
_s += m_cut;
|
||||
|
||||
s += lf;
|
||||
s += "painting ";
|
||||
s += spainting_policy(m_painting);
|
||||
_s += lf;
|
||||
_s += "painting ";
|
||||
_s += spainting_policy(m_painting);
|
||||
|
||||
s += lf;
|
||||
s += "hatching ";
|
||||
s += shatching_policy(m_hatching);
|
||||
_s += lf;
|
||||
_s += "hatching ";
|
||||
_s += shatching_policy(m_hatching);
|
||||
|
||||
s += lf;
|
||||
s += "projection ";
|
||||
s += sprojection_type(m_projection);
|
||||
_s += lf;
|
||||
_s += "projection ";
|
||||
_s += sprojection_type(m_projection);
|
||||
|
||||
s += lf;
|
||||
s += "font ";
|
||||
s += m_font;
|
||||
_s += lf;
|
||||
_s += "font ";
|
||||
_s += m_font;
|
||||
|
||||
if(m_font_modeling==font_outline) {
|
||||
s += lf;
|
||||
s += "font_modeling ";
|
||||
s += s_font_outline();
|
||||
_s += lf;
|
||||
_s += "font_modeling ";
|
||||
_s += s_font_outline();
|
||||
} else if(m_font_modeling==font_filled) {
|
||||
s += lf;
|
||||
s += "font_modeling ";
|
||||
s += s_font_filled();
|
||||
_s += lf;
|
||||
_s += "font_modeling ";
|
||||
_s += s_font_filled();
|
||||
} else if(m_font_modeling==font_pixmap) {
|
||||
s += lf;
|
||||
s += "font_modeling ";
|
||||
s += s_font_pixmap();
|
||||
_s += lf;
|
||||
_s += "font_modeling ";
|
||||
_s += s_font_pixmap();
|
||||
}
|
||||
|
||||
s += lf;
|
||||
s += "options ";
|
||||
s += m_options;
|
||||
_s += lf;
|
||||
_s += "options ";
|
||||
_s += m_options;
|
||||
|
||||
s += lf;
|
||||
s += "color_mapping ";
|
||||
s += m_color_mapping;
|
||||
_s += lf;
|
||||
_s += "color_mapping ";
|
||||
_s += m_color_mapping;
|
||||
|
||||
s += lf;
|
||||
s += "front_face ";
|
||||
s += (m_front_face==winding_ccw?"ccw":"cw");
|
||||
_s += lf;
|
||||
_s += "front_face ";
|
||||
_s += (m_front_face==winding_ccw?"ccw":"cw");
|
||||
|
||||
s += lf;
|
||||
s += "hjust ";
|
||||
s += shjust(m_hjust);
|
||||
_s += lf;
|
||||
_s += "hjust ";
|
||||
_s += shjust(m_hjust);
|
||||
|
||||
s += lf;
|
||||
s += "vjust ";
|
||||
s += svjust(m_vjust);
|
||||
_s += lf;
|
||||
_s += "vjust ";
|
||||
_s += svjust(m_vjust);
|
||||
|
||||
return s;
|
||||
return _s;
|
||||
}
|
||||
|
||||
void color(const colorf& a_v){m_color = a_v;}
|
||||
|
||||
+29
-17
@@ -317,9 +317,6 @@ public:
|
||||
matrix* tsf = new matrix;
|
||||
m_sep.add(tsf);
|
||||
|
||||
float fw = width * wmargin_factor;
|
||||
float fh = height * hmargin_factor;
|
||||
|
||||
//sf<float> zfront ?
|
||||
float zz = back_visible.value()?0.01f:0;
|
||||
|
||||
@@ -364,9 +361,9 @@ public:
|
||||
if(hjust==center) {
|
||||
xtrans = 0;
|
||||
} else if(hjust==left) {
|
||||
xtrans = -fw*0.5f+bxw*0.5f;
|
||||
xtrans = bxw*0.5f;
|
||||
} else if(hjust==right) {
|
||||
xtrans = fw*0.5f-bxw*0.5f;
|
||||
xtrans = -bxw*0.5f;
|
||||
}
|
||||
|
||||
float bxh = mx_y-mn_y;
|
||||
@@ -374,20 +371,21 @@ public:
|
||||
if(vjust==middle) {
|
||||
ytrans = 0;
|
||||
} else if(vjust==bottom) {
|
||||
ytrans = -fh*0.5f+bxh*0.5f;
|
||||
ytrans = bxh*0.5f;
|
||||
} else if(vjust==top) {
|
||||
ytrans = fh*0.5f-bxh*0.5f;
|
||||
ytrans = -bxh*0.5f;
|
||||
}
|
||||
|
||||
float xx = -(mn_x+mx_x)*0.5F+xtrans;
|
||||
float yy = -(mn_y+mx_y)*0.5F+ytrans;
|
||||
tsf->set_translate(xx,yy,zz);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(enforce_front_width) {
|
||||
|
||||
float fh = height * hmargin_factor;
|
||||
|
||||
float th = fh;
|
||||
float mn_x,mn_y,mn_z;
|
||||
float mx_x,mx_y,mx_z;
|
||||
@@ -406,9 +404,9 @@ public:
|
||||
if(hjust==center) {
|
||||
xtrans = 0;
|
||||
} else if(hjust==left) {
|
||||
xtrans = -fw*0.5f+bxw*0.5f;
|
||||
xtrans = bxw*0.5f;
|
||||
} else if(hjust==right) {
|
||||
xtrans = fw*0.5f-bxw*0.5f;
|
||||
xtrans = -bxw*0.5f;
|
||||
}
|
||||
|
||||
float bxh = mx_y-mn_y;
|
||||
@@ -416,9 +414,9 @@ public:
|
||||
if(vjust==middle) {
|
||||
ytrans = 0;
|
||||
} else if(vjust==bottom) {
|
||||
ytrans = -fh*0.5f+bxh*0.5f;
|
||||
ytrans = bxh*0.5f;
|
||||
} else if(vjust==top) {
|
||||
ytrans = fh*0.5f-bxw*0.5f;
|
||||
ytrans = -bxh*0.5f;
|
||||
}
|
||||
|
||||
float xx = -(mn_x+mx_x)*0.5F+xtrans;
|
||||
@@ -426,15 +424,16 @@ public:
|
||||
tsf->set_translate(xx,yy,zz);
|
||||
|
||||
m_base_text->height = bxh; //=th?
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//various automatic text height strategies :
|
||||
float fw = width * wmargin_factor;
|
||||
float fh = height * hmargin_factor;
|
||||
|
||||
if(confine) {
|
||||
// code common to freetype and hershey :
|
||||
|
||||
|
||||
// try to adjust text within fw x fh (by attempting to be smart !).
|
||||
// the below assumes that text bounds are linear according
|
||||
// "text height".
|
||||
@@ -488,7 +487,7 @@ public:
|
||||
} else if(vjust==bottom) {
|
||||
ytrans = -fh*0.5f+bxh*0.5f;
|
||||
} else if(vjust==top) {
|
||||
ytrans = fh*0.5f-bxw*0.5f;
|
||||
ytrans = fh*0.5f-bxh*0.5f;
|
||||
}
|
||||
|
||||
float xx = -(mn_x+mx_x)*0.5F+xtrans;
|
||||
@@ -498,7 +497,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
// we arrange yy so that two aside texts
|
||||
// with same height will have their text base lines aligned.
|
||||
@@ -548,7 +547,7 @@ public:
|
||||
} else if(vjust==bottom) {
|
||||
ytrans = -fh*0.5f+bxh*0.5f;
|
||||
} else if(vjust==top) {
|
||||
ytrans = fh*0.5f-bxw*0.5f;
|
||||
ytrans = fh*0.5f-bxh*0.5f;
|
||||
}
|
||||
*/
|
||||
float xx = -(mn_x+mx_x)*0.5F+xtrans;
|
||||
@@ -565,6 +564,19 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void map_back_area_to_text() {
|
||||
if(!m_base_text) return;
|
||||
|
||||
float mn_x,mn_y,mn_z;
|
||||
float mx_x,mx_y,mx_z;
|
||||
m_base_text->get_bounds(front_height,mn_x,mn_y,mn_z,mx_x,mx_y,mx_z);
|
||||
|
||||
float bxw = mx_x-mn_x;
|
||||
float bxh = mx_y-mn_y;
|
||||
parent::width = bxw/wmargin_factor;
|
||||
parent::height = bxh/hmargin_factor;
|
||||
}
|
||||
|
||||
protected:
|
||||
separator m_sep;
|
||||
base_text* m_base_text;
|
||||
|
||||
+6
-6
@@ -586,7 +586,7 @@ protected:
|
||||
static void decode_PAW(const std::string& a_s,sencoded& a_sed){
|
||||
a_sed.clear();
|
||||
|
||||
font_type font = sg::latin;
|
||||
font_type hershey_font = sg::latin;
|
||||
hchar::e_move move = hchar::none;
|
||||
bool back = false;
|
||||
bool bar = false;
|
||||
@@ -596,16 +596,16 @@ protected:
|
||||
char c = *it;
|
||||
// Control characters :
|
||||
if(c=='[') {
|
||||
font = sg::greek;
|
||||
hershey_font = sg::greek;
|
||||
continue;
|
||||
} else if(c==']') {
|
||||
font = sg::latin;
|
||||
hershey_font = sg::latin;
|
||||
continue;
|
||||
} else if(c=='"') {
|
||||
font = sg::special;
|
||||
hershey_font = sg::special;
|
||||
continue;
|
||||
} else if(c=='#') {
|
||||
font = sg::latin;
|
||||
hershey_font = sg::latin;
|
||||
continue;
|
||||
} else if(c=='!') {
|
||||
move = hchar::none;
|
||||
@@ -631,7 +631,7 @@ protected:
|
||||
hc.m_y_move = move;
|
||||
hc.m_back = back;
|
||||
hc.m_bar = bar;
|
||||
hc.m_font = font;
|
||||
hc.m_font = hershey_font;
|
||||
hc.m_char = c;
|
||||
|
||||
a_sed.push_back(hc);
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ inline bool match(const std::string& a_string,const std::string& a_pattern,bool
|
||||
return true;
|
||||
}
|
||||
|
||||
//for inlib/app/find.cpp :
|
||||
//for tools/app/find.cpp :
|
||||
inline bool match2(const std::string& a_string,const std::string& a_pattern){
|
||||
return match(a_string,a_pattern,true);
|
||||
}
|
||||
|
||||
+21
-21
@@ -543,15 +543,15 @@ protected:
|
||||
/// e(j) = s""(x(j)-0)/24 e(j+1) = 0 e(j+2) = s""(x(j)+0)/24
|
||||
/// f(j) = s""'(x(j)-0)/120 f(j+1) = 0 f(j+2) = s""'(x(j)+0)/120
|
||||
|
||||
size_t i, m;
|
||||
double pqqr, p, q, r, s, t, u, v,
|
||||
size_t i, _m;
|
||||
double pqqr, p, q, r, _s, t, u, v,
|
||||
b1, p2, p3, q2, q3, r2, pq, pr, qr;
|
||||
|
||||
if (fNp <= 2) return;
|
||||
|
||||
// coefficients of a positive definite, pentadiagonal matrix,
|
||||
// stored in D, E, F from 1 to n-3.
|
||||
m = fNp-2;
|
||||
_m = fNp-2;
|
||||
q = fPoly[1].X()-fPoly[0].X();
|
||||
r = fPoly[2].X()-fPoly[1].X();
|
||||
q2 = q*q;
|
||||
@@ -561,8 +561,8 @@ protected:
|
||||
if (q) fPoly[1].D() = q*6.*q2/(qr*qr);
|
||||
else fPoly[1].D() = 0;
|
||||
|
||||
if (m > 1) {
|
||||
for (i = 1; i < m; ++i) {
|
||||
if (_m > 1) {
|
||||
for (i = 1; i < _m; ++i) {
|
||||
p = q;
|
||||
q = r;
|
||||
r = fPoly[i+2].X()-fPoly[i+1].X();
|
||||
@@ -587,7 +587,7 @@ protected:
|
||||
fPoly[i+1].D() = fPoly[i].E() = fPoly[i-1].F() = 0;
|
||||
}
|
||||
}
|
||||
if (r) fPoly[m-1].D() += r*6.*r2/(qr*qr);
|
||||
if (r) fPoly[_m-1].D() += r*6.*r2/(qr*qr);
|
||||
|
||||
// First and second order divided differences of the given function
|
||||
// values, stored in b from 2 to n and in c from 3 to n
|
||||
@@ -612,14 +612,14 @@ protected:
|
||||
}
|
||||
|
||||
// Solve the linear system with c(i+2) - c(i+1) as right-hand side.
|
||||
if (m > 1) {
|
||||
p=fPoly[0].C()=fPoly[m-1].E()=fPoly[0].F()
|
||||
=fPoly[m-2].F()=fPoly[m-1].F()=0;
|
||||
if (_m > 1) {
|
||||
p=fPoly[0].C()=fPoly[_m-1].E()=fPoly[0].F()
|
||||
=fPoly[_m-2].F()=fPoly[_m-1].F()=0;
|
||||
fPoly[1].C() = fPoly[3].C()-fPoly[2].C();
|
||||
fPoly[1].D() = 1./fPoly[1].D();
|
||||
|
||||
if (m > 2) {
|
||||
for (i = 2; i < m; ++i) {
|
||||
if (_m > 2) {
|
||||
for (i = 2; i < _m; ++i) {
|
||||
q = fPoly[i-1].D()*fPoly[i-1].E();
|
||||
fPoly[i].D() = 1./(fPoly[i].D()-p*fPoly[i-2].F()-q*fPoly[i-1].E());
|
||||
fPoly[i].E() -= q*fPoly[i-1].F();
|
||||
@@ -637,7 +637,7 @@ protected:
|
||||
-fPoly[i].F()*fPoly[i+2].C())*fPoly[i].D();
|
||||
|
||||
// Integrate the third derivative of s(x)
|
||||
m = fNp-1;
|
||||
_m = fNp-1;
|
||||
q = fPoly[1].X()-fPoly[0].X();
|
||||
r = fPoly[2].X()-fPoly[1].X();
|
||||
b1 = fPoly[1].B();
|
||||
@@ -650,25 +650,25 @@ protected:
|
||||
v = t = 0;
|
||||
if (q) fPoly[0].F() = v/q;
|
||||
else fPoly[0].F() = 0;
|
||||
for (i = 1; i < m; ++i) {
|
||||
for (i = 1; i < _m; ++i) {
|
||||
p = q;
|
||||
q = r;
|
||||
if (i != m-1) r = fPoly[i+2].X()-fPoly[i+1].X();
|
||||
if (i != _m-1) r = fPoly[i+2].X()-fPoly[i+1].X();
|
||||
else r = 0;
|
||||
p3 = q3;
|
||||
q3 = q*q*q;
|
||||
pq = qr;
|
||||
qr = q+r;
|
||||
s = t;
|
||||
_s = t;
|
||||
if (qr) t = (fPoly[i+1].C()-fPoly[i].C())/qr;
|
||||
else t = 0;
|
||||
u = v;
|
||||
v = t-s;
|
||||
v = t-_s;
|
||||
if (pq) {
|
||||
fPoly[i].F() = fPoly[i-1].F();
|
||||
if (q) fPoly[i].F() = v/q;
|
||||
fPoly[i].E() = s*5.;
|
||||
fPoly[i].D() = (fPoly[i].C()-q*s)*10;
|
||||
fPoly[i].E() = _s*5.;
|
||||
fPoly[i].D() = (fPoly[i].C()-q*_s)*10;
|
||||
fPoly[i].C() =
|
||||
fPoly[i].D()*(p-q)+(fPoly[i+1].B()-fPoly[i].B()+(u-fPoly[i].E())*
|
||||
p3-(v+fPoly[i].E())*q3)/pq;
|
||||
@@ -682,10 +682,10 @@ protected:
|
||||
|
||||
// End points x(1) and x(n)
|
||||
p = fPoly[1].X()-fPoly[0].X();
|
||||
s = fPoly[0].F()*p*p*p;
|
||||
_s = fPoly[0].F()*p*p*p;
|
||||
fPoly[0].E() = fPoly[0].D() = 0;
|
||||
fPoly[0].C() = fPoly[1].C()-s*10;
|
||||
fPoly[0].B() = b1-(fPoly[0].C()+s)*p;
|
||||
fPoly[0].C() = fPoly[1].C()-_s*10;
|
||||
fPoly[0].B() = b1-(fPoly[0].C()+_s)*p;
|
||||
|
||||
q = fPoly[fNp-1].X()-fPoly[fNp-2].X();
|
||||
t = fPoly[fNp-2].F()*q*q*q;
|
||||
|
||||
+26
-26
@@ -13,20 +13,20 @@ inline bool vsprintf(std::string& a_string,int a_length,const char* a_format,va_
|
||||
a_string.clear();
|
||||
if(a_length<0) return false;
|
||||
if(!a_format) return false;
|
||||
char* s = new char[a_length+1];
|
||||
if(!s) return false;
|
||||
s[a_length] = '\0';
|
||||
int n = vsnpf(s,a_length+1,a_format,a_args);
|
||||
char* _s = new char[a_length+1];
|
||||
if(!_s) return false;
|
||||
_s[a_length] = '\0';
|
||||
int n = vsnpf(_s,a_length+1,a_format,a_args);
|
||||
if(n>a_length) {
|
||||
delete [] s;
|
||||
delete [] _s;
|
||||
return false;
|
||||
}
|
||||
if(s[a_length]!='\0') {
|
||||
delete [] s;
|
||||
if(_s[a_length]!='\0') {
|
||||
delete [] _s;
|
||||
return false;
|
||||
}
|
||||
a_string = s;
|
||||
delete [] s;
|
||||
a_string = _s;
|
||||
delete [] _s;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,23 +35,23 @@ inline bool sprintf(std::string& a_string,int a_length,const char* a_format,...)
|
||||
a_string.clear();
|
||||
if(a_length<0) return false;
|
||||
if(!a_format) return false;
|
||||
char* s = new char[a_length+1];
|
||||
if(!s) return false;
|
||||
s[a_length] = '\0';
|
||||
char* _s = new char[a_length+1];
|
||||
if(!_s) return false;
|
||||
_s[a_length] = '\0';
|
||||
va_list args;
|
||||
va_start(args,a_format);
|
||||
int n = vsnpf(s,a_length+1,a_format,args);
|
||||
int n = vsnpf(_s,a_length+1,a_format,args);
|
||||
va_end(args);
|
||||
if(n>a_length) {
|
||||
delete [] s;
|
||||
delete [] _s;
|
||||
return false;
|
||||
}
|
||||
if(s[a_length]!='\0') {
|
||||
delete [] s;
|
||||
if(_s[a_length]!='\0') {
|
||||
delete [] _s;
|
||||
return false;
|
||||
}
|
||||
a_string = s;
|
||||
delete [] s;
|
||||
a_string = _s;
|
||||
delete [] _s;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -59,14 +59,14 @@ inline bool print2sv(std::string& a_string,int a_length,const char* a_format,va_
|
||||
if(a_length<0) {a_string.clear();return false;}
|
||||
if(!a_format) {a_string.clear();return false;}
|
||||
a_string.assign(a_length,' '); //data = a_length+1
|
||||
char* s = const_cast<char*>(a_string.c_str());
|
||||
//s[a_length] shoulg be '\0'.
|
||||
int n = vsnpf(s,a_length+1,a_format,a_args);
|
||||
char* _s = const_cast<char*>(a_string.c_str());
|
||||
//_s[a_length] shoulg be '\0'.
|
||||
int n = vsnpf(_s,a_length+1,a_format,a_args);
|
||||
if(n>a_length) { //a_string is compromised.
|
||||
a_string.clear(); //we cross fingers.
|
||||
return false;
|
||||
}
|
||||
if(s[a_length]!='\0') { //a_string is compromised.
|
||||
if(_s[a_length]!='\0') { //a_string is compromised.
|
||||
a_string.clear(); //we cross fingers.
|
||||
return false;
|
||||
}
|
||||
@@ -78,17 +78,17 @@ inline bool print2s(std::string& a_string,int a_length,const char* a_format,...)
|
||||
if(a_length<0) {a_string.clear();return false;}
|
||||
if(!a_format) {a_string.clear();return false;}
|
||||
a_string.assign(a_length,' '); //data = a_length+1
|
||||
char* s = const_cast<char*>(a_string.c_str());
|
||||
//s[a_length] shoulg be '\0'.
|
||||
char* _s = const_cast<char*>(a_string.c_str());
|
||||
//_s[a_length] shoulg be '\0'.
|
||||
va_list args;
|
||||
va_start(args,a_format);
|
||||
int n = vsnpf(s,a_length+1,a_format,args);
|
||||
int n = vsnpf(_s,a_length+1,a_format,args);
|
||||
va_end(args);
|
||||
if(n>a_length) { //a_string is compromised.
|
||||
a_string.clear(); //we cross fingers.
|
||||
return false;
|
||||
}
|
||||
if(s[a_length]!='\0') { //a_string is compromised.
|
||||
if(_s[a_length]!='\0') { //a_string is compromised.
|
||||
a_string.clear(); //we cross fingers.
|
||||
return false;
|
||||
}
|
||||
|
||||
+3
-3
@@ -66,9 +66,9 @@ inline void toxml(std::string& a_string){
|
||||
}
|
||||
|
||||
inline std::string to_xml(const std::string& a_string){
|
||||
std::string s = a_string;
|
||||
toxml(s);
|
||||
return s;
|
||||
std::string _s = a_string;
|
||||
toxml(_s);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline void to_win(std::string& a_string) {
|
||||
|
||||
+3
-3
@@ -58,9 +58,9 @@ inline bool strip(std::string& a_string,what a_type = both,char a_char = ' '){
|
||||
|
||||
#ifdef TOOLS_DEPRECATED
|
||||
inline std::string strp(const std::string& a_string,what a_type = both,char a_char = ' '){
|
||||
std::string s(a_string);
|
||||
strip(s,a_type,a_char);
|
||||
return s;
|
||||
std::string _s(a_string);
|
||||
strip(_s,a_type,a_char);
|
||||
return _s;
|
||||
}
|
||||
#endif //TOOLS_DEPRECATED
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ inline const std::string& stype(bool) {
|
||||
return s_v;
|
||||
}
|
||||
|
||||
// for inlib::mcol<T> :
|
||||
// for tools::mcol<T> :
|
||||
inline const std::string& stype(int64) {
|
||||
static const std::string s_v("tools::int64");
|
||||
return s_v;
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public:
|
||||
//::gluTessCallback(tobj,(GLUenum)GLU_TESS_ERROR_DATA, (Func)errorCallback);
|
||||
//::gluTessCallback(tobj,(GLUenum)GLU_TESS_COMBINE_DATA,(Func)combineCallback);
|
||||
|
||||
// NOTE : the gluTessCallback_<> are inlib/glutess specific.
|
||||
// NOTE : the gluTessCallback_<> are tools/glutess specific.
|
||||
::gluTessCallback_GLU_TESS_VERTEX_DATA (tobj,vertexCallback);
|
||||
::gluTessCallback_GLU_TESS_BEGIN_DATA (tobj,beginCallback);
|
||||
::gluTessCallback_GLU_TESS_END_DATA (tobj,endCallback);
|
||||
|
||||
+39
-39
@@ -17,75 +17,75 @@
|
||||
namespace tools {
|
||||
|
||||
inline std::string tos(unsigned char a_value){
|
||||
std::string s;
|
||||
std::string _s;
|
||||
if(is_printable(a_value))
|
||||
sprintf(s,32,"%c",a_value);
|
||||
sprintf(_s,32,"%c",a_value);
|
||||
else
|
||||
sprintf(s,32,"%d",a_value);
|
||||
return s;
|
||||
sprintf(_s,32,"%d",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(char a_value){
|
||||
std::string s;
|
||||
std::string _s;
|
||||
if(is_printable(a_value))
|
||||
sprintf(s,32,"%c",a_value);
|
||||
sprintf(_s,32,"%c",a_value);
|
||||
else
|
||||
sprintf(s,32,"%d",a_value);
|
||||
return s;
|
||||
sprintf(_s,32,"%d",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(unsigned short a_value) {
|
||||
std::string s;
|
||||
sprintf(s,32,"%d",a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,"%d",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(short a_value){
|
||||
std::string s;
|
||||
sprintf(s,32,"%d",a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,"%d",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(unsigned int a_value) {
|
||||
std::string s;
|
||||
sprintf(s,32,"%u",a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,"%u",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tosx(unsigned int a_value) {
|
||||
std::string s;
|
||||
sprintf(s,32,"%x",a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,"%x",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(int a_value){
|
||||
std::string s;
|
||||
sprintf(s,32,"%d",a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,"%d",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(uint64 a_value) {
|
||||
std::string s;
|
||||
sprintf(s,32,uint64_format(),a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,uint64_format(),a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(int64 a_value){
|
||||
std::string s;
|
||||
sprintf(s,32,int64_format(),a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,int64_format(),a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(float a_value){
|
||||
std::string s;
|
||||
sprintf(s,32,"%g",a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,"%g",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(double a_value){
|
||||
std::string s;
|
||||
sprintf(s,32,"%g",a_value);
|
||||
return s;
|
||||
std::string _s;
|
||||
sprintf(_s,32,"%g",a_value);
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string tos(bool a_value){
|
||||
@@ -112,12 +112,12 @@ inline std::string tos(const std::vector<T>& a_vals,
|
||||
}
|
||||
|
||||
inline std::string tos(unsigned int a_linen,const char* a_lines[]) {
|
||||
std::string s;
|
||||
std::string _s;
|
||||
for(unsigned int index=0;index<a_linen;index++) {
|
||||
s += std::string(a_lines[index]);
|
||||
s += "\n";
|
||||
_s += std::string(a_lines[index]);
|
||||
_s += "\n";
|
||||
}
|
||||
return s;
|
||||
return _s;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -10,13 +10,13 @@
|
||||
namespace tools {
|
||||
|
||||
inline void toss(const char* a_from,char a_s[],unsigned int& a_l) {
|
||||
char* s = (char*)a_from;
|
||||
char* _s = (char*)a_from;
|
||||
a_l = 0;
|
||||
char* pos = a_s;
|
||||
while(*s) {
|
||||
*pos = *s;pos++;
|
||||
while(*_s) {
|
||||
*pos = *_s;pos++;
|
||||
a_l++;
|
||||
s++;
|
||||
_s++;
|
||||
}
|
||||
*pos = 0;
|
||||
}
|
||||
|
||||
+28
-28
@@ -17,13 +17,13 @@ namespace tools {
|
||||
|
||||
typedef int int32;
|
||||
typedef __int64 int64;
|
||||
inline const char* int32_format() {static const char s[] = "%d";return s;}
|
||||
inline const char* int64_format() {static const char s[] = "%ld";return s;}
|
||||
inline const char* int32_format() {static const char s_v[] = "%d";return s_v;}
|
||||
inline const char* int64_format() {static const char s_v[] = "%ld";return s_v;}
|
||||
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned __int64 uint64;
|
||||
inline const char* uint32_format() {static const char s[] = "%u";return s;}
|
||||
inline const char* uint64_format() {static const char s[] = "%lu";return s;}
|
||||
inline const char* uint32_format() {static const char s_v[] = "%u";return s_v;}
|
||||
inline const char* uint64_format() {static const char s_v[] = "%lu";return s_v;}
|
||||
|
||||
#ifdef _WIN64
|
||||
typedef unsigned long long diff_pointer_t;
|
||||
@@ -33,12 +33,12 @@ typedef unsigned long diff_pointer_t;
|
||||
|
||||
#ifdef _WIN64
|
||||
typedef unsigned long long upointer;
|
||||
inline const char* upointer_format() {static const char s[] = "%llu";return s;}
|
||||
inline const char* upointer_format_x() {static const char s[] = "0x%llx";return s;}
|
||||
inline const char* upointer_format() {static const char s_v[] = "%llu";return s_v;}
|
||||
inline const char* upointer_format_x() {static const char s_v[] = "0x%llx";return s_v;}
|
||||
#else
|
||||
typedef unsigned long upointer;
|
||||
inline const char* upointer_format() {static const char s[] = "%lu";return s;}
|
||||
inline const char* upointer_format_x() {static const char s[] = "0x%lx";return s;}
|
||||
inline const char* upointer_format() {static const char s_v[] = "%lu";return s_v;}
|
||||
inline const char* upointer_format_x() {static const char s_v[] = "0x%lx";return s_v;}
|
||||
#endif
|
||||
|
||||
#elif defined(_LP64)
|
||||
@@ -46,38 +46,38 @@ inline const char* upointer_format_x() {static const char s[] = "0x%lx";return s
|
||||
// 64 Bit Platforms
|
||||
typedef int int32;
|
||||
typedef long int64;
|
||||
inline const char* int32_format() {static const char s[] = "%d";return s;}
|
||||
inline const char* int64_format() {static const char s[] = "%ld";return s;}
|
||||
inline const char* int32_format() {static const char s_v[] = "%d";return s_v;}
|
||||
inline const char* int64_format() {static const char s_v[] = "%ld";return s_v;}
|
||||
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned long uint64;
|
||||
inline const char* uint32_format() {static const char s[] = "%u";return s;}
|
||||
inline const char* uint64_format() {static const char s[] = "%lu";return s;}
|
||||
inline const char* uint32_format() {static const char s_v[] = "%u";return s_v;}
|
||||
inline const char* uint64_format() {static const char s_v[] = "%lu";return s_v;}
|
||||
|
||||
typedef unsigned long diff_pointer_t;
|
||||
|
||||
typedef unsigned long upointer;
|
||||
inline const char* upointer_format() {static const char s[] = "%lu";return s;}
|
||||
inline const char* upointer_format_x() {static const char s[] = "0x%lx";return s;}
|
||||
inline const char* upointer_format() {static const char s_v[] = "%lu";return s_v;}
|
||||
inline const char* upointer_format_x() {static const char s_v[] = "0x%lx";return s_v;}
|
||||
|
||||
#else
|
||||
|
||||
// 32-Bit Platforms
|
||||
typedef int int32;
|
||||
typedef long long int64;
|
||||
inline const char* int32_format() {static const char s[] = "%d";return s;}
|
||||
inline const char* int64_format() {static const char s[] = "%lld";return s;}
|
||||
inline const char* int32_format() {static const char s_v[] = "%d";return s_v;}
|
||||
inline const char* int64_format() {static const char s_v[] = "%lld";return s_v;}
|
||||
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned long long uint64;
|
||||
inline const char* uint32_format() {static const char s[] = "%u";return s;}
|
||||
inline const char* uint64_format() {static const char s[] = "%llu";return s;}
|
||||
inline const char* uint32_format() {static const char s_v[] = "%u";return s_v;}
|
||||
inline const char* uint64_format() {static const char s_v[] = "%llu";return s_v;}
|
||||
|
||||
typedef unsigned long diff_pointer_t;
|
||||
|
||||
typedef unsigned long upointer;
|
||||
inline const char* upointer_format() {static const char s[] = "%lu";return s;}
|
||||
inline const char* upointer_format_x() {static const char s[] = "0x%lx";return s;}
|
||||
inline const char* upointer_format() {static const char s_v[] = "%lu";return s_v;}
|
||||
inline const char* upointer_format_x() {static const char s_v[] = "0x%lx";return s_v;}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,17 +115,17 @@ inline unsigned int size_float() {return 4;}
|
||||
inline unsigned int size_double() {return 8;}
|
||||
|
||||
// used in arrout :
|
||||
inline const char* type_format(float) {static const char s[] = "%g";return s;}
|
||||
inline const char* type_format(double) {static const char s[] = "%g";return s;}
|
||||
inline const char* type_format(float) {static const char s_v[] = "%g";return s_v;}
|
||||
inline const char* type_format(double) {static const char s_v[] = "%g";return s_v;}
|
||||
|
||||
inline const char* type_format(char) {static const char s[] = "%d";return s;}
|
||||
inline const char* type_format(short) {static const char s[] = "%d";return s;}
|
||||
inline const char* type_format(int) {static const char s[] = "%d";return s;}
|
||||
inline const char* type_format(char) {static const char s_v[] = "%d";return s_v;}
|
||||
inline const char* type_format(short) {static const char s_v[] = "%d";return s_v;}
|
||||
inline const char* type_format(int) {static const char s_v[] = "%d";return s_v;}
|
||||
inline const char* type_format(int64) {return int64_format();}
|
||||
|
||||
inline const char* type_format(unsigned char) {static const char s[] = "%u";return s;}
|
||||
inline const char* type_format(unsigned short) {static const char s[] = "%u";return s;}
|
||||
inline const char* type_format(unsigned int) {static const char s[] = "%u";return s;}
|
||||
inline const char* type_format(unsigned char) {static const char s_v[] = "%u";return s_v;}
|
||||
inline const char* type_format(unsigned short) {static const char s_v[] = "%u";return s_v;}
|
||||
inline const char* type_format(unsigned int) {static const char s_v[] = "%u";return s_v;}
|
||||
inline const char* type_format(uint64) {return uint64_format();}
|
||||
|
||||
typedef unsigned int key_code;
|
||||
|
||||
+12
-12
@@ -413,14 +413,14 @@ public:
|
||||
return tmp;
|
||||
}
|
||||
value operator+=(const value& a_from) {
|
||||
value s = operator+(a_from);
|
||||
*this = s;
|
||||
return s;
|
||||
value _s = operator+(a_from);
|
||||
*this = _s;
|
||||
return _s;
|
||||
}
|
||||
value operator-=(const value& a_from) {
|
||||
value s = operator-(a_from);
|
||||
*this = s;
|
||||
return s;
|
||||
value _s = operator-(a_from);
|
||||
*this = _s;
|
||||
return _s;
|
||||
}
|
||||
*/
|
||||
private:
|
||||
@@ -1007,15 +1007,15 @@ public:
|
||||
public: // for valop :
|
||||
|
||||
std::string stype() const {
|
||||
std::string s;
|
||||
if(!s_type(s)) return "unknown";
|
||||
return s;
|
||||
std::string _s;
|
||||
if(!s_type(_s)) return "unknown";
|
||||
return _s;
|
||||
}
|
||||
|
||||
static std::string stype(e_type a_type) {
|
||||
std::string s;
|
||||
if(!s_type(a_type,s)) return "unknown";
|
||||
return s;
|
||||
std::string _s;
|
||||
if(!s_type(a_type,_s)) return "unknown";
|
||||
return _s;
|
||||
}
|
||||
|
||||
static std::string error_div_zero() {return "divide by zero.";}
|
||||
|
||||
+53
-53
@@ -3195,56 +3195,56 @@ inline bool value::i_set(value& aThis,const Slash::Core::IValue& aValue){
|
||||
*/
|
||||
|
||||
inline std::string value::to_string(const value& aThis){
|
||||
std::string s;
|
||||
std::string _s;
|
||||
switch(aThis.m_type) {
|
||||
case value::NONE:
|
||||
sprintf(s,5,"(nil)");
|
||||
return s;
|
||||
sprintf(_s,5,"(nil)");
|
||||
return _s;
|
||||
case value::INT:
|
||||
sprintf(s,16,"%d",aThis.u.m_int);
|
||||
return s;
|
||||
sprintf(_s,16,"%d",aThis.u.m_int);
|
||||
return _s;
|
||||
case value::DOUBLE:
|
||||
sprintf(s,16,"%g",aThis.u.m_double);
|
||||
return s;
|
||||
sprintf(_s,16,"%g",aThis.u.m_double);
|
||||
return _s;
|
||||
case value::VOID_STAR:
|
||||
sprintf(s,32,upointer_format_x(),(upointer)aThis.u.m_void_star);
|
||||
return s;
|
||||
sprintf(_s,32,upointer_format_x(),(upointer)aThis.u.m_void_star);
|
||||
return _s;
|
||||
case value::UNSIGNED_SHORT:
|
||||
sprintf(s,16,"%u",aThis.u.m_unsigned_short);
|
||||
return s;
|
||||
sprintf(_s,16,"%u",aThis.u.m_unsigned_short);
|
||||
return _s;
|
||||
case value::UNSIGNED_INT:
|
||||
sprintf(s,16,"%u",aThis.u.m_unsigned_int);
|
||||
return s;
|
||||
sprintf(_s,16,"%u",aThis.u.m_unsigned_int);
|
||||
return _s;
|
||||
case value::BOOL:
|
||||
sprintf(s,5,"%s",aThis.u.m_bool?"true":"false");
|
||||
return s;
|
||||
sprintf(_s,5,"%s",aThis.u.m_bool?"true":"false");
|
||||
return _s;
|
||||
case value::SHORT:
|
||||
sprintf(s,16,"%d",aThis.u.m_short);
|
||||
return s;
|
||||
sprintf(_s,16,"%d",aThis.u.m_short);
|
||||
return _s;
|
||||
case value::INT64:{
|
||||
sprintf(s,16,int64_format(),aThis.u.m_int64);
|
||||
}return s;
|
||||
sprintf(_s,16,int64_format(),aThis.u.m_int64);
|
||||
}return _s;
|
||||
case value::UNSIGNED_INT64:{
|
||||
sprintf(s,16,int64_format(),aThis.u.m_unsigned_int64);
|
||||
}return s;
|
||||
sprintf(_s,16,int64_format(),aThis.u.m_unsigned_int64);
|
||||
}return _s;
|
||||
case value::FLOAT:
|
||||
sprintf(s,16,"%g",aThis.u.m_float);
|
||||
return s;
|
||||
sprintf(_s,16,"%g",aThis.u.m_float);
|
||||
return _s;
|
||||
//case value::UNSIGNED_CHAR:
|
||||
// sprintf(s,16,"%c",aThis.u.m_unsigned_char);
|
||||
// return s;
|
||||
// sprintf(_s,16,"%c",aThis.u.m_unsigned_char);
|
||||
// return _s;
|
||||
//case value::CHAR:
|
||||
// sprintf(s,16,"%c",aThis.u.m_char);
|
||||
// return s;
|
||||
// sprintf(_s,16,"%c",aThis.u.m_char);
|
||||
// return _s;
|
||||
case value::DOUBLE_STAR:
|
||||
sprintf(s,32,upointer_format_x(),(upointer)aThis.u.m_double_star);
|
||||
return s;
|
||||
sprintf(_s,32,upointer_format_x(),(upointer)aThis.u.m_double_star);
|
||||
return _s;
|
||||
case value::FLOAT_STAR:
|
||||
sprintf(s,32,upointer_format_x(),(upointer)aThis.u.m_float_star);
|
||||
return s;
|
||||
sprintf(_s,32,upointer_format_x(),(upointer)aThis.u.m_float_star);
|
||||
return _s;
|
||||
case value::INT_STAR:
|
||||
sprintf(s,32,upointer_format_x(),(upointer)aThis.u.m_int_star);
|
||||
return s;
|
||||
sprintf(_s,32,upointer_format_x(),(upointer)aThis.u.m_int_star);
|
||||
return _s;
|
||||
case value::STRING:
|
||||
return *aThis.u.m_string;
|
||||
|
||||
@@ -3253,38 +3253,38 @@ inline std::string value::to_string(const value& aThis){
|
||||
//case value::ARRAY_CHAR:
|
||||
// return tos<char>(aThis.u.m_array_char->vector());
|
||||
case value::ARRAY_UNSIGNED_SHORT:
|
||||
if(!nums2s<unsigned short>(aThis.u.m_array_unsigned_short->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<unsigned short>(aThis.u.m_array_unsigned_short->vector(),_s)) {}
|
||||
return _s;
|
||||
case value::ARRAY_SHORT:
|
||||
if(!nums2s<short>(aThis.u.m_array_short->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<short>(aThis.u.m_array_short->vector(),_s)) {}
|
||||
return _s;
|
||||
|
||||
case value::ARRAY_UNSIGNED_INT:
|
||||
if(!nums2s<unsigned int>(aThis.u.m_array_unsigned_int->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<unsigned int>(aThis.u.m_array_unsigned_int->vector(),_s)) {}
|
||||
return _s;
|
||||
case value::ARRAY_INT:
|
||||
if(!nums2s<int>(aThis.u.m_array_int->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<int>(aThis.u.m_array_int->vector(),_s)) {}
|
||||
return _s;
|
||||
|
||||
case value::ARRAY_UNSIGNED_INT64:
|
||||
if(!nums2s<uint64>(aThis.u.m_array_unsigned_int64->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<uint64>(aThis.u.m_array_unsigned_int64->vector(),_s)) {}
|
||||
return _s;
|
||||
case value::ARRAY_INT64:
|
||||
if(!nums2s<int64>(aThis.u.m_array_int64->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<int64>(aThis.u.m_array_int64->vector(),_s)) {}
|
||||
return _s;
|
||||
|
||||
case value::ARRAY_FLOAT:
|
||||
if(!nums2s<float>(aThis.u.m_array_float->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<float>(aThis.u.m_array_float->vector(),_s)) {}
|
||||
return _s;
|
||||
case value::ARRAY_DOUBLE:
|
||||
if(!nums2s<double>(aThis.u.m_array_double->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<double>(aThis.u.m_array_double->vector(),_s)) {}
|
||||
return _s;
|
||||
case value::ARRAY_BOOL:
|
||||
b2s(aThis.u.m_array_bool->vector(),s);
|
||||
return s;
|
||||
b2s(aThis.u.m_array_bool->vector(),_s);
|
||||
return _s;
|
||||
case value::ARRAY_STRING:
|
||||
if(!nums2s<std::string>(aThis.u.m_array_string->vector(),s)) {}
|
||||
return s;
|
||||
if(!nums2s<std::string>(aThis.u.m_array_string->vector(),_s)) {}
|
||||
return _s;
|
||||
default:
|
||||
return "unknown"; //it should not happen.
|
||||
}
|
||||
|
||||
+6
-6
@@ -4,14 +4,14 @@
|
||||
#ifndef tools_version
|
||||
#define tools_version
|
||||
|
||||
#define TOOLS_MAJOR_VERSION 5
|
||||
#define TOOLS_MINOR_VERSION 6
|
||||
#define TOOLS_PATCH_VERSION 0
|
||||
#define TOOLS_VERSION "5.6.0"
|
||||
#define TOOLS_VERSION_VRP "v5r6p0"
|
||||
#define TOOLS_MAJOR_VERSION 6
|
||||
#define TOOLS_MINOR_VERSION 0
|
||||
#define TOOLS_PATCH_VERSION 1
|
||||
#define TOOLS_VERSION "6.0.1"
|
||||
#define TOOLS_VERSION_VRP "v6r0p1"
|
||||
|
||||
namespace tools {
|
||||
inline unsigned int version() {return 50600;}
|
||||
inline unsigned int version() {return 60001;}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+4
-4
@@ -22,10 +22,10 @@ namespace waxml {
|
||||
inline std::string soutd(std::ostringstream& a_oss,double a_value) {
|
||||
a_oss.str("");
|
||||
a_oss << a_value;
|
||||
std::string s("\"");
|
||||
s += a_oss.str();
|
||||
s += "\"";
|
||||
return s;
|
||||
std::string _s("\"");
|
||||
_s += a_oss.str();
|
||||
_s += "\"";
|
||||
return _s;
|
||||
}
|
||||
|
||||
inline std::string bin_to_string(std::ostringstream& a_oss,int a_index) {
|
||||
|
||||
+6
-6
@@ -168,9 +168,9 @@ public:
|
||||
const std::vector<iobj*>& columns() const {return m_cols;}
|
||||
|
||||
std::string booking(bool a_xml_esc) const {
|
||||
std::string s;
|
||||
get_booking(m_cols,a_xml_esc,s);
|
||||
return s;
|
||||
std::string _s;
|
||||
get_booking(m_cols,a_xml_esc,_s);
|
||||
return _s;
|
||||
}
|
||||
void reset() {m_tmp.clear();}
|
||||
const std::string& value() const {return m_tmp;}
|
||||
@@ -473,9 +473,9 @@ public:
|
||||
}
|
||||
|
||||
std::string booking(bool a_xml_esc) const {
|
||||
std::string s;
|
||||
get_booking(m_cols,a_xml_esc,s);
|
||||
return s;
|
||||
std::string _s;
|
||||
get_booking(m_cols,a_xml_esc,_s);
|
||||
return _s;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
+7
-7
@@ -28,13 +28,13 @@ inline date get_date(){
|
||||
struct tm tpa;
|
||||
struct tm *tp = (tm*)::localtime_r(&tloc, &tpa); //does not exist on Windows.
|
||||
#endif
|
||||
unsigned int year = tp->tm_year;
|
||||
unsigned int month = tp->tm_mon + 1;
|
||||
unsigned int day = tp->tm_mday;
|
||||
unsigned int hour = tp->tm_hour;
|
||||
unsigned int min = tp->tm_min;
|
||||
unsigned int sec = tp->tm_sec;
|
||||
return ((year-95)<<26 | month<<22 | day<<17 | hour<<12 | min<<6 | sec);
|
||||
unsigned int _year = tp->tm_year;
|
||||
unsigned int _month = tp->tm_mon + 1;
|
||||
unsigned int _day = tp->tm_mday;
|
||||
unsigned int _hour = tp->tm_hour;
|
||||
unsigned int _min = tp->tm_min;
|
||||
unsigned int _sec = tp->tm_sec;
|
||||
return ((_year-95)<<26 | _month<<22 | _day<<17 | _hour<<12 | _min<<6 | _sec);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
+3
-3
@@ -80,9 +80,9 @@ public:
|
||||
virtual void out(std::ostream& aOut) const {
|
||||
std::string _fname;
|
||||
fullName(_fname);
|
||||
char s[256];
|
||||
snpf(s,sizeof(s)," %-14s%-15s offset=%3d type=%2d %-20s",fTypeName.c_str(),_fname.c_str(),fOffset,fType,fTitle.c_str());
|
||||
aOut << s << std::endl;
|
||||
char _s[256];
|
||||
snpf(_s,sizeof(_s)," %-14s%-15s offset=%3d type=%2d %-20s",fTypeName.c_str(),_fname.c_str(),fOffset,fType,fTitle.c_str());
|
||||
aOut << _s << std::endl;
|
||||
}
|
||||
public:
|
||||
streamer_element(const std::string& aName,const std::string& aTitle,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifndef tools_wroot_mpi_ntuple_column_wise
|
||||
#define tools_wroot_mpi_ntuple_column_wise
|
||||
|
||||
// MPI pntuple. It uses the inlib/impi interface.
|
||||
// MPI pntuple. It uses the tools/impi interface.
|
||||
|
||||
#include "base_pntuple_column_wise"
|
||||
#include "mpi_basket_add"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifndef tools_wroot_mpi_ntuple_row_wise
|
||||
#define tools_wroot_mpi_ntuple_row_wise
|
||||
|
||||
// MPI pntuple. It uses the inlib/impi interface.
|
||||
// MPI pntuple. It uses the tools/impi interface.
|
||||
|
||||
#include "base_pntuple_row_wise"
|
||||
#include "mpi_basket_add"
|
||||
|
||||
+15
-15
@@ -832,15 +832,15 @@ protected:
|
||||
}
|
||||
|
||||
{for(unsigned int index=0;index<dimension;index++) {
|
||||
std::string s = "binNum";
|
||||
std::string _s = "binNum";
|
||||
if(dimension!=1) {
|
||||
if(index==0) s += "X";
|
||||
else if(index==1) s += "Y";
|
||||
else if(index==2) s += "Z";
|
||||
if(index==0) _s += "X";
|
||||
else if(index==1) _s += "Y";
|
||||
else if(index==2) _s += "Z";
|
||||
}
|
||||
if(!_elem->attribute_value(s,svalue)) {
|
||||
if(!_elem->attribute_value(_s,svalue)) {
|
||||
a_out << "tools::xml::aidas::read_bins :"
|
||||
<< " a <bin1d> has no " << s << std::endl;
|
||||
<< " a <bin1d> has no " << _s << std::endl;
|
||||
return false;
|
||||
}
|
||||
if(svalue=="UNDERFLOW") {
|
||||
@@ -1055,11 +1055,11 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string s;
|
||||
if(_elem->attribute_value(s_booking(),s)) {
|
||||
a_booking.push_back(colbook(stype,sname,s,true));
|
||||
} else if(_elem->attribute_value(s_default(),s)) {
|
||||
a_booking.push_back(colbook(stype,sname,s,false));
|
||||
std::string _s;
|
||||
if(_elem->attribute_value(s_booking(),_s)) {
|
||||
a_booking.push_back(colbook(stype,sname,_s,true));
|
||||
} else if(_elem->attribute_value(s_default(),_s)) {
|
||||
a_booking.push_back(colbook(stype,sname,_s,false));
|
||||
} else {
|
||||
a_booking.push_back(colbook(stype,sname,"",false));
|
||||
}
|
||||
@@ -1485,10 +1485,10 @@ protected:
|
||||
if(!to<double>(svalue,errorMinus)) return false;
|
||||
}
|
||||
|
||||
histo::measurement& m = point.coordinate(coord);
|
||||
m.set_value(value);
|
||||
m.set_error_plus(errorPlus);
|
||||
m.set_error_minus(errorMinus);
|
||||
histo::measurement& _m = point.coordinate(coord);
|
||||
_m.set_value(value);
|
||||
_m.set_error_plus(errorPlus);
|
||||
_m.set_error_minus(errorMinus);
|
||||
|
||||
coord++;
|
||||
}
|
||||
|
||||
+7
-7
@@ -172,8 +172,8 @@ public:
|
||||
|
||||
bool res_color(const style_t& a_sty,const std::string& a_key,colorf& a_color,const std::string& a_msg) const {
|
||||
//NOTE : if ret false, we do not set a_color to something.
|
||||
std::string s;
|
||||
if(!find(a_sty,a_key,s)) {
|
||||
std::string _s;
|
||||
if(!find(a_sty,a_key,_s)) {
|
||||
if(a_msg.size()) {
|
||||
m_out << "tools::xml::styles::res_color :"
|
||||
<< " key " << sout(a_key) << " not found"
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(!sg::find_color(m_cmaps,s,a_color)) {
|
||||
if(!sg::find_color(m_cmaps,_s,a_color)) {
|
||||
m_out << "tools::xml::styles::res_color :"
|
||||
<< " key " << sout(a_key) << " is not a color"
|
||||
<< " in style " << sout(a_msg) << "."
|
||||
@@ -212,8 +212,8 @@ public:
|
||||
|
||||
bool res_bool(const style_t& a_sty,const std::string& a_key,bool& a_v,const std::string& a_msg) const {
|
||||
//NOTE : if ret false, we do not set a_v to something.
|
||||
std::string s;
|
||||
if(!find(a_sty,a_key,s)) {
|
||||
std::string _s;
|
||||
if(!find(a_sty,a_key,_s)) {
|
||||
if(a_msg.size()) {
|
||||
m_out << "tools::xml::styles::res_bool :"
|
||||
<< " key " << sout(a_key) << " not found"
|
||||
@@ -223,11 +223,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
bool v;
|
||||
if(!to(s,v)) {
|
||||
if(!to(_s,v)) {
|
||||
m_out << "tools::xml::styles::res_bool :"
|
||||
<< " for key " << sout(a_key) << " not found"
|
||||
<< " in style " << sout(a_msg) << "."
|
||||
<< " can't convert " << sout(s) << " to bool."
|
||||
<< " can't convert " << sout(_s) << " to bool."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
+11
-11
@@ -414,9 +414,9 @@ public:
|
||||
tree* find_item_with_tag(const std::string& a_tag,
|
||||
const std::string& a_name) const {
|
||||
if(a_tag==tag_name()) {
|
||||
std::string s;
|
||||
attribute_value("name",s);
|
||||
if(a_name==s) return const_cast<tree*>(this);
|
||||
std::string _s;
|
||||
attribute_value("name",_s);
|
||||
if(a_name==_s) return const_cast<tree*>(this);
|
||||
}
|
||||
|
||||
// Look children :
|
||||
@@ -568,9 +568,9 @@ public:
|
||||
tree* find_by_attribute(const std::string& a_atb,const std::string& a_value,
|
||||
bool a_up_down = true,bool a_left_right = true) const {
|
||||
if(a_up_down) {
|
||||
std::string s;
|
||||
attribute_value(a_atb,s);
|
||||
if(s==a_value) return const_cast<tree*>(this);
|
||||
std::string _s;
|
||||
attribute_value(a_atb,_s);
|
||||
if(_s==a_value) return const_cast<tree*>(this);
|
||||
|
||||
if(a_left_right) {
|
||||
tools_lforcit(ielem*,m_childs,it) {
|
||||
@@ -607,9 +607,9 @@ public:
|
||||
}}
|
||||
}
|
||||
|
||||
std::string s;
|
||||
attribute_value(a_atb,s);
|
||||
if(s==a_value) return const_cast<tree*>(this);
|
||||
std::string _s;
|
||||
attribute_value(a_atb,_s);
|
||||
if(_s==a_value) return const_cast<tree*>(this);
|
||||
|
||||
}
|
||||
return 0;
|
||||
@@ -784,8 +784,8 @@ public:
|
||||
// Look children :
|
||||
tools_lforcit(ielem*,m_childs,it) {
|
||||
if(tree* _tree = id_cast<ielem,tree>(*(*it))) {
|
||||
std::string s;
|
||||
if(_tree->element_value(a_name,s) && (a_value==s)) return _tree;
|
||||
std::string _s;
|
||||
if(_tree->element_value(a_name,_s) && (a_value==_s)) return _tree;
|
||||
}}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
//
|
||||
// This file had been produced automatically
|
||||
// by the inlib/wrap program from the file :
|
||||
// by the tools/wrap program from the file :
|
||||
// viewplot_fonts_google.style
|
||||
//
|
||||
|
||||
|
||||
Vendored
+3
-12
@@ -1,14 +1,8 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_OpenGL
|
||||
#define tools_OpenGL
|
||||
|
||||
#ifdef TOOLS_TOOLS_GL
|
||||
|
||||
#include "inlib_OpenGL"
|
||||
|
||||
#else //!TOOLS_TOOLS_GL
|
||||
#ifndef toolx_OpenGL
|
||||
#define toolx_OpenGL
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <TargetConditionals.h>
|
||||
@@ -22,7 +16,7 @@
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#elif __APPLE__
|
||||
#ifdef TOOLS_USE_GL_GL_H
|
||||
#if defined(TOOLX_USE_GL_GL_H) || defined(TOOLS_USE_GL_GL_H)
|
||||
#include <GL/gl.h> //Macports X11 GL.
|
||||
#else
|
||||
#include <OpenGL/gl.h> //Apple/OpenGL.
|
||||
@@ -31,7 +25,4 @@
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
|
||||
#endif //TOOLS_TOOLS_GL
|
||||
|
||||
|
||||
#endif
|
||||
Vendored
+7
-7
@@ -1,8 +1,8 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_Qt_glarea
|
||||
#define tools_Qt_glarea
|
||||
#ifndef toolx_Qt_glarea
|
||||
#define toolx_Qt_glarea
|
||||
|
||||
#include "../sg/GL_viewer"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <tools/sg/device_interactor>
|
||||
|
||||
namespace tools {
|
||||
namespace toolx {
|
||||
namespace Qt {
|
||||
|
||||
class glarea : public QGLWidget {
|
||||
@@ -29,10 +29,10 @@ public:
|
||||
//virtual void paintGL();
|
||||
virtual void paintGL() {
|
||||
#if QT_VERSION < 0x050000
|
||||
//::printf("debug : tools::Qt::glarea::paintGL %d %d\n",width(),height());
|
||||
//::printf("debug : toolx::Qt::glarea::paintGL %d %d\n",width(),height());
|
||||
m_viewer.set_size(width(),height());
|
||||
#else
|
||||
//::printf("debug : tools::Qt::glarea::paintGL %d %d\n",m_width,m_height);
|
||||
//::printf("debug : toolx::Qt::glarea::paintGL %d %d\n",m_width,m_height);
|
||||
m_viewer.set_size(m_width,m_height);
|
||||
#endif
|
||||
m_viewer.render();
|
||||
@@ -75,14 +75,14 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
glarea(QWidget* a_parent,tools::sg::GL_viewer& a_viewer):parent(a_parent),m_viewer(a_viewer),m_interactor(0){}
|
||||
glarea(QWidget* a_parent,toolx::sg::GL_viewer& a_viewer):parent(a_parent),m_viewer(a_viewer),m_interactor(0){}
|
||||
virtual ~glarea(){}
|
||||
public:
|
||||
void set_device_interactor(tools::sg::device_interactor* a_interactor) {m_interactor = a_interactor;} //we do not have ownership.
|
||||
protected:
|
||||
tools::key_code convert(/*Qt::Key*/int a_key) {return a_key;}
|
||||
protected:
|
||||
tools::sg::GL_viewer& m_viewer;
|
||||
toolx::sg::GL_viewer& m_viewer;
|
||||
#if QT_VERSION < 0x050000
|
||||
#else
|
||||
protected:
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_Qt_session
|
||||
#define tools_Qt_session
|
||||
#ifndef toolx_Qt_session
|
||||
#define toolx_Qt_session
|
||||
|
||||
// pure Qt code, no GL.
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <QtWidgets/qwidget.h>
|
||||
#endif
|
||||
|
||||
namespace tools {
|
||||
namespace toolx {
|
||||
namespace Qt {
|
||||
|
||||
class session {
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_Qt_sg_viewer
|
||||
#define tools_Qt_sg_viewer
|
||||
#ifndef toolx_Qt_sg_viewer
|
||||
#define toolx_Qt_sg_viewer
|
||||
|
||||
#include "glarea"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <QtWidgets/qboxlayout.h>
|
||||
#endif
|
||||
|
||||
namespace tools {
|
||||
namespace toolx {
|
||||
namespace Qt {
|
||||
|
||||
class sg_viewer : public sg::GL_viewer {
|
||||
+13
-13
@@ -1,8 +1,8 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_Windows_glarea
|
||||
#define tools_Windows_glarea
|
||||
#ifndef toolx_Windows_glarea
|
||||
#define toolx_Windows_glarea
|
||||
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
#else
|
||||
#define TOOLS_WINDOWS_TOUCH
|
||||
#define TOOLX_WINDOWS_TOUCH
|
||||
#endif
|
||||
|
||||
namespace tools {
|
||||
namespace toolx {
|
||||
namespace Windows {
|
||||
|
||||
#ifdef TOOLS_WINDOWS_TOUCH
|
||||
#ifdef TOOLX_WINDOWS_TOUCH
|
||||
inline bool is_message_touch_event() {
|
||||
// from https://stackoverflow.com/questions/29857587/detect-if-wm-mousemove-is-caused-by-touch-pen.
|
||||
static const LONG_PTR c_SIGNATURE_MASK = 0xFFFFFF00;
|
||||
@@ -34,7 +34,7 @@ inline bool is_message_touch_event() {
|
||||
|
||||
class glarea {
|
||||
static const std::string& s_class() {
|
||||
static const std::string s_v("tools::Windows::glarea");
|
||||
static const std::string s_v("toolx::Windows::glarea");
|
||||
return s_v;
|
||||
}
|
||||
static void register_class(){
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
RECT rect;
|
||||
::GetClientRect(m_parent,&rect);
|
||||
//printf("debug : glarea : ca : %d %d\n",rect.right-rect.left,rect.bottom-rect.top);
|
||||
//inlib::log_file::get().writef("debug : glarea : ca : %d %d\n",rect.right-rect.left,rect.bottom-rect.top);
|
||||
//toolx::log_file::get().writef("debug : glarea : ca : %d %d\n",rect.right-rect.left,rect.bottom-rect.top);
|
||||
m_hwnd = ::CreateWindow(s_class().c_str(),
|
||||
NULL,
|
||||
WS_CHILD | WS_VISIBLE,
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
m_context = ::wglCreateContext(m_HDC);
|
||||
}
|
||||
|
||||
#ifdef TOOLS_WINDOWS_TOUCH
|
||||
#ifdef TOOLX_WINDOWS_TOUCH
|
||||
{BYTE digitizer_status = (BYTE)::GetSystemMetrics(SM_DIGITIZER);
|
||||
if((digitizer_status & (0x80 + 0x40)) == 0) {
|
||||
m_touch_available = false;
|
||||
@@ -152,7 +152,7 @@ protected:
|
||||
m_context = ::wglCreateContext(m_HDC);
|
||||
}
|
||||
|
||||
#ifdef TOOLS_WINDOWS_TOUCH
|
||||
#ifdef TOOLX_WINDOWS_TOUCH
|
||||
if(a_from.m_touch_available) {
|
||||
if(!::RegisterTouchWindow(m_hwnd,0)) m_touch_available = false;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
unsigned int h = rect.bottom-rect.top;
|
||||
|
||||
//printf("debug : glarea : paint : %d %d\n",w,h);
|
||||
//inlib::log_file::get().writef("debug : glarea : paint : %d %d\n",w,h);
|
||||
//toolx::log_file::get().writef("debug : glarea : paint : %d %d\n",w,h);
|
||||
|
||||
paint(w,h);
|
||||
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
void set_device_interactor(tools::sg::device_interactor* a_interactor) {m_interactor = a_interactor;} //we do not have ownership.
|
||||
protected:
|
||||
bool is_touch_event() {
|
||||
#ifdef TOOLS_WINDOWS_TOUCH
|
||||
#ifdef TOOLX_WINDOWS_TOUCH
|
||||
if(!m_touch_available) return false;
|
||||
return is_message_touch_event();
|
||||
#else
|
||||
@@ -299,7 +299,7 @@ protected:
|
||||
}
|
||||
} return 0;
|
||||
|
||||
#ifdef TOOLS_WINDOWS_TOUCH
|
||||
#ifdef TOOLX_WINDOWS_TOUCH
|
||||
case WM_TOUCH:{
|
||||
glarea* _this = (glarea*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
|
||||
if(_this && _this->m_touch_available) {
|
||||
@@ -334,7 +334,7 @@ protected:
|
||||
delete [] ti;
|
||||
}
|
||||
}return 0;
|
||||
#endif //TOOLS_WINDOWS_TOUCH
|
||||
#endif //TOOLX_WINDOWS_TOUCH
|
||||
case WM_DESTROY:wm__destroy(a_hwnd);return 0;
|
||||
}
|
||||
return (DefWindowProc(a_hwnd,a_msg,a_wparam,a_lparam));
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_Windows_session
|
||||
#define tools_Windows_session
|
||||
#ifndef toolx_Windows_session
|
||||
#define toolx_Windows_session
|
||||
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include <ostream>
|
||||
|
||||
namespace tools {
|
||||
namespace toolx {
|
||||
namespace Windows {
|
||||
|
||||
class session {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user