ultimatepp/bazaar/SurfaceCtrl_Demo/main.cpp
xemuth 31832bdf55 SurfaceCtrl_Demo: Adding override of Layout function to prevent of view deformation while resizing the window
git-svn-id: svn://ultimatepp.org/upp/trunk@14746 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-08-02 17:42:20 +00:00

40 lines
868 B
C++

#include "SurfaceCtrl_Demo.h"
namespace Upp{
SurfaceCtrl_Demo::SurfaceCtrl_Demo()
{
CtrlLayout(*this, "SurfaceCtrl demo. STL viewer");
filename.SetText( GetFileDirectory(__FILE__) + "\\Stanford_Bunny_sample.stl" );
butOpen.WhenAction = [&] {
try {
bool isText;
String header;
Surface surf;
LoadStl(~filename, surf, isText, header);
surf.GetPanelParams();
surf.GetLimits();
surf.GetSurface();
surf.GetVolume();
canvas.CreateObject(surf,Gray());
} catch (Exc e) {
Exclamation(DeQtf(e));
}
};
canvas.WhenPaint = [&] {
canvas.DrawAllObjects();
};
Sizeable().Zoomable();
}
void SurfaceCtrl_Demo::Layout(){
canvas.GLResize(GetSize().cx,GetSize().cy);
}
}
GUI_APP_MAIN
{
Upp::StdLogSetup( Upp::LOG_COUT | Upp::LOG_FILE);
Upp::SurfaceCtrl_Demo().Run();
}