Hi,
when I run the following code and rotate the object with the mouse the program crashes from time to time.
I work on windows (.NET 2003) and root 5.08/00.
#include <TRint.h>
#include <TGeoManager.h>
#include <TGeoVolume.h>
#include <TThread.h>
#include “Riostream.h”
TRint *app;
void* guiThread(void arg)
{
TGeoManager fGeoManager = new TGeoManager(“MEGDetector”, “MEG detector”);
TGeoVolume* fTop = fGeoManager->MakeBox(“TOPV”, new TGeoMedium(“TOP VOLUME”,1,new TGeoMaterial(“AIR”,14.61 ,7.3,0.1205000E-02)), 150, 150, 565);
fTop->SetVisibility(0);
TGeoVolume* DVC3 = fGeoManager->MakeCtub(“DVC3”,new TGeoMedium(“CATHODE”,2,new TGeoMaterial(“ALUMINIUM”,26.98 ,13,2.7)),1,1,43,0,180,0,-1,-0.3,0,-1,0.3);
DVC3->SetLineColor(4);
TGeoRotation *rot100 = new TGeoRotation(“rot100”,90,0,90,90,0,0);
for (int i=0;i<100;i++)
fTop->AddNode(DVC3,i+1,new TGeoCombiTrans(i*20,0,0,rot100));
fGeoManager->SetTopVolume(fTop);
fGeoManager->CloseGeometry();
fTop->Draw("");
app->Run();
return NULL;
}
int main(int argc, char *argv[])
{
int argn = 1;
char arg[1][100];
char *argp = &arg[0][0];
strcpy(arg[0],argv[0]);
app = new TRint(“App”, &argn, &argp,NULL,0,true);
TThread *thread = new TThread(“guiThread”, guiThread);
thread->Run();
gSystem->Sleep(1000);
while (1) {
gSystem->ProcessEvents();
gSystem->Sleep(10);
}
return 1;
}
Thanks for help,
Matthias