56std::vector<Spinner> gSpinners;
66 const Double_t phi2 = phi1 + 90. +
r.Rndm() * 180.;
68 switch (
r.Integer(4)) {
70 case 1:
return new TGeoTube(rMin, rMax, dz);
71 case 2:
return new TGeoTubeSeg(rMin, rMax, dz, phi1, phi2);
73 return new TGeoCtub(rMin, rMax, dz, phi1, phi2,
r.Rndm() * .5,
r.Rndm() * .5, -1. +
r.Rndm() * .5,
r.Rndm() * .5,
74 r.Rndm() * .5, 1. -
r.Rndm() * .5);
89 gSpinners.push_back({el, el->RefMainTrans(), rate, REveUtil::ServerTimeMs()});
97 for (
Int_t i = 0; i <
n; ++i) {
98 auto pivot =
new REveElement(
Form(
"%s pivot %d", parent->GetCName(), i));
99 RandomOrientation(pivot->RefMainTrans());
100 parent->AddElement(pivot);
101 AddSpinner(pivot,
r.Uniform(0.2, 0.6) * (
r.Rndm() < 0.5 ? -1 : 1));
104 body->SetShape(RandomShape(
size));
105 body->SetMainColor(kColors[
r.Integer(std::size(kColors))]);
106 body->RefMainTrans().SetPos(radius *
r.Uniform(0.7, 1.3), 0, 0);
107 RandomOrientation(body->RefMainTrans());
108 pivot->AddElement(body);
109 AddSpinner(body,
r.Uniform(0.5, 1.5) * (
r.Rndm() < 0.5 ? -1 : 1));
112 AddLevel(body, levels - 1,
n, 0.35 * radius, 0.4 *
size);
117class OrbitRefresher :
public TTimer {
124 const Double_t now = REveUtil::ServerTimeMs();
125 for (
auto &s : gSpinners) {
128 t.RotateLF(1, 2, s.fRate * (now - s.fT0Ms) / 1000.);
141 auto eveMng = REveManager::Create();
142 eveMng->AllowMultipleRemoteConnections(
false,
false);
148 eveMng->GetEventScene()->AddElement(system);
149 AddLevel(system, levels,
n, 1000, 150);
153 auto timer =
new OrbitRefresher;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
double Double_t
Double 8 bytes.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Base class for REveUtil visualization elements, providing hierarchy management, rendering control and...
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
RAII guard for locking Eve manager (ctor) and processing changes (dtor).
REveTrans is a 4x4 transformation matrix for homogeneous coordinates stored internally in a column-ma...
The cut tubes constructor has the form:
Base abstract class for all shapes.
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
A tube segment is a tube having a range in phi.
This is the base class for the ROOT Random number generators.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Handles synchronous and a-synchronous timer events.
void Reset()
Reset the timer.
Bool_t Notify() override
Notify when timer times out.
Namespace for ROOT features in testing.
constexpr Double_t TwoPi()