Move an element from the server by changing only its transformation.
One box stands still. Every 1.5 s the other is moved by SetTransMatrix(), which streams only the new matrix. The client moves the object it already has and rebuilds no geometry.
class REveTransMover :
public TTimer {
int fStep{0};
public:
{
t.SetPos(30.0 *
TMath::Sin(0.4 * fStep), 0.0, 0.0);
fEl->SetTransMatrix(t.Array());
++fStep;
}
};
{
b->SetMainTransparency(0);
b->SetVertex(0, -
a, -
a, z -
a);
b->SetVertex(1, -
a,
a, z -
a);
b->SetVertex(2,
a,
a, z -
a);
b->SetVertex(3,
a, -
a, z -
a);
b->SetVertex(4, -
a, -
a, z +
a);
b->SetVertex(5, -
a,
a, z +
a);
b->SetVertex(6,
a,
a, z +
a);
b->SetVertex(7,
a, -
a, z +
a);
}
void trans_update()
{
auto eveMng = REveManager::Create();
eveMng->AllowMultipleRemoteConnections(false, false);
auto still = make_box(
"Still",
kCyan, 10, -20);
eveMng->GetEventScene()->AddElement(still);
auto mover = make_box(
"Mover",
kMagenta, 10, 20);
mover->InitMainTrans();
eveMng->GetEventScene()->AddElement(mover);
eveMng->Show();
(new REveTransMover(mover, 1500))->TurnOn();
}
bool Bool_t
Boolean (0=false, 1=true) (bool)
short Color_t
Color number (short)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
float Float_t
Float 4 bytes (float)
3D box with arbitrary vertices (cuboid).
Base class for REveUtil visualization elements, providing hierarchy management, rendering control and...
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...
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.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
- Author
- Matevz Tadel
Definition in file trans_update.C.