Changeset e09b70
- Timestamp:
- Jun 18, 2010, 10:44:04 AM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 394529
- Parents:
- e38447
- Location:
- src
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
re38447 re09b70 105 105 SHAPESOURCE = \ 106 106 Shapes/BaseShapes.cpp \ 107 Shapes/Shape.cpp 107 Shapes/Shape.cpp \ 108 Shapes/ShapeOps.cpp 108 109 SHAPEHEADER = \ 109 110 Shapes/BaseShapes.hpp \ 110 Shapes/Shape.hpp 111 Shapes/Shape.hpp \ 112 Shapes/ShapeOps.hpp 111 113 112 114 -
src/Shapes/Shape.cpp
re38447 re09b70 34 34 } 35 35 36 // allows arbitrary friendship, but only if implementation is known 37 Shape::impl_ptr getShapeImpl(const Shape &shape){ 38 return shape.getImpl(); 39 } 40 36 41 /***************************** Some simple Shapes ***************************/ 37 42 … … 61 66 62 67 Shape operator&&(const Shape &lhs,const Shape &rhs){ 63 Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl( lhs.getImpl(),rhs.getImpl()));68 Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl(getShapeImpl(lhs),getShapeImpl(rhs))); 64 69 return Shape(newImpl); 65 70 } … … 78 83 79 84 Shape operator||(const Shape &lhs,const Shape &rhs){ 80 Shape::impl_ptr newImpl = Shape::impl_ptr(new OrShape_impl( lhs.getImpl(),rhs.getImpl()));85 Shape::impl_ptr newImpl = Shape::impl_ptr(new OrShape_impl(getShapeImpl(lhs),getShapeImpl(rhs))); 81 86 return Shape(newImpl); 82 87 } … … 95 100 96 101 Shape operator!(const Shape &arg){ 97 Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl( arg.getImpl()));102 Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl(getShapeImpl(arg))); 98 103 return Shape(newImpl); 99 104 } -
src/Shapes/Shape.hpp
re38447 re09b70 16 16 class Shape 17 17 { 18 friend Shape operator&&(const Shape&,const Shape&);19 friend Shape operator||(const Shape&,const Shape&);20 friend Shape operator!(const Shape&);21 18 public: 22 19 typedef boost::shared_ptr<Shape_impl> impl_ptr; 20 friend impl_ptr getShapeImpl(const Shape&); 23 21 24 22 Shape(impl_ptr); -
src/Shapes/Shape_impl.hpp
re38447 re09b70 13 13 class Shape_impl { 14 14 public: 15 Shape_impl(){}; 16 virtual ~Shape_impl(){}; 15 17 virtual bool isInside(const Vector &point)=0; 16 18 }; … … 58 60 }; 59 61 62 Shape::impl_ptr getShapeImpl(const Shape&); 63 60 64 #endif /* SHAPE_IMPL_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.