Structural deformable models
PartParam.h
Go to the documentation of this file.
1 #ifndef _PARTPARAM_H_
2 #define _PARTPARAM_H_
3 
4 #include <iostream>
5 
6 //spring model parameters
7 #define PART_SPRINGCONST 50.0f
8 #define PART_DAMPING 5.0f
9 #define PART_MASS 1.0f
10 #define PART_GRAV 0.0f
11 #define PART_VISCOUS 2.0f
12 #define PART_IMGFORCE 70.0f
13 #define PART_TORQUE 100.0f
14 
15 /* old set
16  #define PART_SPRINGCONST 0.1f
17  #define PART_DAMPING 0.1f
18  #define PART_MASS 0.05f
19  #define PART_GRAV 0.0f
20  #define PART_VISCOUS 0.1f
21  #define PART_IMGFORCE 1.0f
22  #define PART_TORQUE 5.0f
23 */
24 
26 public:
32  mass = PART_MASS;
35  }
36 
37  friend std::ostream& operator<<(std::ostream &os, const ParticleParam &p) {
39  os << "#";
40  os << "p springconst " << p.springconst << std::endl;
41  if(p.damping == PART_DAMPING)
42  os << "#";
43  os << "p damping " << p.damping << std::endl;
44  if(p.mass == PART_MASS)
45  os << "#";
46  os << "p mass " << p.mass << std::endl;
47  if(p.gravitational == PART_GRAV)
48  os << "#";
49  os << "p grav " << p.gravitational << std::endl;
50  if(p.viscousdrag == PART_VISCOUS)
51  os << "#";
52  os << "p viscousdrag " << p.viscousdrag << std::endl;
53  if(p.imgforce == PART_IMGFORCE)
54  os << "#";
55  os << "p imageforce " << p.imgforce << std::endl;
56  if(p.torque == PART_TORQUE)
57  os << "#";
58  os << "p torque " << p.torque << std::endl;
59  return os;
60  }
61 
63  float viscousdrag;
64  float springconst;
65  float damping;
66  float mass;
67  float imgforce;
68  float torque;
69 
70  //static member needs to be initialized somewhere so the linker
71  //doesn't generate 'undefined reference'. This is done in Model.cpp
73 };
74 
75 #endif
#define PART_TORQUE
Definition: PartParam.h:13
float imgforce
Definition: PartParam.h:67
static ParticleParam global
Definition: PartParam.h:72
#define PART_IMGFORCE
Definition: PartParam.h:12
#define PART_GRAV
Definition: PartParam.h:10
float mass
Definition: PartParam.h:66
friend std::ostream & operator<<(std::ostream &os, const ParticleParam &p)
Definition: PartParam.h:37
float damping
Definition: PartParam.h:65
#define PART_MASS
Definition: PartParam.h:9
float viscousdrag
Definition: PartParam.h:63
float torque
Definition: PartParam.h:68
#define PART_SPRINGCONST
Definition: PartParam.h:7
#define PART_DAMPING
Definition: PartParam.h:8
float springconst
Definition: PartParam.h:64
#define PART_VISCOUS
Definition: PartParam.h:11
float gravitational
Definition: PartParam.h:62