- Timestamp:
- Nov 15, 2012, 5:29:43 PM (12 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:
- 4477b7
- Parents:
- 6e5d35
- git-author:
- Michael Ankele <ankele@…> (09/05/12 14:11:12)
- git-committer:
- Frederik Heber <heber@…> (11/15/12 17:29:43)
- Location:
- src/Shapes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Shapes/ShapeFactory.cpp
r6e5d35 r4f041a4 34 34 35 35 #include "CodePatterns/MemDebug.hpp" 36 #include "CodePatterns/Log.hpp"37 36 38 37 #include "ShapeFactory.hpp" … … 51 50 for (int i=0; i<SHAPETYPES_MAX; i++) 52 51 nameShapeMap.insert(std::pair<std::string, ShapeType>(shapeNames[i], (ShapeType)i)); 52 53 // Init state. 54 type = SPHERE; 55 translation.Zero(); 56 stretch.Zero(); 57 for (int i=0; i<NDIM; i++) 58 angle[i] = 0; 53 59 } 54 60 … … 73 79 } 74 80 81 82 void ShapeFactory::setStretch(const Vector &stretch) 83 { 84 ASSERT(!stretch.IsZero(), 85 "ShapeFactory::setStretch() - stretch is zero."); 86 this->stretch = stretch; 87 } 88 75 89 CONSTRUCT_SINGLETON(ShapeFactory) -
src/Shapes/ShapeFactory.hpp
r6e5d35 r4f041a4 16 16 17 17 #include "CodePatterns/Singleton.hpp" 18 #include "LinearAlgebra/Vector.hpp" 18 19 19 20 class ShapeFactory : public Singleton<ShapeFactory> … … 29 30 std::string getShapeName(ShapeType type); 30 31 32 33 // setters/getters for the current state 34 const double* getAngle() const { return angle; } 35 void setAngle(double angleX, double angleY, double angleZ) { angle[0] = angleX; angle[1] = angleY; angle[2] = angleZ; } 36 37 Vector getStretch() const { return stretch; } 38 void setStretch(const Vector &stretch); 39 40 Vector getTranslation() const { return translation; } 41 void setTranslation(const Vector &translation) { this->translation = translation; } 42 43 ShapeType getType() const { return type; } 44 void setType(ShapeType type) { this->type = type; } 45 31 46 private: 32 47 // private constructor and destructor due to singleton … … 34 49 virtual ~ShapeFactory(); 35 50 51 // name/type maps 36 52 static const char *shapeNames[]; 37 53 typedef std::map<ShapeType, std::string> ShapeNameMap; … … 39 55 typedef std::map<std::string,ShapeType> NameShapeMap; 40 56 NameShapeMap nameShapeMap; 57 58 // current state 59 ShapeType type; 60 Vector translation; 61 Vector stretch; 62 double angle[NDIM]; 41 63 }; 42 64
Note:
See TracChangeset
for help on using the changeset viewer.