ResultInfo.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: UnstructGrid
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2012, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeCore/Base.h"
16 #include "CeeCore/Str.h"
17 #include "CeeUnstructGrid/Base.h"
18 #include "CeeUnstructGrid/CustomResultGenerator.h"
19 
20 
21 #include <map>
22 
23 namespace cee {
24 namespace ug {
25 
26 class UnstructGridModel;
27 class DataState;
28 
29 //==================================================================================================
30 //
31 //
32 //
33 //==================================================================================================
34 class CEE_UG_EXPORT ResultInfo
35 {
36 
37 public:
38  ResultInfo();
39  ResultInfo(ResultType type, int resultId, const Str& resultName, ResultMapping resMapping);
40  ResultInfo(ResultType type, int resultId, const Str& resultName, ResultMapping resMapping, ResultType baseResultType, int baseResultId, DeriveOperation deriveOperation);
41  ResultInfo(ResultType type, int resultId, const Str& resultName, ResultMapping resMapping, std::vector<CustomResultArgument>& customResultArguments, const CustomResultGenerator* customResultGenerator);
42  ResultInfo(ResultType type, const Str& resultName, ResultMapping resMapping, std::vector<CustomResultArgument>& customResultArguments, const CustomResultGenerator* customResultGenerator);
43 
44  ResultInfo(const ResultInfo& other);
45  ~ResultInfo();
46 
47  ResultInfo& operator=(const ResultInfo& rhs);
48  bool operator==(const ResultInfo& rhs) const;
49  bool operator!=(const ResultInfo& rhs) const;
50 
51  ResultType type() const;
52  int id() const;
53 
54  Str name() const;
55  void setName(const Str& name);
56 
57  Str idString() const;
58  void setIdString(const Str& idString);
59 
60  ResultMapping resultMapping() const;
61 
62  ResultType baseResultType() const;
63  int baseResultId() const;
64  DeriveOperation deriveOperation() const;
65 
66  StrainType strainType() const;
67  void setStrainType(StrainType type);
68 
69  bool isValid() const;
70  bool isCustom() const;
71 
72  Str resultCalculatorId() const;
73 
74  Str nature() const;
75  void setNature(const Str& nature);
76 
77  const std::vector<int>& sectionIds() const;
78  void setSectionIds(const std::vector<int>& ids);
79 
80  Str attribute(const Str& name) const;
81  std::vector<Str> attributeNames() const;
82 
83  static Str deriveOperationName(DeriveOperation deriveOperation);
84 
85  void setCustomResultGenerator(const CustomResultGenerator* generator, const std::vector<CustomResultArgument>& arguments);
86  std::vector<CustomResultArgument> customResultArguments() const;
87  const CustomResultGenerator* customResultGenerator() const;
88 
89  void setId(int id);
90  static int nextId(ResultType resultType);
91 
92 private:
93  void setAttribute(const Str& name, const Str& value);
94 
95  static int updateOrGetNextId(ResultType resultId, int id, bool update);
96 
97 private:
98 
99  CEE_BASE_F(DataSourceDirectory);
100  CEE_PRIVATE_IMPL(ResultInfo);
101 };
102 
103 
104 
105 
106 } // namespace ug
107 } // namespace cee
A class to generate custom results.
Definition: CustomResultGenerator.h:42
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Simple class containing metadata info for a result.
Definition: ResultInfo.h:34
A general unicode based string class.
Definition: Str.h:28
bool operator!=(const PtrRef< T1 > &a, const PtrRef< T2 > &b)
Returns true if the internal pointers of refs a and b are different.
Definition: PtrRef.h:58
StrainType
Type of the strain result in the model, if any.
Definition: Base.h:105
DeriveOperation
Available operations to derive a result from a base result.
Definition: Base.h:57
bool operator==(const PtrRef< T1 > &a, const PtrRef< T2 > &b)
Returns true if the internal pointers of refs a and b are equal.
Definition: PtrRef.h:57
Metadata directory for a data source.
Definition: DataSourceDirectory.h:40
ResultMapping
Available scalar and vector result mappings.
Definition: Base.h:47
ResultType
Different types of results.
Definition: Base.h:90