Changes in / [d74077:8f4df1]
- Files:
-
- 74 added
- 38 deleted
- 246 edited
-
Makefile.am (modified) (2 diffs)
-
TestRunnerClient.cpp (added)
-
TestRunnerClient.h (added)
-
config/ltmain.sh (added)
-
configure.ac (modified) (4 diffs)
-
libmolecuilder_config.h.in (added)
-
m4/gwqt4.m4 (modified) (4 diffs)
-
molecuilder.pc.in (added)
-
src/Actions/Action.cpp (modified) (3 diffs)
-
src/Actions/Action.hpp (modified) (1 diff)
-
src/Actions/ActionHistory.cpp (modified) (2 diffs)
-
src/Actions/ActionHistory.hpp (modified) (2 diffs)
-
src/Actions/ActionSequence.cpp (modified) (1 diff)
-
src/Actions/ActionSequence.hpp (modified) (2 diffs)
-
src/Actions/AnalysisAction/MolecularVolumeAction.cpp (modified) (3 diffs)
-
src/Actions/AnalysisAction/MolecularVolumeAction.hpp (modified) (1 diff)
-
src/Actions/AnalysisAction/PairCorrelationAction.cpp (modified) (3 diffs)
-
src/Actions/AnalysisAction/PairCorrelationAction.hpp (modified) (2 diffs)
-
src/Actions/AnalysisAction/PointCorrelationAction.cpp (modified) (3 diffs)
-
src/Actions/AnalysisAction/PointCorrelationAction.hpp (modified) (2 diffs)
-
src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp (modified) (5 diffs)
-
src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp (modified) (1 diff)
-
src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp (modified) (3 diffs)
-
src/Actions/AnalysisAction/SurfaceCorrelationAction.hpp (modified) (2 diffs)
-
src/Actions/AtomAction/AddAction.cpp (modified) (3 diffs)
-
src/Actions/AtomAction/AddAction.hpp (modified) (2 diffs)
-
src/Actions/AtomAction/ChangeElementAction.cpp (modified) (5 diffs)
-
src/Actions/AtomAction/ChangeElementAction.hpp (modified) (1 diff)
-
src/Actions/AtomAction/RemoveAction.cpp (modified) (3 diffs)
-
src/Actions/AtomAction/RemoveAction.hpp (modified) (1 diff)
-
src/Actions/AtomsCalculation.hpp (modified) (2 diffs)
-
src/Actions/AtomsCalculation_impl.hpp (modified) (1 diff)
-
src/Actions/Calculation.hpp (modified) (1 diff)
-
src/Actions/Calculation_impl.hpp (modified) (1 diff)
-
src/Actions/CmdAction/BondLengthTableAction.cpp (modified) (3 diffs)
-
src/Actions/CmdAction/BondLengthTableAction.hpp (modified) (1 diff)
-
src/Actions/CmdAction/ElementDbAction.cpp (modified) (3 diffs)
-
src/Actions/CmdAction/ElementDbAction.hpp (modified) (1 diff)
-
src/Actions/CmdAction/FastParsingAction.cpp (modified) (4 diffs)
-
src/Actions/CmdAction/FastParsingAction.hpp (modified) (1 diff)
-
src/Actions/CmdAction/HelpAction.cpp (modified) (1 diff)
-
src/Actions/CmdAction/HelpAction.hpp (modified) (1 diff)
-
src/Actions/CmdAction/VerboseAction.cpp (modified) (4 diffs)
-
src/Actions/CmdAction/VerboseAction.hpp (modified) (1 diff)
-
src/Actions/CmdAction/VersionAction.cpp (modified) (3 diffs)
-
src/Actions/CmdAction/VersionAction.hpp (modified) (1 diff)
-
src/Actions/ErrorAction.cpp (modified) (1 diff)
-
src/Actions/FragmentationAction/DepthFirstSearchAction.cpp (modified) (3 diffs)
-
src/Actions/FragmentationAction/DepthFirstSearchAction.hpp (modified) (1 diff)
-
src/Actions/FragmentationAction/FragmentationAction.cpp (modified) (3 diffs)
-
src/Actions/FragmentationAction/FragmentationAction.hpp (modified) (1 diff)
-
src/Actions/FragmentationAction/SubgraphDissectionAction.cpp (modified) (3 diffs)
-
src/Actions/FragmentationAction/SubgraphDissectionAction.hpp (modified) (2 diffs)
-
src/Actions/Makefile.am (modified) (6 diffs)
-
src/Actions/MakroAction.cpp (modified) (1 diff)
-
src/Actions/MakroAction.hpp (modified) (1 diff)
-
src/Actions/ManipulateAtomsProcess.cpp (modified) (1 diff)
-
src/Actions/ManipulateAtomsProcess.hpp (modified) (1 diff)
-
src/Actions/MapOfActions.cpp (modified) (7 diffs)
-
src/Actions/MethodAction.cpp (modified) (1 diff)
-
src/Actions/MethodAction.hpp (modified) (1 diff)
-
src/Actions/MoleculeAction/BondFileAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/BondFileAction.hpp (modified) (1 diff)
-
src/Actions/MoleculeAction/ChangeNameAction.cpp (modified) (2 diffs)
-
src/Actions/MoleculeAction/ChangeNameAction.hpp (modified) (1 diff)
-
src/Actions/MoleculeAction/FillWithMoleculeAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/FillWithMoleculeAction.hpp (modified) (2 diffs)
-
src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp (modified) (1 diff)
-
src/Actions/MoleculeAction/RotateAroundOriginByAngleAction.cpp (added)
-
src/Actions/MoleculeAction/RotateAroundOriginByAngleAction.hpp (added)
-
src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp (added)
-
src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.hpp (added)
-
src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp (modified) (4 diffs)
-
src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp (modified) (2 diffs)
-
src/Actions/MoleculeAction/SaveAdjacencyAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/SaveAdjacencyAction.hpp (modified) (1 diff)
-
src/Actions/MoleculeAction/SaveBondsAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/SaveBondsAction.hpp (modified) (1 diff)
-
src/Actions/MoleculeAction/SaveTemperatureAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/SaveTemperatureAction.hpp (modified) (1 diff)
-
src/Actions/MoleculeAction/SuspendInWaterAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/SuspendInWaterAction.hpp (modified) (1 diff)
-
src/Actions/MoleculeAction/TranslateAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/TranslateAction.hpp (modified) (2 diffs)
-
src/Actions/MoleculeAction/VerletIntegrationAction.cpp (modified) (3 diffs)
-
src/Actions/MoleculeAction/VerletIntegrationAction.hpp (modified) (1 diff)
-
src/Actions/ParserAction/LoadXyzAction.cpp (modified) (3 diffs)
-
src/Actions/ParserAction/LoadXyzAction.hpp (modified) (1 diff)
-
src/Actions/ParserAction/SaveXyzAction.cpp (modified) (2 diffs)
-
src/Actions/ParserAction/SaveXyzAction.hpp (modified) (1 diff)
-
src/Actions/SelectionAction/AllAtomsAction.cpp (modified) (3 diffs)
-
src/Actions/SelectionAction/AllAtomsAction.hpp (modified) (1 diff)
-
src/Actions/SelectionAction/AllMoleculesAction.cpp (modified) (3 diffs)
-
src/Actions/SelectionAction/AllMoleculesAction.hpp (modified) (1 diff)
-
src/Actions/SelectionAction/AtomByIdAction.cpp (modified) (3 diffs)
-
src/Actions/SelectionAction/AtomByIdAction.hpp (modified) (1 diff)
-
src/Actions/SelectionAction/MoleculeByIdAction.cpp (modified) (3 diffs)
-
src/Actions/SelectionAction/MoleculeByIdAction.hpp (modified) (1 diff)
-
src/Actions/SelectionAction/NotAllAtomsAction.cpp (modified) (5 diffs)
-
src/Actions/SelectionAction/NotAllAtomsAction.hpp (modified) (1 diff)
-
src/Actions/SelectionAction/NotAllMoleculesAction.cpp (modified) (3 diffs)
-
src/Actions/SelectionAction/NotAllMoleculesAction.hpp (modified) (1 diff)
-
src/Actions/SelectionAction/NotAtomByIdAction.cpp (modified) (3 diffs)
-
src/Actions/SelectionAction/NotAtomByIdAction.hpp (modified) (1 diff)
-
src/Actions/SelectionAction/NotMoleculeByIdAction.cpp (modified) (3 diffs)
-
src/Actions/SelectionAction/NotMoleculeByIdAction.hpp (modified) (1 diff)
-
src/Actions/TesselationAction/ConvexEnvelopeAction.cpp (modified) (3 diffs)
-
src/Actions/TesselationAction/ConvexEnvelopeAction.hpp (modified) (1 diff)
-
src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp (modified) (3 diffs)
-
src/Actions/TesselationAction/NonConvexEnvelopeAction.hpp (modified) (1 diff)
-
src/Actions/ValueStorage.cpp (added)
-
src/Actions/ValueStorage.hpp (added)
-
src/Actions/WorldAction/AddEmptyBoundaryAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/AddEmptyBoundaryAction.hpp (modified) (2 diffs)
-
src/Actions/WorldAction/BoundInBoxAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/BoundInBoxAction.hpp (modified) (1 diff)
-
src/Actions/WorldAction/CenterInBoxAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/CenterInBoxAction.hpp (modified) (1 diff)
-
src/Actions/WorldAction/CenterOnEdgeAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/CenterOnEdgeAction.hpp (modified) (1 diff)
-
src/Actions/WorldAction/ChangeBoxAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/ChangeBoxAction.hpp (modified) (1 diff)
-
src/Actions/WorldAction/InputAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/InputAction.hpp (modified) (1 diff)
-
src/Actions/WorldAction/OutputAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/OutputAction.hpp (modified) (1 diff)
-
src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/RemoveSphereOfAtomsAction.hpp (modified) (2 diffs)
-
src/Actions/WorldAction/RepeatBoxAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/RepeatBoxAction.hpp (modified) (2 diffs)
-
src/Actions/WorldAction/ScaleBoxAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/ScaleBoxAction.hpp (modified) (2 diffs)
-
src/Actions/WorldAction/SetDefaultNameAction.cpp (modified) (4 diffs)
-
src/Actions/WorldAction/SetDefaultNameAction.hpp (modified) (1 diff)
-
src/Actions/WorldAction/SetGaussianBasisAction.cpp (modified) (4 diffs)
-
src/Actions/WorldAction/SetGaussianBasisAction.hpp (modified) (1 diff)
-
src/Actions/WorldAction/SetOutputFormatsAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/SetOutputFormatsAction.hpp (modified) (1 diff)
-
src/AtomSet.hpp (added)
-
src/BoundaryLineSet.cpp (modified) (1 diff)
-
src/BoundaryPointSet.cpp (modified) (1 diff)
-
src/BoundaryPolygonSet.cpp (modified) (1 diff)
-
src/BoundaryTriangleSet.cpp (modified) (1 diff)
-
src/BoundaryTriangleSet.hpp (modified) (1 diff)
-
src/Box.cpp (modified) (8 diffs)
-
src/Box.hpp (modified) (3 diffs)
-
src/CandidateForTesselation.cpp (modified) (1 diff)
-
src/CandidateForTesselation.hpp (modified) (1 diff)
-
src/CommandLineParser.cpp (modified) (1 diff)
-
src/ConfigFileBuffer.cpp (modified) (1 diff)
-
src/Descriptors/AtomDescriptor.hpp (modified) (1 diff)
-
src/Descriptors/AtomSelectionDescriptor.cpp (modified) (1 diff)
-
src/Descriptors/MoleculeSelectionDescriptor.cpp (modified) (1 diff)
-
src/Descriptors/SelectiveIterator_impl.hpp (modified) (1 diff)
-
src/Exceptions/Makefile.am (added)
-
src/Formula.cpp (modified) (5 diffs)
-
src/Formula.hpp (modified) (4 diffs)
-
src/Helpers/Assert.cpp (modified) (5 diffs)
-
src/Helpers/Assert.hpp (modified) (5 diffs)
-
src/Helpers/Info.cpp (added)
-
src/Helpers/Info.hpp (added)
-
src/Helpers/Log.cpp (added)
-
src/Helpers/Log.hpp (added)
-
src/Helpers/Makefile.am (added)
-
src/Helpers/MemDebug.cpp (modified) (4 diffs)
-
src/Helpers/MemDebug.hpp (modified) (2 diffs)
-
src/Helpers/Verbose.cpp (added)
-
src/Helpers/Verbose.hpp (added)
-
src/Helpers/errorlogger.cpp (added)
-
src/Helpers/errorlogger.hpp (added)
-
src/Helpers/helpers.cpp (added)
-
src/Helpers/helpers.hpp (added)
-
src/Helpers/logger.cpp (added)
-
src/Helpers/logger.hpp (added)
-
src/Legacy/oldmenu.cpp (modified) (1 diff)
-
src/Line.cpp (deleted)
-
src/Line.hpp (deleted)
-
src/LinearAlgebra/Line.cpp (added)
-
src/LinearAlgebra/Line.hpp (added)
-
src/LinearAlgebra/Makefile.am (added)
-
src/LinearAlgebra/Matrix.cpp (added)
-
src/LinearAlgebra/Matrix.hpp (added)
-
src/LinearAlgebra/MatrixContent.hpp (added)
-
src/LinearAlgebra/Plane.cpp (added)
-
src/LinearAlgebra/Plane.hpp (added)
-
src/LinearAlgebra/Space.cpp (added)
-
src/LinearAlgebra/Space.hpp (added)
-
src/LinearAlgebra/Vector.cpp (added)
-
src/LinearAlgebra/Vector.hpp (added)
-
src/LinearAlgebra/VectorContent.hpp (added)
-
src/LinearAlgebra/VectorInterface.cpp (added)
-
src/LinearAlgebra/VectorInterface.hpp (added)
-
src/LinearAlgebra/VectorSet.hpp (added)
-
src/LinearAlgebra/gslmatrix.cpp (added)
-
src/LinearAlgebra/gslmatrix.hpp (added)
-
src/LinearAlgebra/gslvector.cpp (added)
-
src/LinearAlgebra/gslvector.hpp (added)
-
src/LinearAlgebra/linearsystemofequations.cpp (added)
-
src/LinearAlgebra/linearsystemofequations.hpp (added)
-
src/LinearAlgebra/vector_ops.cpp (added)
-
src/LinearAlgebra/vector_ops.hpp (added)
-
src/Makefile.am (modified) (15 diffs)
-
src/Matrix.cpp (deleted)
-
src/Matrix.hpp (deleted)
-
src/MatrixContent.hpp (deleted)
-
src/Parser/ChangeTracker.cpp (modified) (2 diffs)
-
src/Parser/FormatParserStorage.cpp (modified) (1 diff)
-
src/Parser/Makefile.am (added)
-
src/Parser/MpqcParser.cpp (modified) (2 diffs)
-
src/Parser/PcpParser.cpp (modified) (2 diffs)
-
src/Parser/TremoloParser.cpp (modified) (3 diffs)
-
src/Parser/XyzParser.cpp (modified) (5 diffs)
-
src/Patterns/Registry_impl.hpp (modified) (1 diff)
-
src/Plane.cpp (deleted)
-
src/Plane.hpp (deleted)
-
src/Shapes/BaseShapes.cpp (modified) (1 diff)
-
src/Shapes/ShapeOps_impl.hpp (modified) (1 diff)
-
src/Space.cpp (deleted)
-
src/Space.hpp (deleted)
-
src/ThermoStatContainer.cpp (modified) (1 diff)
-
src/UIElements/CommandLineUI/CommandLineDialog.cpp (modified) (2 diffs)
-
src/UIElements/Dialog.cpp (modified) (2 diffs)
-
src/UIElements/Dialog.hpp (modified) (2 diffs)
-
src/UIElements/Makefile.am (modified) (4 diffs)
-
src/UIElements/Menu/TextMenu.cpp (modified) (1 diff)
-
src/UIElements/Menu/TextMenu.hpp (modified) (2 diffs)
-
src/UIElements/QT4/IntQTQuery.ui (added)
-
src/UIElements/QT4/IntsQTQuery.ui (added)
-
src/UIElements/QT4/QTDialog.cpp (modified) (2 diffs)
-
src/UIElements/QT4/QTMainWindow.cpp (modified) (1 diff)
-
src/UIElements/TextUI/TextDialog.cpp (modified) (1 diff)
-
src/UIElements/TextUI/TextWindow.cpp (modified) (1 diff)
-
src/UIElements/ValueStorage.cpp (deleted)
-
src/UIElements/ValueStorage.hpp (deleted)
-
src/UIElements/Views/QT4/QTStatusBar.cpp (modified) (1 diff)
-
src/VectorContent.hpp (deleted)
-
src/VectorInterface.cpp (deleted)
-
src/VectorInterface.hpp (deleted)
-
src/VectorSet.hpp (deleted)
-
src/World.cpp (modified) (5 diffs)
-
src/World.hpp (modified) (3 diffs)
-
src/analysis_bonds.cpp (modified) (1 diff)
-
src/analysis_correlation.cpp (modified) (1 diff)
-
src/analysis_correlation.hpp (modified) (1 diff)
-
src/analyzer.cpp (modified) (1 diff)
-
src/atom.cpp (modified) (5 diffs)
-
src/atom.hpp (modified) (3 diffs)
-
src/atom_atominfo.hpp (modified) (1 diff)
-
src/atom_bondedparticle.cpp (modified) (1 diff)
-
src/atom_graphnode.cpp (modified) (1 diff)
-
src/atom_trajectoryparticle.cpp (modified) (1 diff)
-
src/atom_trajectoryparticleinfo.hpp (modified) (1 diff)
-
src/bond.cpp (modified) (1 diff)
-
src/bondgraph.cpp (modified) (1 diff)
-
src/boundary.cpp (modified) (3 diffs)
-
src/builder.cpp (modified) (5 diffs)
-
src/config.cpp (modified) (2 diffs)
-
src/datacreator.cpp (modified) (1 diff)
-
src/defs.hpp (modified) (1 diff)
-
src/element.cpp (modified) (2 diffs)
-
src/element.hpp (modified) (3 diffs)
-
src/ellipsoid.cpp (modified) (1 diff)
-
src/errorlogger.cpp (deleted)
-
src/errorlogger.hpp (deleted)
-
src/graph.cpp (modified) (1 diff)
-
src/gslmatrix.cpp (deleted)
-
src/gslmatrix.hpp (deleted)
-
src/gslvector.cpp (deleted)
-
src/gslvector.hpp (deleted)
-
src/helpers.cpp (deleted)
-
src/helpers.hpp (deleted)
-
src/info.cpp (deleted)
-
src/info.hpp (deleted)
-
src/joiner.cpp (modified) (1 diff)
-
src/leastsquaremin.cpp (modified) (1 diff)
-
src/linearsystemofequations.cpp (deleted)
-
src/linearsystemofequations.hpp (deleted)
-
src/linkedcell.cpp (modified) (1 diff)
-
src/linkedcell.hpp (modified) (1 diff)
-
src/log.cpp (deleted)
-
src/log.hpp (deleted)
-
src/logger.cpp (deleted)
-
src/logger.hpp (deleted)
-
src/molecule.cpp (modified) (13 diffs)
-
src/molecule.hpp (modified) (5 diffs)
-
src/molecule_dynamics.cpp (modified) (1 diff)
-
src/molecule_fragmentation.cpp (modified) (1 diff)
-
src/molecule_geometry.cpp (modified) (8 diffs)
-
src/molecule_graph.cpp (modified) (1 diff)
-
src/molecule_pointcloud.cpp (modified) (1 diff)
-
src/moleculelist.cpp (modified) (1 diff)
-
src/parser.cpp (modified) (1 diff)
-
src/periodentafel.cpp (modified) (1 diff)
-
src/stackclass.hpp (modified) (1 diff)
-
src/tesselation.cpp (modified) (2 diffs)
-
src/tesselation.hpp (modified) (1 diff)
-
src/tesselationhelpers.cpp (modified) (1 diff)
-
src/test/ActOnAlltest.hpp (modified) (1 diff)
-
src/triangleintersectionlist.cpp (modified) (1 diff)
-
src/unittests/ActOnAllUnitTest.cpp (modified) (1 diff)
-
src/unittests/ActionSequenceTest.cpp (modified) (7 diffs)
-
src/unittests/BoxUnittest.cpp (added)
-
src/unittests/BoxUnittest.hpp (added)
-
src/unittests/DummyUI.hpp (added)
-
src/unittests/FormulaUnittest.cpp (modified) (2 diffs)
-
src/unittests/LineUnittest.cpp (modified) (1 diff)
-
src/unittests/LineUnittest.hpp (modified) (1 diff)
-
src/unittests/Makefile.am (modified) (13 diffs)
-
src/unittests/MatrixUnittest.cpp (modified) (1 diff)
-
src/unittests/PlaneUnittest.cpp (modified) (1 diff)
-
src/unittests/PlaneUnittest.hpp (modified) (1 diff)
-
src/unittests/ShapeUnittest.cpp (modified) (1 diff)
-
src/unittests/ShapeUnittest.hpp (modified) (1 diff)
-
src/unittests/analysisbondsunittest.cpp (modified) (1 diff)
-
src/unittests/bondgraphunittest.cpp (modified) (1 diff)
-
src/unittests/gslmatrixsymmetricunittest.hpp (modified) (1 diff)
-
src/unittests/gslmatrixunittest.hpp (modified) (1 diff)
-
src/unittests/gslvectorunittest.hpp (modified) (1 diff)
-
src/unittests/infounittest.cpp (modified) (1 diff)
-
src/unittests/linearsystemofequationsunittest.cpp (modified) (1 diff)
-
src/unittests/linearsystemofequationsunittest.hpp (modified) (1 diff)
-
src/unittests/logunittest.cpp (modified) (1 diff)
-
src/unittests/manipulateAtomsTest.cpp (modified) (3 diffs)
-
src/unittests/memoryallocatorunittest.cpp (modified) (1 diff)
-
src/unittests/stackclassunittest.cpp (modified) (1 diff)
-
src/unittests/tesselation_insideoutsideunittest.cpp (modified) (1 diff)
-
src/unittests/vectorunittest.cpp (modified) (1 diff)
-
src/unittests/vectorunittest.hpp (modified) (1 diff)
-
src/vector.cpp (deleted)
-
src/vector.hpp (deleted)
-
src/vector_ops.cpp (deleted)
-
src/vector_ops.hpp (deleted)
-
src/verbose.cpp (deleted)
-
src/verbose.hpp (deleted)
-
test_all.sh (modified) (1 diff)
-
tests/Tesselations/Makefile.am (modified) (1 diff)
-
tests/Tesselations/defs.in (modified) (1 diff)
-
tests/regression/Molecules/10/post/test-rotated-xYz20.xyz (added)
-
tests/regression/Molecules/10/post/test-rotated-z180.xyz (added)
-
tests/regression/Molecules/10/post/test-rotated-z360.xyz (added)
-
tests/regression/Molecules/10/post/test-rotated-z90.xyz (added)
-
tests/regression/Molecules/10/pre/test.xyz (added)
-
tests/regression/Molecules/8/post/test-rotated-xYz20.xyz (added)
-
tests/regression/Molecules/8/post/test-rotated-z180.xyz (added)
-
tests/regression/Molecules/8/post/test-rotated-z360.xyz (added)
-
tests/regression/Molecules/8/post/test-rotated-z90.xyz (added)
-
tests/regression/Molecules/8/pre/test-rotated-xYz20.xyz (added)
-
tests/regression/Molecules/8/pre/test-rotated-z180.xyz (added)
-
tests/regression/Molecules/8/pre/test-rotated-z360.xyz (added)
-
tests/regression/Molecules/8/pre/test-rotated-z90.xyz (added)
-
tests/regression/Molecules/8/pre/test.conf (deleted)
-
tests/regression/Molecules/9/post/test-rotated-xYz20.xyz (added)
-
tests/regression/Molecules/9/post/test-rotated-z180.xyz (added)
-
tests/regression/Molecules/9/post/test-rotated-z360.xyz (added)
-
tests/regression/Molecules/9/post/test-rotated-z90.xyz (added)
-
tests/regression/Molecules/9/pre/test.xyz (added)
-
tests/regression/testsuite-molecules.at (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
rd74077 r8f4df1 1 1 ACLOCAL_AMFLAGS = -I m4 2 2 SUBDIRS = src src/unittests doc tests 3 4 AUTOMAKE_OPTIONS = subdir-objects 3 5 4 6 EXTRA_DIST = autogen.sh … … 7 9 doc: 8 10 cd doc && make doxygen-docs 11 12 unity: 13 cd src && make unity -
configure.ac
rd74077 r8f4df1 6 6 AC_CONFIG_AUX_DIR(config) 7 7 AC_CONFIG_SRCDIR([src/builder.cpp]) 8 AC_CONFIG_HEADER([config.h]) 8 AC_CONFIG_HEADER([config.h libmolecuilder_config.h]) 9 AC_CONFIG_MACRO_DIR([m4]) 9 10 10 11 AM_INIT_AUTOMAKE(dist-bzip2 parallel-tests) … … 14 15 AC_PROG_CXX 15 16 AC_PROG_CC 16 AC_PROG_RANLIB 17 # obselete by LT_INIT 18 #AC_PROG_RANLIB 17 19 AC_PROG_INSTALL 18 20 AC_CHECK_PROG([LATEX],[latex],[latex],[:]) … … 23 25 AM_MISSING_PROG([DOXYGEN], [doxygen]) 24 26 27 LT_INIT([disable-static]) 28 29 # Define these substitions here to keep all version information in one place. 30 # For information on how to properly maintain the library version information, 31 # refer to the libtool manual, section "Updating library version information": 32 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html 33 AC_SUBST([MOLECUILDER_SO_VERSION], [1:2:0]) 34 AC_SUBST([MOLECUILDER_API_VERSION], [1.0]) 35 25 36 # Checks for libraries. 26 AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))37 AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found])) 27 38 28 39 # Boost libraries … … 110 121 doc/molecuilder.xml]) 111 122 AC_CONFIG_FILES([ 123 molecuilder-${MOLECUILDER_API_VERSION}.pc:molecuilder.pc.in]) 124 AC_CONFIG_FILES([ 112 125 Makefile 113 126 doc/Makefile 114 127 src/Makefile 115 128 src/Actions/Makefile 129 src/Exceptions/Makefile 130 src/Helpers/Makefile 131 src/LinearAlgebra/Makefile 132 src/Parser/Makefile 116 133 src/UIElements/Makefile 117 134 src/unittests/Makefile]) -
m4/gwqt4.m4
rd74077 r8f4df1 147 147 QT_LIBS="$QT_LIB" 148 148 if test $QT_IS_STATIC = yes ; then 149 QT_LIBS="$QT_LIBS - L$x_libraries -lXext -lX11 -lm -lSM -lICE"149 QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE" 150 150 fi 151 151 ;; … … 154 154 QT_LIBS="$QT_LIB" 155 155 if test $QT_IS_STATIC = yes ; then 156 QT_LIBS="$QT_LIBS - L$x_libraries -lXext -lX11 -lm -lSM -lICE -ldl"156 QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE -ldl" 157 157 fi 158 158 ;; … … 162 162 QT_LIBS="$QT_LIB" 163 163 if test $QT_IS_STATIC = yes ; then 164 QT_LIBS="$QT_LIBS - L$x_libraries -lXext -lX11 -lm -lSM -lICE"164 QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE" 165 165 fi 166 166 ;; … … 169 169 QT_LIBS="$QT_LIB" 170 170 if test $QT_IS_STATIC = yes ; then 171 QT_LIBS="$QT_LIBS - L$x_libraries -lXext -lX11 -lm -lSM -lICE -lresolv -lsocket -lnsl"171 QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE -lresolv -lsocket -lnsl" 172 172 fi 173 173 ;; -
src/Actions/Action.cpp
rd74077 r8f4df1 16 16 #include "UIElements/Dialog.hpp" 17 17 #include "Helpers/MemDebug.hpp" 18 #include "UIElements/UIFactory.hpp" 18 19 19 #include " log.hpp"20 #include " verbose.hpp"20 #include "Helpers/Log.hpp" 21 #include "Helpers/Verbose.hpp" 21 22 22 23 using namespace std; … … 45 46 } 46 47 48 Dialog * Action::createDialog(){ 49 Dialog *dialog = UIFactory::getInstance().makeDialog(); 50 return fillDialog(dialog); 51 } 52 47 53 void Action::call(enum QueryOptions flag){ 48 54 if(!isActive()){ … … 52 58 if (flag == Interactive) { 53 59 Dialog* dialog = createDialog(); 54 if (dialog != NULL) {60 if (dialog->hasQueries()) { 55 61 dialog->display(); 56 delete(dialog);57 62 } 63 delete(dialog); 58 64 } 59 65 state_ptr state = Action::failure; -
src/Actions/Action.hpp
rd74077 r8f4df1 369 369 static state_ptr failure; 370 370 371 private:372 371 /** 373 372 * This creates the dialog requesting the information needed for this action from the user 374 373 * via means of the user interface. 375 374 */ 376 virtual Dialog * createDialog()=0; 375 Dialog * createDialog(); 376 377 private: 378 379 virtual Dialog * fillDialog(Dialog*)=0; 377 380 378 381 /** -
src/Actions/ActionHistory.cpp
rd74077 r8f4df1 86 86 } 87 87 88 Dialog* ActionHistory::UndoAction::createDialog(){ 89 return NULL; 88 Dialog* ActionHistory::UndoAction::fillDialog(Dialog *dialog){ 89 ASSERT(dialog,"No Dialog given when filling action dialog"); 90 return dialog; 90 91 } 91 92 … … 124 125 } 125 126 126 Dialog* ActionHistory::RedoAction::createDialog(){ 127 return NULL; 127 Dialog* ActionHistory::RedoAction::fillDialog(Dialog *dialog){ 128 ASSERT(dialog,"No Dialog given when filling action dialog"); 129 return dialog; 128 130 } 129 131 -
src/Actions/ActionHistory.hpp
rd74077 r8f4df1 38 38 39 39 virtual bool isActive(); 40 40 protected: 41 virtual Dialog * fillDialog(Dialog *dialog); 41 42 private: 42 virtual Dialog * createDialog();43 43 virtual Action::state_ptr performCall(); 44 44 virtual Action::state_ptr performUndo(Action::state_ptr); … … 58 58 virtual bool isActive(); 59 59 60 protected: 61 virtual Dialog * fillDialog(Dialog *dialog); 60 62 private: 61 virtual Dialog * createDialog();62 63 virtual Action::state_ptr performCall(); 63 64 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/ActionSequence.cpp
rd74077 r8f4df1 41 41 // this method is used outside the ActionModule 42 42 // Each action registers itself with the history 43 void ActionSequence::callAllDialogs(){43 Dialog* ActionSequence::fillAllDialogs(Dialog *dialog){ 44 44 for(actionSet::iterator it=actions.begin(); it!=actions.end(); it++){ 45 // we want to have a global bookkeeping for all actions in the sequence, so 46 // we bypass the normal call 47 Dialog * dialog = (*it)->createDialog(); 48 if (dialog != NULL) { 49 dialog->display(); 50 delete(dialog); 51 } 45 dialog = (*it)->fillDialog(dialog); 52 46 } 53 } 54 55 // This method is used internally when MakroActions are constructed. 56 // In this case only the makro Action should be registered and 57 // handle the states 58 ActionSequence::stateSet ActionSequence::callAllDialogs(bool){ 59 stateSet states; 60 for(actionSet::iterator it=actions.begin(); it!=actions.end(); it++){ 61 // we want to have a global bookkeeping for all actions in the sequence, so 62 // we bypass the normal call 63 (*it)->createDialog()->display(); 64 } 65 return states; 47 return dialog; 66 48 } 67 49 -
src/Actions/ActionSequence.hpp
rd74077 r8f4df1 30 30 31 31 void callAll(); 32 void callAllDialogs();33 32 34 33 bool canUndo(); … … 37 36 protected: 38 37 stateSet callAll(bool); // Dummy parameter to allow overloading 39 stateSet callAllDialogs(bool); // Dummy parameter to allow overloading38 Dialog* fillAllDialogs(Dialog *dialog); 40 39 stateSet undoAll(stateSet); 41 40 stateSet redoAll(stateSet); -
src/Actions/AnalysisAction/MolecularVolumeAction.cpp
rd74077 r8f4df1 14 14 #include "molecule.hpp" 15 15 #include "linkedcell.hpp" 16 #include " log.hpp"17 #include " verbose.hpp"16 #include "Helpers/Log.hpp" 17 #include "Helpers/Verbose.hpp" 18 18 #include "World.hpp" 19 19 … … 25 25 #include "UIElements/UIFactory.hpp" 26 26 #include "UIElements/Dialog.hpp" 27 #include " UIElements/ValueStorage.hpp"27 #include "Actions/ValueStorage.hpp" 28 28 29 29 const char AnalysisMolecularVolumeAction::NAME[] = "molecular-volume"; … … 40 40 }; 41 41 42 Dialog * AnalysisMolecularVolumeAction::createDialog() { 43 Dialog *dialog = UIFactory::getInstance().makeDialog(); 44 42 Dialog * AnalysisMolecularVolumeAction::fillDialog(Dialog *dialog) { 43 ASSERT(dialog,"No Dialog given when filling action dialog"); 45 44 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); 46 45 -
src/Actions/AnalysisAction/MolecularVolumeAction.hpp
rd74077 r8f4df1 23 23 24 24 virtual const std::string getName(); 25 26 protected: 27 virtual Dialog * fillDialog(Dialog*); 25 28 private: 26 virtual Dialog * createDialog();27 29 virtual Action::state_ptr performCall(); 28 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/AnalysisAction/PairCorrelationAction.cpp
rd74077 r8f4df1 13 13 #include "boundary.hpp" 14 14 #include "linkedcell.hpp" 15 #include " verbose.hpp"16 #include " log.hpp"15 #include "Helpers/Verbose.hpp" 16 #include "Helpers/Log.hpp" 17 17 #include "element.hpp" 18 18 #include "molecule.hpp" 19 19 #include "periodentafel.hpp" 20 #include " vector.hpp"20 #include "LinearAlgebra/Vector.hpp" 21 21 #include "World.hpp" 22 22 … … 28 28 #include "UIElements/UIFactory.hpp" 29 29 #include "UIElements/Dialog.hpp" 30 #include " UIElements/ValueStorage.hpp"30 #include "Actions/ValueStorage.hpp" 31 31 32 32 const char AnalysisPairCorrelationAction::NAME[] = "pair-correlation"; … … 51 51 52 52 53 Dialog* AnalysisPairCorrelationAction:: createDialog() {54 Dialog *dialog = UIFactory::getInstance().makeDialog();53 Dialog* AnalysisPairCorrelationAction::fillDialog(Dialog* dialog) { 54 ASSERT(dialog,"No Dialog given when filling action dialog"); 55 55 56 56 dialog->queryElements("elements", ValueStorage::getInstance().getDescription("elements")); -
src/Actions/AnalysisAction/PairCorrelationAction.hpp
rd74077 r8f4df1 10 10 11 11 #include "Actions/Action.hpp" 12 #include <string> 12 13 #include <vector> 13 #include <string>14 14 15 15 class element; … … 27 27 28 28 virtual const std::string getName(); 29 29 protected: 30 virtual Dialog * fillDialog(Dialog*); 30 31 private: 31 virtual Dialog * createDialog(); 32 virtual Action::state_ptr performCall(); 32 virtual Action::state_ptr performCall(); 33 33 virtual Action::state_ptr performUndo(Action::state_ptr); 34 34 virtual Action::state_ptr performRedo(Action::state_ptr); -
src/Actions/AnalysisAction/PointCorrelationAction.cpp
rd74077 r8f4df1 13 13 #include "boundary.hpp" 14 14 #include "linkedcell.hpp" 15 #include " verbose.hpp"16 #include " log.hpp"15 #include "Helpers/Verbose.hpp" 16 #include "Helpers/Log.hpp" 17 17 #include "element.hpp" 18 18 #include "molecule.hpp" 19 19 #include "periodentafel.hpp" 20 #include " vector.hpp"20 #include "LinearAlgebra/Vector.hpp" 21 21 #include "World.hpp" 22 22 … … 28 28 #include "UIElements/UIFactory.hpp" 29 29 #include "UIElements/Dialog.hpp" 30 #include " UIElements/ValueStorage.hpp"30 #include "Actions/ValueStorage.hpp" 31 31 32 32 const char AnalysisPointCorrelationAction::NAME[] = "point-correlation"; … … 51 51 }; 52 52 53 Dialog* AnalysisPointCorrelationAction:: createDialog() {54 Dialog *dialog = UIFactory::getInstance().makeDialog();53 Dialog* AnalysisPointCorrelationAction::fillDialog(Dialog *dialog) { 54 ASSERT(dialog,"No Dialog given when filling action dialog"); 55 55 56 56 dialog->queryVector("position", false, ValueStorage::getInstance().getDescription("position")); -
src/Actions/AnalysisAction/PointCorrelationAction.hpp
rd74077 r8f4df1 10 10 11 11 #include "Actions/Action.hpp" 12 #include " vector.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 13 #include <vector> 14 14 #include <string> … … 29 29 30 30 virtual const std::string getName(); 31 protected: 32 virtual Dialog * fillDialog(Dialog*); 31 33 private: 32 virtual Dialog * createDialog();33 34 virtual Action::state_ptr performCall(); 34 35 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include "Helpers/Log.hpp" 13 #include "Helpers/Verbose.hpp" 14 #include "LinearAlgebra/Matrix.hpp" 15 #include "LinearAlgebra/Vector.hpp" 16 #include "element.hpp" 12 17 #include "molecule.hpp" 13 #include "log.hpp"14 #include "verbose.hpp"15 18 16 19 #include <iostream> … … 21 24 #include "UIElements/UIFactory.hpp" 22 25 #include "UIElements/Dialog.hpp" 23 #include " UIElements/ValueStorage.hpp"26 #include "Actions/ValueStorage.hpp" 24 27 25 28 const char AnalysisPrincipalAxisSystemAction::NAME[] = "principal-axis-system"; … … 36 39 }; 37 40 38 Dialog* AnalysisPrincipalAxisSystemAction:: createDialog() {39 Dialog *dialog = UIFactory::getInstance().makeDialog();41 Dialog* AnalysisPrincipalAxisSystemAction::fillDialog(Dialog *dialog) { 42 ASSERT(dialog,"No Dialog given when filling action dialog"); 40 43 41 44 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); … … 46 49 Action::state_ptr AnalysisPrincipalAxisSystemAction::performCall() { 47 50 molecule *mol = NULL; 51 Matrix InertiaTensor; 48 52 49 53 ValueStorage::getInstance().queryCurrentValue(NAME, mol); … … 51 55 for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) { 52 56 molecule *mol = iter->second; 53 mol->PrincipalAxisSystem(false); 57 Vector *CenterOfGravity = mol->DetermineCenterOfGravity(); 58 59 // reset inertia tensor 60 InertiaTensor.zero(); 61 62 // sum up inertia tensor 63 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 64 Vector x = (*iter)->getPosition(); 65 x -= *CenterOfGravity; 66 const double mass = (*iter)->getType()->mass; 67 InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]); 68 InertiaTensor.at(0,1) += mass*(-x[0]*x[1]); 69 InertiaTensor.at(0,2) += mass*(-x[0]*x[2]); 70 InertiaTensor.at(1,0) += mass*(-x[1]*x[0]); 71 InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]); 72 InertiaTensor.at(1,2) += mass*(-x[1]*x[2]); 73 InertiaTensor.at(2,0) += mass*(-x[2]*x[0]); 74 InertiaTensor.at(2,1) += mass*(-x[2]*x[1]); 75 InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]); 76 } 77 // print InertiaTensor for debugging 78 DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl); 54 79 } 55 80 return Action::success; -
src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp
rd74077 r8f4df1 13 13 #include "boundary.hpp" 14 14 #include "linkedcell.hpp" 15 #include " verbose.hpp"16 #include " log.hpp"15 #include "Helpers/Verbose.hpp" 16 #include "Helpers/Log.hpp" 17 17 #include "element.hpp" 18 18 #include "molecule.hpp" 19 19 #include "periodentafel.hpp" 20 #include " vector.hpp"20 #include "LinearAlgebra/Vector.hpp" 21 21 #include "World.hpp" 22 22 … … 28 28 #include "UIElements/UIFactory.hpp" 29 29 #include "UIElements/Dialog.hpp" 30 #include " UIElements/ValueStorage.hpp"30 #include "Actions/ValueStorage.hpp" 31 31 32 32 const char AnalysisSurfaceCorrelationAction::NAME[] = "surface-correlation"; … … 52 52 53 53 54 Dialog* AnalysisSurfaceCorrelationAction:: createDialog() {55 Dialog *dialog = UIFactory::getInstance().makeDialog();54 Dialog* AnalysisSurfaceCorrelationAction::fillDialog(Dialog *dialog) { 55 ASSERT(dialog,"No Dialog given when filling action dialog"); 56 56 57 57 dialog->queryMolecule("molecule-by-id", ValueStorage::getInstance().getDescription("molecule-by-id")); -
src/Actions/AnalysisAction/SurfaceCorrelationAction.hpp
rd74077 r8f4df1 10 10 11 11 #include "Actions/Action.hpp" 12 #include <string> 12 13 #include <vector> 13 #include <string>14 14 15 15 class element; … … 28 28 29 29 virtual const std::string getName(); 30 protected: 31 virtual Dialog * fillDialog(Dialog*); 30 32 private: 31 virtual Dialog * createDialog();32 33 virtual Action::state_ptr performCall(); 33 34 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/AtomAction/AddAction.cpp
rd74077 r8f4df1 12 12 #include "atom.hpp" 13 13 #include "element.hpp" 14 #include " log.hpp"14 #include "Helpers/Log.hpp" 15 15 #include "molecule.hpp" 16 #include " vector.hpp"17 #include " verbose.hpp"16 #include "LinearAlgebra/Vector.hpp" 17 #include "Helpers/Verbose.hpp" 18 18 #include "World.hpp" 19 19 … … 25 25 #include "UIElements/UIFactory.hpp" 26 26 #include "UIElements/Dialog.hpp" 27 #include " UIElements/ValueStorage.hpp"27 #include "Actions/ValueStorage.hpp" 28 28 29 29 const char AtomAddAction::NAME[] = "add-atom"; … … 42 42 }; 43 43 44 Dialog * AtomAddAction:: createDialog() {45 Dialog *dialog = UIFactory::getInstance().makeDialog();44 Dialog * AtomAddAction::fillDialog(Dialog *dialog) { 45 ASSERT(dialog,"No Dialog given when filling action dialog"); 46 46 47 47 dialog->queryElement(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/AtomAction/AddAction.hpp
rd74077 r8f4df1 10 10 11 11 #include "Actions/Action.hpp" 12 #include " vector.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 13 14 14 class element; … … 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/AtomAction/ChangeElementAction.cpp
rd74077 r8f4df1 12 12 #include "atom.hpp" 13 13 #include "element.hpp" 14 #include "log.hpp" 15 #include "vector.hpp" 16 #include "verbose.hpp" 14 #include "Helpers/Log.hpp" 15 #include "LinearAlgebra/Vector.hpp" 16 #include "Helpers/Verbose.hpp" 17 #include "molecule.hpp" 17 18 #include "World.hpp" 18 19 … … 24 25 #include "UIElements/UIFactory.hpp" 25 26 #include "UIElements/Dialog.hpp" 26 #include " UIElements/ValueStorage.hpp"27 #include "Actions/ValueStorage.hpp" 27 28 28 29 const char AtomChangeElementAction::NAME[] = "change-element"; … … 40 41 }; 41 42 42 Dialog* AtomChangeElementAction:: createDialog() {43 Dialog *dialog = UIFactory::getInstance().makeDialog();43 Dialog* AtomChangeElementAction::fillDialog(Dialog *dialog) { 44 ASSERT(dialog,"No Dialog given when filling action dialog"); 44 45 45 46 dialog->queryElement(NAME, ValueStorage::getInstance().getDescription(NAME)); … … 51 52 atom *first = NULL; 52 53 element *elemental = NULL; 54 molecule *mol = NULL; 53 55 54 56 ValueStorage::getInstance().queryCurrentValue(NAME, elemental); … … 57 59 first = iter->second; 58 60 DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental->symbol << "." << endl); 61 mol = first->getMolecule(); 62 first->removeFromMolecule(); // remove atom 59 63 first->setType(elemental); 64 mol->AddAtom(first); // add atom to ensure correctness of formula 60 65 } 61 66 return Action::success; -
src/Actions/AtomAction/ChangeElementAction.hpp
rd74077 r8f4df1 26 26 27 27 virtual const std::string getName(); 28 protected: 29 virtual Dialog * fillDialog(Dialog*); 28 30 private: 29 virtual Dialog * createDialog();30 31 virtual Action::state_ptr performCall(); 31 32 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/AtomAction/RemoveAction.cpp
rd74077 r8f4df1 12 12 #include "atom.hpp" 13 13 #include "Descriptors/AtomDescriptor.hpp" 14 #include " log.hpp"14 #include "Helpers/Log.hpp" 15 15 #include "molecule.hpp" 16 #include " verbose.hpp"16 #include "Helpers/Verbose.hpp" 17 17 #include "World.hpp" 18 18 … … 24 24 #include "UIElements/UIFactory.hpp" 25 25 #include "UIElements/Dialog.hpp" 26 #include " UIElements/ValueStorage.hpp"26 #include "Actions/ValueStorage.hpp" 27 27 28 28 const char AtomRemoveAction::NAME[] = "remove-atom"; … … 39 39 }; 40 40 41 Dialog* AtomRemoveAction:: createDialog() {42 Dialog *dialog = UIFactory::getInstance().makeDialog();41 Dialog* AtomRemoveAction::fillDialog(Dialog *dialog) { 42 ASSERT(dialog,"No Dialog given when filling action dialog"); 43 43 44 44 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/AtomAction/RemoveAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog*); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/AtomsCalculation.hpp
rd74077 r8f4df1 11 11 #include "Actions/Calculation.hpp" 12 12 13 class Dialog; 14 13 15 template<typename T> 14 16 class AtomsCalculation : public Calculation<std::vector<T> > … … 20 22 protected: 21 23 virtual std::vector<T>* doCalc(); 24 virtual Dialog *fillDialog(Dialog *dialog); 22 25 23 26 private: -
src/Actions/AtomsCalculation_impl.hpp
rd74077 r8f4df1 45 45 } 46 46 47 template<typename T> 48 Dialog *AtomsCalculation<T>::fillDialog(Dialog *dialog){ 49 ASSERT(dialog,"No Dialog given when filling action dialog"); 50 return dialog; 51 } 47 52 48 53 #endif /* ATOMSCALCULATION_IMPL_HPP_ */ -
src/Actions/Calculation.hpp
rd74077 r8f4df1 64 64 virtual T* doCalc()=0; 65 65 private: 66 virtual Dialog* createDialog();67 66 virtual Action::state_ptr performCall(); 68 67 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/Calculation_impl.hpp
rd74077 r8f4df1 27 27 28 28 // methods inherited from Action 29 30 template<typename T>31 Dialog* Calculation<T>::createDialog(){32 return NULL;33 }34 29 35 30 template<typename T> -
src/Actions/CmdAction/BondLengthTableAction.cpp
rd74077 r8f4df1 12 12 #include "bondgraph.hpp" 13 13 #include "config.hpp" 14 #include " log.hpp"15 #include " verbose.hpp"14 #include "Helpers/Log.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 const char CommandLineBondLengthTableAction::NAME[] = "bond-table"; … … 39 39 }; 40 40 41 Dialog* CommandLineBondLengthTableAction:: createDialog() {42 Dialog *dialog = UIFactory::getInstance().makeDialog();41 Dialog* CommandLineBondLengthTableAction::fillDialog(Dialog *dialog) { 42 ASSERT(dialog,"No Dialog given when filling action dialog"); 43 43 44 44 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/CmdAction/BondLengthTableAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/CmdAction/ElementDbAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "config.hpp" 13 #include " log.hpp"13 #include "Helpers/Log.hpp" 14 14 #include "periodentafel.hpp" 15 #include " verbose.hpp"15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 const char CommandLineElementDbAction::NAME[] = "element-db"; … … 39 39 }; 40 40 41 Dialog* CommandLineElementDbAction:: createDialog() {42 Dialog *dialog = UIFactory::getInstance().makeDialog();41 Dialog* CommandLineElementDbAction::fillDialog(Dialog *dialog) { 42 ASSERT(dialog,"No Dialog given when filling action dialog"); 43 43 44 44 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/CmdAction/ElementDbAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/CmdAction/FastParsingAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "config.hpp" 13 #include " log.hpp"14 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 // memento to remember the state when undoing … … 49 49 }; 50 50 51 Dialog* CommandLineFastParsingAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* CommandLineFastParsingAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryBoolean(NAME, MapOfActions::getInstance().getDescription(NAME)); … … 78 78 79 79 Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){ 80 performUndo(_state);80 return performUndo(_state); 81 81 } 82 82 -
src/Actions/CmdAction/FastParsingAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/CmdAction/HelpAction.cpp
rd74077 r8f4df1 34 34 }; 35 35 36 Dialog* CommandLineHelpAction:: createDialog() {37 Dialog *dialog = UIFactory::getInstance().makeDialog();36 Dialog* CommandLineHelpAction::fillDialog(Dialog *dialog) { 37 ASSERT(dialog,"No Dialog given when filling action dialog"); 38 38 39 39 ostringstream usage; -
src/Actions/CmdAction/HelpAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/CmdAction/VerboseAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/CmdAction/VerboseAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"13 #include " verbose.hpp"12 #include "Helpers/Log.hpp" 13 #include "Helpers/Verbose.hpp" 14 14 15 15 #include <iostream> … … 20 20 #include "UIElements/UIFactory.hpp" 21 21 #include "UIElements/Dialog.hpp" 22 #include " UIElements/ValueStorage.hpp"22 #include "Actions/ValueStorage.hpp" 23 23 24 24 // memento to remember the state when undoing … … 47 47 }; 48 48 49 Dialog* CommandLineVerboseAction:: createDialog() {50 Dialog *dialog = UIFactory::getInstance().makeDialog();49 Dialog* CommandLineVerboseAction::fillDialog(Dialog *dialog) { 50 ASSERT(dialog,"No Dialog given when filling action dialog"); 51 51 52 52 dialog->queryInt(NAME, ValueStorage::getInstance().getDescription(NAME)); … … 76 76 77 77 Action::state_ptr CommandLineVerboseAction::performRedo(Action::state_ptr _state){ 78 performUndo(_state);78 return performUndo(_state); 79 79 } 80 80 -
src/Actions/CmdAction/VerboseAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/CmdAction/VersionAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/CmdAction/VersionAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include "version.h" 12 13 13 14 #include <iostream> … … 18 19 #include "UIElements/UIFactory.hpp" 19 20 #include "UIElements/Dialog.hpp" 20 #include " UIElements/ValueStorage.hpp"21 #include "Actions/ValueStorage.hpp" 21 22 22 23 const char CommandLineVersionAction::NAME[] = "version"; … … 33 34 }; 34 35 35 Dialog* CommandLineVersionAction:: createDialog() {36 Dialog *dialog = UIFactory::getInstance().makeDialog();36 Dialog* CommandLineVersionAction::fillDialog(Dialog *dialog) { 37 ASSERT(dialog,"No Dialog given when filling action dialog"); 37 38 38 39 dialog->queryEmpty(NAME, ESPACKVersion); -
src/Actions/CmdAction/VersionAction.hpp
rd74077 r8f4df1 25 25 26 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/ErrorAction.cpp
rd74077 r8f4df1 11 11 12 12 #include "Actions/ErrorAction.hpp" 13 #include " log.hpp"14 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 15 #include "Helpers/Assert.hpp" 16 16 -
src/Actions/FragmentationAction/DepthFirstSearchAction.cpp
rd74077 r8f4df1 13 13 #include "bondgraph.hpp" 14 14 #include "config.hpp" 15 #include " log.hpp"15 #include "Helpers/Log.hpp" 16 16 #include "molecule.hpp" 17 17 #include "Descriptors/MoleculeDescriptor.hpp" 18 18 #include "Descriptors/MoleculeIdDescriptor.hpp" 19 19 #include "stackclass.hpp" 20 #include " verbose.hpp"20 #include "Helpers/Verbose.hpp" 21 21 #include "World.hpp" 22 22 … … 28 28 #include "UIElements/UIFactory.hpp" 29 29 #include "UIElements/Dialog.hpp" 30 #include " UIElements/ValueStorage.hpp"30 #include "Actions/ValueStorage.hpp" 31 31 32 32 const char FragmentationDepthFirstSearchAction::NAME[] = "depth-first-search"; … … 44 44 }; 45 45 46 Dialog* FragmentationDepthFirstSearchAction:: createDialog() {47 Dialog *dialog = UIFactory::getInstance().makeDialog();46 Dialog* FragmentationDepthFirstSearchAction::fillDialog(Dialog *dialog) { 47 ASSERT(dialog,"No Dialog given when filling action dialog"); 48 48 49 49 dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/FragmentationAction/DepthFirstSearchAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/FragmentationAction/FragmentationAction.cpp
rd74077 r8f4df1 13 13 #include "bondgraph.hpp" 14 14 #include "config.hpp" 15 #include " log.hpp"15 #include "Helpers/Log.hpp" 16 16 #include "molecule.hpp" 17 17 #include "Descriptors/MoleculeDescriptor.hpp" … … 26 26 #include "UIElements/UIFactory.hpp" 27 27 #include "UIElements/Dialog.hpp" 28 #include " UIElements/ValueStorage.hpp"28 #include "Actions/ValueStorage.hpp" 29 29 30 30 const char FragmentationFragmentationAction::NAME[] = "fragment-mol"; … … 44 44 }; 45 45 46 Dialog* FragmentationFragmentationAction:: createDialog() {47 Dialog *dialog = UIFactory::getInstance().makeDialog();46 Dialog* FragmentationFragmentationAction::fillDialog(Dialog *dialog) { 47 ASSERT(dialog,"No Dialog given when filling action dialog"); 48 48 49 49 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/FragmentationAction/FragmentationAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/FragmentationAction/SubgraphDissectionAction.cpp
rd74077 r8f4df1 16 16 #include "bondgraph.hpp" 17 17 #include "config.hpp" 18 #include " log.hpp"18 #include "Helpers/Log.hpp" 19 19 #include "molecule.hpp" 20 20 #include "stackclass.hpp" … … 28 28 #include "UIElements/UIFactory.hpp" 29 29 #include "UIElements/Dialog.hpp" 30 #include " UIElements/ValueStorage.hpp"30 #include "Actions/ValueStorage.hpp" 31 31 32 32 const char FragmentationSubgraphDissectionAction::NAME[] = "subgraph-dissect"; … … 43 43 }; 44 44 45 Dialog* FragmentationSubgraphDissectionAction:: createDialog() {46 Dialog *dialog = UIFactory::getInstance().makeDialog();45 Dialog* FragmentationSubgraphDissectionAction::fillDialog(Dialog *dialog) { 46 ASSERT(dialog,"No Dialog given when filling action dialog"); 47 47 48 48 dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME)); -
src/Actions/FragmentationAction/SubgraphDissectionAction.hpp
rd74077 r8f4df1 7 7 8 8 #ifndef SUBGRAPHDISSECTIONACTION_HPP_ 9 #define SUBGRAPHDISSECTIONACTION_HPP_ f9 #define SUBGRAPHDISSECTIONACTION_HPP_ 10 10 11 11 #include "Actions/Action.hpp" … … 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/Makefile.am
rd74077 r8f4df1 6 6 AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl 7 7 AM_CXXFLAGS = $(CPPUNIT_CFLAGS) 8 9 noinst_LIBRARIES = libMolecuilderActions.a10 libMolecuilderActions_a_SOURCES = ${ACTIONSSOURCE} ${ACTIONSHEADER}11 8 12 9 ACTIONSSOURCE = \ … … 20 17 ${TESSELATIONACTIONSOURCE} \ 21 18 ${WORLDACTIONSOURCE} \ 22 MapOfActions.cpp 19 MapOfActions.cpp \ 20 ValueStorage.cpp 23 21 24 22 ACTIONSHEADER = \ … … 33 31 ${WORLDACTIONHEADER} \ 34 32 MapOfActions.hpp \ 33 ValueStorage.hpp \ 35 34 Values.hpp 36 35 … … 86 85 MoleculeAction/FillWithMoleculeAction.cpp \ 87 86 MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \ 87 MoleculeAction/RotateAroundOriginByAngleAction.cpp \ 88 MoleculeAction/RotateAroundSelfByAngleAction.cpp \ 88 89 MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \ 89 90 MoleculeAction/SaveAdjacencyAction.cpp \ … … 98 99 MoleculeAction/FillWithMoleculeAction.hpp \ 99 100 MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \ 101 MoleculeAction/RotateAroundOriginByAngleAction.hpp \ 102 MoleculeAction/RotateAroundSelfByAngleAction.hpp \ 100 103 MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \ 101 104 MoleculeAction/SaveAdjacencyAction.hpp \ … … 168 171 WorldAction/SetOutputFormatsAction.hpp 169 172 173 174 lib_LTLIBRARIES = libMolecuilderActions-@MOLECUILDER_API_VERSION@.la 175 libMolecuilderActions_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 176 libMolecuilderActions_libs = ../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la 177 nobase_libMolecuilderActions_include_HEADERS = ${ACTIONSHEADER} 178 179 ## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la" 180 ## target. Note that @MOLECUILDER_API_VERSION@ is not interpreted by Automake and 181 ## will therefore be treated as if it were literally part of the target name, 182 ## and the variable name derived from that. 183 ## The file extension .cc is recognized by Automake, and makes it produce 184 ## rules which invoke the C++ compiler to produce a libtool object file (.lo) 185 ## from each source file. Note that it is not necessary to list header files 186 ## which are already listed elsewhere in a _HEADERS variable assignment. 187 libMolecuilderActions_@MOLECUILDER_API_VERSION@_la_SOURCES = ${ACTIONSSOURCE} 188 189 ## Instruct libtool to include ABI version information in the generated shared 190 ## library file (.so). The library ABI version is defined in configure.ac, so 191 ## that all version information is kept in one place. 192 libMolecuilderActions_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION) 193 194 ## The generated configuration header is installed in its own subdirectory of 195 ## $(libdir). The reason for this is that the configuration information put 196 ## into this header file describes the target platform the installed library 197 ## has been built for. Thus the file must not be installed into a location 198 ## intended for architecture-independent files, as defined by the Filesystem 199 ## Hierarchy Standard (FHS). 200 ## The nodist_ prefix instructs Automake to not generate rules for including 201 ## the listed files in the distribution on 'make dist'. Files that are listed 202 ## in _HEADERS variables are normally included in the distribution, but the 203 ## configuration header file is generated at configure time and should not be 204 ## shipped with the source tarball. 205 libMolecuilderActions_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include 206 nodist_libMolecuilderActions_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h 207 208 ## Install the generated pkg-config file (.pc) into the expected location for 209 ## architecture-dependent package configuration information. Occasionally, 210 ## pkg-config files are also used for architecture-independent data packages, 211 ## in which case the correct install location would be $(datadir)/pkgconfig. 212 pkgconfigdir = $(libdir)/pkgconfig 213 pkgconfig_DATA = $(top_builddir)/molecuilder-$(MOLECUILDER_API_VERSION).pc 214 215 unity.cpp: 216 echo "" > unity.cpp; \ 217 list='$(ACTIONSSOURCE)'; for file in $$list; do \ 218 echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \ 219 done; 220 221 MOSTLYCLEANFILES = unity.cpp -
src/Actions/MakroAction.cpp
rd74077 r8f4df1 44 44 } 45 45 46 Dialog* MakroAction:: createDialog() {47 actions->callAllDialogs();46 Dialog* MakroAction::fillDialog(Dialog *dialog) { 47 return actions->fillAllDialogs(dialog); 48 48 } 49 49 -
src/Actions/MakroAction.hpp
rd74077 r8f4df1 29 29 bool shouldUndo(); 30 30 31 protected: 32 virtual Dialog *fillDialog(Dialog *dialog); 31 33 private: 32 virtual Dialog * createDialog();33 34 virtual Action::state_ptr performCall(); 34 35 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/ManipulateAtomsProcess.cpp
rd74077 r8f4df1 27 27 {} 28 28 29 Dialog* ManipulateAtomsProcess::createDialog(){ 30 return NULL; 29 Dialog* ManipulateAtomsProcess::fillDialog(Dialog *dialog){ 30 ASSERT(dialog,"No Dialog given when filling action dialog"); 31 return dialog; 31 32 } 32 33 -
src/Actions/ManipulateAtomsProcess.hpp
rd74077 r8f4df1 27 27 28 28 virtual void doManipulate(World *); 29 30 protected: 31 virtual Dialog * fillDialog(Dialog*); 29 32 private: 30 31 virtual Dialog* createDialog();32 33 virtual Action::state_ptr performCall(); 33 34 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MapOfActions.cpp
rd74077 r8f4df1 26 26 #include "CommandLineParser.hpp" 27 27 #include "element.hpp" 28 #include " log.hpp"29 #include " Matrix.hpp"28 #include "Helpers/Log.hpp" 29 #include "LinearAlgebra/Matrix.hpp" 30 30 #include "molecule.hpp" 31 31 #include "periodentafel.hpp" 32 #include " vector.hpp"33 #include " verbose.hpp"32 #include "LinearAlgebra/Vector.hpp" 33 #include "Helpers/Verbose.hpp" 34 34 35 35 #include "Actions/ActionRegistry.hpp" … … 55 55 #include "Actions/MoleculeAction/FillWithMoleculeAction.hpp" 56 56 #include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp" 57 #include "Actions/MoleculeAction/RotateAroundOriginByAngleAction.hpp" 58 #include "Actions/MoleculeAction/RotateAroundSelfByAngleAction.hpp" 57 59 #include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp" 58 60 #include "Actions/MoleculeAction/SaveAdjacencyAction.hpp" … … 203 205 DescriptionMap["remove-sphere"] = "remove sphere of atoms of around a specified atom"; 204 206 DescriptionMap["repeat-box"] = "create periodic copies of the simulation box per axis"; 207 DescriptionMap["rotate-origin"] = "rotates molecules by a specific angle around origin"; 208 DescriptionMap["rotate-self"] = "rotates molecules by a specific angle around own center of gravity"; 205 209 DescriptionMap["rotate-to-pas"] = "calculate the principal axis system of the specified molecule and rotate specified axis to align with main axis"; 206 210 DescriptionMap["save-adjacency"] = "name of the adjacency file to write to"; … … 319 323 TypeMap["remove-sphere"] = &typeid(double); 320 324 TypeMap["repeat-box"] = &typeid(VectorValue); 321 TypeMap["rotate-to-pas"] = &typeid(molecule); 325 TypeMap["rotate-origin"] = &typeid(double); 326 TypeMap["rotate-self"] = &typeid(double); 327 TypeMap["rotate-to-pas"] = &typeid(VectorValue); 322 328 TypeMap["save-adjacency"] = &typeid(std::string); 323 329 TypeMap["save-bonds"] = &typeid(std::string); … … 423 429 MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "fill-molecule") ); 424 430 MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "linear-interpolate") ); 431 MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "rotate-origin") ); 432 MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "rotate-self") ); 425 433 MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "rotate-to-pas") ); 426 434 MenuContainsActionMap.insert( pair<std::string, std::string> ("molecule", "save-adjacency") ); … … 487 495 generic.insert("remove-sphere"); 488 496 generic.insert("repeat-box"); 497 generic.insert("rotate-origin"); 498 generic.insert("rotate-self"); 489 499 generic.insert("rotate-to-pas"); 490 500 generic.insert("save-adjacency"); … … 807 817 new MoleculeFillWithMoleculeAction(); 808 818 new MoleculeLinearInterpolationofTrajectoriesAction(); 819 new MoleculeRotateAroundOriginByAngleAction(); 820 new MoleculeRotateAroundSelfByAngleAction(); 809 821 new MoleculeRotateToPrincipalAxisSystemAction(); 810 822 new MoleculeSaveAdjacencyAction(); -
src/Actions/MethodAction.cpp
rd74077 r8f4df1 26 26 {} 27 27 28 Dialog* MethodAction::createDialog() { 29 return NULL; 28 Dialog* MethodAction::fillDialog(Dialog *dialog) { 29 ASSERT(dialog,"No Dialog given when filling action dialog"); 30 return dialog; 30 31 } 31 32 -
src/Actions/MethodAction.hpp
rd74077 r8f4df1 25 25 virtual bool shouldUndo(); 26 26 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/BondFileAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/MoleculeAction/BondFileAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"12 #include "Helpers/Log.hpp" 13 13 #include "molecule.hpp" 14 #include " verbose.hpp"14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 … … 54 54 }; 55 55 56 Dialog* MoleculeBondFileAction:: createDialog() {57 Dialog *dialog = UIFactory::getInstance().makeDialog();56 Dialog* MoleculeBondFileAction::fillDialog(Dialog *dialog) { 57 ASSERT(dialog,"No Dialog given when filling action dialog"); 58 58 59 59 dialog->queryString(NAME, MapOfActions::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/BondFileAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/ChangeNameAction.cpp
rd74077 r8f4df1 20 20 #include "UIElements/UIFactory.hpp" 21 21 #include "UIElements/Dialog.hpp" 22 #include " UIElements/ValueStorage.hpp"22 #include "Actions/ValueStorage.hpp" 23 23 24 24 /****** MoleculeChangeNameAction *****/ … … 50 50 }; 51 51 52 Dialog* MoleculeChangeNameAction:: createDialog() {53 Dialog *dialog = UIFactory::getInstance().makeDialog();52 Dialog* MoleculeChangeNameAction::fillDialog(Dialog *dialog) { 53 ASSERT(dialog,"No Dialog given when filling action dialog"); 54 54 55 55 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/ChangeNameAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/FillWithMoleculeAction.cpp
rd74077 r8f4df1 15 15 #include "config.hpp" 16 16 #include "molecule.hpp" 17 #include " verbose.hpp"17 #include "Helpers/Verbose.hpp" 18 18 #include "World.hpp" 19 19 … … 26 26 #include "UIElements/UIFactory.hpp" 27 27 #include "UIElements/Dialog.hpp" 28 #include " UIElements/ValueStorage.hpp"28 #include "Actions/ValueStorage.hpp" 29 29 30 30 /****** MoleculeFillWithMoleculeAction *****/ … … 60 60 }; 61 61 62 Dialog* MoleculeFillWithMoleculeAction:: createDialog() {63 Dialog *dialog = UIFactory::getInstance().makeDialog();62 Dialog* MoleculeFillWithMoleculeAction::fillDialog(Dialog *dialog) { 63 ASSERT(dialog,"No Dialog given when filling action dialog"); 64 64 65 65 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/FillWithMoleculeAction.hpp
rd74077 r8f4df1 11 11 #include "Actions/Action.hpp" 12 12 #include "Actions/Process.hpp" 13 #include " vector.hpp"13 #include "LinearAlgebra/Vector.hpp" 14 14 15 15 class MoleculeListClass; … … 28 28 29 29 virtual const std::string getName(); 30 protected: 31 virtual Dialog * fillDialog(Dialog *dialog); 30 32 private: 31 virtual Dialog * createDialog();32 33 virtual Action::state_ptr performCall(); 33 34 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp
rd74077 r8f4df1 12 12 #include "atom.hpp" 13 13 #include "defs.hpp" 14 #include " log.hpp"14 #include "Helpers/Log.hpp" 15 15 #include "molecule.hpp" 16 #include " verbose.hpp"16 #include "Helpers/Verbose.hpp" 17 17 #include "World.hpp" 18 18 … … 25 25 #include "UIElements/UIFactory.hpp" 26 26 #include "UIElements/Dialog.hpp" 27 #include " UIElements/ValueStorage.hpp"27 #include "Actions/ValueStorage.hpp" 28 28 29 29 … … 59 59 }; 60 60 61 Dialog* MoleculeLinearInterpolationofTrajectoriesAction:: createDialog() {62 Dialog *dialog = UIFactory::getInstance().makeDialog();61 Dialog* MoleculeLinearInterpolationofTrajectoriesAction::fillDialog(Dialog *dialog) { 62 ASSERT(dialog,"No Dialog given when filling action dialog"); 63 63 64 64 dialog->queryString(NAME, MapOfActions::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include "log.hpp" 12 #include "Helpers/Log.hpp" 13 #include "Helpers/Verbose.hpp" 14 #include "LinearAlgebra/Line.hpp" 15 #include "LinearAlgebra/Matrix.hpp" 16 #include "LinearAlgebra/Vector.hpp" 17 #include "element.hpp" 13 18 #include "molecule.hpp" 14 #include "verbose.hpp"15 19 16 20 … … 23 27 #include "UIElements/UIFactory.hpp" 24 28 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"29 #include "Actions/ValueStorage.hpp" 26 30 27 31 /****** MoleculeRotateToPrincipalAxisSystemAction *****/ … … 48 52 {} 49 53 50 void MoleculeRotateToPrincipalAxisSystem() { 54 void MoleculeRotateToPrincipalAxisSystem(Vector &Axis) { 55 ValueStorage::getInstance().setCurrentValue(MoleculeRotateToPrincipalAxisSystemAction::NAME, Axis); 51 56 ActionRegistry::getInstance().getActionByName(MoleculeRotateToPrincipalAxisSystemAction::NAME)->call(Action::NonInteractive); 52 57 }; 53 58 54 Dialog* MoleculeRotateToPrincipalAxisSystemAction:: createDialog() {55 Dialog *dialog = UIFactory::getInstance().makeDialog();59 Dialog* MoleculeRotateToPrincipalAxisSystemAction::fillDialog(Dialog *dialog) { 60 ASSERT(dialog,"No Dialog given when filling action dialog"); 56 61 57 dialog->query Empty(NAME, MapOfActions::getInstance().getDescription(NAME));62 dialog->queryVector(NAME, false, MapOfActions::getInstance().getDescription(NAME)); 58 63 59 64 return dialog; … … 62 67 Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performCall() { 63 68 molecule *mol = NULL; 69 Vector Axis; 70 71 // obtain axis to rotate to 72 ValueStorage::getInstance().queryCurrentValue(NAME, Axis); 64 73 65 74 for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) { 66 75 mol = iter->second; 67 76 DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl); 68 mol->PrincipalAxisSystem(true); 77 Matrix InertiaTensor; 78 Vector *CenterOfGravity = mol->DetermineCenterOfGravity(); 79 80 // reset inertia tensor 81 InertiaTensor.zero(); 82 83 // sum up inertia tensor 84 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 85 Vector x = (*iter)->getPosition(); 86 x -= *CenterOfGravity; 87 const double mass = (*iter)->getType()->mass; 88 InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]); 89 InertiaTensor.at(0,1) += mass*(-x[0]*x[1]); 90 InertiaTensor.at(0,2) += mass*(-x[0]*x[2]); 91 InertiaTensor.at(1,0) += mass*(-x[1]*x[0]); 92 InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]); 93 InertiaTensor.at(1,2) += mass*(-x[1]*x[2]); 94 InertiaTensor.at(2,0) += mass*(-x[2]*x[0]); 95 InertiaTensor.at(2,1) += mass*(-x[2]*x[1]); 96 InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]); 97 } 98 // print InertiaTensor for debugging 99 DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl); 100 101 // diagonalize to determine principal axis system 102 Vector Eigenvalues = InertiaTensor.transformToEigenbasis(); 103 104 for(int i=0;i<NDIM;i++) 105 DoLog(0) && (Log() << Verbose(0) << "eigenvalue = " << Eigenvalues[i] << ", eigenvector = " << InertiaTensor.column(i) << endl); 106 107 // check whether we rotate or not 108 DoLog(0) && (Log() << Verbose(0) << "Transforming molecule into PAS ... "); 109 110 // obtain first column, eigenvector to biggest eigenvalue 111 Vector BiggestEigenvector(InertiaTensor.column(Eigenvalues.SmallestComponent())); 112 Vector DesiredAxis(Axis); 113 114 // Creation Line that is the rotation axis 115 DesiredAxis.VectorProduct(BiggestEigenvector); 116 Line RotationAxis(Vector(0.,0.,0.), DesiredAxis); 117 118 // determine angle 119 const double alpha = BiggestEigenvector.Angle(Axis); 120 121 DoLog(0) && (Log() << Verbose(0) << alpha << endl); 122 123 for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) { 124 *(*iter) -= *CenterOfGravity; 125 (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), alpha)); 126 *(*iter) += *CenterOfGravity; 127 } 128 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 129 130 // summing anew for debugging (resulting matrix has to be diagonal!) 131 // reset inertia tensor 132 InertiaTensor.zero(); 133 134 // sum up inertia tensor 135 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 136 Vector x = (*iter)->getPosition(); 137 x -= *CenterOfGravity; 138 const double mass = (*iter)->getType()->mass; 139 InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]); 140 InertiaTensor.at(0,1) += mass*(-x[0]*x[1]); 141 InertiaTensor.at(0,2) += mass*(-x[0]*x[2]); 142 InertiaTensor.at(1,0) += mass*(-x[1]*x[0]); 143 InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]); 144 InertiaTensor.at(1,2) += mass*(-x[1]*x[2]); 145 InertiaTensor.at(2,0) += mass*(-x[2]*x[0]); 146 InertiaTensor.at(2,1) += mass*(-x[2]*x[1]); 147 InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]); 148 // print InertiaTensor for debugging 149 DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl); 150 } 151 152 // free everything 153 delete(CenterOfGravity); 69 154 } 70 155 return Action::success; -
src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp
rd74077 r8f4df1 13 13 14 14 class MoleculeListClass; 15 class Vector; 15 16 16 void MoleculeRotateToPrincipalAxisSystem( );17 void MoleculeRotateToPrincipalAxisSystem(Vector &Axis); 17 18 18 19 class MoleculeRotateToPrincipalAxisSystemAction : public Action { 19 friend void MoleculeRotateToPrincipalAxisSystem( );20 friend void MoleculeRotateToPrincipalAxisSystem(Vector &Axis); 20 21 21 22 public: … … 27 28 28 29 virtual const std::string getName(); 30 protected: 31 virtual Dialog * fillDialog(Dialog *dialog); 29 32 private: 30 virtual Dialog * createDialog();31 33 virtual Action::state_ptr performCall(); 32 34 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/SaveAdjacencyAction.cpp
rd74077 r8f4df1 12 12 #include "bondgraph.hpp" 13 13 #include "config.hpp" 14 #include " log.hpp"14 #include "Helpers/Log.hpp" 15 15 #include "molecule.hpp" 16 #include " verbose.hpp"16 #include "Helpers/Verbose.hpp" 17 17 #include "World.hpp" 18 18 … … 26 26 #include "UIElements/UIFactory.hpp" 27 27 #include "UIElements/Dialog.hpp" 28 #include " UIElements/ValueStorage.hpp"28 #include "Actions/ValueStorage.hpp" 29 29 30 30 /****** MoleculeSaveAdjacencyAction *****/ … … 56 56 }; 57 57 58 Dialog* MoleculeSaveAdjacencyAction:: createDialog() {59 Dialog *dialog = UIFactory::getInstance().makeDialog();58 Dialog* MoleculeSaveAdjacencyAction::fillDialog(Dialog *dialog) { 59 ASSERT(dialog,"No Dialog given when filling action dialog"); 60 60 61 61 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/SaveAdjacencyAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/SaveBondsAction.cpp
rd74077 r8f4df1 12 12 #include "bondgraph.hpp" 13 13 #include "config.hpp" 14 #include " log.hpp"14 #include "Helpers/Log.hpp" 15 15 #include "molecule.hpp" 16 #include " verbose.hpp"16 #include "Helpers/Verbose.hpp" 17 17 #include "World.hpp" 18 18 … … 26 26 #include "UIElements/UIFactory.hpp" 27 27 #include "UIElements/Dialog.hpp" 28 #include " UIElements/ValueStorage.hpp"28 #include "Actions/ValueStorage.hpp" 29 29 30 30 /****** MoleculeSaveBondsAction *****/ … … 56 56 }; 57 57 58 Dialog* MoleculeSaveBondsAction:: createDialog() {59 Dialog *dialog = UIFactory::getInstance().makeDialog();58 Dialog* MoleculeSaveBondsAction::fillDialog(Dialog *dialog) { 59 ASSERT(dialog,"No Dialog given when filling action dialog"); 60 60 61 61 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/SaveBondsAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/SaveTemperatureAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/MoleculeAction/SaveTemperatureAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"12 #include "Helpers/Log.hpp" 13 13 #include "molecule.hpp" 14 #include " verbose.hpp"14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 /****** MoleculeSaveTemperatureAction *****/ … … 53 53 }; 54 54 55 Dialog* MoleculeSaveTemperatureAction:: createDialog() {56 Dialog *dialog = UIFactory::getInstance().makeDialog();55 Dialog* MoleculeSaveTemperatureAction::fillDialog(Dialog *dialog) { 56 ASSERT(dialog,"No Dialog given when filling action dialog"); 57 57 58 58 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/SaveTemperatureAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/SuspendInWaterAction.cpp
rd74077 r8f4df1 12 12 #include "boundary.hpp" 13 13 #include "config.hpp" 14 #include " log.hpp"15 #include " verbose.hpp"14 #include "Helpers/Log.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 /****** MoleculeSuspendInWaterAction *****/ … … 53 53 }; 54 54 55 Dialog* MoleculeSuspendInWaterAction:: createDialog() {56 Dialog *dialog = UIFactory::getInstance().makeDialog();55 Dialog* MoleculeSuspendInWaterAction::fillDialog(Dialog *dialog) { 56 ASSERT(dialog,"No Dialog given when filling action dialog"); 57 57 58 58 dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/SuspendInWaterAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/TranslateAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/MoleculeAction/TranslateAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"12 #include "Helpers/Log.hpp" 13 13 #include "molecule.hpp" 14 #include " vector.hpp"15 #include " verbose.hpp"14 #include "LinearAlgebra/Vector.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 24 24 #include "UIElements/UIFactory.hpp" 25 25 #include "UIElements/Dialog.hpp" 26 #include " UIElements/ValueStorage.hpp"26 #include "Actions/ValueStorage.hpp" 27 27 28 28 /****** MoleculeTranslateAction *****/ … … 55 55 }; 56 56 57 Dialog* MoleculeTranslateAction:: createDialog() {58 Dialog *dialog = UIFactory::getInstance().makeDialog();57 Dialog* MoleculeTranslateAction::fillDialog(Dialog *dialog) { 58 ASSERT(dialog,"No Dialog given when filling action dialog"); 59 59 60 60 dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/TranslateAction.hpp
rd74077 r8f4df1 11 11 #include "Actions/Action.hpp" 12 12 #include "Actions/Process.hpp" 13 #include " vector.hpp"13 #include "LinearAlgebra/Vector.hpp" 14 14 15 15 class MoleculeListClass; … … 28 28 29 29 virtual const std::string getName(); 30 protected: 31 virtual Dialog * fillDialog(Dialog *dialog); 30 32 private: 31 virtual Dialog * createDialog();32 33 virtual Action::state_ptr performCall(); 33 34 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/MoleculeAction/VerletIntegrationAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/MoleculeAction/VerletIntegrationAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"12 #include "Helpers/Log.hpp" 13 13 #include "molecule.hpp" 14 #include " verbose.hpp"14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 /****** MoleculeVerletIntegrationAction *****/ … … 53 53 }; 54 54 55 Dialog* MoleculeVerletIntegrationAction:: createDialog() {56 Dialog *dialog = UIFactory::getInstance().makeDialog();55 Dialog* MoleculeVerletIntegrationAction::fillDialog(Dialog *dialog) { 56 ASSERT(dialog,"No Dialog given when filling action dialog"); 57 57 58 58 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/MoleculeAction/VerletIntegrationAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/ParserAction/LoadXyzAction.cpp
rd74077 r8f4df1 14 14 #include "Parser/XyzParser.hpp" 15 15 #include "atom.hpp" 16 #include " log.hpp"16 #include "Helpers/Log.hpp" 17 17 #include "molecule.hpp" 18 #include " verbose.hpp"18 #include "Helpers/Verbose.hpp" 19 19 #include "World.hpp" 20 20 … … 26 26 #include "UIElements/UIFactory.hpp" 27 27 #include "UIElements/Dialog.hpp" 28 #include " UIElements/ValueStorage.hpp"28 #include "Actions/ValueStorage.hpp" 29 29 30 30 /****** ParserLoadXyzAction *****/ … … 56 56 }; 57 57 58 Dialog* ParserLoadXyzAction:: createDialog() {59 Dialog *dialog = UIFactory::getInstance().makeDialog();58 Dialog* ParserLoadXyzAction::fillDialog(Dialog *dialog) { 59 ASSERT(dialog,"No Dialog given when filling action dialog"); 60 60 61 61 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/ParserAction/LoadXyzAction.hpp
rd74077 r8f4df1 25 25 26 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/ParserAction/SaveXyzAction.cpp
rd74077 r8f4df1 21 21 #include "UIElements/UIFactory.hpp" 22 22 #include "UIElements/Dialog.hpp" 23 #include " UIElements/ValueStorage.hpp"23 #include "Actions/ValueStorage.hpp" 24 24 25 25 … … 52 52 }; 53 53 54 Dialog* ParserSaveXyzAction:: createDialog() {55 Dialog *dialog = UIFactory::getInstance().makeDialog();54 Dialog* ParserSaveXyzAction::fillDialog(Dialog *dialog) { 55 ASSERT(dialog,"No Dialog given when filling action dialog"); 56 56 57 57 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/ParserAction/SaveXyzAction.hpp
rd74077 r8f4df1 25 25 26 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/SelectionAction/AllAtomsAction.cpp
rd74077 r8f4df1 12 12 #include "Descriptors/AtomDescriptor.hpp" 13 13 #include "atom.hpp" 14 #include " log.hpp"15 #include " verbose.hpp"14 #include "Helpers/Log.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 … … 49 49 }; 50 50 51 Dialog* SelectionAllAtomsAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* SelectionAllAtomsAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/SelectionAction/AllAtomsAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog* createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/SelectionAction/AllMoleculesAction.cpp
rd74077 r8f4df1 12 12 #include "Descriptors/MoleculeDescriptor.hpp" 13 13 #include "atom.hpp" 14 #include " log.hpp"15 #include " verbose.hpp"14 #include "Helpers/Log.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 … … 49 49 }; 50 50 51 Dialog* SelectionAllMoleculesAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* SelectionAllMoleculesAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/SelectionAction/AllMoleculesAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog* createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/SelectionAction/AtomByIdAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "atom.hpp" 13 #include " log.hpp"14 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 … … 49 49 }; 50 50 51 Dialog* SelectionAtomByIdAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* SelectionAtomByIdAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/SelectionAction/AtomByIdAction.hpp
rd74077 r8f4df1 26 26 27 27 virtual const std::string getName(); 28 protected: 29 virtual Dialog * fillDialog(Dialog *dialog); 28 30 private: 29 virtual Dialog* createDialog();30 31 virtual Action::state_ptr performCall(); 31 32 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/SelectionAction/MoleculeByIdAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "molecule.hpp" 13 #include " log.hpp"14 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 … … 49 49 }; 50 50 51 Dialog* SelectionMoleculeByIdAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* SelectionMoleculeByIdAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryMolecule(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/SelectionAction/MoleculeByIdAction.hpp
rd74077 r8f4df1 26 26 27 27 virtual const std::string getName(); 28 protected: 29 virtual Dialog * fillDialog(Dialog *dialog); 28 30 private: 29 virtual Dialog* createDialog();30 31 virtual Action::state_ptr performCall(); 31 32 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/SelectionAction/NotAllAtomsAction.cpp
rd74077 r8f4df1 12 12 #include "Descriptors/AtomDescriptor.hpp" 13 13 #include "atom.hpp" 14 #include " log.hpp"15 #include " verbose.hpp"14 #include "Helpers/Log.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 28 28 // memento to remember the state when undoing 29 29 30 class Selection AllAtomsState : public ActionState {30 class SelectionNotAllAtomsState : public ActionState { 31 31 public: 32 Selection AllAtomsState(std::vector<atom*> _selectedAtoms) :32 SelectionNotAllAtomsState(std::vector<atom*> _selectedAtoms) : 33 33 selectedAtoms(_selectedAtoms) 34 34 {} … … 49 49 }; 50 50 51 Dialog* SelectionNotAllAtomsAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* SelectionNotAllAtomsAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); … … 61 61 DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms." << endl); 62 62 World::getInstance().clearAtomSelection(); 63 return Action::state_ptr(new Selection AllAtomsState(selectedAtoms));63 return Action::state_ptr(new SelectionNotAllAtomsState(selectedAtoms)); 64 64 } 65 65 66 66 Action::state_ptr SelectionNotAllAtomsAction::performUndo(Action::state_ptr _state) { 67 Selection AllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());67 SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get()); 68 68 69 69 World::getInstance().clearAtomSelection(); … … 71 71 World::getInstance().selectAtom(*iter); 72 72 73 return Action::state_ptr(new Selection AllAtomsState(state->selectedAtoms));73 return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms)); 74 74 } 75 75 76 76 Action::state_ptr SelectionNotAllAtomsAction::performRedo(Action::state_ptr _state){ 77 Selection AllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());77 SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get()); 78 78 79 79 World::getInstance().clearAtomSelection(); 80 80 81 return Action::state_ptr(new Selection AllAtomsState(state->selectedAtoms));81 return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms)); 82 82 } 83 83 -
src/Actions/SelectionAction/NotAllAtomsAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog* createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/SelectionAction/NotAllMoleculesAction.cpp
rd74077 r8f4df1 12 12 #include "Descriptors/MoleculeDescriptor.hpp" 13 13 #include "atom.hpp" 14 #include " log.hpp"15 #include " verbose.hpp"14 #include "Helpers/Log.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 … … 49 49 }; 50 50 51 Dialog* SelectionNotAllMoleculesAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* SelectionNotAllMoleculesAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/SelectionAction/NotAllMoleculesAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog* createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/SelectionAction/NotAtomByIdAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "atom.hpp" 13 #include " log.hpp"14 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 … … 49 49 }; 50 50 51 Dialog* SelectionNotAtomByIdAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* SelectionNotAtomByIdAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/SelectionAction/NotAtomByIdAction.hpp
rd74077 r8f4df1 26 26 27 27 virtual const std::string getName(); 28 protected: 29 virtual Dialog * fillDialog(Dialog *dialog); 28 30 private: 29 virtual Dialog* createDialog();30 31 virtual Action::state_ptr performCall(); 31 32 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/SelectionAction/NotMoleculeByIdAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "molecule.hpp" 13 #include " log.hpp"14 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 … … 49 49 }; 50 50 51 Dialog* SelectionNotMoleculeByIdAction:: createDialog() {52 Dialog *dialog = UIFactory::getInstance().makeDialog();51 Dialog* SelectionNotMoleculeByIdAction::fillDialog(Dialog *dialog) { 52 ASSERT(dialog,"No Dialog given when filling action dialog"); 53 53 54 54 dialog->queryMolecule(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/SelectionAction/NotMoleculeByIdAction.hpp
rd74077 r8f4df1 26 26 27 27 virtual const std::string getName(); 28 protected: 29 virtual Dialog * fillDialog(Dialog *dialog); 28 30 private: 29 virtual Dialog* createDialog();30 31 virtual Action::state_ptr performCall(); 31 32 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/TesselationAction/ConvexEnvelopeAction.cpp
rd74077 r8f4df1 13 13 #include "config.hpp" 14 14 #include "linkedcell.hpp" 15 #include " log.hpp"15 #include "Helpers/Log.hpp" 16 16 #include "molecule.hpp" 17 #include " verbose.hpp"17 #include "Helpers/Verbose.hpp" 18 18 #include "World.hpp" 19 19 … … 25 25 #include "UIElements/UIFactory.hpp" 26 26 #include "UIElements/Dialog.hpp" 27 #include " UIElements/ValueStorage.hpp"27 #include "Actions/ValueStorage.hpp" 28 28 29 29 /****** TesselationConvexEnvelopeAction *****/ … … 56 56 }; 57 57 58 Dialog* TesselationConvexEnvelopeAction:: createDialog() {59 Dialog *dialog = UIFactory::getInstance().makeDialog();58 Dialog* TesselationConvexEnvelopeAction::fillDialog(Dialog *dialog) { 59 ASSERT(dialog,"No Dialog given when filling action dialog"); 60 60 61 61 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/TesselationAction/ConvexEnvelopeAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp
rd74077 r8f4df1 12 12 #include "boundary.hpp" 13 13 #include "linkedcell.hpp" 14 #include " log.hpp"14 #include "Helpers/Log.hpp" 15 15 #include "molecule.hpp" 16 #include " verbose.hpp"16 #include "Helpers/Verbose.hpp" 17 17 #include "World.hpp" 18 18 … … 24 24 #include "UIElements/UIFactory.hpp" 25 25 #include "UIElements/Dialog.hpp" 26 #include " UIElements/ValueStorage.hpp"26 #include "Actions/ValueStorage.hpp" 27 27 28 28 /****** TesselationNonConvexEnvelopeAction *****/ … … 55 55 }; 56 56 57 Dialog* TesselationNonConvexEnvelopeAction:: createDialog() {58 Dialog *dialog = UIFactory::getInstance().makeDialog();57 Dialog* TesselationNonConvexEnvelopeAction::fillDialog(Dialog *dialog) { 58 ASSERT(dialog,"No Dialog given when filling action dialog"); 59 59 60 60 dialog->queryDouble(NAME, MapOfActions::getInstance().getDescription(NAME)); -
src/Actions/TesselationAction/NonConvexEnvelopeAction.hpp
rd74077 r8f4df1 27 27 28 28 virtual const std::string getName(); 29 protected: 30 virtual Dialog * fillDialog(Dialog *dialog); 29 31 private: 30 virtual Dialog * createDialog();31 32 virtual Action::state_ptr performCall(); 32 33 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/AddEmptyBoundaryAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "atom.hpp" 13 #include " log.hpp"14 #include " vector.hpp"13 #include "Helpers/Log.hpp" 14 #include "LinearAlgebra/Vector.hpp" 15 15 #include "World.hpp" 16 16 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 #include "Helpers/Assert.hpp" 27 27 … … 40 40 }; 41 41 42 Dialog* WorldAddEmptyBoundaryAction:: createDialog() {43 Dialog *dialog = UIFactory::getInstance().makeDialog();42 Dialog* WorldAddEmptyBoundaryAction::fillDialog(Dialog *dialog) { 43 ASSERT(dialog,"No Dialog given when filling action dialog"); 44 44 45 45 dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/AddEmptyBoundaryAction.hpp
rd74077 r8f4df1 10 10 11 11 #include "Actions/Action.hpp" 12 #include " vector.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 13 14 14 void WorldAddEmptyBoundary(Vector &boundary); … … 25 25 26 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/BoundInBoxAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/WorldAction/BoundInBoxAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"12 #include "Helpers/Log.hpp" 13 13 #include "molecule.hpp" 14 14 #include "World.hpp" … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 const char WorldBoundInBoxAction::NAME[] = "bound-in-box"; … … 37 37 }; 38 38 39 Dialog* WorldBoundInBoxAction:: createDialog() {40 Dialog *dialog = UIFactory::getInstance().makeDialog();39 Dialog* WorldBoundInBoxAction::fillDialog(Dialog *dialog) { 40 ASSERT(dialog,"No Dialog given when filling action dialog"); 41 41 42 42 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/BoundInBoxAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/CenterInBoxAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "Box.hpp" 13 #include " log.hpp"13 #include "Helpers/Log.hpp" 14 14 #include "molecule.hpp" 15 15 #include "World.hpp" … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 const char WorldCenterInBoxAction::NAME[] = "center-in-box"; … … 38 38 }; 39 39 40 Dialog* WorldCenterInBoxAction:: createDialog() {41 Dialog *dialog = UIFactory::getInstance().makeDialog();40 Dialog* WorldCenterInBoxAction::fillDialog(Dialog *dialog) { 41 ASSERT(dialog,"No Dialog given when filling action dialog"); 42 42 43 43 dialog->queryBox(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/CenterInBoxAction.hpp
rd74077 r8f4df1 25 25 26 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/CenterOnEdgeAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "atom.hpp" 13 #include " log.hpp"14 #include " vector.hpp"13 #include "Helpers/Log.hpp" 14 #include "LinearAlgebra/Vector.hpp" 15 15 #include "World.hpp" 16 #include " Matrix.hpp"16 #include "LinearAlgebra/Matrix.hpp" 17 17 18 18 #include <iostream> … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 #include "Helpers/Assert.hpp" 27 27 … … 39 39 }; 40 40 41 Dialog* WorldCenterOnEdgeAction:: createDialog() {42 Dialog *dialog = UIFactory::getInstance().makeDialog();41 Dialog* WorldCenterOnEdgeAction::fillDialog(Dialog *dialog) { 42 ASSERT(dialog,"No Dialog given when filling action dialog"); 43 43 44 44 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/CenterOnEdgeAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/ChangeBoxAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/WorldAction/ChangeBoxAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"13 #include " verbose.hpp"12 #include "Helpers/Log.hpp" 13 #include "Helpers/Verbose.hpp" 14 14 #include "World.hpp" 15 15 #include "Box.hpp" 16 #include " Matrix.hpp"16 #include "LinearAlgebra/Matrix.hpp" 17 17 18 18 #include <iostream> … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 const char WorldChangeBoxAction::NAME[] = "change-box"; … … 39 39 }; 40 40 41 Dialog* WorldChangeBoxAction:: createDialog() {42 Dialog *dialog = UIFactory::getInstance().makeDialog();41 Dialog* WorldChangeBoxAction::fillDialog(Dialog *dialog) { 42 ASSERT(dialog,"No Dialog given when filling action dialog"); 43 43 44 44 dialog->queryBox(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/ChangeBoxAction.hpp
rd74077 r8f4df1 25 25 26 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/InputAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/WorldAction/InputAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"12 #include "Helpers/Log.hpp" 13 13 #include "molecule.hpp" 14 14 #include "Parser/FormatParserStorage.hpp" 15 15 #include "Parser/PcpParser.hpp" 16 #include " verbose.hpp"16 #include "Helpers/Verbose.hpp" 17 17 #include "World.hpp" 18 18 … … 24 24 #include "UIElements/UIFactory.hpp" 25 25 #include "UIElements/Dialog.hpp" 26 #include " UIElements/ValueStorage.hpp"26 #include "Actions/ValueStorage.hpp" 27 27 28 28 const char WorldInputAction::NAME[] = "input"; … … 40 40 }; 41 41 42 Dialog* WorldInputAction:: createDialog() {43 Dialog *dialog = UIFactory::getInstance().makeDialog();42 Dialog* WorldInputAction::fillDialog(Dialog *dialog) { 43 ASSERT(dialog,"No Dialog given when filling action dialog"); 44 44 45 45 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/InputAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/OutputAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "Parser/ChangeTracker.hpp" 13 #include " log.hpp"14 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 const char WorldOutputAction::NAME[] = "output"; … … 37 37 }; 38 38 39 Dialog* WorldOutputAction:: createDialog() {40 Dialog *dialog = UIFactory::getInstance().makeDialog();39 Dialog* WorldOutputAction::fillDialog(Dialog *dialog) { 40 ASSERT(dialog,"No Dialog given when filling action dialog"); 41 41 42 42 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/OutputAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
rd74077 r8f4df1 12 12 #include "Descriptors/AtomDescriptor.hpp" 13 13 #include "atom.hpp" 14 #include "element.hpp" 15 #include "log.hpp" 14 #include "Helpers/Log.hpp" 16 15 #include "molecule.hpp" 17 #include " vector.hpp"18 #include " verbose.hpp"16 #include "LinearAlgebra/Vector.hpp" 17 #include "Helpers/Verbose.hpp" 19 18 #include "World.hpp" 20 19 … … 26 25 #include "UIElements/UIFactory.hpp" 27 26 #include "UIElements/Dialog.hpp" 28 #include " UIElements/ValueStorage.hpp"27 #include "Actions/ValueStorage.hpp" 29 28 30 29 const char WorldRemoveSphereOfAtomsAction::NAME[] = "remove-sphere"; … … 43 42 }; 44 43 45 Dialog* WorldRemoveSphereOfAtomsAction:: createDialog() {46 Dialog *dialog = UIFactory::getInstance().makeDialog();44 Dialog* WorldRemoveSphereOfAtomsAction::fillDialog(Dialog *dialog) { 45 ASSERT(dialog,"No Dialog given when filling action dialog"); 47 46 48 47 dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/RemoveSphereOfAtomsAction.hpp
rd74077 r8f4df1 10 10 11 11 #include "Actions/Action.hpp" 12 #include " vector.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 13 14 14 … … 26 26 27 27 virtual const std::string getName(); 28 protected: 29 virtual Dialog * fillDialog(Dialog *dialog); 28 30 private: 29 virtual Dialog * createDialog();30 31 virtual Action::state_ptr performCall(); 31 32 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/RepeatBoxAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "atom.hpp" 13 #include " log.hpp"13 #include "Helpers/Log.hpp" 14 14 #include "molecule.hpp" 15 #include " vector.hpp"16 #include " Matrix.hpp"17 #include " verbose.hpp"15 #include "LinearAlgebra/Vector.hpp" 16 #include "LinearAlgebra/Matrix.hpp" 17 #include "Helpers/Verbose.hpp" 18 18 #include "World.hpp" 19 19 #include "Box.hpp" … … 27 27 #include "UIElements/UIFactory.hpp" 28 28 #include "UIElements/Dialog.hpp" 29 #include " UIElements/ValueStorage.hpp"29 #include "Actions/ValueStorage.hpp" 30 30 #include "Descriptors/MoleculeDescriptor.hpp" 31 31 #include "Descriptors/MoleculePtrDescriptor.hpp" … … 45 45 }; 46 46 47 Dialog * WorldRepeatBoxAction:: createDialog() {48 Dialog *dialog = UIFactory::getInstance().makeDialog();47 Dialog * WorldRepeatBoxAction::fillDialog(Dialog *dialog) { 48 ASSERT(dialog,"No Dialog given when filling action dialog"); 49 49 50 50 dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/RepeatBoxAction.hpp
rd74077 r8f4df1 10 10 11 11 #include "Actions/Action.hpp" 12 #include " vector.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 13 14 14 void WorldRepeatBox(Vector &Repeater); … … 25 25 26 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/ScaleBoxAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "atom.hpp" 13 #include " log.hpp"14 #include " vector.hpp"15 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "LinearAlgebra/Vector.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 #include "Box.hpp" 18 #include " Matrix.hpp"18 #include "LinearAlgebra/Matrix.hpp" 19 19 20 20 #include <iostream> … … 25 25 #include "UIElements/UIFactory.hpp" 26 26 #include "UIElements/Dialog.hpp" 27 #include " UIElements/ValueStorage.hpp"27 #include "Actions/ValueStorage.hpp" 28 28 29 29 const char WorldScaleBoxAction::NAME[] = "scale-box"; … … 41 41 }; 42 42 43 Dialog* WorldScaleBoxAction:: createDialog() {44 Dialog *dialog = UIFactory::getInstance().makeDialog();43 Dialog* WorldScaleBoxAction::fillDialog(Dialog *dialog) { 44 ASSERT(dialog,"No Dialog given when filling action dialog"); 45 45 46 46 dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/ScaleBoxAction.hpp
rd74077 r8f4df1 10 10 11 11 #include "Actions/Action.hpp" 12 #include " vector.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 13 14 14 void WorldScaleBox(Vector &Scaler); … … 25 25 26 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 27 29 private: 28 virtual Dialog * createDialog();29 30 virtual Action::state_ptr performCall(); 30 31 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/SetDefaultNameAction.cpp
rd74077 r8f4df1 10 10 #include "Actions/WorldAction/SetDefaultNameAction.hpp" 11 11 #include "Actions/ActionRegistry.hpp" 12 #include " log.hpp"13 #include " verbose.hpp"12 #include "Helpers/Log.hpp" 13 #include "Helpers/Verbose.hpp" 14 14 #include "World.hpp" 15 15 … … 21 21 #include "UIElements/UIFactory.hpp" 22 22 #include "UIElements/Dialog.hpp" 23 #include " UIElements/ValueStorage.hpp"23 #include "Actions/ValueStorage.hpp" 24 24 25 25 … … 48 48 }; 49 49 50 Dialog* WorldSetDefaultNameAction:: createDialog() {51 Dialog *dialog = UIFactory::getInstance().makeDialog();50 Dialog* WorldSetDefaultNameAction::fillDialog(Dialog *dialog) { 51 ASSERT(dialog,"No Dialog given when filling action dialog"); 52 52 53 53 string defaultname = World::getInstance().getDefaultName(); … … 79 79 80 80 Action::state_ptr WorldSetDefaultNameAction::performRedo(Action::state_ptr _state){ 81 performUndo(_state);81 return performUndo(_state); 82 82 } 83 83 -
src/Actions/WorldAction/SetDefaultNameAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/SetGaussianBasisAction.cpp
rd74077 r8f4df1 11 11 #include "Actions/ActionRegistry.hpp" 12 12 #include "config.hpp" 13 #include " log.hpp"14 #include " verbose.hpp"13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 15 #include "World.hpp" 16 16 … … 22 22 #include "UIElements/UIFactory.hpp" 23 23 #include "UIElements/Dialog.hpp" 24 #include " UIElements/ValueStorage.hpp"24 #include "Actions/ValueStorage.hpp" 25 25 26 26 … … 50 50 }; 51 51 52 Dialog* WorldSetGaussianBasisAction:: createDialog() {53 Dialog *dialog = UIFactory::getInstance().makeDialog();52 Dialog* WorldSetGaussianBasisAction::fillDialog(Dialog *dialog) { 53 ASSERT(dialog,"No Dialog given when filling action dialog"); 54 54 55 55 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); … … 79 79 80 80 Action::state_ptr WorldSetGaussianBasisAction::performRedo(Action::state_ptr _state){ 81 performUndo(_state);81 return performUndo(_state); 82 82 } 83 83 -
src/Actions/WorldAction/SetGaussianBasisAction.hpp
rd74077 r8f4df1 24 24 25 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 26 28 private: 27 virtual Dialog * createDialog();28 29 virtual Action::state_ptr performCall(); 29 30 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/Actions/WorldAction/SetOutputFormatsAction.cpp
rd74077 r8f4df1 12 12 #include "Parser/ChangeTracker.hpp" 13 13 #include "Parser/FormatParserStorage.hpp" 14 #include " log.hpp"15 #include " verbose.hpp"14 #include "Helpers/Log.hpp" 15 #include "Helpers/Verbose.hpp" 16 16 #include "World.hpp" 17 17 … … 23 23 #include "UIElements/UIFactory.hpp" 24 24 #include "UIElements/Dialog.hpp" 25 #include " UIElements/ValueStorage.hpp"25 #include "Actions/ValueStorage.hpp" 26 26 27 27 const char WorldSetOutputFormatsAction::NAME[] = "set-output"; … … 39 39 }; 40 40 41 Dialog* WorldSetOutputFormatsAction:: createDialog() {42 Dialog *dialog = UIFactory::getInstance().makeDialog();41 Dialog* WorldSetOutputFormatsAction::fillDialog(Dialog *dialog) { 42 ASSERT(dialog,"No Dialog given when filling action dialog"); 43 43 44 44 dialog->queryStrings(NAME, ValueStorage::getInstance().getDescription(NAME)); -
src/Actions/WorldAction/SetOutputFormatsAction.hpp
rd74077 r8f4df1 26 26 27 27 virtual const std::string getName(); 28 protected: 29 virtual Dialog * fillDialog(Dialog *dialog); 28 30 private: 29 virtual Dialog * createDialog();30 31 virtual Action::state_ptr performCall(); 31 32 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/BoundaryLineSet.cpp
rd74077 r8f4df1 15 15 16 16 #include "Helpers/Assert.hpp" 17 #include "info.hpp" 18 #include "log.hpp" 17 #include "Helpers/Info.hpp" 18 #include "Helpers/Log.hpp" 19 #include "Helpers/Verbose.hpp" 19 20 #include "tesselationhelpers.hpp" 20 #include "vector.hpp" 21 #include "verbose.hpp" 21 #include "LinearAlgebra/Vector.hpp" 22 22 23 23 using namespace std; -
src/BoundaryPointSet.cpp
rd74077 r8f4df1 15 15 16 16 #include "Helpers/Assert.hpp" 17 #include " info.hpp"18 #include " log.hpp"19 #include " vector.hpp"20 #include " verbose.hpp"17 #include "Helpers/Info.hpp" 18 #include "Helpers/Log.hpp" 19 #include "LinearAlgebra/Vector.hpp" 20 #include "Helpers/Verbose.hpp" 21 21 22 22 using namespace std; -
src/BoundaryPolygonSet.cpp
rd74077 r8f4df1 16 16 17 17 #include "Helpers/Assert.hpp" 18 #include " helpers.hpp"19 #include " info.hpp"20 #include " log.hpp"21 #include " Plane.hpp"22 #include " vector.hpp"23 #include " verbose.hpp"18 #include "Helpers/helpers.hpp" 19 #include "Helpers/Info.hpp" 20 #include "Helpers/Log.hpp" 21 #include "LinearAlgebra/Plane.hpp" 22 #include "LinearAlgebra/Vector.hpp" 23 #include "Helpers/Verbose.hpp" 24 24 25 25 using namespace std; -
src/BoundaryTriangleSet.cpp
rd74077 r8f4df1 15 15 16 16 #include "Helpers/Assert.hpp" 17 #include " info.hpp"18 #include "Line .hpp"19 #include " log.hpp"20 #include " Plane.hpp"21 #include " vector.hpp"22 #include " verbose.hpp"17 #include "Helpers/Info.hpp" 18 #include "LinearAlgebra/Line.hpp" 19 #include "Helpers/Log.hpp" 20 #include "LinearAlgebra/Plane.hpp" 21 #include "LinearAlgebra/Vector.hpp" 22 #include "Helpers/Verbose.hpp" 23 23 24 24 using namespace std; -
src/BoundaryTriangleSet.hpp
rd74077 r8f4df1 10 10 11 11 #include "BoundaryMaps.hpp" 12 #include " vector.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 13 14 14 #include <set> -
src/Box.cpp
rd74077 r8f4df1 11 11 12 12 #include <cmath> 13 14 #include "Matrix.hpp" 15 #include "vector.hpp" 13 #include <iostream> 14 #include <cstdlib> 15 16 #include "LinearAlgebra/Matrix.hpp" 17 #include "LinearAlgebra/Vector.hpp" 18 #include "LinearAlgebra/Plane.hpp" 16 19 17 20 #include "Helpers/Assert.hpp" 21 22 using namespace std; 18 23 19 24 Box::Box() … … 23 28 Minv = new Matrix(); 24 29 Minv->one(); 30 conditions.resize(3); 31 conditions[0] = conditions[1] = conditions[2] = Wrap; 25 32 } 26 33 … … 28 35 M=new Matrix(*src.M); 29 36 Minv = new Matrix(*src.Minv); 37 conditions = src.conditions; 30 38 } 31 39 … … 60 68 Vector helper = translateOut(point); 61 69 for(int i=NDIM;i--;){ 62 double intpart,fracpart; 63 fracpart = modf(helper.at(i),&intpart); 64 if(fracpart<0.) 65 fracpart+=1.; 66 helper.at(i)=fracpart; 70 71 switch(conditions[i]){ 72 case Wrap: 73 helper.at(i)=fmod(helper.at(i),1); 74 helper.at(i)+=(helper.at(i)>=0)?0:1; 75 break; 76 case Bounce: 77 { 78 // there probably is a better way to handle this... 79 // all the fabs and fmod modf probably makes it very slow 80 double intpart,fracpart; 81 fracpart = modf(fabs(helper.at(i)),&intpart); 82 helper.at(i) = fabs(fracpart-fmod(intpart,2)); 83 } 84 break; 85 case Ignore: 86 break; 87 default: 88 ASSERT(0,"No default case for this"); 89 } 90 67 91 } 68 92 return translateIn(helper); … … 72 96 { 73 97 bool result = true; 74 Vector tester = (*Minv) * point;98 Vector tester = translateOut(point); 75 99 76 100 for(int i=0;i<NDIM;i++) 77 result = result && ((tester[i] >= -MYEPSILON) && ((tester[i] - 1.) < MYEPSILON)); 101 result = result && 102 ((conditions[i] == Ignore) || 103 ((tester[i] >= -MYEPSILON) && 104 ((tester[i] - 1.) < MYEPSILON))); 78 105 79 106 return result; … … 82 109 83 110 VECTORSET(std::list) Box::explode(const Vector &point,int n) const{ 111 ASSERT(isInside(point),"Exploded point not inside Box"); 84 112 VECTORSET(std::list) res; 85 113 86 // translate the Vector into each of the 27 neighbourhoods 87 88 // first create all translation Vectors 89 // there are (n*2+1)^3 such vectors 90 int max_dim = (n*2+1); 91 int max_dim2 = max_dim*max_dim; 92 int max = max_dim2*max_dim; 93 // only one loop to avoid unneccessary jumps 94 for(int i = 0;i<max;++i){ 95 // get all coordinates for this iteration 96 int n1 = (i%max_dim)-n; 97 int n2 = ((i/max_dim)%max_dim)-n; 98 int n3 = ((i/max_dim2))-n; 99 Vector translation = translateIn(Vector(n1,n2,n3)); 100 res.push_back(translation); 101 } 102 // translate all the translation vector by the offset defined by point 103 res.translate(point); 114 Vector translater = translateOut(point); 115 Vector mask; // contains the ignored coordinates 116 117 // count the number of coordinates we need to do 118 int dims = 0; // number of dimensions that are not ignored 119 vector<int> coords; 120 vector<int> index; 121 for(int i=0;i<NDIM;++i){ 122 if(conditions[i]==Ignore){ 123 mask[i]=translater[i]; 124 continue; 125 } 126 coords.push_back(i); 127 index.push_back(-n); 128 dims++; 129 } // there are max vectors in total we need to create 130 131 if(!dims){ 132 // all boundaries are ignored 133 res.push_back(point); 134 return res; 135 } 136 137 bool done = false; 138 while(!done){ 139 // create this vector 140 Vector helper; 141 for(int i=0;i<dims;++i){ 142 switch(conditions[coords[i]]){ 143 case Wrap: 144 helper[coords[i]] = index[i]+translater[coords[i]]; 145 break; 146 case Bounce: 147 { 148 // Bouncing the coordinate x produces the series: 149 // 0 -> x 150 // 1 -> 2-x 151 // 2 -> 2+x 152 // 3 -> 4-x 153 // 4 -> 4+x 154 // the first number is the next bigger even number (n+n%2) 155 // the next number is the value with alternating sign (x-2*(n%2)*x) 156 // the negative numbers produce the same sequence reversed and shifted 157 int n = abs(index[i]) + ((index[i]<0)?-1:0); 158 int sign = (index[i]<0)?-1:+1; 159 int even = n%2; 160 helper[coords[i]]=n+even+translater[coords[i]]-2*even*translater[coords[i]]; 161 helper[coords[i]]*=sign; 162 } 163 break; 164 case Ignore: 165 ASSERT(0,"Ignored coordinate handled in generation loop"); 166 default: 167 ASSERT(0,"No default case for this switch-case"); 168 } 169 170 } 171 // add back all ignored coordinates (not handled in above loop) 172 helper+=mask; 173 res.push_back(translateIn(helper)); 174 // set the new indexes 175 int pos=0; 176 ++index[pos]; 177 while(index[pos]>n){ 178 index[pos++]=-n; 179 if(pos>=dims) { // it's trying to increase one beyond array... all vectors generated 180 done = true; 181 break; 182 } 183 ++index[pos]; 184 } 185 } 104 186 return res; 105 187 } 106 188 107 189 VECTORSET(std::list) Box::explode(const Vector &point) const{ 108 VECTORSET(std::list) res; 109 110 // translate the Vector into each of the 27 neighbourhoods 111 112 // first create all 27 translation Vectors 113 // these loops depend on fixed parameters and can easily be expanded 114 // by the compiler to allow code without jumps 115 for(int n1 = -1;n1<=1;++n1){ 116 for(int n2 = -1;n2<=1;++n2){ 117 for(int n3 = -1;n3<=1;++n3){ 118 // get all coordinates for this iteration 119 Vector translation = translateIn(Vector(n1,n2,n3)); 120 res.push_back(translation); 121 } 122 } 123 } 124 // translate all the translation vector by the offset defined by point 125 res.translate(point); 126 return res; 190 ASSERT(isInside(point),"Exploded point not inside Box"); 191 return explode(point,1); 127 192 } 128 193 129 194 double Box::periodicDistanceSquared(const Vector &point1,const Vector &point2) const{ 130 VECTORSET(std::list) expansion = explode(point1); 131 double res = expansion.minDistSquared(point2); 195 Vector helper1 = WrapPeriodically(point1); 196 Vector helper2 = WrapPeriodically(point2); 197 VECTORSET(std::list) expansion = explode(helper1); 198 double res = expansion.minDistSquared(helper2); 132 199 return res; 133 200 } … … 137 204 res = sqrt(periodicDistanceSquared(point1,point2)); 138 205 return res; 206 } 207 208 const Box::Conditions_t Box::getConditions(){ 209 return conditions; 210 } 211 212 void Box::setCondition(int i,Box::BoundaryCondition_t condition){ 213 conditions[i]=condition; 214 } 215 216 const vector<pair<Plane,Plane> > Box::getBoundingPlanes(){ 217 vector<pair<Plane,Plane> > res; 218 for(int i=0;i<NDIM;++i){ 219 Vector base1,base2,base3; 220 base2[(i+1)%NDIM] = 1.; 221 base3[(i+2)%NDIM] = 1.; 222 Plane p1(translateIn(base1), 223 translateIn(base2), 224 translateIn(base3)); 225 Vector offset; 226 offset[i]=1; 227 Plane p2(translateIn(base1+offset), 228 translateIn(base2+offset), 229 translateIn(base3+offset)); 230 res.push_back(make_pair(p1,p2)); 231 } 232 return res; 233 } 234 235 void Box::setCuboid(const Vector &endpoint){ 236 ASSERT(endpoint[0]>0 && endpoint[1]>0 && endpoint[2]>0,"Vector does not define a full cuboid"); 237 M->one(); 238 M->diagonal()=endpoint; 239 Vector &dinv = Minv->diagonal(); 240 for(int i=NDIM;i--;) 241 dinv[i]=1/endpoint[i]; 139 242 } 140 243 … … 145 248 M = new Matrix(*src.M); 146 249 Minv = new Matrix(*src.Minv); 250 conditions = src.conditions; 147 251 } 148 252 return *this; -
src/Box.hpp
rd74077 r8f4df1 11 11 class Matrix; 12 12 class Vector; 13 class Plane; 13 14 14 15 #include <list> 15 #include "VectorSet.hpp" 16 #include <vector> 17 #include "LinearAlgebra/VectorSet.hpp" 16 18 17 19 /** … … 26 28 { 27 29 public: 30 typedef enum{ 31 Wrap, 32 Bounce, 33 Ignore 34 } BoundaryCondition_t; 35 36 typedef vector<BoundaryCondition_t> Conditions_t; 37 28 38 Box(); 29 39 Box(const Box&); … … 89 99 double periodicDistance(const Vector &point1,const Vector &point2) const; 90 100 101 const Conditions_t getConditions(); 102 void setCondition(int,BoundaryCondition_t); 103 104 const vector<pair<Plane,Plane> > getBoundingPlanes(); 105 106 void setCuboid(const Vector&); 107 91 108 private: 109 Conditions_t conditions; 92 110 Matrix *M; //!< Defines the layout of the box 93 111 Matrix *Minv; //!< Inverse of M to avoid recomputation -
src/CandidateForTesselation.cpp
rd74077 r8f4df1 16 16 17 17 #include "Helpers/Assert.hpp" 18 #include " info.hpp"18 #include "Helpers/Info.hpp" 19 19 //#include "Line.hpp" 20 20 #include "linkedcell.hpp" 21 #include " log.hpp"21 #include "Helpers/Log.hpp" 22 22 //#include "Plane.hpp" 23 #include " vector.hpp"24 #include " verbose.hpp"23 #include "LinearAlgebra/Vector.hpp" 24 #include "Helpers/Verbose.hpp" 25 25 26 26 using namespace std; -
src/CandidateForTesselation.hpp
rd74077 r8f4df1 10 10 11 11 #include "BoundaryMaps.hpp" 12 #include " vector.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 13 14 14 #include <list> -
src/CommandLineParser.cpp
rd74077 r8f4df1 15 15 #include "Patterns/Singleton_impl.hpp" 16 16 #include "CommandLineParser.hpp" 17 #include " log.hpp"18 #include " verbose.hpp"17 #include "Helpers/Log.hpp" 18 #include "Helpers/Verbose.hpp" 19 19 20 20 using namespace std; -
src/ConfigFileBuffer.cpp
rd74077 r8f4df1 7 7 8 8 #include "ConfigFileBuffer.hpp" 9 #include " helpers.hpp"9 #include "Helpers/helpers.hpp" 10 10 #include "lists.hpp" 11 #include " verbose.hpp"12 #include " log.hpp"11 #include "Helpers/Verbose.hpp" 12 #include "Helpers/Log.hpp" 13 13 #include "World.hpp" 14 14 -
src/Descriptors/AtomDescriptor.hpp
rd74077 r8f4df1 35 35 // close coupling to the world to allow access 36 36 friend atom* World::getAtom(AtomDescriptor descriptor); 37 friend std::vector<atom*>World::getAllAtoms(AtomDescriptor descriptor);37 friend World::AtomComposite World::getAllAtoms(AtomDescriptor descriptor); 38 38 template <class,class,class> friend class SelectiveIterator; 39 39 -
src/Descriptors/AtomSelectionDescriptor.cpp
rd74077 r8f4df1 9 9 #include "Descriptors/AtomSelectionDescriptor_impl.hpp" 10 10 11 #include " helpers.hpp"11 #include "Helpers/helpers.hpp" 12 12 13 13 AtomSelectionDescriptor_impl::AtomSelectionDescriptor_impl(){} -
src/Descriptors/MoleculeSelectionDescriptor.cpp
rd74077 r8f4df1 9 9 #include "Descriptors/MoleculeSelectionDescriptor_impl.hpp" 10 10 11 #include " helpers.hpp"11 #include "Helpers/helpers.hpp" 12 12 13 13 MoleculeSelectionDescriptor_impl::MoleculeSelectionDescriptor_impl(){} -
src/Descriptors/SelectiveIterator_impl.hpp
rd74077 r8f4df1 9 9 #define SELECTIVEITERATOR_IMPL_HPP_ 10 10 11 #include " helpers.hpp"11 #include "Helpers/helpers.hpp" 12 12 13 13 template<class _Target, -
src/Formula.cpp
rd74077 r8f4df1 55 55 56 56 void Formula::fromString(const std::string &formula) throw(ParseError){ 57 // make this transactional, in case an error is thrown 58 Formula res; 59 string::const_iterator begin = formula.begin(); 60 string::const_iterator end = formula.end(); 61 res.parseFromString(begin,end,static_cast<char>(0)); 62 (*this)=res; 63 } 64 65 int Formula::parseMaybeNumber(string::const_iterator &it,string::const_iterator &end) throw(ParseError){ 66 static const range<char> Numbers = makeRange('0',static_cast<char>('9'+1)); 67 int count = 0; 68 while(it!=end && Numbers.isInRange(*it)) 69 count = (count*10) + ((*it++)-Numbers.first); 70 // one is implicit 71 count = (count!=0)?count:1; 72 return count; 73 } 74 75 void Formula::parseFromString(string::const_iterator &it,string::const_iterator &end,char delimiter) throw(ParseError){ 57 76 // some constants needed for parsing... Assumes ASCII, change if other encodings are used 58 77 static const range<char> CapitalLetters = makeRange('A',static_cast<char>('Z'+1)); 59 78 static const range<char> SmallLetters = makeRange('a',static_cast<char>('z'+1)); 60 static const range<char> Numbers = makeRange('0',static_cast<char>('9'+1)); 79 map<char,char> delimiters; 80 delimiters['('] = ')'; 81 delimiters['['] = ']'; 61 82 // clean the formula 62 83 clear(); 63 string::const_iterator end = formula.end(); // will be used frequently 64 for(string::const_iterator it=formula.begin();it!=end;){ 84 for(/*send from above*/;it!=end && *it!=delimiter;/*updated in loop*/){ 85 // we might have a sub formula 86 if(delimiters.count(*it)){ 87 Formula sub; 88 char nextdelim=delimiters[*it]; 89 sub.parseFromString(++it,end,nextdelim); 90 if(!sub.getElementCount()){ 91 throw(ParseError(__FILE__,__LINE__)); 92 } 93 int count = parseMaybeNumber(++it,end); 94 addFormula(sub,count); 95 continue; 96 } 65 97 string shorthand; 66 98 // Atom names start with a capital letter … … 71 103 while(it!=end && SmallLetters.isInRange(*it)) 72 104 shorthand+=(*it++); 73 // now we can count the occurences 74 int count = 0; 75 while(it!=end && Numbers.isInRange(*it)) 76 count = (count*10) + ((*it++)-Numbers.first); 77 // one is implicit 78 count = (count!=0)?count:1; 105 int count = parseMaybeNumber(it,end); 79 106 // test if the shorthand exists 80 107 if(!World::getInstance().getPeriode()->FindElement(shorthand)) … … 83 110 addElements(shorthand,count); 84 111 } 112 if(it==end && delimiter!=0){ 113 throw(ParseError(__FILE__,__LINE__)); 114 } 85 115 } 86 116 … … 93 123 *output << "#Ion_TypeNr.\tAmount\tZ\tRGauss\tL_Max(PP)L_Loc(PP)IonMass\t# chemical name, symbol" << endl; 94 124 for(const_iterator iter=begin(); iter!=end();++iter){ 95 (*iter).first->No = No;96 125 result = result && (*iter).first->Checkout(output, No++, (*iter).second); 97 126 } … … 195 224 } 196 225 226 void Formula::addFormula(const Formula &formula,unsigned int n){ 227 for(Formula::const_iterator iter=formula.begin();iter!=formula.end();++iter){ 228 this->addElements(iter->first,iter->second*n); 229 } 230 } 231 232 enumeration<Formula::key_type> Formula::enumerateElements() const{ 233 enumeration<key_type> res(1); 234 for(Formula::const_iterator iter=begin();iter!=end();++iter){ 235 res.add(iter->first); 236 } 237 return res; 238 } 239 197 240 const unsigned int Formula::operator[](const element *element) const{ 198 241 ASSERT(element,"Invalid pointer in access of Formula"); -
src/Formula.hpp
rd74077 r8f4df1 16 16 17 17 #include "types.hpp" 18 #include "Helpers/helpers.hpp" 18 19 19 20 class element; … … 22 23 { 23 24 public: 24 typedef element*key_type;25 typedef const element* key_type; 25 26 typedef unsigned int mapped_type; 26 27 typedef std::pair<key_type, mapped_type> value_type; … … 65 66 66 67 unsigned int getElementCount() const; 67 bool hasElement( const element*)const;68 bool hasElement(key_type) const; 68 69 bool hasElement(atomicNumber_t) const; 69 70 bool hasElement(const std::string&) const; 70 71 71 void operator+=( const element*);72 void operator+=(key_type); 72 73 void operator+=(atomicNumber_t); 73 74 void operator+=(const std::string&); 74 75 75 void operator-=( const element*);76 void operator-=(key_type); 76 77 void operator-=(atomicNumber_t); 77 78 void operator-=(const std::string&); 78 79 79 void addElements( const element*,unsigned int);80 void addElements(key_type,unsigned int); 80 81 void addElements(atomicNumber_t,unsigned int); 81 82 void addElements(const std::string&,unsigned int); 82 83 84 void addFormula(const Formula&,unsigned int); 85 86 enumeration<key_type> enumerateElements() const; 87 83 88 // only const versions, because someone might try to increment a previously 84 89 // not set element 85 const unsigned int operator[]( const element*) const;90 const unsigned int operator[](key_type) const; 86 91 const unsigned int operator[](atomicNumber_t) const; 87 92 const unsigned int operator[](std::string) const; … … 98 103 99 104 private: 105 void parseFromString(std::string::const_iterator&,std::string::const_iterator&,char) throw(ParseError); 106 int parseMaybeNumber(std::string::const_iterator &it,std::string::const_iterator &end) throw(ParseError); 100 107 // this contains all counts of elements in the formula 101 108 // the size of the actual structure might be used in comparisons -
src/Helpers/Assert.cpp
rd74077 r8f4df1 5 5 * Author: crueger 6 6 */ 7 8 #include "Helpers/MemDebug.hpp"9 7 10 8 #include "Helpers/Assert.hpp" … … 46 44 } 47 45 48 using namespace Assert;49 50 46 #ifndef NDEBUG 51 47 52 Action _my_assert::defaultAction = Ask; 53 std::vector<Assert::hook_t> _my_assert::hooks; 48 #ifdef __GNUC__ 49 #include <cstdlib> 50 #include <execinfo.h> 51 #include <cxxabi.h> 52 #endif 54 53 55 std::map<std::string,bool> _wrapper::ignores; 56 const char* _wrapper::message_ptr = "source pointer did not point to object of desired type"; 57 const char* _wrapper::message_ref = "source reference did not contain object of desired type"; 54 Assert::Action Assert::_my_assert::defaultAction = Ask; 55 std::vector<Assert::hook_t> Assert::_my_assert::hooks; 58 56 57 std::map<std::string,bool> Assert::_wrapper::ignores; 58 const char* Assert::_wrapper::message_ptr = "source pointer did not point to object of desired type"; 59 const char* Assert::_wrapper::message_ref = "source reference did not contain object of desired type"; 59 60 60 bool _my_assert::check(const bool res, 61 const char* condition, 62 const char* message, 63 const char* filename, 64 const int line, 65 bool& ignore) 61 bool Assert::_my_assert::check(const char* condition, 62 const char* message, 63 const char* filename, 64 const int line, 65 bool& ignore) 66 66 { 67 if(!res){ 68 cout << "Assertion \"" << condition << "\" failed in file " << filename << " at line " << line << endl; 69 cout << "Assertion Message: " << message << std::endl; 70 while(true){ 71 char choice; 72 if(defaultAction==Ask) { 73 cout << "Please choose: (a)bort, (t)hrow execption, (i)gnore, al(w)ays ignore" << endl; 74 cin >> choice; 75 } 76 else{ 77 choice = ActionKeys[defaultAction]; 78 } 79 switch(choice){ 80 case 'a': 81 return true; 82 break; 83 case 't': 84 throw AssertionFailure(condition,filename,line,message); 85 break; 86 case 'w': 87 ignore = true; 88 // fallthrough 89 case 'i': 90 return false; 91 break; 92 } 67 cout << "Assertion \"" << condition << "\" failed in file " << filename << " at line " << line << endl; 68 cout << "Assertion Message: " << message << std::endl; 69 while(true){ 70 char choice; 71 if(defaultAction==Assert::Ask) { 72 #ifdef __GNUC__ 73 cout << "Please choose: (a)bort, (t)hrow execption, show (b)actrace, (i)gnore, al(w)ays ignore" << endl; 74 #else 75 cout << "Please choose: (a)bort, (t)hrow execption, (i)gnore, al(w)ays ignore" << endl; 76 #endif /* __GNUC__ */ 77 cin >> choice; 78 } 79 else{ 80 choice = ActionKeys[defaultAction]; 81 } 82 switch(choice){ 83 case 'a': 84 return true; 85 break; 86 case 't': 87 throw AssertionFailure(condition,filename,line,message); 88 break; 89 #ifdef __GNUC__ 90 case 'b': 91 Assert::_my_assert::backtrace(filename,line); 92 break; 93 #endif /* __GNUC__ */ 94 case 'w': 95 ignore = true; 96 // fallthrough 97 case 'i': 98 return false; 99 break; 93 100 } 94 101 } … … 96 103 } 97 104 98 void _my_assert::doHooks(){ 105 #ifdef __GNUC__ 106 void Assert::_my_assert::backtrace(const char *file, int line){ 107 const size_t max_depth = 100; 108 void* stack_addrs[max_depth]; 109 size_t stack_depth; 110 char **stack_strings=0; 111 const char *func_name=0; 112 size_t sz = 64; 113 114 // get the backtrace 115 stack_depth = ::backtrace(stack_addrs,max_depth); 116 stack_strings = backtrace_symbols(stack_addrs, stack_depth); 117 // used later for demangling 118 // reserved here, so we can free it unconditionally 119 char *dm_function = static_cast<char*>(malloc(sz)); 120 if(!dm_function){ 121 // malloc failed... we are out of luck 122 cout << "cannot provide stack trace due to exhausted memory" << endl; 123 return; 124 } 125 126 cout << "Backtrace from " << file << "@" << line << ":" << endl; 127 128 // i=2 because we don't want this function, nor the assertion handler 129 for(unsigned int i=2;i<stack_depth-2;++i){ 130 // find the mangled function name 131 char *begin = stack_strings[i]; 132 // function name starts with a ( 133 while(*begin && *begin!='(') ++begin; 134 char *end=begin; 135 while(*end && *end!='+') ++end; 136 137 // see if we found our function name 138 if(*begin && *end){ 139 *begin++ = 0; 140 *end = 0; 141 // use the C++ demangler 142 143 int status; 144 char *func_ret = abi::__cxa_demangle(begin, dm_function, &sz, &status); 145 if(func_ret){ 146 // abi might have realloced... 147 dm_function = func_ret; 148 func_name = dm_function; 149 } 150 else{ 151 // demangling failed... get the function name without demangling 152 func_name = begin; 153 } 154 } 155 else{ 156 // function name not found... get the whole line 157 func_name = stack_strings[i]; 158 } 159 cout << func_name << endl; 160 } 161 free(dm_function); 162 free(stack_strings); // malloc()ed by backtrace_symbols 163 } 164 #endif /* __GNUC__ */ 165 166 void Assert::_my_assert::doHooks(){ 99 167 for(vector<hook_t>::reverse_iterator iter = hooks.rbegin(); iter!=hooks.rend(); ++iter ){ 100 168 (*iter)(); … … 102 170 } 103 171 104 void _my_assert::addHook(hook_t hook){172 void Assert::_my_assert::addHook(hook_t hook){ 105 173 hooks.push_back(hook); 106 174 } 107 175 108 void _my_assert::removeHook(Assert::hook_t hook){176 void Assert::_my_assert::removeHook(Assert::hook_t hook){ 109 177 for(vector<hook_t>::iterator iter = hooks.begin(); iter!=hooks.end();){ 110 178 if((*iter)==hook){ … … 117 185 } 118 186 119 void _my_assert::setDefault(Assert::Action action){187 void Assert::_my_assert::setDefault(Assert::Action action){ 120 188 defaultAction = action; 121 189 } 122 Assert::Action _my_assert::getDefault(){190 Assert::Action Assert::_my_assert::getDefault(){ 123 191 return defaultAction; 124 192 } 125 std::string _my_assert::printDefault(){193 std::string Assert::_my_assert::printDefault(){ 126 194 return ActionNames[defaultAction]; 127 195 } -
src/Helpers/Assert.hpp
rd74077 r8f4df1 234 234 static bool ignore = false;\ 235 235 if(!ignore){\ 236 if( Assert::_my_assert::check((condition),STRINGIFY(condition),(message),\237 __FILE__,__LINE__,ignore)){\236 if(!(condition) && Assert::_my_assert::check(STRINGIFY(condition),(message),\ 237 __FILE__,__LINE__,ignore)){\ 238 238 Assert::_my_assert::doHooks();\ 239 239 DEBUG_BREAK;\ … … 247 247 static bool ignore = false; \ 248 248 if(!ignore){\ 249 if(Assert::_my_assert::check( false,"Exception caught",(message),__FILE__,__LINE__,ignore)){\249 if(Assert::_my_assert::check("Exception caught",(message),__FILE__,__LINE__,ignore)){\ 250 250 Assert::_my_assert::doHooks();\ 251 DEBUG_BREAK;\251 DEBUG_BREAK;\ 252 252 }\ 253 253 }\ … … 299 299 class _my_assert{ 300 300 public: 301 static bool check(const bool res, 302 const char* condition, 301 static bool check(const char* condition, 303 302 const char* message, 304 303 const char* filename, 305 304 const int line, 306 305 bool& ignore); 306 #ifdef __GNUC__ 307 static void backtrace(const char *file, int line); 308 #endif /* __GNUC__ */ 307 309 static void addHook(Assert::hook_t hook); 308 310 static void removeHook(Assert::hook_t hook); … … 332 334 333 335 if(!ignore){ 334 if(_my_assert::check(dynamic_cast<target>(src)==static_cast<target>(src),"type-safe typecast",335 message_ptr,file,line,ignore)){336 bool res = dynamic_cast<target>(src)==static_cast<target>(src); 337 if(!res && _my_assert::check("type-safe typecast",message_ptr,file,line,ignore)){ 336 338 _my_assert::doHooks(); 337 339 DEBUG_BREAK; … … 354 356 catch(...){ 355 357 if(!ignore){ 356 if(_my_assert::check( 0,"type-safe typecast",message_ref,file,line,ignore)){358 if(_my_assert::check("type-safe typecast",message_ref,file,line,ignore)){ 357 359 _my_assert::doHooks(); 358 360 DEBUG_BREAK; -
src/Helpers/MemDebug.cpp
rd74077 r8f4df1 72 72 // all allocated memory blocks 73 73 struct entry_t { 74 typedef unsigned int checksum_t; 74 75 // we seperate the tracking info from the rest 75 76 // A checksum will be calculated for this part of … … 90 91 } info; 91 92 bool isIgnored; 92 ch archecksum;93 checksum_t checksum; 93 94 entry_t *prev; 94 95 entry_t *next; … … 117 118 // calculates a simple checksum for the info block 118 119 // the checksum is used to find memory corruptions 119 inline charcalcChecksum(entry_t::info_t *info){120 inline entry_t::checksum_t calcChecksum(entry_t::info_t *info){ 120 121 char *buffer = (char*)info; 121 charchecksum =0;122 entry_t::checksum_t checksum =0; 122 123 for(size_t i=0;i<sizeof(entry_t::info_t);i++){ 123 124 checksum+=buffer[i]; … … 154 155 cout << "Chunk reserved at: " << pos->info.file << ":" << pos->info.line << endl; 155 156 #endif 157 } 158 } 159 160 void dumpMemory(std::ostream &ost){ 161 ost << "Maximum allocated Memory: " << max << " bytes" << endl; 162 ost << "Maximum allocated Memory: " << max << " bytes" << endl; 163 ost << "Currently allocated Memory: " << state <<" bytes" << endl; 164 ost << allocs << " allocated chunks total" << endl; 165 bool corrupted=false; 166 for(entry_t *pos=begin;pos;pos=pos->next){ 167 ost << "\nChunk of " << pos->info.nbytes << " bytes" << " still available" << endl; 168 # ifdef __GNUC__ 169 ost << "Chunk reserved at: " << pos->info.function 170 << " (" << pos->info.file << ":" << pos->info.line << ")" << endl; 171 # else 172 ost << "Chunk reserved at: " << pos->info.file << ":" << pos->info.line << endl; 173 # endif 174 ost << "Chunk address: " << pos->info.location << endl; 175 entry_t::checksum_t checksum = calcChecksum(&pos->info); 176 ost << "Checksum of chunk: " << checksum << endl; 177 ost << "Checksum at allocation time: " << pos->checksum << endl; 178 if(checksum!=pos->checksum){ 179 ost << "!!!Chunk was corrupted!!!" << endl; 180 corrupted=true; 181 } 182 } 183 if(corrupted){ 184 ost << "\n!!!Memory corruption detected!!!" << endl; 156 185 } 157 186 } -
src/Helpers/MemDebug.hpp
rd74077 r8f4df1 61 61 */ 62 62 void getState(); 63 void dumpMemory(std::ostream&); 63 64 64 65 void _ignore(void*); … … 100 101 101 102 #else 103 104 #include <iosfwd> 105 102 106 // memory debugging was disabled 103 107 104 108 namespace Memory { 105 inline void getState(){} 109 inline void getState(){}; 110 111 inline void dumpMemory(std::ostream&){}; 106 112 107 113 template <typename T> -
src/Legacy/oldmenu.cpp
rd74077 r8f4df1 20 20 #include "element.hpp" 21 21 #include "ellipsoid.hpp" 22 #include " helpers.hpp"22 #include "Helpers/helpers.hpp" 23 23 #include "leastsquaremin.hpp" 24 24 #include "linkedcell.hpp" 25 #include " log.hpp"25 #include "Helpers/Log.hpp" 26 26 #include "memoryusageobserverunittest.hpp" 27 27 #include "molecule.hpp" 28 28 #include "periodentafel.hpp" 29 29 #include "vector_ops.hpp" 30 #include " Plane.hpp"31 #include "Line .hpp"30 #include "LinearAlgebra/Plane.hpp" 31 #include "LinearAlgebra/Line.hpp" 32 32 33 33 #include "UIElements/UIFactory.hpp" -
src/Makefile.am
rd74077 r8f4df1 2 2 # Also indentation by a single tab 3 3 4 SUBDIRS = Actions UIElements 5 6 # this includes source files that need to be present at multiple points 7 HELPERSOURCE = \ 8 Helpers/Assert.cpp \ 9 Helpers/MemDebug.cpp 10 4 SUBDIRS = Actions Exceptions Helpers LinearAlgebra Parser UIElements 5 11 6 ATOMSOURCE = \ 12 7 atom.cpp \ … … 30 25 atom_trajectoryparticleinfo.hpp 31 26 32 LINALGSOURCE = \33 ${HELPERSOURCE} \34 gslmatrix.cpp \35 gslvector.cpp \36 linearsystemofequations.cpp \37 Space.cpp \38 vector.cpp39 40 LINALGHEADER = \41 gslmatrix.hpp \42 gslvector.hpp \43 linearsystemofequations.hpp \44 Space.hpp \45 vector.hpp46 47 27 ANALYSISSOURCE = \ 48 28 analysis_bonds.cpp \ … … 76 56 Actions/MethodAction.hpp \ 77 57 Actions/Process.hpp 78 79 EXCEPTIONSOURCE = \80 Exceptions/CustomException.cpp \81 Exceptions/IllegalTypeException.cpp \82 Exceptions/LinearDependenceException.cpp \83 Exceptions/MathException.cpp \84 Exceptions/MissingValueException.cpp \85 Exceptions/NotInvertibleException.cpp \86 Exceptions/ParseError.cpp \87 Exceptions/SkewException.cpp \88 Exceptions/ZeroVectorException.cpp89 90 EXCEPTIONHEADER = \91 Exceptions/CustomException.hpp \92 Exceptions/IllegalTypeException.hpp \93 Exceptions/LinearDependenceException.hpp \94 Exceptions/MathException.hpp \95 Exceptions/MissingValueException.hpp \96 Exceptions/NotInvertibleException.hpp \97 Exceptions/ParseError.hpp \98 Exceptions/SkewException.hpp \99 Exceptions/ZeroVectorException.hpp100 101 PARSERSOURCE = \102 Parser/ChangeTracker.cpp \103 Parser/FormatParser.cpp \104 Parser/FormatParserStorage.cpp \105 Parser/MpqcParser.cpp \106 Parser/PcpParser.cpp \107 Parser/TremoloParser.cpp \108 Parser/XyzParser.cpp109 110 PARSERHEADER = \111 Parser/ChangeTracker.hpp \112 Parser/FormatParser.hpp \113 Parser/FormatParserStorage.hpp \114 Parser/MpqcParser.hpp \115 Parser/PcpParser.hpp \116 Parser/TremoloParser.hpp \117 Parser/XyzParser.hpp118 58 119 59 PATTERNSOURCE = \ … … 132 72 Shapes/Shape.hpp \ 133 73 Shapes/ShapeOps.hpp 74 134 75 135 136 QTUIMOC_HEADER = UIElements/QT4/QTDialog.hpp \137 UIElements/QT4/QTMainWindow.hpp \138 UIElements/Menu/QT4/QTMenu.hpp \139 UIElements/Views/QT4/QTWorldView.hpp \140 UIElements/Views/QT4/GLMoleculeView.hpp \141 UIElements/Views/QT4/QTMoleculeView.hpp \142 UIElements/Views/QT4/QTStatusBar.hpp143 144 QTUIMOC_TARGETS = QTMainWindow.moc.cpp \145 QTMenu.moc.cpp\146 QTDialog.moc.cpp \147 QTWorldView.moc.cpp \148 GLMoleculeView.moc.cpp \149 QTMoleculeView.moc.cpp \150 QTStatusBar.moc.cpp151 152 76 DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp \ 153 77 Descriptors/AtomIdDescriptor.cpp \ … … 172 96 Descriptors/MoleculePtrDescriptor.hpp \ 173 97 Descriptors/MoleculeSelectionDescriptor.cpp 98 99 100 QTUIMOC_HEADER = UIElements/QT4/QTDialog.hpp \ 101 UIElements/QT4/QTMainWindow.hpp \ 102 UIElements/Menu/QT4/QTMenu.hpp \ 103 UIElements/Views/QT4/QTWorldView.hpp \ 104 UIElements/Views/QT4/GLMoleculeView.hpp \ 105 UIElements/Views/QT4/QTMoleculeView.hpp \ 106 UIElements/Views/QT4/QTStatusBar.hpp 174 107 175 QTUISOURCE = ${QTUIMOC_TARGETS}\108 QTUISOURCE = allmocs.moc.cpp \ 176 109 UIElements/QT4/QTMainWindow.cpp \ 177 110 UIElements/QT4/QTDialog.cpp \ … … 195 128 PointCloud.cpp \ 196 129 tesselation.cpp \ 130 tesselationhelpers.cpp \ 197 131 TesselPoint.cpp 198 132 … … 205 139 PointCloud.hpp \ 206 140 tesselation.hpp \ 141 tesselationhelpers.hpp \ 207 142 TesselPoint.hpp 208 143 209 SOURCE = \144 MOLECUILDERSOURCE = \ 210 145 ${ANALYSISSOURCE} \ 211 146 ${ACTIONSSOURCE} \ 212 147 ${ATOMSOURCE} \ 213 ${EXCEPTIONSOURCE} \214 148 ${PATTERNSOURCE} \ 215 ${PARSERSOURCE} \216 149 ${SHAPESOURCE} \ 217 150 ${DESCRIPTORSOURCE} \ 218 ${HELPERSOURCE} \219 151 ${TESSELATIONSOURCE} \ 220 152 bond.cpp \ … … 228 160 elements_db.cpp \ 229 161 ellipsoid.cpp \ 230 errorlogger.cpp \231 162 Formula.cpp \ 232 163 graph.cpp \ 233 helpers.cpp \234 info.cpp \235 164 leastsquaremin.cpp \ 236 Line.cpp \237 165 linkedcell.cpp \ 238 log.cpp \239 logger.cpp \240 Matrix.cpp \241 166 moleculelist.cpp \ 242 167 molecule.cpp \ … … 248 173 parser.cpp \ 249 174 periodentafel.cpp \ 250 Plane.cpp \251 Space.cpp \252 tesselation.cpp \253 tesselationhelpers.cpp \254 175 ThermoStatContainer.cpp \ 255 176 triangleintersectionlist.cpp \ 256 vector.cpp \ 257 vector_ops.cpp \ 258 VectorInterface.cpp \ 259 verbose.cpp \ 177 UIElements/UIFactory.cpp \ 260 178 World.cpp 261 179 262 HEADER = \180 MOLECUILDERHEADER = \ 263 181 ${ANALYSISHEADER} \ 264 182 ${ACTIONSHEADER} \ 265 183 ${ATOMHEADER} \ 266 ${EXCEPTIONHEADER} \267 ${PARSERHEADER} \268 184 ${PATTERNHEADER} \ 269 185 ${SHAPEHEADER} \ … … 281 197 elements_db.hpp \ 282 198 ellipsoid.hpp \ 283 errorlogger.hpp \284 199 Formula.hpp \ 285 200 graph.hpp \ 286 helpers.hpp \287 info.hpp \288 201 leastsquaremin.hpp \ 289 Line.hpp \290 202 linkedcell.hpp \ 291 203 lists.hpp \ 292 log.hpp \293 logger.hpp \294 Matrix.hpp \295 204 molecule.hpp \ 296 205 molecule_template.hpp \ 297 206 parser.hpp \ 298 207 periodentafel.hpp \ 299 Plane.hpp \300 208 stackclass.hpp \ 301 tesselation.hpp \302 tesselationhelpers.hpp \303 209 ThermoStatContainer.hpp \ 304 210 triangleintersectionlist.hpp \ 305 verbose.hpp \ 306 vector_ops.hpp \ 307 VectorInterface.hpp \ 211 UIElements/UIFactory.hpp \ 308 212 World.hpp 309 213 310 # the following files are no longer used: 311 # memoryallocator.hpp \ 312 # memoryallocator.cpp \ 313 # memoryusageobserver.hpp \ 314 # memoryusageobserver.cpp 214 lib_LTLIBRARIES = libMolecuilder-@MOLECUILDER_API_VERSION@.la 215 libMolecuilder_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 216 libMolecuilder_LIBS = \ 217 LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \ 218 ${BOOST_PROGRAM_OPTIONS_LIB} 219 220 # UIElements/libMolecuilderUI.a \ 221 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 222 Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \ 223 Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \ 224 Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \ 225 $(BOOST_LIB) \ 226 ${BOOST_THREAD_LIB} 227 228 nobase_libMolecuilder_include_HEADERS = ${MOLECUILDERHEADER} 229 230 ## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la" 231 ## target. Note that @MOLECUILDER_API_VERSION@ is not interpreted by Automake and 232 ## will therefore be treated as if it were literally part of the target name, 233 ## and the variable name derived from that. 234 ## The file extension .cc is recognized by Automake, and makes it produce 235 ## rules which invoke the C++ compiler to produce a libtool object file (.lo) 236 ## from each source file. Note that it is not necessary to list header files 237 ## which are already listed elsewhere in a _HEADERS variable assignment. 238 libMolecuilder_@MOLECUILDER_API_VERSION@_la_SOURCES = ${MOLECUILDERSOURCE} $(srcdir)/version.c 239 240 ## Instruct libtool to include ABI version information in the generated shared 241 ## library file (.so). The library ABI version is defined in configure.ac, so 242 ## that all version information is kept in one place. 243 libMolecuilder_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION) 244 245 ## The generated configuration header is installed in its own subdirectory of 246 ## $(libdir). The reason for this is that the configuration information put 247 ## into this header file describes the target platform the installed library 248 ## has been built for. Thus the file must not be installed into a location 249 ## intended for architecture-independent files, as defined by the Filesystem 250 ## Hierarchy Standard (FHS). 251 ## The nodist_ prefix instructs Automake to not generate rules for including 252 ## the listed files in the distribution on 'make dist'. Files that are listed 253 ## in _HEADERS variables are normally included in the distribution, but the 254 ## configuration header file is generated at configure time and should not be 255 ## shipped with the source tarball. 256 libMolecuilder_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include 257 nodist_libMolecuilder_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h 258 259 ## Install the generated pkg-config file (.pc) into the expected location for 260 ## architecture-dependent package configuration information. Occasionally, 261 ## pkg-config files are also used for architecture-independent data packages, 262 ## in which case the correct install location would be $(datadir)/pkgconfig. 263 pkgconfigdir = $(libdir)/pkgconfig 264 pkgconfig_DATA = $(top_builddir)/molecuilder-$(MOLECUILDER_API_VERSION).pc 265 315 266 316 267 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) … … 318 269 INCLUDES = -I$(top_srcdir)/src/unittests -I$(top_srcdir)/src/Actions -I$(top_srcdir)/src/UIElements 319 270 320 noinst_LIBRARIES = libm olecuilder.a libgslwrapper.a libmenu.a libparser.a271 noinst_LIBRARIES = libmenu.a 321 272 bin_PROGRAMS = molecuilder molecuildergui joiner analyzer 273 EXTRA_PROGRAMS = unity 322 274 323 275 molecuilderdir = ${bindir} 324 276 325 libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}326 327 277 libmenu_a_SOURCES = ${UISOURCE} ${UIHEADER} 328 libparser_a_SOURCES = ${PARSERSOURCE} ${PARSERHEADER}329 libgslwrapper_a_SOURCES = ${LINALGSOURCE} ${LINALGHEADER}330 278 331 279 molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db … … 334 282 #molecuilder_CXXFLAGS += -DNO_CACHING 335 283 molecuilder_LDFLAGS = $(BOOST_LIB) 336 molecuilder_SOURCES = ${LEGACYSOURCE} builder.cpp 337 molecuilder_SOURCES += $(srcdir)/version.c 338 molecuilder_LDADD = UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a libparser.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} 284 molecuilder_SOURCES = builder.cpp 285 molecuilder_LDADD = \ 286 UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ 287 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 288 libMolecuilder-@MOLECUILDER_API_VERSION@.la \ 289 Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \ 290 LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \ 291 Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \ 292 Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \ 293 $(BOOST_LIB) \ 294 ${BOOST_THREAD_LIB} \ 295 ${BOOST_PROGRAM_OPTIONS_LIB} 296 339 297 340 298 #Stuff for building the GUI using QT 341 molecuildergui_SOURCES = ${QTUISOURCE} ${LEGACYSOURCE} builder.cpp 342 molecuildergui_SOURCES += $(srcdir)/version.c 299 molecuildergui_SOURCES = ${QTUISOURCE} builder.cpp 343 300 molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} -DUSE_GUI_QT 344 301 molecuildergui_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS} ${GLU_LDFLAGS} 345 molecuildergui_LDADD = UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a libparser.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} ${GUI_LIBS} 346 347 joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp 348 joiner_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB} 349 350 analyzer_SOURCES = analyzer.cpp datacreator.cpp parser.cpp helpers.hpp periodentafel.hpp parser.hpp datacreator.hpp 351 analyzer_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB} 302 303 unity_SOURCES = unity.cpp 304 unity_LDADD = $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} 305 306 molecuildergui_LDADD = \ 307 UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ 308 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 309 libMolecuilder-@MOLECUILDER_API_VERSION@.la \ 310 Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \ 311 LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \ 312 Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \ 313 Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \ 314 $(BOOST_LIB) \ 315 ${BOOST_THREAD_LIB} \ 316 ${BOOST_PROGRAM_OPTIONS_LIB} \ 317 ${GUI_LIBS} 318 319 joiner_SOURCES = joiner.cpp datacreator.cpp datacreator.hpp periodentafel.hpp 320 joiner_LDADD = \ 321 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 322 libMolecuilder-@MOLECUILDER_API_VERSION@.la \ 323 Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \ 324 LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \ 325 Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \ 326 Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \ 327 $(BOOST_LIB) \ 328 ${BOOST_THREAD_LIB} \ 329 ${BOOST_PROGRAM_OPTIONS_LIB} 330 331 analyzer_SOURCES = analyzer.cpp datacreator.cpp periodentafel.hpp datacreator.hpp 332 analyzer_LDADD = \ 333 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 334 libMolecuilder-@MOLECUILDER_API_VERSION@.la \ 335 Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \ 336 LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \ 337 Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \ 338 Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \ 339 $(BOOST_LIB) \ 340 ${BOOST_THREAD_LIB} \ 341 ${BOOST_PROGRAM_OPTIONS_LIB} 352 342 353 343 #Rules needed for QT4 … … 355 345 # Therfore `%'-rules do not seem to work 356 346 #Quick fix to get it done otherwise 357 ${QTUIMOC_TARGETS}: ${QTUIMOC_HEADER} 347 allmocs.moc.cpp: ${QTUIMOC_HEADER} 348 echo "" > allmocs.moc.cpp;\ 358 349 list='$(QTUIMOC_HEADER)'; for header in $$list; do \ 359 350 echo "Making mocfile for $$header"; \ … … 361 352 $(MOC) $(srcdir)/$$header -o $$target \ 362 353 || eval $$failcom; \ 354 echo "#include \"$$target\"" >> allmocs.moc.cpp; \ 363 355 done; 364 356 365 MOSTLYCLEANFILES = ${QTUIMOC_TARGETS}366 367 357 #EXTRA_DIST = ${molecuilder_DATA} 368 358 … … 383 373 384 374 375 unity.cpp: ${MOLECUILDERSOURCE} ${MOLECUILDERHEADER} 376 echo "" > unity.cpp; \ 377 list='$(MOLECUILDERSOURCE)'; for file in $$list; do \ 378 echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \ 379 done; \ 380 subdirs='$(SUBDIRS)';for directory in $$subdirs; do\ 381 olddir=$$PWD;\ 382 cd $$directory && make unity.cpp;\ 383 cd $$olddir;\ 384 echo "#include \"$$directory/unity.cpp\"" >> unity.cpp;\ 385 done;\ 386 echo "#include \"$(srcdir)/builder.cpp\"" >> unity.cpp; 387 echo "#include \"$(srcdir)/version.c\"" >> unity.cpp; 388 389 MOSTLYCLEANFILES = allmocs.moc.cpp unity.cpp 390 -
src/Parser/ChangeTracker.cpp
rd74077 r8f4df1 9 9 #include "Parser/ChangeTracker.hpp" 10 10 #include "Patterns/Singleton_impl.hpp" 11 11 #include "Helpers/Log.hpp" 12 #include "Helpers/Verbose.hpp" 12 13 13 14 /** … … 49 50 */ 50 51 void ChangeTracker::saveStatus() { 52 DoLog(0) && (Log() << Verbose(0) << "Saving changes." << std::endl); 51 53 if (hasChanged()) { 52 54 notifyAll(); -
src/Parser/FormatParserStorage.cpp
rd74077 r8f4df1 17 17 #include "Parser/XyzParser.hpp" 18 18 19 #include " log.hpp"20 #include " verbose.hpp"19 #include "Helpers/Log.hpp" 20 #include "Helpers/Verbose.hpp" 21 21 22 22 #include "Helpers/Assert.hpp" -
src/Parser/MpqcParser.cpp
rd74077 r8f4df1 11 11 #include "config.hpp" 12 12 #include "element.hpp" 13 #include "log.hpp" 13 #include "Helpers/Log.hpp" 14 #include "Helpers/Verbose.hpp" 15 #include "LinearAlgebra/Vector.hpp" 14 16 #include "periodentafel.hpp" 15 #include "vector.hpp"16 #include "verbose.hpp"17 17 #include "World.hpp" 18 18 … … 43 43 void MpqcParser::save(ostream *file) 44 44 { 45 DoLog(0) && (Log() << Verbose(0) << "Saving changes to MPQC ." << std::endl); 46 45 47 if (HessianPresent) 46 48 saveHessian(file); -
src/Parser/PcpParser.cpp
rd74077 r8f4df1 14 14 #include "element.hpp" 15 15 #include "Helpers/Assert.hpp" 16 #include "log.hpp" 16 #include "Helpers/Log.hpp" 17 #include "Helpers/Verbose.hpp" 18 #include "LinearAlgebra/Matrix.hpp" 17 19 #include "molecule.hpp" 18 20 #include "PcpParser.hpp" 19 21 #include "periodentafel.hpp" 20 22 #include "ThermoStatContainer.hpp" 21 #include "verbose.hpp"22 23 #include "World.hpp" 23 #include "Matrix.hpp"24 24 #include "Box.hpp" 25 25 … … 332 332 void PcpParser::save(std::ostream* file) 333 333 { 334 DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl); 335 334 336 const Matrix &domain = World::getInstance().getDomain().getM(); 335 337 class ThermoStatContainer *Thermostats = World::getInstance().getThermostats(); -
src/Parser/TremoloParser.cpp
rd74077 r8f4df1 9 9 10 10 #include "Helpers/Assert.hpp" 11 #include "Helpers/Log.hpp" 12 #include "Helpers/Verbose.hpp" 11 13 #include "TremoloParser.hpp" 12 14 #include "World.hpp" … … 21 23 22 24 using namespace std; 23 using namespace boost;24 25 25 26 /** … … 99 100 */ 100 101 void TremoloParser::save(ostream* file) { 102 DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl); 103 101 104 vector<atom*>::iterator atomIt; 102 105 vector<string>::iterator it; -
src/Parser/XyzParser.cpp
rd74077 r8f4df1 8 8 #include "Helpers/MemDebug.hpp" 9 9 10 #include "Helpers/Log.hpp" 11 #include "Helpers/Verbose.hpp" 10 12 #include "XyzParser.hpp" 11 13 #include "World.hpp" 12 14 #include "atom.hpp" 15 #include "molecule.hpp" 13 16 #include "element.hpp" 14 17 #include "periodentafel.hpp" … … 35 38 */ 36 39 void XyzParser::load(istream* file) { 37 atom* newAtom; 40 atom* newAtom = NULL; 41 molecule* newmol = NULL; 38 42 int numberOfAtoms; 39 43 char commentBuffer[512], type[3]; … … 45 49 comment = commentBuffer; 46 50 51 newmol = World::getInstance().createMolecule(); 52 newmol->ActiveFlag = true; 53 World::getInstance().getMolecules()->insert(newmol); 47 54 for (int i = 0; i < numberOfAtoms; i++) { 48 55 newAtom = World::getInstance().createAtom(); … … 53 60 } 54 61 newAtom->setType(World::getInstance().getPeriode()->FindElement(type)); 62 newmol->AddAtom(newAtom); 55 63 } 56 64 } … … 62 70 */ 63 71 void XyzParser::save(ostream* file) { 72 DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl); 64 73 if (comment == "") { 65 74 time_t now = time((time_t *)NULL); // Get the system time and put it into 'now' as 'calender time' -
src/Patterns/Registry_impl.hpp
rd74077 r8f4df1 15 15 16 16 #include "Helpers/Assert.hpp" 17 #include <ios tream>17 #include <iosfwd> 18 18 19 19 /** Constructor for class Registry. -
src/Shapes/BaseShapes.cpp
rd74077 r8f4df1 9 9 #include "Shapes/BaseShapes_impl.hpp" 10 10 11 #include " vector.hpp"11 #include "LinearAlgebra/Vector.hpp" 12 12 13 13 bool Sphere_impl::isInside(const Vector &point){ -
src/Shapes/ShapeOps_impl.hpp
rd74077 r8f4df1 10 10 11 11 #include "Shapes/Shape_impl.hpp" 12 #include " vector.hpp"13 #include " Matrix.hpp"12 #include "LinearAlgebra/Vector.hpp" 13 #include "LinearAlgebra/Matrix.hpp" 14 14 15 15 class Resize_impl : public Shape_impl -
src/ThermoStatContainer.cpp
rd74077 r8f4df1 10 10 #include "ConfigFileBuffer.hpp" 11 11 #include "config.hpp" 12 #include " log.hpp"12 #include "Helpers/Log.hpp" 13 13 #include "ThermoStatContainer.hpp" 14 #include " verbose.hpp"14 #include "Helpers/Verbose.hpp" 15 15 16 16 /** Constructor for class ThermoStatContainer. -
src/UIElements/CommandLineUI/CommandLineDialog.cpp
rd74077 r8f4df1 23 23 #include "CommandLineParser.hpp" 24 24 #include "defs.hpp" 25 #include " log.hpp"26 #include " Matrix.hpp"25 #include "Helpers/Log.hpp" 26 #include "LinearAlgebra/Matrix.hpp" 27 27 #include "periodentafel.hpp" 28 #include " verbose.hpp"28 #include "Helpers/Verbose.hpp" 29 29 #include "World.hpp" 30 30 #include "Box.hpp" … … 33 33 #include "element.hpp" 34 34 #include "molecule.hpp" 35 #include " vector.hpp"35 #include "LinearAlgebra/Vector.hpp" 36 36 37 37 using namespace std; -
src/UIElements/Dialog.cpp
rd74077 r8f4df1 9 9 10 10 #include "Dialog.hpp" 11 #include " ValueStorage.hpp"12 13 #include " verbose.hpp"11 #include "Actions/ValueStorage.hpp" 12 13 #include "Helpers/Verbose.hpp" 14 14 #include "atom.hpp" 15 15 #include "element.hpp" 16 16 #include "molecule.hpp" 17 #include " vector.hpp"18 #include " Matrix.hpp"17 #include "LinearAlgebra/Vector.hpp" 18 #include "LinearAlgebra/Matrix.hpp" 19 19 #include "Box.hpp" 20 20 … … 68 68 } 69 69 70 bool Dialog::hasQueries(){ 71 return queries.size(); 72 } 73 70 74 /****************** Query types Infrastructure **************************/ 71 75 -
src/UIElements/Dialog.hpp
rd74077 r8f4df1 14 14 15 15 #include "Box.hpp" 16 #include " vector.hpp"16 #include "LinearAlgebra/Vector.hpp" 17 17 18 18 class atom; … … 61 61 virtual void setAll(); 62 62 63 virtual bool hasQueries(); 64 63 65 protected: 64 66 // methodology for handling queries -
src/UIElements/Makefile.am
rd74077 r8f4df1 5 5 AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl 6 6 AM_CXXFLAGS = $(CPPUNIT_CFLAGS) 7 8 noinst_LIBRARIES = libMolecuilderUI.a9 libMolecuilderUI_a_SOURCES = ${UISOURCE} ${UIHEADER}10 7 11 8 VIEWSOURCE = \ … … 45 42 ${VIEWSOURCE} \ 46 43 Dialog.cpp \ 47 MainWindow.cpp \ 48 UIFactory.cpp \ 49 ValueStorage.cpp 44 MainWindow.cpp 50 45 51 46 UIHEADER = \ … … 56 51 ${VIEWHEADER} \ 57 52 Dialog.hpp \ 58 MainWindow.hpp \ 59 UIFactory.hpp \ 60 ValueStorage.hpp 53 MainWindow.hpp 61 54 62 55 TEXTUISOURCE = \ … … 82 75 CommandLineUI/CommandLineWindow.hpp 83 76 77 lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la 78 libMolecuilderUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 79 libMolecuilderUI_LIBS = \ 80 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la 84 81 82 nobase_libMolecuilderUI_include_HEADERS = ${UIHEADER} 83 84 ## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la" 85 ## target. Note that @MOLECUILDER_API_VERSION@ is not interpreted by Automake and 86 ## will therefore be treated as if it were literally part of the target name, 87 ## and the variable name derived from that. 88 ## The file extension .cc is recognized by Automake, and makes it produce 89 ## rules which invoke the C++ compiler to produce a libtool object file (.lo) 90 ## from each source file. Note that it is not necessary to list header files 91 ## which are already listed elsewhere in a _HEADERS variable assignment. 92 libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${UISOURCE} 93 94 ## Instruct libtool to include ABI version information in the generated shared 95 ## library file (.so). The library ABI version is defined in configure.ac, so 96 ## that all version information is kept in one place. 97 libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION) 98 99 ## The generated configuration header is installed in its own subdirectory of 100 ## $(libdir). The reason for this is that the configuration information put 101 ## into this header file describes the target platform the installed library 102 ## has been built for. Thus the file must not be installed into a location 103 ## intended for architecture-independent files, as defined by the Filesystem 104 ## Hierarchy Standard (FHS). 105 ## The nodist_ prefix instructs Automake to not generate rules for including 106 ## the listed files in the distribution on 'make dist'. Files that are listed 107 ## in _HEADERS variables are normally included in the distribution, but the 108 ## configuration header file is generated at configure time and should not be 109 ## shipped with the source tarball. 110 libMolecuilderUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include 111 nodist_libMolecuilderUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h 112 113 ## Install the generated pkg-config file (.pc) into the expected location for 114 ## architecture-dependent package configuration information. Occasionally, 115 ## pkg-config files are also used for architecture-independent data packages, 116 ## in which case the correct install location would be $(datadir)/pkgconfig. 117 pkgconfigdir = $(libdir)/pkgconfig 118 pkgconfig_DATA = $(top_builddir)/molecuilder-$(MOLECUILDER_API_VERSION).pc 119 120 unity.cpp: 121 echo "" > unity.cpp; \ 122 list='$(UISOURCE)'; for file in $$list; do \ 123 echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \ 124 done; 125 126 MOSTLYCLEANFILES = unity.cpp -
src/UIElements/Menu/TextMenu.cpp
rd74077 r8f4df1 127 127 } 128 128 129 Dialog* TextMenu::LeaveAction::createDialog(){ 129 Dialog* TextMenu::LeaveAction::fillDialog(Dialog *dialog){ 130 ASSERT(dialog,"No Dialog given when filling action dialog"); 131 return dialog; 130 132 } 131 133 -
src/UIElements/Menu/TextMenu.hpp
rd74077 r8f4df1 10 10 11 11 #include <list> 12 #include < ostream>12 #include <iosfwd> 13 13 #include <string> 14 14 … … 35 35 bool shouldUndo(); 36 36 37 protected: 38 virtual Dialog* fillDialog(Dialog *dialog); 37 39 private: 38 virtual Dialog* createDialog();39 40 virtual Action::state_ptr performCall(); 40 41 virtual Action::state_ptr performUndo(Action::state_ptr); -
src/UIElements/QT4/QTDialog.cpp
rd74077 r8f4df1 24 24 #include <Qt/qcombobox.h> 25 25 26 #include <boost/lexical_cast.hpp> 27 26 28 #include "Helpers/MemDebug.hpp" 27 29 … … 33 35 #include "Descriptors/AtomIdDescriptor.hpp" 34 36 #include "Descriptors/MoleculeIdDescriptor.hpp" 35 #include " Matrix.hpp"37 #include "LinearAlgebra/Matrix.hpp" 36 38 #include "Box.hpp" 37 39 -
src/UIElements/QT4/QTMainWindow.cpp
rd74077 r8f4df1 21 21 #include "atom.hpp" 22 22 #include "molecule.hpp" 23 #include " verbose.hpp"23 #include "Helpers/Verbose.hpp" 24 24 #include "Actions/Action.hpp" 25 25 #include "Actions/ActionRegistry.hpp" -
src/UIElements/TextUI/TextDialog.cpp
rd74077 r8f4df1 14 14 #include <Descriptors/MoleculeDescriptor.hpp> 15 15 #include <Descriptors/MoleculeIdDescriptor.hpp> 16 #include <boost/lexical_cast.hpp> 16 17 #include "TextUI/TextDialog.hpp" 17 18 18 19 #include "World.hpp" 19 20 #include "periodentafel.hpp" 20 #include " log.hpp"21 #include " verbose.hpp"21 #include "Helpers/Log.hpp" 22 #include "Helpers/Verbose.hpp" 22 23 23 24 #include "atom.hpp" 24 25 #include "element.hpp" 25 26 #include "molecule.hpp" 26 #include " vector.hpp"27 #include " Matrix.hpp"27 #include "LinearAlgebra/Vector.hpp" 28 #include "LinearAlgebra/Matrix.hpp" 28 29 #include "Box.hpp" 29 30 -
src/UIElements/TextUI/TextWindow.cpp
rd74077 r8f4df1 25 25 #include "Views/StreamStringView.hpp" 26 26 #include "Views/MethodStringView.hpp" 27 #include "Helpers/MemDebug.hpp"28 27 29 28 #include "defs.hpp" 30 #include " log.hpp"31 #include " verbose.hpp"29 #include "Helpers/Log.hpp" 30 #include "Helpers/Verbose.hpp" 32 31 33 32 // all needed due to config::SaveAll() -
src/UIElements/Views/QT4/QTStatusBar.cpp
rd74077 r8f4df1 14 14 #include "QTStatusBar.hpp" 15 15 #include "World.hpp" 16 #include " helpers.hpp"16 #include "Helpers/helpers.hpp" 17 17 #include "Actions/Process.hpp" 18 18 -
src/World.cpp
rd74077 r8f4df1 25 25 #include "Helpers/Assert.hpp" 26 26 #include "Box.hpp" 27 #include " Matrix.hpp"27 #include "LinearAlgebra/Matrix.hpp" 28 28 #include "defs.hpp" 29 29 … … 32 32 33 33 using namespace std; 34 35 const unsigned int MAX_POOL_FRAGMENTATION=20; 36 const unsigned int MAX_FRAGMENTATION_SKIPS=100; 34 37 35 38 /******************************* getter and setter ************************/ … … 48 51 } 49 52 50 vector<atom*>World::getAllAtoms(AtomDescriptor descriptor){53 World::AtomComposite World::getAllAtoms(AtomDescriptor descriptor){ 51 54 return descriptor.findAll(); 52 55 } 53 56 54 vector<atom*>World::getAllAtoms(){57 World::AtomComposite World::getAllAtoms(){ 55 58 return getAllAtoms(AllAtoms()); 56 59 } … … 718 721 delete cell_size; 719 722 delete molecules_deprecated; 720 delete periode;721 delete configuration;722 delete Thermostats;723 723 MoleculeSet::iterator molIter; 724 724 for(molIter=molecules.begin();molIter!=molecules.end();++molIter){ … … 731 731 } 732 732 atoms.clear(); 733 delete periode; 734 delete configuration; 735 delete Thermostats; 733 736 } 734 737 -
src/World.hpp
rd74077 r8f4df1 25 25 #include "Patterns/ObservedContainer.hpp" 26 26 #include "Helpers/Range.hpp" 27 #include "AtomSet.hpp" 27 28 28 29 // include config.h … … 76 77 typedef ObservedContainer<std::map<moleculeId_t,molecule*> > MoleculeSet; 77 78 79 typedef ATOMSET(std::vector) AtomComposite; 80 78 81 /***** getter and setter *****/ 79 82 // reference to pointer is used for legacy reason... reference will be removed latter to keep encapsulation of World object … … 97 100 * returns a vector containing all atoms that match a given descriptor 98 101 */ 99 std::vector<atom*>getAllAtoms(AtomDescriptor descriptor);100 std::vector<atom*>getAllAtoms();102 AtomComposite getAllAtoms(AtomDescriptor descriptor); 103 AtomComposite getAllAtoms(); 101 104 102 105 /** -
src/analysis_bonds.cpp
rd74077 r8f4df1 12 12 #include "bond.hpp" 13 13 #include "element.hpp" 14 #include " info.hpp"15 #include " verbose.hpp"16 #include " log.hpp"14 #include "Helpers/Info.hpp" 15 #include "Helpers/Verbose.hpp" 16 #include "Helpers/Log.hpp" 17 17 #include "molecule.hpp" 18 18 -
src/analysis_correlation.cpp
rd74077 r8f4df1 14 14 #include "analysis_correlation.hpp" 15 15 #include "element.hpp" 16 #include " info.hpp"17 #include " log.hpp"16 #include "Helpers/Info.hpp" 17 #include "Helpers/Log.hpp" 18 18 #include "molecule.hpp" 19 19 #include "tesselation.hpp" 20 20 #include "tesselationhelpers.hpp" 21 21 #include "triangleintersectionlist.hpp" 22 #include " vector.hpp"23 #include " Matrix.hpp"24 #include " verbose.hpp"22 #include "LinearAlgebra/Vector.hpp" 23 #include "LinearAlgebra/Matrix.hpp" 24 #include "Helpers/Verbose.hpp" 25 25 #include "World.hpp" 26 26 #include "Box.hpp" -
src/analysis_correlation.hpp
rd74077 r8f4df1 27 27 28 28 #include "atom.hpp" 29 #include "helpers.hpp" 30 #include "log.hpp" 31 #include "verbose.hpp" 29 #include "Helpers/Verbose.hpp" 32 30 33 31 /****************************************** forward declarations *****************************/ -
src/analyzer.cpp
rd74077 r8f4df1 13 13 14 14 #include "datacreator.hpp" 15 #include " helpers.hpp"15 #include "Helpers/helpers.hpp" 16 16 #include "parser.hpp" 17 17 #include "periodentafel.hpp" 18 #include " verbose.hpp"18 #include "Helpers/Verbose.hpp" 19 19 20 20 // include config.h -
src/atom.cpp
rd74077 r8f4df1 13 13 #include "lists.hpp" 14 14 #include "parser.hpp" 15 #include " vector.hpp"15 #include "LinearAlgebra/Vector.hpp" 16 16 #include "World.hpp" 17 17 #include "molecule.hpp" … … 19 19 20 20 #include <iomanip> 21 #include <iostream> 21 22 22 23 /************************************* Functions for class atom *************************************/ … … 105 106 }; 106 107 108 bool atom::isFather(const atom *ptr){ 109 return ptr==father; 110 } 111 107 112 /** Checks whether atom is within the given box. 108 113 * \param offset offset to box origin … … 157 162 * \return true - \a *out present, false - \a *out is NULL 158 163 */ 159 bool atom::OutputArrayIndexed(ostream * const out, const int *ElementNo, int *AtomNo, const char *comment) const164 bool atom::OutputArrayIndexed(ostream * const out,const enumeration<const element*> &elementLookup, int *AtomNo, const char *comment) const 160 165 { 161 166 AtomNo[getType()->Z]++; // increment number 162 167 if (out != NULL) { 163 *out << "Ion_Type" << ElementNo[getType()->Z] << "_" << AtomNo[getType()->Z] << "\t" << fixed << setprecision(9) << showpoint; 168 const element *elemental = getType(); 169 cout << "Looking for atom with element " << *elemental << endl; 170 ASSERT(elementLookup.there.find(elemental)!=elementLookup.there.end(),"Type of this atom was not in the formula upon enumeration"); 171 *out << "Ion_Type" << elementLookup.there.find(elemental)->second << "_" << AtomNo[elemental->Z] << "\t" << fixed << setprecision(9) << showpoint; 164 172 *out << at(0) << "\t" << at(1) << "\t" << at(2); 165 173 *out << "\t" << FixedIon; … … 337 345 mol = _mol; 338 346 if(!mol->containsAtom(this)){ 339 mol-> AddAtom(this);347 mol->insert(this); 340 348 } 341 349 } -
src/atom.hpp
rd74077 r8f4df1 22 22 #include <vector> 23 23 24 #include "Helpers/helpers.hpp" 24 25 #include "atom_atominfo.hpp" 25 26 #include "atom_bondedparticle.hpp" … … 52 53 53 54 bool OutputIndexed(ofstream * const out, const int ElementNo, const int AtomNo, const char *comment = NULL) const; 54 bool OutputArrayIndexed(ostream * const out, const int *ElementNo, int *AtomNo, const char *comment = NULL) const;55 bool OutputArrayIndexed(ostream * const out,const enumeration<const element*>&, int *AtomNo, const char *comment = NULL) const; 55 56 bool OutputXYZLine(ofstream *out) const; 56 57 bool OutputTrajectory(ofstream * const out, const int *ElementNo, int *AtomNo, const int step) const; … … 61 62 62 63 void EqualsFather ( const atom *ptr, const atom **res ) const; 64 bool isFather(const atom *ptr); 63 65 void CorrectFather(); 64 66 atom *GetTrueFather(); -
src/atom_atominfo.hpp
rd74077 r8f4df1 19 19 #endif 20 20 21 #include " vector.hpp"22 #include " VectorInterface.hpp"21 #include "LinearAlgebra/Vector.hpp" 22 #include "LinearAlgebra/VectorInterface.hpp" 23 23 24 24 /****************************************** forward declarations *****************************/ -
src/atom_bondedparticle.cpp
rd74077 r8f4df1 13 13 #include "element.hpp" 14 14 #include "lists.hpp" 15 #include " log.hpp"16 #include " verbose.hpp"15 #include "Helpers/Log.hpp" 16 #include "Helpers/Verbose.hpp" 17 17 18 18 /** Constructor of class BondedParticle. -
src/atom_graphnode.cpp
rd74077 r8f4df1 9 9 10 10 #include "atom_graphnode.hpp" 11 #include " log.hpp"12 #include " verbose.hpp"11 #include "Helpers/Log.hpp" 12 #include "Helpers/Verbose.hpp" 13 13 14 14 /** Constructor of class GraphNode. -
src/atom_trajectoryparticle.cpp
rd74077 r8f4df1 12 12 #include "config.hpp" 13 13 #include "element.hpp" 14 #include " info.hpp"15 #include " log.hpp"14 #include "Helpers/Info.hpp" 15 #include "Helpers/Log.hpp" 16 16 #include "parser.hpp" 17 17 #include "ThermoStatContainer.hpp" 18 #include " verbose.hpp"18 #include "Helpers/Verbose.hpp" 19 19 20 20 /** Constructor of class TrajectoryParticle. -
src/atom_trajectoryparticleinfo.hpp
rd74077 r8f4df1 20 20 #include <vector> 21 21 22 #include " vector.hpp"23 #include " VectorSet.hpp"22 #include "LinearAlgebra/Vector.hpp" 23 #include "LinearAlgebra/VectorSet.hpp" 24 24 25 25 /********************************************** declarations *******************************/ -
src/bond.cpp
rd74077 r8f4df1 7 7 #include "Helpers/MemDebug.hpp" 8 8 9 #include "Helpers/Log.hpp" 10 #include "Helpers/Verbose.hpp" 9 11 #include "atom.hpp" 10 12 #include "bond.hpp" 11 13 #include "element.hpp" 12 14 #include "lists.hpp" 13 #include "log.hpp"14 #include "verbose.hpp"15 15 16 16 -
src/bondgraph.cpp
rd74077 r8f4df1 14 14 #include "bondgraph.hpp" 15 15 #include "element.hpp" 16 #include " info.hpp"17 #include " verbose.hpp"18 #include " log.hpp"16 #include "Helpers/Info.hpp" 17 #include "Helpers/Verbose.hpp" 18 #include "Helpers/Log.hpp" 19 19 #include "molecule.hpp" 20 20 #include "parser.hpp" 21 21 #include "periodentafel.hpp" 22 #include " vector.hpp"22 #include "LinearAlgebra/Vector.hpp" 23 23 24 24 /** Constructor of class BondGraph. -
src/boundary.cpp
rd74077 r8f4df1 6 6 #include "Helpers/MemDebug.hpp" 7 7 8 #include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp" 8 9 #include "BoundaryPointSet.hpp" 9 10 #include "BoundaryLineSet.hpp" 10 11 #include "BoundaryTriangleSet.hpp" 11 12 #include "CandidateForTesselation.hpp" 12 #include "BoundaryPolygonSet.hpp" 13 #include "TesselPoint.hpp" 13 //#include "TesselPoint.hpp" 14 14 #include "World.hpp" 15 15 #include "atom.hpp" … … 18 18 #include "config.hpp" 19 19 #include "element.hpp" 20 #include " helpers.hpp"21 #include " info.hpp"20 #include "Helpers/helpers.hpp" 21 #include "Helpers/Info.hpp" 22 22 #include "linkedcell.hpp" 23 #include " verbose.hpp"24 #include " log.hpp"23 #include "Helpers/Verbose.hpp" 24 #include "Helpers/Log.hpp" 25 25 #include "molecule.hpp" 26 26 #include "tesselation.hpp" 27 27 #include "tesselationhelpers.hpp" 28 28 #include "World.hpp" 29 #include " Plane.hpp"30 #include " Matrix.hpp"29 #include "LinearAlgebra/Plane.hpp" 30 #include "LinearAlgebra/Matrix.hpp" 31 31 #include "Box.hpp" 32 32 … … 679 679 double cellvolume = 0.; 680 680 681 // transform to PAS 682 mol->PrincipalAxisSystem(true); 681 // transform to PAS by Action 682 Vector MainAxis(0.,0.,1.); 683 MoleculeRotateToPrincipalAxisSystem(MainAxis); 683 684 684 685 IsAngstroem = configuration->GetIsAngstroem(); -
src/builder.cpp
rd74077 r8f4df1 59 59 #include "CommandLineParser.hpp" 60 60 #include "config.hpp" 61 #include " log.hpp"61 #include "Helpers/Log.hpp" 62 62 #include "molecule.hpp" 63 63 #include "periodentafel.hpp" … … 72 72 #include "UIElements/Dialog.hpp" 73 73 #include "Menu/ActionMenuItem.hpp" 74 #include " verbose.hpp"74 #include "Helpers/Verbose.hpp" 75 75 #include "World.hpp" 76 76 … … 110 110 } 111 111 112 void dumpMemory(){ 113 ofstream ost("molecuilder.memdump"); 114 Memory::dumpMemory(ost); 115 } 116 112 117 int main(int argc, char **argv) 113 118 { 114 119 // while we are non interactive, we want to abort from asserts 115 //ASSERT_DO(Assert::Abort); 120 ASSERT_DO(Assert::Abort); 121 ASSERT_HOOK(dumpMemory); 116 122 string line; 117 123 char **Arguments = NULL; … … 127 133 // need to init the history before any action is created 128 134 ActionHistory::init(); 129 130 // In the interactive mode, we can leave the user the choice in case of error131 ASSERT_DO(Assert::Ask);132 135 133 136 // from this moment on, we need to be sure to deeinitialize in the correct order … … 155 158 UIFactory::makeUserInterface("CommandLine"); 156 159 } else { 160 // In the interactive mode, we can leave the user the choice in case of error 161 ASSERT_DO(Assert::Ask); 157 162 #ifdef USE_GUI_QT 158 163 DoLog(0) && (Log() << Verbose(0) << "Setting UI to QT4." << endl); -
src/config.cpp
rd74077 r8f4df1 16 16 #include "ConfigFileBuffer.hpp" 17 17 #include "element.hpp" 18 #include " helpers.hpp"19 #include " info.hpp"18 #include "Helpers/helpers.hpp" 19 #include "Helpers/Info.hpp" 20 20 #include "lists.hpp" 21 #include " verbose.hpp"22 #include " log.hpp"21 #include "Helpers/Verbose.hpp" 22 #include "Helpers/Log.hpp" 23 23 #include "molecule.hpp" 24 24 #include "molecule.hpp" … … 26 26 #include "ThermoStatContainer.hpp" 27 27 #include "World.hpp" 28 #include " Matrix.hpp"28 #include "LinearAlgebra/Matrix.hpp" 29 29 #include "Box.hpp" 30 30 -
src/datacreator.cpp
rd74077 r8f4df1 10 10 11 11 #include "datacreator.hpp" 12 #include " helpers.hpp"12 #include "Helpers/helpers.hpp" 13 13 #include "parser.hpp" 14 #include " verbose.hpp"14 #include "Helpers/Verbose.hpp" 15 15 16 16 #include <iomanip> -
src/defs.hpp
rd74077 r8f4df1 84 84 #define MOLECUILDER_NAME "Molecuilder" 85 85 86 const unsigned int MAX_POOL_FRAGMENTATION=20;87 const unsigned int MAX_FRAGMENTATION_SKIPS=100;86 const extern unsigned int MAX_POOL_FRAGMENTATION; 87 const extern unsigned int MAX_FRAGMENTATION_SKIPS; 88 88 89 89 #endif /*DEFS_HPP_*/ -
src/element.cpp
rd74077 r8f4df1 26 26 next(NULL), 27 27 sort(NULL), 28 No(-1),29 28 Valence(0), 30 29 NoValenceOrbitals(0) … … 70 69 return string(symbol); 71 70 } 71 72 std::string element::getName() const{ 73 return string(name); 74 } 75 76 std::ostream &operator<<(std::ostream &ost,const element &elem){ 77 ost << elem.getName() << "(" << elem.getNumber() << ")"; 78 return ost; 79 } -
src/element.hpp
rd74077 r8f4df1 41 41 element *next; //!< next element in list 42 42 int *sort; //!< sorc criteria 43 int No; //!< number of element set on periodentafel::Output()44 43 double Valence; //!< number of valence electrons for this element 45 44 int NoValenceOrbitals; //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix() … … 53 52 atomicNumber_t getNumber() const; 54 53 std::string getSymbol() const; 54 std::string getName() const; 55 55 56 56 //> print element entries to screen … … 61 61 }; 62 62 63 std::ostream &operator<<(std::ostream&,const element&); 63 64 64 65 #endif /* ELEMENT_HPP_ */ -
src/ellipsoid.cpp
rd74077 r8f4df1 19 19 #include "ellipsoid.hpp" 20 20 #include "linkedcell.hpp" 21 #include " log.hpp"21 #include "Helpers/Log.hpp" 22 22 #include "tesselation.hpp" 23 #include " vector.hpp"24 #include " Matrix.hpp"25 #include " verbose.hpp"23 #include "LinearAlgebra/Vector.hpp" 24 #include "LinearAlgebra/Matrix.hpp" 25 #include "Helpers/Verbose.hpp" 26 26 27 27 /** Determines squared distance for a given point \a x to surface of ellipsoid. -
src/graph.cpp
rd74077 r8f4df1 13 13 #include "config.hpp" 14 14 #include "graph.hpp" 15 #include " verbose.hpp"16 #include " log.hpp"15 #include "Helpers/Verbose.hpp" 16 #include "Helpers/Log.hpp" 17 17 #include "molecule.hpp" 18 18 -
src/joiner.cpp
rd74077 r8f4df1 13 13 14 14 #include "datacreator.hpp" 15 #include " helpers.hpp"15 #include "Helpers/helpers.hpp" 16 16 #include "parser.hpp" 17 17 #include "periodentafel.hpp" 18 #include " verbose.hpp"18 #include "Helpers/Verbose.hpp" 19 19 20 20 //============================== MAIN ============================= -
src/leastsquaremin.cpp
rd74077 r8f4df1 11 11 12 12 #include "leastsquaremin.hpp" 13 #include " vector.hpp"13 #include "LinearAlgebra/Vector.hpp" 14 14 15 15 /** Determines sum of squared distances of \a X to all \a **vectors. -
src/linkedcell.cpp
rd74077 r8f4df1 8 8 9 9 #include "atom.hpp" 10 #include " helpers.hpp"10 #include "Helpers/helpers.hpp" 11 11 #include "linkedcell.hpp" 12 #include " verbose.hpp"13 #include " log.hpp"12 #include "Helpers/Verbose.hpp" 13 #include "Helpers/Log.hpp" 14 14 #include "molecule.hpp" 15 15 #include "tesselation.hpp" 16 #include " vector.hpp"16 #include "LinearAlgebra/Vector.hpp" 17 17 18 18 // ========================================================= class LinkedCell =========================================== -
src/linkedcell.hpp
rd74077 r8f4df1 24 24 25 25 #include "defs.hpp" 26 #include " vector.hpp"26 #include "LinearAlgebra/Vector.hpp" 27 27 28 28 /****************************************** forward declarations *****************************/ -
src/molecule.cpp
rd74077 r8f4df1 24 24 #include "element.hpp" 25 25 #include "graph.hpp" 26 #include " helpers.hpp"26 #include "Helpers/helpers.hpp" 27 27 #include "leastsquaremin.hpp" 28 28 #include "linkedcell.hpp" 29 29 #include "lists.hpp" 30 #include " log.hpp"30 #include "Helpers/Log.hpp" 31 31 #include "molecule.hpp" 32 32 … … 34 34 #include "stackclass.hpp" 35 35 #include "tesselation.hpp" 36 #include " vector.hpp"37 #include " Matrix.hpp"36 #include "LinearAlgebra/Vector.hpp" 37 #include "LinearAlgebra/Matrix.hpp" 38 38 #include "World.hpp" 39 39 #include "Box.hpp" 40 #include " Plane.hpp"40 #include "LinearAlgebra/Plane.hpp" 41 41 #include "Exceptions/LinearDependenceException.hpp" 42 42 … … 151 151 molecule::const_iterator molecule::erase( const_iterator loc ) 152 152 { 153 OBSERVE; 153 154 molecule::const_iterator iter = loc; 154 155 iter--; … … 156 157 atomIds.erase( atom->getId() ); 157 158 atoms.remove( atom ); 159 formula-=atom->getType(); 158 160 atom->removeFromMolecule(); 159 161 return iter; … … 162 164 molecule::const_iterator molecule::erase( atom * key ) 163 165 { 166 OBSERVE; 164 167 molecule::const_iterator iter = find(key); 165 168 if (iter != end()){ 166 169 atomIds.erase( key->getId() ); 167 170 atoms.remove( key ); 171 formula-=key->getType(); 168 172 key->removeFromMolecule(); 169 173 } … … 183 187 pair<molecule::iterator,bool> molecule::insert ( atom * const key ) 184 188 { 189 OBSERVE; 185 190 pair<atomIdSet::iterator,bool> res = atomIds.insert(key->getId()); 186 191 if (res.second) { // push atom if went well 187 192 atoms.push_back(key); 193 formula+=key->getType(); 188 194 return pair<iterator,bool>(molecule::iterator(--end()),res.second); 189 195 } else { … … 233 239 if (pointer != NULL) { 234 240 atom *walker = pointer->clone(); 241 formula += walker->getType(); 235 242 walker->setName(pointer->getName()); 236 243 walker->nr = last_atom++; // increase number within molecule … … 616 623 { 617 624 molecule *copy = World::getInstance().createMolecule(); 618 atom *LeftAtom = NULL, *RightAtom = NULL;619 625 620 626 // copy all atoms 621 ActOnCopyWithEachAtom ( &molecule::AddCopyAtom, copy);627 for_each(atoms.begin(),atoms.end(),bind1st(mem_fun(&molecule::AddCopyAtom),copy)); 622 628 623 629 // copy all bonds 624 bond *Binder = NULL;625 bond *NewBond = NULL;626 630 for(molecule::iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) 627 631 for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin()) 628 632 if ((*BondRunner)->leftatom == *AtomRunner) { 629 Binder = (*BondRunner);633 bond *Binder = (*BondRunner); 630 634 631 635 // get the pendant atoms of current bond in the copy molecule 632 copy->ActOnAllAtoms( &atom::EqualsFather, (const atom *)Binder->leftatom, (const atom **)&LeftAtom ); 633 copy->ActOnAllAtoms( &atom::EqualsFather, (const atom *)Binder->rightatom, (const atom **)&RightAtom ); 634 635 NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree); 636 atomSet::iterator leftiter=find_if(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::isFather),Binder->leftatom)); 637 atomSet::iterator rightiter=find_if(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::isFather),Binder->rightatom)); 638 ASSERT(leftiter!=atoms.end(),"No original left atom for bondcopy found"); 639 ASSERT(leftiter!=atoms.end(),"No original right atom for bondcopy found"); 640 atom *LeftAtom = *leftiter; 641 atom *RightAtom = *rightiter; 642 643 bond *NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree); 636 644 NewBond->Cyclic = Binder->Cyclic; 637 645 if (Binder->Cyclic) … … 640 648 } 641 649 // correct fathers 642 ActOnAllAtoms( &atom::CorrectFather);650 for_each(atoms.begin(),atoms.end(),mem_fun(&atom::CorrectFather)); 643 651 644 652 // copy values … … 849 857 * \param *out output stream 850 858 */ 851 bool molecule::Output(ofstream * const output) 852 { 853 int ElementNo[MAX_ELEMENTS], AtomNo[MAX_ELEMENTS]; 854 855 for (int i=0;i<MAX_ELEMENTS;++i) { 856 AtomNo[i] = 0; 857 ElementNo[i] = 0; 858 } 859 bool molecule::Output(ostream * const output) 860 { 859 861 if (output == NULL) { 860 862 return false; 861 863 } else { 864 int AtomNo[MAX_ELEMENTS]; 865 memset(AtomNo,0,(MAX_ELEMENTS-1)*sizeof(*AtomNo)); 866 enumeration<const element*> elementLookup = formula.enumerateElements(); 867 for(map<const element*,unsigned int>::iterator iter=elementLookup.there.begin(); 868 iter!=elementLookup.there.end();++iter){ 869 cout << "Enumerated element " << *iter->first << " with number " << iter->second << endl; 870 } 862 871 *output << "#Ion_TypeNr._Nr.R[0] R[1] R[2] MoveType (0 MoveIon, 1 FixedIon)" << endl; 863 SetIndexedArrayForEachAtomTo ( ElementNo, &element::Z, &AbsoluteValue, 1); 864 int current=1; 865 for (int i=0;i<MAX_ELEMENTS;++i) { 866 if (ElementNo[i] == 1) 867 ElementNo[i] = current++; 868 } 869 ActOnAllAtoms( &atom::OutputArrayIndexed, (ostream * const) output, (const int *)ElementNo, (int *)AtomNo, (const char *) NULL ); 872 for_each(atoms.begin(),atoms.end(),boost::bind(&atom::OutputArrayIndexed,_1,output,elementLookup,AtomNo,(const char*)0)); 870 873 return true; 871 874 } … … 910 913 { 911 914 DoLog(2) && (Log() << Verbose(2) << endl << "From Contents of ListOfBonds, all non-hydrogen atoms:" << endl); 912 ActOnAllAtoms (&atom::OutputBondOfAtom);915 for_each(atoms.begin(),atoms.end(),mem_fun(&atom::OutputBondOfAtom)); 913 916 DoLog(0) && (Log() << Verbose(0) << endl); 914 917 }; … … 933 936 for (int step=0;step<MDSteps;step++) { 934 937 *output << getAtomCount() << "\n\tCreated by molecuilder, step " << step << ", on " << ctime(&now); 935 ActOnAllAtoms( &atom::OutputTrajectoryXYZ, output, step);938 for_each(atoms.begin(),atoms.end(),boost::bind(&atom::OutputTrajectoryXYZ,_1,output,step)); 936 939 } 937 940 return true; … … 950 953 now = time((time_t *)NULL); // Get the system time and put it into 'now' as 'calender time' 951 954 *output << getAtomCount() << "\n\tCreated by molecuilder on " << ctime(&now); 952 ActOnAllAtoms( &atom::OutputXYZLine, output);955 for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputXYZLine),output)); 953 956 return true; 954 957 } else -
src/molecule.hpp
rd74077 r8f4df1 29 29 #include "Patterns/Cacheable.hpp" 30 30 #include "Formula.hpp" 31 #include "AtomSet.hpp" 31 32 32 33 #include "Descriptors/MoleculeDescriptor_impl.hpp" … … 84 85 85 86 public: 86 typedef std::list<atom*>atomSet;87 typedef ATOMSET(std::list) atomSet; 87 88 typedef std::set<atomId_t> atomIdSet; 88 89 typedef ObservedIterator<atomSet> iterator; … … 257 258 void Scale(const double ** const factor); 258 259 void DeterminePeriodicCenter(Vector ¢er); 259 Vector * DetermineCenterOfGravity() ;260 Vector * DetermineCenterOfGravity() const; 260 261 Vector * DetermineCenterOfAll() const; 261 262 Vector * DetermineCenterOfBox() const; … … 265 266 bool VerletForceIntegration(char *file, config &configuration, const size_t offset); 266 267 void Thermostats(config &configuration, double ActualTemp, int Thermostat); 267 void PrincipalAxisSystem(bool DoRotate);268 268 double VolumeOfConvexEnvelope(bool IsAngstroem); 269 269 … … 328 328 329 329 // Output routines. 330 bool Output( ofstream * const output);330 bool Output(std::ostream * const output); 331 331 bool OutputTrajectories(ofstream * const output); 332 332 void OutputListOfBonds() const; -
src/molecule_dynamics.cpp
rd74077 r8f4df1 12 12 #include "config.hpp" 13 13 #include "element.hpp" 14 #include " info.hpp"15 #include " verbose.hpp"16 #include " log.hpp"14 #include "Helpers/Info.hpp" 15 #include "Helpers/Verbose.hpp" 16 #include "Helpers/Log.hpp" 17 17 #include "molecule.hpp" 18 18 #include "parser.hpp" 19 #include " Plane.hpp"19 #include "LinearAlgebra/Plane.hpp" 20 20 #include "ThermoStatContainer.hpp" 21 21 -
src/molecule_fragmentation.cpp
rd74077 r8f4df1 15 15 #include "config.hpp" 16 16 #include "element.hpp" 17 #include " helpers.hpp"17 #include "Helpers/helpers.hpp" 18 18 #include "lists.hpp" 19 #include " verbose.hpp"20 #include " log.hpp"19 #include "Helpers/Verbose.hpp" 20 #include "Helpers/Log.hpp" 21 21 #include "molecule.hpp" 22 22 #include "periodentafel.hpp" 23 23 #include "World.hpp" 24 #include " Matrix.hpp"24 #include "LinearAlgebra/Matrix.hpp" 25 25 #include "Box.hpp" 26 26 #include "stackclass.hpp" -
src/molecule_geometry.cpp
rd74077 r8f4df1 10 10 #endif 11 11 12 #include "Helpers/helpers.hpp" 13 #include "Helpers/Log.hpp" 12 14 #include "Helpers/MemDebug.hpp" 15 #include "Helpers/Verbose.hpp" 16 #include "LinearAlgebra/Line.hpp" 17 #include "LinearAlgebra/Matrix.hpp" 18 #include "LinearAlgebra/Plane.hpp" 13 19 14 20 #include "atom.hpp" … … 16 22 #include "config.hpp" 17 23 #include "element.hpp" 18 #include "helpers.hpp"19 24 #include "leastsquaremin.hpp" 20 #include "verbose.hpp"21 #include "log.hpp"22 25 #include "molecule.hpp" 23 26 #include "World.hpp" 24 #include "Plane.hpp" 25 #include "Matrix.hpp" 27 26 28 #include "Box.hpp" 29 27 30 #include <boost/foreach.hpp> 28 31 … … 48 51 *iter -= *Center; 49 52 *iter -= *CenterBox; 50 iter->setPosition(domain.WrapPeriodically(iter->getPosition()));51 }53 } 54 atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1)); 52 55 53 56 delete(Center); … … 66 69 67 70 // go through all atoms 68 BOOST_FOREACH(atom* iter, atoms){ 69 iter->setPosition(domain.WrapPeriodically(iter->getPosition())); 70 } 71 atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1)); 71 72 72 73 return status; … … 167 168 * \return pointer to center of gravity vector 168 169 */ 169 Vector * molecule::DetermineCenterOfGravity() 170 Vector * molecule::DetermineCenterOfGravity() const 170 171 { 171 172 molecule::const_iterator iter = begin(); // start at first in list … … 250 251 BOOST_FOREACH(atom* iter, atoms){ 251 252 *iter += *trans; 252 iter->setPosition(domain.WrapPeriodically(iter->getPosition()));253 }253 } 254 atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1)); 254 255 255 256 }; … … 263 264 OBSERVE; 264 265 Plane p(*n,0); 265 BOOST_FOREACH(atom* iter, atoms ){ 266 iter->setPosition(p.mirrorVector(iter->getPosition())); 267 } 266 atoms.transformNodes(boost::bind(&Plane::mirrorVector,p,_1)); 268 267 }; 269 268 … … 325 324 }; 326 325 327 /** Transforms/Rotates the given molecule into its principal axis system.328 * \param *out output stream for debugging329 * \param DoRotate whether to rotate (true) or only to determine the PAS.330 * TODO treatment of trajetories missing331 */332 void molecule::PrincipalAxisSystem(bool DoRotate)333 {334 double InertiaTensor[NDIM*NDIM];335 Vector *CenterOfGravity = DetermineCenterOfGravity();336 337 CenterPeriodic();338 339 // reset inertia tensor340 for(int i=0;i<NDIM*NDIM;i++)341 InertiaTensor[i] = 0.;342 343 // sum up inertia tensor344 for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {345 Vector x = (*iter)->getPosition();346 //x.SubtractVector(CenterOfGravity);347 InertiaTensor[0] += (*iter)->getType()->mass*(x[1]*x[1] + x[2]*x[2]);348 InertiaTensor[1] += (*iter)->getType()->mass*(-x[0]*x[1]);349 InertiaTensor[2] += (*iter)->getType()->mass*(-x[0]*x[2]);350 InertiaTensor[3] += (*iter)->getType()->mass*(-x[1]*x[0]);351 InertiaTensor[4] += (*iter)->getType()->mass*(x[0]*x[0] + x[2]*x[2]);352 InertiaTensor[5] += (*iter)->getType()->mass*(-x[1]*x[2]);353 InertiaTensor[6] += (*iter)->getType()->mass*(-x[2]*x[0]);354 InertiaTensor[7] += (*iter)->getType()->mass*(-x[2]*x[1]);355 InertiaTensor[8] += (*iter)->getType()->mass*(x[0]*x[0] + x[1]*x[1]);356 }357 // print InertiaTensor for debugging358 DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);359 for(int i=0;i<NDIM;i++) {360 for(int j=0;j<NDIM;j++)361 DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");362 DoLog(0) && (Log() << Verbose(0) << endl);363 }364 DoLog(0) && (Log() << Verbose(0) << endl);365 366 // diagonalize to determine principal axis system367 gsl_eigen_symmv_workspace *T = gsl_eigen_symmv_alloc(NDIM);368 gsl_matrix_view m = gsl_matrix_view_array(InertiaTensor, NDIM, NDIM);369 gsl_vector *eval = gsl_vector_alloc(NDIM);370 gsl_matrix *evec = gsl_matrix_alloc(NDIM, NDIM);371 gsl_eigen_symmv(&m.matrix, eval, evec, T);372 gsl_eigen_symmv_free(T);373 gsl_eigen_symmv_sort(eval, evec, GSL_EIGEN_SORT_ABS_DESC);374 375 for(int i=0;i<NDIM;i++) {376 DoLog(1) && (Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i));377 DoLog(0) && (Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl);378 }379 380 // check whether we rotate or not381 if (DoRotate) {382 DoLog(1) && (Log() << Verbose(1) << "Transforming molecule into PAS ... ");383 // the eigenvectors specify the transformation matrix384 Matrix M = Matrix(evec->data);385 Vector tempVector;386 BOOST_FOREACH(atom* iter, atoms){387 tempVector = iter->getPosition();388 tempVector *= M;389 iter->setPosition(tempVector);390 }391 DoLog(0) && (Log() << Verbose(0) << "done." << endl);392 393 // summing anew for debugging (resulting matrix has to be diagonal!)394 // reset inertia tensor395 for(int i=0;i<NDIM*NDIM;i++)396 InertiaTensor[i] = 0.;397 398 // sum up inertia tensor399 for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {400 Vector x = (*iter)->getPosition();401 InertiaTensor[0] += (*iter)->getType()->mass*(x[1]*x[1] + x[2]*x[2]);402 InertiaTensor[1] += (*iter)->getType()->mass*(-x[0]*x[1]);403 InertiaTensor[2] += (*iter)->getType()->mass*(-x[0]*x[2]);404 InertiaTensor[3] += (*iter)->getType()->mass*(-x[1]*x[0]);405 InertiaTensor[4] += (*iter)->getType()->mass*(x[0]*x[0] + x[2]*x[2]);406 InertiaTensor[5] += (*iter)->getType()->mass*(-x[1]*x[2]);407 InertiaTensor[6] += (*iter)->getType()->mass*(-x[2]*x[0]);408 InertiaTensor[7] += (*iter)->getType()->mass*(-x[2]*x[1]);409 InertiaTensor[8] += (*iter)->getType()->mass*(x[0]*x[0] + x[1]*x[1]);410 }411 // print InertiaTensor for debugging412 DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);413 for(int i=0;i<NDIM;i++) {414 for(int j=0;j<NDIM;j++)415 DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");416 DoLog(0) && (Log() << Verbose(0) << endl);417 }418 DoLog(0) && (Log() << Verbose(0) << endl);419 }420 421 // free everything422 delete(CenterOfGravity);423 gsl_vector_free(eval);424 gsl_matrix_free(evec);425 };426 427 428 326 /** Align all atoms in such a manner that given vector \a *n is along z axis. 429 327 * \param n[] alignment vector. -
src/molecule_graph.cpp
rd74077 r8f4df1 18 18 #include "defs.hpp" 19 19 #include "element.hpp" 20 #include " helpers.hpp"21 #include " info.hpp"20 #include "Helpers/helpers.hpp" 21 #include "Helpers/Info.hpp" 22 22 #include "linkedcell.hpp" 23 23 #include "lists.hpp" 24 #include " verbose.hpp"25 #include " log.hpp"24 #include "Helpers/Verbose.hpp" 25 #include "Helpers/Log.hpp" 26 26 #include "molecule.hpp" 27 27 #include "World.hpp" 28 28 #include "Helpers/fast_functions.hpp" 29 29 #include "Helpers/Assert.hpp" 30 #include " Matrix.hpp"30 #include "LinearAlgebra/Matrix.hpp" 31 31 #include "Box.hpp" 32 32 #include "stackclass.hpp" -
src/molecule_pointcloud.cpp
rd74077 r8f4df1 10 10 #include "atom.hpp" 11 11 #include "config.hpp" 12 #include " info.hpp"12 #include "Helpers/Info.hpp" 13 13 #include "molecule.hpp" 14 14 -
src/moleculelist.cpp
rd74077 r8f4df1 23 23 #include "config.hpp" 24 24 #include "element.hpp" 25 #include " helpers.hpp"25 #include "Helpers/helpers.hpp" 26 26 #include "linkedcell.hpp" 27 27 #include "lists.hpp" 28 #include " verbose.hpp"29 #include " log.hpp"28 #include "Helpers/Verbose.hpp" 29 #include "Helpers/Log.hpp" 30 30 #include "molecule.hpp" 31 31 #include "periodentafel.hpp" 32 32 #include "Helpers/Assert.hpp" 33 #include " Matrix.hpp"33 #include "LinearAlgebra/Matrix.hpp" 34 34 #include "Box.hpp" 35 35 #include "stackclass.hpp" -
src/parser.cpp
rd74077 r8f4df1 11 11 #include <cstring> 12 12 13 #include " helpers.hpp"13 #include "Helpers/helpers.hpp" 14 14 #include "parser.hpp" 15 #include " verbose.hpp"15 #include "Helpers/Verbose.hpp" 16 16 17 17 // include config.h -
src/periodentafel.cpp
rd74077 r8f4df1 17 17 #include "element.hpp" 18 18 #include "elements_db.hpp" 19 #include " helpers.hpp"19 #include "Helpers/helpers.hpp" 20 20 #include "lists.hpp" 21 #include " log.hpp"21 #include "Helpers/Log.hpp" 22 22 #include "periodentafel.hpp" 23 #include " verbose.hpp"23 #include "Helpers/Verbose.hpp" 24 24 25 25 using namespace std; -
src/stackclass.hpp
rd74077 r8f4df1 11 11 #endif 12 12 13 #include " verbose.hpp"14 #include " log.hpp"13 #include "Helpers/Verbose.hpp" 14 #include "Helpers/Log.hpp" 15 15 16 16 /****************************************** forward declarations *****************************/ -
src/tesselation.cpp
rd74077 r8f4df1 11 11 #include <iomanip> 12 12 13 #include "Helpers/helpers.hpp" 14 #include "Helpers/Info.hpp" 13 15 #include "BoundaryPointSet.hpp" 14 16 #include "BoundaryLineSet.hpp" … … 18 20 #include "CandidateForTesselation.hpp" 19 21 #include "PointCloud.hpp" 20 #include "helpers.hpp"21 #include "info.hpp"22 22 #include "linkedcell.hpp" 23 #include " log.hpp"23 #include "Helpers/Log.hpp" 24 24 #include "tesselation.hpp" 25 25 #include "tesselationhelpers.hpp" 26 26 #include "triangleintersectionlist.hpp" 27 #include " vector.hpp"28 #include "Line .hpp"29 #include " vector_ops.hpp"30 #include " verbose.hpp"31 #include " Plane.hpp"27 #include "LinearAlgebra/Vector.hpp" 28 #include "LinearAlgebra/Line.hpp" 29 #include "LinearAlgebra/vector_ops.hpp" 30 #include "Helpers/Verbose.hpp" 31 #include "LinearAlgebra/Plane.hpp" 32 32 #include "Exceptions/LinearDependenceException.hpp" 33 33 #include "Helpers/Assert.hpp" -
src/tesselation.hpp
rd74077 r8f4df1 30 30 #include "TesselPoint.hpp" 31 31 #include "atom_particleinfo.hpp" 32 #include " helpers.hpp"33 #include " vector.hpp"32 #include "Helpers/helpers.hpp" 33 #include "LinearAlgebra/Vector.hpp" 34 34 35 35 -
src/tesselationhelpers.cpp
rd74077 r8f4df1 15 15 #include "BoundaryTriangleSet.hpp" 16 16 #include "CandidateForTesselation.hpp" 17 #include " info.hpp"17 #include "Helpers/Info.hpp" 18 18 #include "linkedcell.hpp" 19 #include " linearsystemofequations.hpp"20 #include " log.hpp"19 #include "LinearAlgebra/linearsystemofequations.hpp" 20 #include "Helpers/Log.hpp" 21 21 #include "tesselation.hpp" 22 22 #include "tesselationhelpers.hpp" 23 #include " vector.hpp"24 #include "Line .hpp"25 #include " vector_ops.hpp"26 #include " verbose.hpp"27 #include " Plane.hpp"28 #include " Matrix.hpp"23 #include "LinearAlgebra/Vector.hpp" 24 #include "LinearAlgebra/Line.hpp" 25 #include "LinearAlgebra/vector_ops.hpp" 26 #include "Helpers/Verbose.hpp" 27 #include "LinearAlgebra/Plane.hpp" 28 #include "LinearAlgebra/Matrix.hpp" 29 29 30 30 void GetSphere(Vector * const center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS) -
src/test/ActOnAlltest.hpp
rd74077 r8f4df1 12 12 13 13 #include <list> 14 #include "../ vector.hpp"14 #include "../LinearAlgebra/Vector.hpp" 15 15 16 16 #define ListOfVectors list<Vector *> -
src/triangleintersectionlist.cpp
rd74077 r8f4df1 15 15 #include "triangleintersectionlist.hpp" 16 16 17 #include "Helpers/Info.hpp" 18 #include "BoundaryMaps.hpp" 17 19 #include "BoundaryPointSet.hpp" 18 20 #include "BoundaryLineSet.hpp" 19 21 #include "BoundaryTriangleSet.hpp" 20 #include "info.hpp"21 22 #include "tesselation.hpp" 22 #include " vector.hpp"23 #include " verbose.hpp"23 #include "LinearAlgebra/Vector.hpp" 24 #include "Helpers/Verbose.hpp" 24 25 25 26 /** Constructor for class TriangleIntersectionList. -
src/unittests/ActOnAllUnitTest.cpp
rd74077 r8f4df1 14 14 #include "../test/ActOnAlltest.hpp" 15 15 #include "ActOnAllUnitTest.hpp" 16 #include " vector.hpp"16 #include "LinearAlgebra/Vector.hpp" 17 17 18 18 #ifdef HAVE_TESTRUNNER -
src/unittests/ActionSequenceTest.cpp
rd74077 r8f4df1 17 17 #include "Actions/ActionRegistry.hpp" 18 18 19 #include "DummyUI.hpp" 20 19 21 #ifdef HAVE_TESTRUNNER 20 22 #include "UnitTestMain.hpp" … … 33 35 virtual ~canUndoActionStub(){} 34 36 35 virtual Dialog* createDialog(){ 36 return NULL; 37 virtual Dialog* fillDialog(Dialog *dialog){ 38 ASSERT(dialog,"No Dialog given when filling action dialog"); 39 return dialog; 37 40 } 38 41 … … 60 63 virtual ~cannotUndoActionStub(){} 61 64 62 virtual Dialog* createDialog(){ 63 return NULL; 65 virtual Dialog* fillDialog(Dialog *dialog){ 66 ASSERT(dialog,"No Dialog given when filling action dialog"); 67 return dialog; 64 68 } 65 69 … … 90 94 virtual ~wasCalledActionStub(){} 91 95 92 virtual Dialog* createDialog(){93 return NULL;96 virtual Dialog* fillDialog(Dialog *dialog){ 97 return dialog; 94 98 } 95 99 virtual Action::state_ptr performCall(){ … … 119 123 120 124 void ActionSequenceTest::setUp(){ 125 static bool hasDescriptor = false; 121 126 ActionHistory::init(); 127 // TODO: find a way to really reset the factory to a clean state in tear-down 128 if(!hasDescriptor){ 129 UIFactory::registerFactory(new DummyUIFactory::description()); 130 hasDescriptor = true; 131 } 132 UIFactory::makeUserInterface("Dummy"); 122 133 // create some necessary stubs used in this test 123 134 positive1 = new canUndoActionStub(); … … 146 157 ActionHistory::purgeInstance(); 147 158 ActionRegistry::purgeInstance(); 159 UIFactory::purgeInstance(); 148 160 } 149 161 … … 231 243 232 244 CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled()); 233 CPPUNIT_ASSERT_EQUAL(true,wasCalled 1->wasCalled());245 CPPUNIT_ASSERT_EQUAL(true,wasCalled2->wasCalled()); 234 246 235 247 ActionHistory::getInstance().undoLast(); 236 248 237 249 CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled()); 238 CPPUNIT_ASSERT_EQUAL(false,wasCalled 1->wasCalled());239 240 } 241 242 250 CPPUNIT_ASSERT_EQUAL(false,wasCalled2->wasCalled()); 251 252 } 253 254 -
src/unittests/FormulaUnittest.cpp
rd74077 r8f4df1 185 185 } 186 186 { 187 Formula formula("CH2(COOH)2"); 188 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)4); 189 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)4); 190 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)3); 191 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0); 192 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 193 } 194 { 195 Formula formula("K4[Fe(CN)6]"); 196 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)0); 197 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)0); 198 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)6); 199 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0); 200 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 201 CPPUNIT_ASSERT_EQUAL(formula["K"],(unsigned int)4); 202 CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)1); 203 CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)6); 204 } 205 { 206 Formula formula("[CrCl3(H2O)3]"); 207 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)6); 208 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)3); 209 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)0); 210 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0); 211 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 212 CPPUNIT_ASSERT_EQUAL(formula["Cr"],(unsigned int)1); 213 CPPUNIT_ASSERT_EQUAL(formula["Cl"],(unsigned int)3); 214 } 215 { 216 Formula formula("Mg3[Fe(CN)6]2"); 217 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)0); 218 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)0); 219 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)12); 220 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0); 221 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 222 CPPUNIT_ASSERT_EQUAL(formula["Mg"],(unsigned int)3); 223 CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)2); 224 CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)12); 225 } 226 { 227 Formula formula("Na[Fe((HO2CCH2)2NCH2CH2N(CH2CO2H)2)]"); 228 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)16); 229 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)8); 230 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)10); 231 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)1); 232 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 233 CPPUNIT_ASSERT_EQUAL(formula["Mg"],(unsigned int)0); 234 CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)1); 235 CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)2); 236 } 237 { 187 238 CPPUNIT_ASSERT_THROW(Formula formula("74107"),ParseError); 188 239 CPPUNIT_ASSERT_THROW(Formula formula(" "),ParseError); … … 192 243 CPPUNIT_ASSERT_THROW(Formula formula("1NaCl"),ParseError); 193 244 CPPUNIT_ASSERT_THROW(Formula formula("Mag"),ParseError); 245 CPPUNIT_ASSERT_THROW(Formula formula("AgCl)"),ParseError); 246 CPPUNIT_ASSERT_THROW(Formula formula("(Na"),ParseError); 247 CPPUNIT_ASSERT_THROW(Formula formula("(Mag)"),ParseError); 248 CPPUNIT_ASSERT_THROW(Formula formula("MgCl2)"),ParseError); 249 CPPUNIT_ASSERT_THROW(Formula formula("((MgCl2)"),ParseError); 250 CPPUNIT_ASSERT_THROW(Formula formula("(MgCl2))"),ParseError); 251 CPPUNIT_ASSERT_THROW(Formula formula("(MgCl2]"),ParseError); 252 CPPUNIT_ASSERT_THROW(Formula formula("[MgCl2)"),ParseError); 253 CPPUNIT_ASSERT_THROW(Formula formula("N(aCl"),ParseError); 254 CPPUNIT_ASSERT_THROW(Formula formula("Na()Cl"),ParseError); 194 255 } 195 256 -
src/unittests/LineUnittest.cpp
rd74077 r8f4df1 8 8 #include "LineUnittest.hpp" 9 9 10 #include " vector.hpp"10 #include "LinearAlgebra/Vector.hpp" 11 11 #include "Exceptions/LinearDependenceException.hpp" 12 12 #include "Exceptions/SkewException.hpp" -
src/unittests/LineUnittest.hpp
rd74077 r8f4df1 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 #include "Line .hpp"13 #include "LinearAlgebra/Line.hpp" 14 14 15 15 class LineUnittest : public CppUnit::TestFixture -
src/unittests/Makefile.am
rd74077 r8f4df1 7 7 AM_CXXFLAGS = $(CPPUNIT_CFLAGS) 8 8 9 MENUTESTS = \10 ActionSequenceTest11 12 9 TESTS = \ 10 ActionSequenceTest \ 13 11 ActOnAllUnitTest \ 14 12 AnalysisBondsUnitTests \ … … 19 17 AtomDescriptorTest \ 20 18 BondGraphUnitTest \ 19 BoxUnittest \ 21 20 CacheableTest \ 22 21 CountBondsUnitTest \ … … 44 43 Tesselation_BoundaryTriangleUnitTest \ 45 44 Tesselation_InOutsideUnitTest \ 46 VectorUnitTest \ 47 ${MENUTESTS} 45 VectorUnitTest 48 46 49 47 … … 51 49 noinst_PROGRAMS = $(TESTS) TestRunner 52 50 53 GSLLIBS = ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} 54 ALLLIBS = ../libmolecuilder.a ${GSLLIBS} 55 PARSERLIBS = ../libparser.a ${ALLLIBS} 51 GSLLIBS = \ 52 ../LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \ 53 ../Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \ 54 ../Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \ 55 $(BOOST_LIB) \ 56 ${BOOST_THREAD_LIB} 57 ALLLIBS = \ 58 ../Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \ 59 ${PARSERLIBS} \ 60 ../libMolecuilder-@MOLECUILDER_API_VERSION@.la \ 61 ${GSLLIBS} \ 62 ${BOOST_PROGRAM_OPTIONS_LIB} 63 PARSERLIBS = ../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la 64 UILIBS = ../UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la 56 65 57 66 TESTSOURCES = \ … … 65 74 atomsCalculationTest.cpp \ 66 75 bondgraphunittest.cpp \ 76 BoxUnittest.cpp \ 67 77 CacheableTest.cpp \ 68 78 CountBondsUnitTest.cpp \ … … 102 112 atomsCalculationTest.hpp \ 103 113 bondgraphunittest.hpp \ 114 BoxUnittest.hpp \ 104 115 CacheableTest.hpp \ 105 116 CountBondsUnitTest.hpp \ … … 118 129 MoleculeDescriptorTest.hpp \ 119 130 periodentafelTest.hpp \ 131 ParserUnitTest.hpp \ 120 132 PlaneUnittest.hpp \ 121 133 ObserverTest.hpp \ … … 128 140 129 141 130 ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hppActionSequenceTest.cpp ActionSequenceTest.hpp131 ActionSequenceTest_LDADD = ${ ALLLIBS}142 ActionSequenceTest_SOURCES = UnitTestMain.cpp ActionSequenceTest.cpp ActionSequenceTest.hpp 143 ActionSequenceTest_LDADD = ${UILIBS} ${ALLLIBS} 132 144 133 145 ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp … … 155 167 BondGraphUnitTest_LDADD = ${ALLLIBS} 156 168 169 BoxUnittest_SOURCES = UnitTestMain.cpp BoxUnittest.cpp BoxUnittest.hpp 170 BoxUnittest_LDADD = ${ALLLIBS} 171 157 172 CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp 158 173 CacheableTest_LDADD = ${ALLLIBS} … … 165 180 166 181 GSLMatrixSymmetricUnitTest_SOURCES = UnitTestMain.cpp gslmatrixsymmetricunittest.cpp gslmatrixsymmetricunittest.hpp 167 GSLMatrixSymmetricUnitTest_LDADD = ${ GSLLIBS}182 GSLMatrixSymmetricUnitTest_LDADD = ${ALLLIBS} 168 183 169 184 GSLMatrixUnitTest_SOURCES = UnitTestMain.cpp gslmatrixunittest.cpp gslmatrixunittest.hpp 170 GSLMatrixUnitTest_LDADD = ${ GSLLIBS}185 GSLMatrixUnitTest_LDADD = ${ALLLIBS} 171 186 172 187 GSLVectorUnitTest_SOURCES = UnitTestMain.cpp gslvectorunittest.cpp gslvectorunittest.hpp 173 GSLVectorUnitTest_LDADD = ${ GSLLIBS}188 GSLVectorUnitTest_LDADD = ${ALLLIBS} 174 189 175 190 InfoUnitTest_SOURCES = UnitTestMain.cpp infounittest.cpp infounittest.hpp … … 192 207 193 208 manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp 194 manipulateAtomsTest_LDADD = ${ ALLLIBS}209 manipulateAtomsTest_LDADD = ${UILIBS} ${ALLLIBS} 195 210 196 211 MatrixUnittest_SOURCES = UnitTestMain.cpp MatrixUnittest.cpp MatrixUnittest.hpp … … 204 219 205 220 ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp 206 ParserUnitTest_LDADD = ${ PARSERLIBS}221 ParserUnitTest_LDADD = ${ALLLIBS} 207 222 208 223 periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp … … 224 239 TesselationUnitTest_LDADD = ${ALLLIBS} 225 240 226 Tesselation_BoundaryTriangleUnitTest_SOURCES = UnitTestMain.cpp tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp Stubs/TesselPoint_stub.cpp Stubs/TesselPoint_stub.hpp241 Tesselation_BoundaryTriangleUnitTest_SOURCES = UnitTestMain.cpp tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp 227 242 Tesselation_BoundaryTriangleUnitTest_LDADD = ${ALLLIBS} 228 243 229 Tesselation_InOutsideUnitTest_SOURCES = UnitTestMain.cpp tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp Stubs/TesselPoint_stub.cpp Stubs/TesselPoint_stub.hpp244 Tesselation_InOutsideUnitTest_SOURCES = UnitTestMain.cpp tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp 230 245 Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS} 231 246 232 TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS) Stubs/TesselPoint_stub.cpp Stubs/TesselPoint_stub.hpp233 TestRunner_LDADD = ${ ALLLIBS}247 TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS) 248 TestRunner_LDADD = ${UILIBS} ${ALLLIBS} 234 249 235 250 VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp -
src/unittests/MatrixUnittest.cpp
rd74077 r8f4df1 11 11 12 12 #include "MatrixUnittest.hpp" 13 #include " Matrix.hpp"14 #include " vector.hpp"13 #include "LinearAlgebra/Matrix.hpp" 14 #include "LinearAlgebra/Vector.hpp" 15 15 #include "Exceptions/NotInvertibleException.hpp" 16 16 -
src/unittests/PlaneUnittest.cpp
rd74077 r8f4df1 18 18 #endif /*HAVE_TESTRUNNER*/ 19 19 20 #include " vector.hpp"21 #include "Line .hpp"20 #include "LinearAlgebra/Vector.hpp" 21 #include "LinearAlgebra/Line.hpp" 22 22 23 23 CPPUNIT_TEST_SUITE_REGISTRATION( PlaneUnittest ); -
src/unittests/PlaneUnittest.hpp
rd74077 r8f4df1 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 #include " Plane.hpp"13 #include "LinearAlgebra/Plane.hpp" 14 14 15 15 class PlaneUnittest : public CppUnit::TestFixture -
src/unittests/ShapeUnittest.cpp
rd74077 r8f4df1 16 16 #endif /*HAVE_TESTRUNNER*/ 17 17 18 #include "LinearAlgebra/Vector.hpp" 18 19 #include "Shapes/Shape.hpp" 19 #include "vector.cpp"20 20 21 21 // Registers the fixture into the 'registry' -
src/unittests/ShapeUnittest.hpp
rd74077 r8f4df1 14 14 class Vector; 15 15 16 #include " vector.hpp"16 #include "LinearAlgebra/Vector.hpp" 17 17 18 18 class ShapeUnittest : public CppUnit::TestFixture -
src/unittests/analysisbondsunittest.cpp
rd74077 r8f4df1 24 24 #include "molecule.hpp" 25 25 #include "periodentafel.hpp" 26 #include " vector.hpp"26 #include "LinearAlgebra/Vector.hpp" 27 27 #include "World.hpp" 28 28 -
src/unittests/bondgraphunittest.cpp
rd74077 r8f4df1 23 23 #include "bondgraph.hpp" 24 24 #include "element.hpp" 25 #include " log.hpp"25 #include "Helpers/Log.hpp" 26 26 #include "molecule.hpp" 27 27 #include "periodentafel.hpp" -
src/unittests/gslmatrixsymmetricunittest.hpp
rd74077 r8f4df1 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 #include " gslmatrix.hpp"13 #include "LinearAlgebra/gslmatrix.hpp" 14 14 15 15 /********************************************** Test classes **************************************/ -
src/unittests/gslmatrixunittest.hpp
rd74077 r8f4df1 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 #include " gslmatrix.hpp"13 #include "LinearAlgebra/gslmatrix.hpp" 14 14 15 15 /********************************************** Test classes **************************************/ -
src/unittests/gslvectorunittest.hpp
rd74077 r8f4df1 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 #include " gslvector.hpp"13 #include "LinearAlgebra/gslvector.hpp" 14 14 15 15 /********************************************** Test classes **************************************/ -
src/unittests/infounittest.cpp
rd74077 r8f4df1 15 15 #include <stdio.h> 16 16 17 #include " info.hpp"17 #include "Helpers/Info.hpp" 18 18 #include "infounittest.hpp" 19 #include " log.hpp"19 #include "Helpers/Log.hpp" 20 20 21 21 #ifdef HAVE_TESTRUNNER -
src/unittests/linearsystemofequationsunittest.cpp
rd74077 r8f4df1 15 15 16 16 #include "linearsystemofequationsunittest.hpp" 17 #include " vector.hpp"17 #include "LinearAlgebra/Vector.hpp" 18 18 19 19 #ifdef HAVE_TESTRUNNER -
src/unittests/linearsystemofequationsunittest.hpp
rd74077 r8f4df1 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 #include " linearsystemofequations.hpp"13 #include "LinearAlgebra/linearsystemofequations.hpp" 14 14 15 15 /********************************************** Test classes **************************************/ -
src/unittests/logunittest.cpp
rd74077 r8f4df1 11 11 12 12 #include "logunittest.hpp" 13 #include " log.hpp"13 #include "Helpers/Log.hpp" 14 14 #include "defs.hpp" 15 #include " verbose.hpp"15 #include "Helpers/Verbose.hpp" 16 16 17 17 #ifdef HAVE_TESTRUNNER -
src/unittests/manipulateAtomsTest.cpp
rd74077 r8f4df1 22 22 #include "World.hpp" 23 23 #include "atom.hpp" 24 25 #include "DummyUI.hpp" 24 26 25 27 #ifdef HAVE_TESTRUNNER … … 72 74 // set up and tear down 73 75 void manipulateAtomsTest::setUp(){ 76 static bool hasDescriptor = false; 74 77 ActionHistory::init(); 75 78 World::getInstance(); 79 // TODO: find a way to really reset the factory to a clean state in tear-down 80 if(!hasDescriptor){ 81 UIFactory::registerFactory(new DummyUIFactory::description()); 82 hasDescriptor = true; 83 } 84 UIFactory::makeUserInterface("Dummy"); 76 85 for(int i=0;i<ATOM_COUNT;++i){ 77 86 atoms[i]= new AtomStub(i); … … 83 92 ActionRegistry::purgeInstance(); 84 93 ActionHistory::purgeInstance(); 94 UIFactory::purgeInstance(); 85 95 } 86 96 -
src/unittests/memoryallocatorunittest.cpp
rd74077 r8f4df1 13 13 #include "memoryallocatorunittest.hpp" 14 14 #include "memoryusageobserver.hpp" 15 #include " helpers.hpp"16 #include " log.hpp"15 #include "Helpers/helpers.hpp" 16 #include "Helpers/Log.hpp" 17 17 #include "defs.hpp" 18 18 -
src/unittests/stackclassunittest.cpp
rd74077 r8f4df1 13 13 14 14 #include "stackclassunittest.hpp" 15 #include " log.hpp"15 #include "Helpers/Log.hpp" 16 16 17 17 #ifdef HAVE_TESTRUNNER -
src/unittests/tesselation_insideoutsideunittest.cpp
rd74077 r8f4df1 21 21 #include "CandidateForTesselation.hpp" 22 22 #include "tesselation_insideoutsideunittest.hpp" 23 #include " verbose.hpp"23 #include "Helpers/Verbose.hpp" 24 24 25 25 #ifdef HAVE_TESTRUNNER -
src/unittests/vectorunittest.cpp
rd74077 r8f4df1 14 14 15 15 #include "defs.hpp" 16 #include " log.hpp"17 #include " vector.hpp"18 #include " vector_ops.hpp"16 #include "Helpers/Log.hpp" 17 #include "LinearAlgebra/Vector.hpp" 18 #include "LinearAlgebra/vector_ops.hpp" 19 19 #include "vectorunittest.hpp" 20 #include " Plane.hpp"20 #include "LinearAlgebra/Plane.hpp" 21 21 #include "Exceptions/LinearDependenceException.hpp" 22 #include " Matrix.hpp"22 #include "LinearAlgebra/Matrix.hpp" 23 23 24 24 #ifdef HAVE_TESTRUNNER -
src/unittests/vectorunittest.hpp
rd74077 r8f4df1 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 #include " vector.hpp"13 #include "LinearAlgebra/Vector.hpp" 14 14 15 15 /********************************************** Test classes **************************************/ -
test_all.sh
rd74077 r8f4df1 135 135 echo -n " $test: " >> $outfile; 136 136 valgrind -v --error-exitcode=255 $test >> $logfile 2>&1; 137 if $?137 if [ $? ] 138 138 then 139 139 echo "OK" >> $outfile -
tests/Tesselations/Makefile.am
rd74077 r8f4df1 1 TESTS = 1_2-dimethoxyethane.test \ 2 1_2-dimethylbenzene.test \ 3 2-methylcyclohexanone.test \ 4 benzene.test \ 5 cholesterol.test \ 6 cycloheptane.test \ 7 dimethyl_bromomalonate.test \ 8 glucose.test \ 9 heptan.test \ 10 isoleucine.test \ 11 neohexane.test \ 12 N_N-dimethylacetamide.test \ 13 proline.test \ 14 putrescine.test \ 15 tartaric_acid.test 1 TESTS = \ 2 1_2-dimethoxyethane.test \ 3 1_2-dimethylbenzene.test \ 4 2-methylcyclohexanone.test \ 5 benzene.test \ 6 cholesterol.test \ 7 cycloheptane.test \ 8 dimethyl_bromomalonate.test \ 9 glucose.test \ 10 isoleucine.test \ 11 neohexane.test \ 12 N_N-dimethylacetamide.test \ 13 proline.test \ 14 putrescine.test \ 15 tartaric_acid.test 16 17 # heptan.test -
tests/Tesselations/defs.in
rd74077 r8f4df1 54 54 #echo "Current dir is `pwd`, calling $MOLECUILDER $mol.conf -e $exec_prefix -p ../$mol.xyz -N $RADIUS $FILENAME." 55 55 if [ -e $mol.dbond ]; then 56 $MOLECUILDER $mol.conf -e $exec_prefix -p../$mol.xyz -A $mol.dbond --select-molecule-by-id 0 -N $RADIUS --nonconvex-file $FILENAME 2>stderr >stdout || exitcode=$?56 $MOLECUILDER -i ../$mol.xyz -A $mol.dbond --select-molecule-by-id 0 -N $RADIUS --nonconvex-file $FILENAME 2>stderr >stdout || exitcode=$? 57 57 else 58 $MOLECUILDER $mol.conf -e $exec_prefix -p../$mol.xyz --select-molecule-by-id 0 -N $RADIUS --nonconvex-file $FILENAME 2>stderr >stdout || exitcode=$?58 $MOLECUILDER -i ../$mol.xyz --select-molecule-by-id 0 -N $RADIUS --nonconvex-file $FILENAME 2>stderr >stdout || exitcode=$? 59 59 fi 60 60 #echo "Molecuilder done with exitcode $exitcode." -
tests/regression/testsuite-molecules.at
rd74077 r8f4df1 61 61 62 62 # 8. Rotate to PAS 63 AT_SETUP([Molecules - BROKEN:Rotate to PAS])63 AT_SETUP([Molecules - Rotate to PAS]) 64 64 AT_KEYWORDS([Molecules]) 65 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/pre/test.* .], 0) 66 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m 0], 0, [stdout], [stderr]) 67 #AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 65 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/pre/test-*.xyz .], 0) 66 AT_CHECK([../../molecuilder -i test-rotated-z90.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr]) 67 AT_CHECK([file="test-rotated-z90.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 68 AT_CHECK([../../molecuilder -i test-rotated-z180.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr]) 69 AT_CHECK([file="test-rotated-z180.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 70 AT_CHECK([../../molecuilder -i test-rotated-z360.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr]) 71 AT_CHECK([file="test-rotated-z360.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 72 AT_CHECK([../../molecuilder -i test-rotated-xYz20.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr]) 73 AT_CHECK([file="test-rotated-xYz20.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 68 74 AT_CLEANUP 69 75 76 # 9. Rotate around origin 77 AT_SETUP([Molecules - Rotate around origin]) 78 AT_KEYWORDS([Molecules]) 79 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0) 80 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-origin 90. --position "0,0,1"], 0, [stdout], [stderr]) 81 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z90.xyz], 0, [ignore], [ignore]) 82 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0) 83 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-origin 180. --position "0,0,1"], 0, [stdout], [stderr]) 84 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z180.xyz], 0, [ignore], [ignore]) 85 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0) 86 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-origin 360. --position "0,0,1"], 0, [stdout], [stderr]) 87 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z360.xyz], 0, [ignore], [ignore]) 88 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz], 0, [ignore], [ignore]) 89 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0) 90 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-origin 20. --position "1,2,1"], 0, [stdout], [stderr]) 91 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-xYz20.xyz], 0, [ignore], [ignore]) 92 AT_CLEANUP 93 94 # 9. Rotate around self 95 AT_SETUP([Molecules - Rotate around self]) 96 AT_KEYWORDS([Molecules]) 97 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0) 98 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 90. --position "0,0,1"], 0, [stdout], [stderr]) 99 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z90.xyz], 0, [ignore], [ignore]) 100 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0) 101 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 180. --position "0,0,1"], 0, [stdout], [stderr]) 102 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z180.xyz], 0, [ignore], [ignore]) 103 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0) 104 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 360. --position "0,0,1"], 0, [stdout], [stderr]) 105 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z360.xyz], 0, [ignore], [ignore]) 106 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz], 0, [ignore], [ignore]) 107 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0) 108 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 20. --position "1,2,1"], 0, [stdout], [stderr]) 109 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-xYz20.xyz], 0, [ignore], [ignore]) 110 AT_CLEANUP 111
Note:
See TracChangeset
for help on using the changeset viewer.
