Atoms Crowd  4.1.0
SyncLayoutGenerator.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <Atoms/LayoutGenerators/LayoutGenerator.h>
11 #include <vector>
12 
13 namespace Atoms
14 {
15  class ATOMS_EXPORT SyncLayoutGenerator : public LayoutGenerator
16  {
17  public:
18 
20 
21  virtual ~SyncLayoutGenerator();
22 
23  virtual std::vector<AgentInitData> generate(double time)
24  #ifdef __APPLE__
25  override
26  #endif
27  ;
28 
29  inline void setParentGenerator(Atoms::LayoutGeneratorPtr& parent);
30 
31  inline void setAgentTypeOverride(const std::map<int, std::string>& data);
32 
33  inline const std::map<int, std::string>& agentTypeOverride() const;
34 
35  inline void setDefaultAgentType(const std::string& data);
36 
37  inline const std::string& defaultAgentType() const;
38 
39  inline const char* typeName() override { return "syncLayout"; };
40 
41  inline bool allowMultiLayoutGenerator() override { return false; }
42 
43  private:
44 
45  Atoms::LayoutGeneratorPtr m_parentGenerator;
46 
47  std::map<int, std::string> m_overrideAgentType;
48 
49  std::string m_defaultAgentType;
50  };
51 }
52 
53 #include "SyncLayoutGenerator.impl.h"
Atoms::SyncLayoutGenerator::typeName
const char * typeName() override
Get the type name for this generator.
Definition: SyncLayoutGenerator.h:39
Atoms::SyncLayoutGenerator::generate
virtual std::vector< AgentInitData > generate(double time)
Generate a vector of agent init data.
Atoms::SyncLayoutGenerator
Definition: SyncLayoutGenerator.h:16
Atoms::SyncLayoutGenerator::allowMultiLayoutGenerator
bool allowMultiLayoutGenerator() override
Returns whether this layout generator can work in conjunction with other layout generators.
Definition: SyncLayoutGenerator.h:41
Atoms
Atoms namespace.
Definition: Agent.h:28
Atoms::LayoutGenerator
Layout generator.
Definition: LayoutGenerator.h:29