BioDynaMo  v1.05.120-25dc9790
vtk_agents.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
15 #ifndef CORE_VISUALIZATION_PARAVIEW_VTK_AGENTS_H_
16 #define CORE_VISUALIZATION_PARAVIEW_VTK_AGENTS_H_
17 
18 // std
19 #include <string>
20 #include <vector>
21 // Paraview
22 #include <vtkCPDataDescription.h>
23 #include <vtkUnstructuredGrid.h>
24 // BioDynaMo
25 #include "core/agent/agent.h"
26 #include "core/shape.h"
27 
28 class TClass;
29 
30 namespace bdm {
31 
32 class ParaviewAdaptorTest_GenerateSimulationInfoJson_Test;
33 
36 class VtkAgents {
37  public:
38  VtkAgents(const char* type_name, vtkCPDataDescription* data_description);
39 
40  ~VtkAgents();
41 
42  vtkUnstructuredGrid* GetData(uint64_t idx);
43  Shape GetShape() const;
44  TClass* GetTClass();
45  void Update(const std::vector<Agent*>* agents);
46  void WriteToFile(uint64_t step) const;
47 
48  private:
49  std::string name_;
50  TClass* tclass_;
51  std::vector<vtkUnstructuredGrid*> data_;
53 
54  TClass* FindTClass();
55  void InitializeDataMembers(const Agent* agent,
56  std::vector<std::string>* data_members) const;
57  void UpdateMappedDataArrays(uint64_t tid, const std::vector<Agent*>* agents,
58  uint64_t start, uint64_t end);
59 
61 };
62 
63 } // namespace bdm
64 
65 #endif // CORE_VISUALIZATION_PARAVIEW_VTK_AGENTS_H_
shape.h
bdm::Shape
Shape
Definition: shape.h:20
bdm::VtkAgents::data_
std::vector< vtkUnstructuredGrid * > data_
Definition: vtk_agents.h:51
bdm::VtkAgents::shape_
Shape shape_
Definition: vtk_agents.h:52
bdm::VtkAgents::GetData
vtkUnstructuredGrid * GetData(uint64_t idx)
Definition: vtk_agents.cc:114
bdm
Definition: agent.cc:39
bdm::VtkAgents::ParaviewAdaptorTest_GenerateSimulationInfoJson_Test
friend class ParaviewAdaptorTest_GenerateSimulationInfoJson_Test
Definition: vtk_agents.h:60
bdm::VtkAgents::GetShape
Shape GetShape() const
Definition: vtk_agents.cc:117
bdm::VtkAgents::tclass_
TClass * tclass_
Definition: vtk_agents.h:50
bdm::Agent
Contains code required by all agents.
Definition: agent.h:79
bdm::VtkAgents::name_
std::string name_
Definition: vtk_agents.h:49
bdm::VtkAgents
Definition: vtk_agents.h:36
bdm::VtkAgents::UpdateMappedDataArrays
void UpdateMappedDataArrays(uint64_t tid, const std::vector< Agent * > *agents, uint64_t start, uint64_t end)
Definition: vtk_agents.cc:155
agent.h
bdm::VtkAgents::WriteToFile
void WriteToFile(uint64_t step) const
Definition: vtk_agents.cc:146
bdm::VtkAgents::~VtkAgents
~VtkAgents()
Definition: vtk_agents.cc:105
bdm::VtkAgents::FindTClass
TClass * FindTClass()
Definition: vtk_agents.cc:170
bdm::VtkAgents::GetTClass
TClass * GetTClass()
Definition: vtk_agents.cc:120
bdm::VtkAgents::Update
void Update(const std::vector< Agent * > *agents)
Definition: vtk_agents.cc:123
bdm::VtkAgents::InitializeDataMembers
void InitializeDataMembers(const Agent *agent, std::vector< std::string > *data_members) const
Definition: vtk_agents.cc:191
bdm::VtkAgents::VtkAgents
VtkAgents(const char *type_name, vtkCPDataDescription *data_description)
Definition: vtk_agents.cc:44