-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
369 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#ifndef INCLUDE_FLAMEGPU_VISUALISER_ENVIRONMENTGRAPHVIS_H_ | ||
#define INCLUDE_FLAMEGPU_VISUALISER_ENVIRONMENTGRAPHVIS_H_ | ||
#ifdef FLAMEGPU_VISUALISATION | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "flamegpu/visualiser/color/Color.h" | ||
|
||
namespace flamegpu { | ||
struct EnvironmentDirectedGraphData; | ||
namespace detail { | ||
class CUDAEnvironmentDirectedGraphBuffers; | ||
} // namespace detail | ||
namespace visualiser { | ||
struct LineConfig; | ||
|
||
struct EnvironmentGraphVisData { | ||
explicit EnvironmentGraphVisData(std::shared_ptr<detail::CUDAEnvironmentDirectedGraphBuffers> _graph, std::shared_ptr<LineConfig>_lines); | ||
void constructGraph(); | ||
std::string x_varName = "x"; | ||
std::string y_varName = "y"; | ||
std::string z_varName = "z"; | ||
std::string xy_varName; | ||
std::string xyz_varName; | ||
Color color; | ||
const EnvironmentDirectedGraphData &graphData; | ||
const std::shared_ptr<const detail::CUDAEnvironmentDirectedGraphBuffers> graph; | ||
const std::shared_ptr<LineConfig> lines; | ||
}; | ||
class EnvironmentGraphVis { | ||
public: | ||
explicit EnvironmentGraphVis(std::shared_ptr<EnvironmentGraphVisData> data); | ||
|
||
/** | ||
* Set the name of the variable representing the agents x/y/z location coordinates | ||
* @param var_name Name of the agent variable | ||
* @note unnecessary if the variables are named "x", "y", "z" respectively | ||
* @note Implicitly calls clearXYProperty(), clearXYZProperty() | ||
* @throws InvalidEnvProperty If the variable is not type float[1] | ||
*/ | ||
void setXProperty(const std::string &var_name); | ||
void setYProperty(const std::string &var_name); | ||
void setZProperty(const std::string &var_name); | ||
/** | ||
* Set the name of the array variable (length 2) representing the agents x/y location coordinates | ||
* @param var_name Name of the agent variable | ||
* @note Implicitly calls clearXProperty(), clearYProperty(), clearZProperty(),clearXYZProperty() | ||
* @throws InvalidEnvProperty If the variable is not type float[2] | ||
*/ | ||
void setXYProperty(const std::string &var_name); | ||
/** | ||
* Set the name of the array variable (length 3) representing the agents x/y/z location coordinates | ||
* @param var_name Name of the agent variable | ||
* @note Implicitly calls clearXProperty(), clearYProperty(), clearZProperty(),clearXYProperty() | ||
* @throws InvalidEnvProperty If the variable is not type float[3] | ||
*/ | ||
void setXYZProperty(const std::string &var_name); | ||
|
||
void setColor(const Color& cf); | ||
private: | ||
/** | ||
* Pointer to data struct | ||
*/ | ||
std::shared_ptr<EnvironmentGraphVisData> data; | ||
}; | ||
} // namespace visualiser | ||
} // namespace flamegpu | ||
|
||
#endif // FLAMEGPU_VISUALISATION | ||
#endif // INCLUDE_FLAMEGPU_VISUALISER_ENVIRONMENTGRAPHVIS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.