Ejemplo n.º 1
0
void MainFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
{
    wxFileDialog dialog (this, _T(""), _T(""), _T(""), _T("STL files (*.STL)|*.stl|XML files (*.XML)|*.xml"));

    dialog.SetFilename("D.STL");

    if (dialog.ShowModal() == wxID_OK)
    {
        wxString fn(dialog.GetPath().c_str());
        if (fn.Matches("*.xml"))
        {

            this->aniframe->UpdateControls();
        }
        else
        {
            // make the surface
            const char *fn = dialog.GetPath().c_str();
            GSTsurface *gstsurface = new GSTsurface();
            gst->gstees.push_back(gstsurface);
            gstsurface->LoadSTL(fn);
            gstsurface->AddToRenderer(&gst->ren1);

            // make a bounding box for it
            gst->MakeRectBoundary(gstsurface->xrg, gstsurface->yrg, gstsurface->zrg.hi + 1.0);
        }

        MaximizeView();

        gst->renWin->Render();
        UpdateActors();
        UpdateAnimate();
    }
}
Ejemplo n.º 2
0
int FreesteelWindow::LoadSTL(const char* str)
{
	GSTsurface* surf = new GSTsurface();
	surf->LoadSTL(str);
	return add(surf);
}