Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions graf3d/eve7/inc/ROOT/REveScene.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public:

void StreamMotionChanges(nlohmann::json &arr);
void SendChangesToSubscribers();
void ClearOutput();

/// Output of the last StreamElements() or StreamRepresentationChanges().
const std::string &GetOutputJson() const { return fOutputJson; }
Expand Down
7 changes: 7 additions & 0 deletions graf3d/eve7/src/REveManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,9 @@ void REveManager::StreamToNewConnection(unsigned connid)
Send(connid, fWorld->fOutputJson);
printf(" for now assume world-scene has no render data, binary-size=%d\n", fWorld->fTotalBinarySize);
assert(fWorld->fTotalBinarySize == 0);
// Sent to this connection only; the next SendSceneChanges() must not send
// it to everyone again.
fWorld->ClearOutput();

for (auto &c : fScenes->RefChildren()) {
REveScene *scene = dynamic_cast<REveScene *>(c);
Expand All @@ -911,6 +914,7 @@ void REveManager::StreamToNewConnection(unsigned connid)
} else {
printf(" NOT sending binary, len = %d\n", scene->fTotalBinarySize);
}
scene->ClearOutput();
}

fServerState.fCV.notify_all();
Expand Down Expand Up @@ -1302,6 +1306,9 @@ void REveManager::MIRExecThread()
Send(mir->fConnId, scene->fOutputJson);
if (scene->fTotalBinarySize > 0)
SendBinary(mir->fConnId, &scene->fOutputBinary[0], scene->fTotalBinarySize);
// Streamed to this connection only; SendSceneChanges() below must
// not send it to every subscriber.
scene->ClearOutput();
}

SendSceneChanges();
Expand Down
11 changes: 11 additions & 0 deletions graf3d/eve7/src/REveScene.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,17 @@ void REveScene::SendChangesToSubscribers()
}
REX::gEve->SceneSubscriberWaitingResponse(client->fId);
}
ClearOutput();
}

////////////////////////////////////////////////////////////////////////////////
/// Drop the output of the last StreamElements() or
/// StreamRepresentationChanges() once it has been sent, so that the next
/// SendChangesToSubscribers() does not send it again. REveManager calls this
/// after streaming a scene directly to one new connection.

void REveScene::ClearOutput()
{
fOutputJson.clear();
fOutputBinary.clear();
fTotalBinarySize = 0;
Expand Down
Loading