Designer::Designer(int argc, char **argv):
screen_w(1280),
screen_h(960),
+ base_mesh(0),
input(0),
mode(SELECT),
cam_yaw(M_PI/2),
else if((*i)->get_track().get_flex())
(*i)->set_color(GL::Color(1, 0.5, 1));
}
+
+ if(!layout->get_base().empty())
+ {
+ base_mesh=new GL::Mesh;
+ DataFile::load(*base_mesh, layout->get_base());
+ }
}
selection=new Selection;
float uz=cos_pitch*0.41421;
float xf=static_cast<float>(x)*2/screen_w-1;
- float yf=1-static_cast<float>(y)*2/screen_h;
+ float yf=static_cast<float>(y)*2/screen_h-1;
float vx=cos_yaw*cos_pitch + xf*rx + yf*ux;
float vy=sin_yaw*cos_pitch + xf*ry + yf*uy;
cat_layout_3d->render();
else
{
+ if(base_mesh)
+ {
+ GL::Texture::unbind();
+ base_mesh->draw();
+ }
layout_3d->render(true);
manipulator->render();
if(mode==MEASURE)
#include <msp/gbase/window.h>
#include <msp/gbase/glcontext.h>
#include <msp/gl/font.h>
+#include <msp/gl/mesh.h>
#include <msp/time/timestamp.h>
#include "libmarklin/catalogue.h"
#include "libmarklin/layout.h"
Marklin::Layout3D *layout_3d;
Marklin::Layout *cat_layout;
Marklin::Layout3D *cat_layout_3d;
+ Msp::GL::Mesh *base_mesh;
Selection *selection;
Manipulator *manipulator;
Measure *measure;
(*i)->check_slope();
angle=0;
- //snapped=0;
+ wrap_rot=0;
signal_done.emit(false);
}
{
mode=NONE;
update_wrap();
- //snapped=0;
+ angle=0;
for(set<Track *>::iterator i=neighbors.begin(); i!=neighbors.end(); ++i)
for(vector<MTrack>::iterator j=tracks.begin(); j!=tracks.end(); ++j)
j->track->snap_to(**i, true);
}
+ for(vector<MTrack>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
+ i->rot=i->track->get_rotation();
+
update_neighbors();
signal_done.emit(true);
Layout(Catalogue &);
~Layout();
+ const std::string &get_base() const { return base; }
const std::set<Track *> &get_tracks() const { return tracks; }
void add_track(Track &);
void remove_track(Track &);