Changeset fa1830 for src/Shapes/Shape.cpp
- Timestamp:
- Aug 10, 2010, 7:26:03 PM (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:
- b8d15ba
- Parents:
- 95e6b1 (diff), c5186e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Shapes/Shape.cpp
r95e6b1 rfa1830 9 9 #include "Shape_impl.hpp" 10 10 11 12 #include "Helpers/Assert.hpp" 13 #include "LinearAlgebra/Vector.hpp" 14 11 15 Shape::Shape(const Shape& src) : 12 16 impl(src.getImpl()) … … 17 21 bool Shape::isInside(const Vector &point) const{ 18 22 return impl->isInside(point); 23 } 24 25 std::vector<Vector> Shape::getHomogeneousPointsOnSurface(const int N) const { 26 return impl->getHomogeneousPointsOnSurface(N); 19 27 } 20 28 … … 65 73 } 66 74 75 std::vector<Vector> AndShape_impl::getHomogeneousPointsOnSurface(const int N) const { 76 std::vector<Vector> PointsOnSurface; 77 ASSERT(false, "AndShape_impl::getHomogeneousPointsOnSurface() not implemented yet"); 78 return PointsOnSurface; 79 } 80 81 67 82 Shape operator&&(const Shape &lhs,const Shape &rhs){ 68 83 Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl(getShapeImpl(lhs),getShapeImpl(rhs))); … … 80 95 bool OrShape_impl::isInside(const Vector &point){ 81 96 return rhs->isInside(point) || lhs->isInside(point); 97 } 98 99 std::vector<Vector> OrShape_impl::getHomogeneousPointsOnSurface(const int N) const { 100 std::vector<Vector> PointsOnSurface_lhs = lhs->getHomogeneousPointsOnSurface(N); 101 std::vector<Vector> PointsOnSurface_rhs = rhs->getHomogeneousPointsOnSurface(N); 102 std::vector<Vector> PointsOnSurface; 103 104 for (std::vector<Vector>::const_iterator iter = PointsOnSurface_lhs.begin(); iter != PointsOnSurface_lhs.end(); ++iter) { 105 if (!rhs->isInside(*iter)) 106 PointsOnSurface.push_back(*iter); 107 } 108 for (std::vector<Vector>::const_iterator iter = PointsOnSurface_rhs.begin(); iter != PointsOnSurface_rhs.end(); ++iter) { 109 if (!lhs->isInside(*iter)) 110 PointsOnSurface.push_back(*iter); 111 } 112 113 return PointsOnSurface; 82 114 } 83 115 … … 99 131 } 100 132 133 std::vector<Vector> NotShape_impl::getHomogeneousPointsOnSurface(const int N) const { 134 // surfaces are the same, only normal direction is different 135 return arg->getHomogeneousPointsOnSurface(N); 136 } 137 101 138 Shape operator!(const Shape &arg){ 102 139 Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl(getShapeImpl(arg)));
Note:
See TracChangeset
for help on using the changeset viewer.