mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Started expanding the module and renderable to include luminosity and velocity
This commit is contained in:
@@ -130,8 +130,12 @@ namespace openspace {
|
||||
// And delegate decoding depending on message type
|
||||
if (type == "CONN")
|
||||
return Message(MessageType::Connection, messageBuffer);
|
||||
if (type == "DATA")
|
||||
else if (type == "DATA")
|
||||
return Message(MessageType::ReadPointData, messageBuffer);
|
||||
else if (type == "LUMI")
|
||||
return Message(MessageType::ReadLuminosityData, messageBuffer);
|
||||
else if (type == "VELO")
|
||||
return Message(MessageType::ReadVelocityData, messageBuffer);
|
||||
else if( type == "ASGN")
|
||||
return Message(MessageType::AddSceneGraphNode, messageBuffer);
|
||||
else if (type == "RSGN")
|
||||
|
||||
@@ -40,6 +40,8 @@ public:
|
||||
enum class MessageType : uint32_t {
|
||||
Connection = 0,
|
||||
ReadPointData,
|
||||
ReadLuminosityData,
|
||||
ReadVelocityData,
|
||||
AddSceneGraphNode,
|
||||
RemoveSceneGraphNode,
|
||||
Color,
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace {
|
||||
constexpr const char* ProgramName = "shaderProgram";
|
||||
constexpr const char* _loggerCat = "PointsCloud";
|
||||
constexpr const char* KeyData = "Data";
|
||||
constexpr const char* KeyLuminosity = "Luminosity";
|
||||
constexpr const char* KeyVelocity = "Velocity";
|
||||
|
||||
constexpr int8_t CurrentCacheVersion = 1;
|
||||
|
||||
@@ -140,6 +142,16 @@ namespace openspace {
|
||||
_hasPointData = true;
|
||||
}
|
||||
|
||||
if (dictionary.hasKey(KeyLuminosity)) {
|
||||
_luminosityData = dictionary.value<std::vector<float>>(KeyLuminosity);
|
||||
_hasLuminosityData = true;
|
||||
}
|
||||
|
||||
if (dictionary.hasKey(KeyVelocity)) {
|
||||
_velocityData = dictionary.value<std::vector<float>>(KeyVelocity);
|
||||
_hasVelocityData = true;
|
||||
}
|
||||
|
||||
if (dictionary.hasKey(OpacityInfo.identifier)) {
|
||||
_opacity = static_cast<float>(
|
||||
dictionary.value<double>(OpacityInfo.identifier));
|
||||
|
||||
@@ -61,6 +61,8 @@ protected:
|
||||
bool readPointData();
|
||||
|
||||
bool _hasPointData = false;
|
||||
bool _hasLuminosityData = false;
|
||||
bool _hasVelocityData = false;
|
||||
bool _isDirty = true;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _shaderProgram = nullptr;
|
||||
@@ -71,6 +73,8 @@ protected:
|
||||
properties::Vec3Property _color;
|
||||
|
||||
std::vector<std::vector<float>> _pointData;
|
||||
std::vector<float> _luminosityData;
|
||||
std::vector<float> _velocityData;
|
||||
std::vector<float> _fullData;
|
||||
std::vector<float> _slicedData;
|
||||
|
||||
|
||||
@@ -191,6 +191,22 @@ namespace openspace {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SoftwareConnection::MessageType::ReadLuminosityData: {
|
||||
messageOffset = 0; // Resets message offset
|
||||
|
||||
luminosityData.clear();
|
||||
luminosityData = readData(message);
|
||||
|
||||
break;
|
||||
}
|
||||
case SoftwareConnection::MessageType::ReadVelocityData: {
|
||||
messageOffset = 0; // Resets message offset
|
||||
|
||||
velocityData.clear();
|
||||
velocityData = readData(message);
|
||||
|
||||
break;
|
||||
}
|
||||
case SoftwareConnection::MessageType::AddSceneGraphNode: {
|
||||
std::string identifier = readIdentifier(message);
|
||||
glm::vec3 color = readColor(message);
|
||||
|
||||
@@ -84,6 +84,8 @@ private:
|
||||
std::string readGUI(std::vector<char>& message);
|
||||
|
||||
std::vector<std::vector<float>> pointData;
|
||||
std::vector<float> luminosityData;
|
||||
std::vector<float> velocityData;
|
||||
std::unordered_map<size_t, std::shared_ptr<Peer>> _peers;
|
||||
mutable std::mutex _peerListMutex;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user