Changeset b92e4a
- Timestamp:
- Mar 28, 2012, 3:17:38 PM (13 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:
- 735940
- Parents:
- 6a7fcbb
- git-author:
- Frederik Heber <heber@…> (01/18/12 00:21:51)
- git-committer:
- Frederik Heber <heber@…> (03/28/12 15:17:38)
- Location:
- src/Shapes
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Shapes/BaseShapes.cpp
r6a7fcbb rb92e4a 61 61 } 62 62 63 std::string Sphere_impl::toString() {63 std::string Sphere_impl::toString() const{ 64 64 return "Sphere()"; 65 } 66 67 enum ShapeType Sphere_impl::getType() const 68 { 69 return SphereType; 65 70 } 66 71 … … 192 197 } 193 198 194 std::string Cuboid_impl::toString() {199 std::string Cuboid_impl::toString() const{ 195 200 return "Cuboid()"; 201 } 202 203 enum ShapeType Cuboid_impl::getType() const 204 { 205 return CuboidType; 196 206 } 197 207 -
src/Shapes/BaseShapes_impl.hpp
r6a7fcbb rb92e4a 20 20 #include "Shapes/Shape_impl.hpp" 21 21 #include "Shapes/ShapeExceptions.hpp" 22 #include "Shapes/ShapeType.hpp" 22 23 23 24 class Sphere_impl : public Shape_impl { … … 26 27 virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException); 27 28 virtual LineSegmentSet getLineIntersections(const Line&); 28 virtual std::string toString(); 29 virtual std::string toString() const; 30 virtual enum ShapeType getType() const; 29 31 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; 30 32 }; … … 35 37 virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException); 36 38 virtual LineSegmentSet getLineIntersections(const Line&); 37 virtual std::string toString(); 39 virtual std::string toString() const; 40 virtual enum ShapeType getType() const; 38 41 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; 39 42 }; -
src/Shapes/Shape.cpp
r6a7fcbb rb92e4a 26 26 #include "Shapes/Shape_impl.hpp" 27 27 #include "Shapes/ShapeExceptions.hpp" 28 #include "Shapes/ShapeType.hpp" 28 29 29 30 #include <string> … … 67 68 } 68 69 70 bool Shape::operator==(const Shape &rhs) const{ 71 return (this->getType() == rhs.getType()); 72 } 73 69 74 std::string Shape::toString() const{ 70 75 return impl->toString(); 76 } 77 78 enum ShapeType Shape::getType() const{ 79 return impl->getType(); 71 80 } 72 81 … … 153 162 } 154 163 155 std::string AndShape_impl::toString() {164 std::string AndShape_impl::toString() const{ 156 165 return std::string("(") + lhs->toString() + std::string("&&") + rhs->toString() + std::string(")"); 166 } 167 168 enum ShapeType AndShape_impl::getType() const{ 169 return CombinedType; 157 170 } 158 171 … … 239 252 } 240 253 241 std::string OrShape_impl::toString() {254 std::string OrShape_impl::toString() const{ 242 255 return std::string("(") + lhs->toString() + std::string("||") + rhs->toString() + std::string(")"); 256 } 257 258 enum ShapeType OrShape_impl::getType() const{ 259 return CombinedType; 243 260 } 244 261 … … 289 306 } 290 307 291 std::string NotShape_impl::toString() {308 std::string NotShape_impl::toString() const{ 292 309 return std::string("!") + arg->toString(); 310 } 311 312 enum ShapeType NotShape_impl::getType() const{ 313 return CombinedType; 293 314 } 294 315 -
src/Shapes/Shape.hpp
r6a7fcbb rb92e4a 19 19 20 20 #include "Shapes/ShapeExceptions.hpp" 21 #include "Shapes/ShapeType.hpp" 21 22 22 23 #include <vector> … … 41 42 Vector getNormal(const Vector &point) const throw(NotOnSurfaceException); 42 43 44 Vector getCenter() const; 45 Vector getRadius() const; 46 43 47 LineSegmentSet getLineIntersections(const Line&); 44 48 std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; … … 46 50 Shape &operator=(const Shape& rhs); 47 51 52 bool operator==(const Shape &rhs) const; 53 48 54 std::string toString() const; 55 enum ShapeType getType() const; 56 49 57 protected: 50 58 impl_ptr getImpl() const; -
src/Shapes/ShapeOps.cpp
r6a7fcbb rb92e4a 71 71 } 72 72 73 enum ShapeType ShapeOpsBase_impl::getType() const { 74 return getArg()->getType(); 75 } 76 73 77 std::vector<Vector> ShapeOpsBase_impl::getHomogeneousPointsOnSurface(const size_t N) const { 74 78 return getArg()->getHomogeneousPointsOnSurface(N);; … … 105 109 } 106 110 107 std::string Resize_impl::toString() {111 std::string Resize_impl::toString() const{ 108 112 std::stringstream sstr; 109 113 sstr << "resize(" << getArg()->toString() << "," << size << ")"; … … 149 153 } 150 154 151 std::string Translate_impl::toString() {155 std::string Translate_impl::toString() const{ 152 156 std::stringstream sstr; 153 157 sstr << "translate(" << getArg()->toString() << "," << offset << ")"; … … 213 217 } 214 218 215 std::string Stretch_impl::toString() {219 std::string Stretch_impl::toString() const{ 216 220 std::stringstream sstr; 217 221 sstr << "stretch(" << getArg()->toString() << "," << factors << ")"; … … 259 263 } 260 264 261 std::string Transform_impl::toString() {265 std::string Transform_impl::toString() const{ 262 266 std::stringstream sstr; 263 267 sstr << "transform(" << getArg()->toString() << "," << transformation << ")"; -
src/Shapes/ShapeOps_impl.hpp
r6a7fcbb rb92e4a 17 17 #include "Shapes/Shape_impl.hpp" 18 18 #include "Shapes/ShapeExceptions.hpp" 19 #include "Shapes/ShapeType.hpp" 19 20 #include "LinearAlgebra/Vector.hpp" 20 21 #include "LinearAlgebra/RealSpaceMatrix.hpp" … … 32 33 virtual Vector getNormal(const Vector &point) throw (NotOnSurfaceException); 33 34 virtual LineSegmentSet getLineIntersections(const Line&); 35 virtual enum ShapeType getType() const; 34 36 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; 35 37 protected: … … 51 53 virtual Vector translateOutPos(const Vector &point); 52 54 virtual Vector translateOutNormal(const Vector &point); 53 virtual std::string toString() ;55 virtual std::string toString() const; 54 56 virtual bool isInside(const Vector& point); 55 57 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; … … 67 69 virtual Vector translateOutPos(const Vector &point); 68 70 virtual Vector translateOutNormal(const Vector &point); 69 virtual std::string toString() ;71 virtual std::string toString() const; 70 72 virtual bool isInside(const Vector& point); 71 73 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; … … 83 85 virtual Vector translateOutPos(const Vector &point); 84 86 virtual Vector translateOutNormal(const Vector &point); 85 virtual std::string toString() ;87 virtual std::string toString() const; 86 88 virtual bool isInside(const Vector& point); 87 89 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; … … 100 102 virtual Vector translateOutPos(const Vector &point); 101 103 virtual Vector translateOutNormal(const Vector &point); 102 virtual std::string toString() ;104 virtual std::string toString() const; 103 105 virtual bool isInside(const Vector& point); 104 106 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; -
src/Shapes/Shape_impl.hpp
r6a7fcbb rb92e4a 19 19 #include "Shapes/Shape.hpp" 20 20 #include "Shapes/ShapeExceptions.hpp" 21 #include "Shapes/ShapeType.hpp" 21 22 #include "LinearAlgebra/Line.hpp" 22 23 #include "LinearAlgebra/LineSegment.hpp" … … 33 34 virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException)=0; 34 35 virtual LineSegmentSet getLineIntersections(const Line&)=0; 35 virtual std::string toString()=0; 36 virtual std::string toString() const =0; 37 virtual enum ShapeType getType() const =0; 36 38 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const=0; 37 39 }; … … 53 55 return res; 54 56 } 55 virtual std::string toString() {57 virtual std::string toString() const{ 56 58 return "Everywhere()"; 59 } 60 virtual enum ShapeType getType() const { 61 return EverywhereType; 57 62 } 58 63 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const { … … 75 80 return LineSegmentSet(line); 76 81 } 77 virtual std::string toString() {82 virtual std::string toString() const{ 78 83 return "Nowhere()"; 84 } 85 virtual enum ShapeType getType() const { 86 return NowhereType; 79 87 } 80 88 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const { … … 92 100 virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException); 93 101 virtual LineSegmentSet getLineIntersections(const Line&); 94 virtual std::string toString(); 102 virtual std::string toString() const; 103 virtual enum ShapeType getType() const; 95 104 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; 96 105 private: … … 107 116 virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException); 108 117 virtual LineSegmentSet getLineIntersections(const Line&); 109 virtual std::string toString(); 118 virtual std::string toString() const; 119 virtual enum ShapeType getType() const; 110 120 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; 111 121 private: … … 122 132 virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException); 123 133 virtual LineSegmentSet getLineIntersections(const Line&); 124 virtual std::string toString(); 134 virtual std::string toString() const; 135 virtual enum ShapeType getType() const; 125 136 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; 126 137 private:
Note:
See TracChangeset
for help on using the changeset viewer.