Commit 1e8f44b0 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

add particleScaleFactor in scontactPlot

parent 5563d5d3
......@@ -129,7 +129,7 @@ void ObjectCollection::display()
rainbow(aa, r, g, b);
glColor4f(r, g, b, 1.);
}
double f = radius[i]/S;
double f = radius[i]/S * _particleScaleFactor;
glScalef(f, f, f);
sphere.draw();
glPopMatrix();
......@@ -140,7 +140,7 @@ void ObjectCollection::display()
glVertexPointer(2, GL_FLOAT, 0, &circleGeom[0]);
glPushMatrix();
glTranslatef(coord[i * 2], coord[i * 2 + 1], 0);
glScalef(radius[i], radius[i], 1.);
glScalef(radius[i]*_particleScaleFactor, radius[i]*_particleScaleFactor, 1.);
if(!fixed[i]) {
glColor4f(0.2, 0.2, 0.6, 0.5);
glDrawArrays(GL_TRIANGLE_FAN, 0, circleGeom.size() / 2);
......@@ -277,7 +277,7 @@ int ObjectCollection::read(int step) {
void ObjectCollection::save_opt(const char *filename) {
FILE *f = fopen(filename, "w");
fprintf(f, "alpha %.16g\nbeta %1.6g\nscale %.16g\nshift %.16g %.16g\n", _rotation[0], _rotation[1], _scale, _shift[0], _shift[1]);
fprintf(f, "alpha %.16g\nbeta %1.6g\nscale %.16g\nshift %.16g %.16g\nparticleScaleFactor %.16g\n", _rotation[0], _rotation[1], _scale, _shift[0], _shift[1], _particleScaleFactor);
fprintf(f, "visible %lu", _visible_flag.size());
for (std::map<int, int>::iterator it = _visible_flag.begin(); it != _visible_flag.end(); ++it) {
fprintf(f, " %i %i", it->first, it->second);
......@@ -300,6 +300,7 @@ void ObjectCollection::load_opt(const char *filename) {
else if (word == "scale") f >> _scale;
else if (word == "shift") f >> _shift[0] >> _shift[1];
else if (word == "clip") f >> _clip;
else if (word == "particleScaleFactor") f >> _particleScaleFactor;
else if (word == "visible") {
size_t count;
f>> count;
......@@ -348,6 +349,7 @@ ObjectCollection::ObjectCollection(const std::string basename)
_scale = -1;
_shift[0] = 0.;
_shift[1] = 0.;
_particleScaleFactor = 1.;
_rotation[0] = 0.;
_rotation[1] = 0.;
_clip = false;
......
......@@ -15,6 +15,7 @@ class ObjectCollection {
int _step;
std::string _filename;
double _shift[2], _scale, _rotation[2];
double _particleScaleFactor;
bool _clip;
void _compute_bbox(float bbox[6]);
std::map<int, int> _visible_flag;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment