mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-16 14:15:26 -06:00
40 lines
868 B
C++
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();
|
|
}
|
|
|