13class V_RENDEREREXPORT Renderer:
public Module {
15 Renderer(
const std::string &name,
const int moduleID, mpi::communicator comm);
18 bool dispatch(
bool block =
true,
bool *messageReceived =
nullptr)
override;
20 int numTimesteps()
const;
25 friend class boost::serialization::access;
27 Variant(
const std::string &name = std::string()): name(name) {}
31 RenderObject::InitialVariantVisibility visible = RenderObject::DontChange;
33 typedef std::map<std::string, Variant> VariantMap;
34 const VariantMap &variants()
const;
37 int sender = vistle::message::Id::Invalid;
38 std::string senderPort;
42 typedef std::map<std::string, ColorMap> ColorMapMap;
45 bool handleMessage(
const message::Message *message,
const MessagePayload &payload)
override;
48 virtual bool removeColorMap(
const std::string &species);
50 virtual std::shared_ptr<RenderObject> addObject(
int senderId,
const std::string &senderPort,
53 virtual void removeObject(std::shared_ptr<RenderObject> ro);
55 bool changeParameter(
const Parameter *p)
override;
56 bool compute()
override;
57 void connectionRemoved(
const Port *from,
const Port *to)
override;
59 int m_fastestObjectReceivePolicy;
60 void removeAllObjects();
62 bool m_maySleep =
true;
65 virtual bool render() = 0;
67 bool handleAddObject(
const message::AddObject &add);
69 bool addInputObject(
int sender,
const std::string &senderPort,
const std::string &portName,
71 std::shared_ptr<RenderObject> addObjectWrapper(
int senderId,
const std::string &senderPort,
74 void removeObjectWrapper(std::shared_ptr<RenderObject> ro);
76 void removeAllSentBy(
int sender,
const std::string &senderPort);
79 Creator(
int id,
const std::string &port,
const std::string &basename)
80 :
module(id), port(port), age(0), iteration(-1)
83 s << basename <<
"_" <<
module;
86 bool operator<(
const Creator &other)
const
88 if (module == other.module)
89 return port < other.port;
90 return module < other.module;
94 if (module == other.module)
95 return port == other.port;
102 mutable int iteration = -1;
105 typedef std::set<Creator> CreatorMap;
106 CreatorMap m_creatorMap;
108 std::vector<std::vector<std::shared_ptr<RenderObject>>> m_objectList;
109 IntParameter *m_renderMode =
nullptr;
110 IntParameter *m_objectsPerFrame =
nullptr;
111 bool needsSync(
const message::Message &m)
const;
113 VariantMap m_variants;
114 ColorMapMap m_colormaps;
116 int m_numObjectsPerFrame = 500;
std::shared_ptr< const Object > const_ptr
std::string module(const std::string &prefix)
Eigen::Matrix< Scalar, 3, 1 > Vector3
ShmVector< char > MessagePayload
bool operator<(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
bool operator==(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
DEFINE_ENUM_WITH_STRING_CONVERSIONS(FieldCompressionMode,(Uncompressed)(ZfpFixedRate)(ZfpAccuracy)(ZfpPrecision)) namespace detail