133 fApply->
Connect(
"Clicked()",
"TGeoTranslationEditor",
this,
"DoApply()");
134 fCancel->
Connect(
"Clicked()",
"TGeoTranslationEditor",
this,
"DoCancel()");
135 fUndo->
Connect(
"Clicked()",
"TGeoTranslationEditor",
this,
"DoUndo()");
136 fTransName->
Connect(
"TextChanged(const char *)",
"TGeoTranslationEditor",
this,
"DoModified()");
137 fTransDx->
Connect(
"ValueSet(Long_t)",
"TGeoTranslationEditor",
this,
"DoDx()");
138 fTransDy->
Connect(
"ValueSet(Long_t)",
"TGeoTranslationEditor",
this,
"DoDy()");
139 fTransDz->
Connect(
"ValueSet(Long_t)",
"TGeoTranslationEditor",
this,
"DoDz()");
199 if (!changed)
return kFALSE;
300 fPhii = fThetai = fPsii = 0.0;
301 fAngleX = fAngleY = fAngleZ = 0.0;
309 fRotName->Resize(135, fRotName->GetDefaultHeight());
310 fRotName->SetToolTipText(
"Enter the rotation name");
311 fRotName->Associate(
this);
324 fRotPhi->Associate(
this);
325 fRotPhi->Resize(90, fRotPhi->GetDefaultHeight());
335 nef->
SetToolTipText(
"Modify the second rotation angle about the new X");
336 fRotTheta->Associate(
this);
337 fRotTheta->Resize(90, fRotTheta->GetDefaultHeight());
348 fRotPsi->Associate(
this);
349 fRotPsi->Resize(90, fRotPsi->GetDefaultHeight());
364 nef->
SetToolTipText(
"Enter the new rotation angle about the selected axis");
365 fRotAxis->Associate(
this);
366 fRotAxis->Resize(90, fRotAxis->GetDefaultHeight());
418 fApply->
Connect(
"Clicked()",
"TGeoRotationEditor",
this,
"DoApply()");
419 fCancel->
Connect(
"Clicked()",
"TGeoRotationEditor",
this,
"DoCancel()");
420 fUndo->
Connect(
"Clicked()",
"TGeoRotationEditor",
this,
"DoUndo()");
421 fRotName->Connect(
"TextChanged(const char *)",
"TGeoRotationEditor",
this,
"DoModified()");
422 fRotPhi->Connect(
"ValueSet(Long_t)",
"TGeoRotationEditor",
this,
"DoRotPhi()");
423 fRotTheta->Connect(
"ValueSet(Long_t)",
"TGeoRotationEditor",
this,
"DoRotTheta()");
424 fRotPsi->Connect(
"ValueSet(Long_t)",
"TGeoRotationEditor",
this,
"DoRotPsi()");
425 fRotAxis->Connect(
"ValueSet(Long_t)",
"TGeoRotationEditor",
this,
"DoRotAngle()");
440 fRotation->GetAngles(fPhii, fThetai, fPsii);
441 const char *
sname = fRotation->GetName();
442 if (!strcmp(sname, fRotation->ClassName())) fRotName->SetText(
"no_name");
444 fRotName->SetText(sname);
447 fRotPhi->SetNumber(fPhii);
448 fRotTheta->SetNumber(fThetai);
449 fRotPsi->SetNumber(fPsii);
450 fRotAxis->SetNumber(0.0);
465 const char *
name = fRotName->GetText();
466 if (!strcmp(name,
"no_name") || !strcmp(name, fRotation->GetName()))
return;
467 fRotation->SetName(name);
475 if (fRotPhi->GetNumber() < 0.) fRotPhi->SetNumber(fRotPhi->GetNumber()+360.);
476 if (fRotPhi->GetNumber() >= 360.) fRotPhi->SetNumber(fRotPhi->GetNumber()-360.);
485 if (fRotTheta->GetNumber() < 0.) fRotTheta->SetNumber(fRotTheta->GetNumber()+360.);
486 if (fRotTheta->GetNumber() >= 360.) fRotTheta->SetNumber(fRotTheta->GetNumber()-360.);
495 if (fRotPsi->GetNumber() < 0.) fRotPsi->SetNumber(fRotPsi->GetNumber()+360.);
496 if (fRotPsi->GetNumber() >= 360.) fRotPsi->SetNumber(fRotPsi->GetNumber()-360.);
505 if (fRotAxis->GetNumber() < 0.) fRotAxis->SetNumber(fRotAxis->GetNumber()+360.);
506 if (fRotAxis->GetNumber() >= 360.) fRotAxis->SetNumber(fRotAxis->GetNumber()-360.);
515 Double_t phi = fRotPhi->GetNumber();
516 Double_t theta = fRotTheta->GetNumber();
517 Double_t psi = fRotPsi->GetNumber();
518 Double_t angle = fRotAxis->GetNumber();
519 Double_t phi0 = 0., theta0 = 0., psi0 = 0.;
520 fRotation->GetAngles(phi0,theta0,psi0);
522 if (phi != psi0 || theta != theta0 || psi != psi0) changed =
kTRUE;
523 if (changed) fRotation->SetAngles(phi, theta, psi);
526 if (fRotX->IsOn()) {fRotation->RotateX(angle); changed =
kTRUE;}
527 if (fRotY->IsOn()) {fRotation->RotateY(angle); changed =
kTRUE;}
528 if (fRotZ->IsOn()) {fRotation->RotateZ(angle); changed =
kTRUE;}
530 if (!changed)
return kFALSE;
531 fRotAxis->SetNumber(0.0);
560 fRotPhi->SetNumber(fPhii);
561 fRotTheta->SetNumber(fThetai);
562 fRotPsi->SetNumber(fPsii);
563 fRotAxis->SetNumber(0.0);
609 fPhii = fThetai = fPsii = 0.0;
611 fAngleX = fAngleY = fAngleZ = 0.0;
619 fRotName->Resize(135, fRotName->GetDefaultHeight());
620 fRotName->SetToolTipText(
"Enter the rotation name");
621 fRotName->Associate(
this);
673 fRotPhi->Associate(
this);
674 fRotPhi->Resize(90, fRotPhi->GetDefaultHeight());
684 nef->
SetToolTipText(
"Modify the second rotation angle about the new X");
685 fRotTheta->Associate(
this);
686 fRotTheta->Resize(90, fRotTheta->GetDefaultHeight());
697 fRotPsi->Associate(
this);
698 fRotPsi->Resize(90, fRotPsi->GetDefaultHeight());
713 nef->
SetToolTipText(
"Enter the new rotation angle about the selected axis");
714 fRotAxis->Associate(
this);
715 fRotAxis->Resize(90, fRotAxis->GetDefaultHeight());
767 fApply->
Connect(
"Clicked()",
"TGeoCombiTransEditor",
this,
"DoApply()");
768 fCancel->
Connect(
"Clicked()",
"TGeoCombiTransEditor",
this,
"DoCancel()");
769 fUndo->
Connect(
"Clicked()",
"TGeoCombiTransEditor",
this,
"DoUndo()");
770 fRotName->Connect(
"TextChanged(const char *)",
"TGeoCombiTransEditor",
this,
"DoModified()");
771 fRotPhi->Connect(
"ValueSet(Long_t)",
"TGeoCombiTransEditor",
this,
"DoRotPhi()");
772 fRotTheta->Connect(
"ValueSet(Long_t)",
"TGeoCombiTransEditor",
this,
"DoRotTheta()");
773 fRotPsi->Connect(
"ValueSet(Long_t)",
"TGeoCombiTransEditor",
this,
"DoRotPsi()");
774 fRotAxis->Connect(
"ValueSet(Long_t)",
"TGeoCombiTransEditor",
this,
"DoRotAngle()");
775 fTransDx->
Connect(
"ValueSet(Long_t)",
"TGeoCombiTransEditor",
this,
"DoDx()");
776 fTransDy->
Connect(
"ValueSet(Long_t)",
"TGeoCombiTransEditor",
this,
"DoDy()");
777 fTransDz->
Connect(
"ValueSet(Long_t)",
"TGeoCombiTransEditor",
this,
"DoDz()");
796 if (rot) rot->
GetAngles(fPhii, fThetai, fPsii);
797 const char *
sname = fCombi->GetName();
798 if (!strcmp(sname, fCombi->ClassName())) fRotName->SetText(
"no_name");
800 fRotName->SetText(sname);
804 fDxi = fCombi->GetTranslation()[0];
805 fDyi = fCombi->GetTranslation()[1];
806 fDzi = fCombi->GetTranslation()[2];
811 fRotPhi->SetNumber(fPhii);
812 fRotTheta->SetNumber(fThetai);
813 fRotPsi->SetNumber(fPsii);
814 fRotAxis->SetNumber(0.0);
829 const char *
name = fRotName->GetText();
830 if (!strcmp(name,
"no_name") || !strcmp(name, fCombi->GetName()))
return;
831 fCombi->SetName(name);
839 if (fRotPhi->GetNumber() < 0.) fRotPhi->SetNumber(fRotPhi->GetNumber()+360.);
840 if (fRotPhi->GetNumber() >= 360.) fRotPhi->SetNumber(fRotPhi->GetNumber()-360.);
849 if (fRotTheta->GetNumber() < 0.) fRotTheta->SetNumber(fRotTheta->GetNumber()+360.);
850 if (fRotTheta->GetNumber() >= 360.) fRotTheta->SetNumber(fRotTheta->GetNumber()-360.);
859 if (fRotPsi->GetNumber() < 0.) fRotPsi->SetNumber(fRotPsi->GetNumber()+360.);
860 if (fRotPsi->GetNumber() >= 360.) fRotPsi->SetNumber(fRotPsi->GetNumber()-360.);
869 if (fRotAxis->GetNumber() < 0.) fRotAxis->SetNumber(fRotAxis->GetNumber()+360.);
870 if (fRotAxis->GetNumber() >= 360.) fRotAxis->SetNumber(fRotAxis->GetNumber()-360.);
883 if (dx != fCombi->GetTranslation()[0] ||
884 dy != fCombi->GetTranslation()[1] ||
885 dz != fCombi->GetTranslation()[2]) changedtr =
kTRUE;
886 if (changedtr) fCombi->SetTranslation(dx, dy, dz);
887 Double_t phi = fRotPhi->GetNumber();
888 Double_t theta = fRotTheta->GetNumber();
889 Double_t psi = fRotPsi->GetNumber();
890 Double_t angle = fRotAxis->GetNumber();
891 Double_t phi0 = 0., theta0 = 0., psi0 = 0.;
893 if (rot) rot->
GetAngles(phi0,theta0,psi0);
895 if (phi!=fPhii || theta!=fThetai || psi!=fPsii) {
897 fCombi->SetRotation(r);
898 rot = fCombi->GetRotation();
903 if (phi != psi0 || theta != theta0 || psi != psi0) changed =
kTRUE;
904 if (changed && rot) rot->
SetAngles(phi, theta, psi);
907 if (fRotX->IsOn()) {fCombi->RotateX(angle); changed =
kTRUE;}
908 if (fRotY->IsOn()) {fCombi->RotateY(angle); changed =
kTRUE;}
909 if (fRotZ->IsOn()) {fCombi->RotateZ(angle); changed =
kTRUE;}
911 if (changedtr) changed =
kTRUE;
912 if (!changed)
return kFALSE;
913 fRotAxis->SetNumber(0.0);
945 fRotPhi->SetNumber(fPhii);
946 fRotTheta->SetNumber(fThetai);
947 fRotPsi->SetNumber(fPsii);
948 fRotAxis->SetNumber(0.0);
void DoRotTheta()
Slot for theta (Euler X convention)
virtual const char * GetName() const
Returns name of object.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
void DoRotAngle()
Slot for additional rotation about one axis.
void DoRotPsi()
Slot for psi (Euler X convention)
void DoRotTheta()
Slot for theta (Euler X convention)
void DoModified()
Slot for notifying changes.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetName(const char *name)
Set the name of the TNamed.
void DoApply()
Slot for applying changes.
void DoName()
Slot for name.
virtual void SetNumber(Double_t val)
void DoRotPsi()
Slot for psi (Euler X convention)
Bool_t DoParameters()
Slot for checking parameters.
Class describing translations.
virtual ~TGeoRotationEditor()
Destructor.
virtual UInt_t GetDefaultHeight() const
virtual Bool_t IsComposite() const
virtual void SetModel(TObject *obj)
Connect to the new matrix.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hirarchically all daughters of a composite frame.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void DoApply()
Slot for applying modifications.
virtual void SetModel(TObject *obj)
Connect to the selected rotation.
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
TGCompositeFrame(const TGCompositeFrame &)
virtual TList * GetList() const
void DoRotPhi()
Slot for phi (Euler X convention)
virtual const Double_t * GetTranslation() const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
void DoRotAngle()
Slot for additional rotation about one axis.
void DoUndo()
Slot for undoing last changes.
virtual void SetSize(const TGDimension &s)
void DoUndo()
Slot for undoing last operation.
Class describing rotation + translation.
void DoCancel()
Slot for cancelling last modifications non-applied.
void DoCancel()
Slot for cancelling last un-applied operations.
Bool_t DoParameters()
Slot for checking parameters.
void DoCancel()
Slot for cancelling last un-applied operations.
Class describing rotations.
TGDimension GetSize() const
void DoName()
Slot for name.
const char * GetText() const
virtual void Modified(Bool_t flag=1)=0
virtual UInt_t GetDefaultHeight() const
virtual ~TGeoCombiTransEditor()
Destructor.
void DoName()
Slot for name.
void GetAngles(Double_t &theta1, Double_t &phi1, Double_t &theta2, Double_t &phi2, Double_t &theta3, Double_t &phi3) const
Retrieve rotation angles.
virtual void ConnectSignals2Slots()
Connect signals to slots.
virtual Double_t GetNumber() const
void DoApply()
Slot for applying modifications.
void DoModified()
Slot for notifying changes.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Mother of all ROOT objects.
TGNumberEntryField * GetNumberEntry() const
Bool_t DoParameters()
Slot for checking parameters.
double f2(const double *x)
TGeoTranslationEditor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for translation editor.
virtual void ConnectSignals2Slots()
Connect signals to slots.
void SetAngles(Double_t phi, Double_t theta, Double_t psi)
Set matrix elements according to Euler angles.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line...
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
virtual void MakeTitle(const char *title)
Create attribute frame title.
void DoUndo()
Slot for undoing last changes.
virtual void ConnectSignals2Slots()
Connect signals to slots.
void DoModified()
Slot for notifying changes.
void SetTranslation(Double_t dx, Double_t dy, Double_t dz)
Set translation components.
TGeoTranslation * fTranslation
void DoRotPhi()
Slot for phi (Euler X convention)
virtual void SetModel(TObject *obj)
Connect to the selected combi matrix.
virtual ~TGeoTranslationEditor()
Destructor.
const char * Data() const