ResultBlock.h
1 //##################################################################################################
2 //
3 // Ceetron Export
4 // Component: VTFx
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2015, 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 "CeeVTFx/Base.h"
16 #include "CeeVTFx/Block.h"
17 #include "CeeCore/Str.h"
18 
19 class VTFxResultBlock;
20 
21 namespace cee {
22 namespace vtfx {
23 
24 //=================================================================================================================================
25 //
26 //
27 //
28 //=================================================================================================================================
29 class CEE_VTFX_EXPORT ResultBlock : public Block
30 {
31 public:
32  // Result types for ResultBlock
33  // -----------------------------------------------------------------------------
34  enum ResultType {
35  UNKNOWN_TYPE = -1,
36  SCALAR = 0,
37  VECTOR = 1,
38  DISPLACEMENT = 2,
39  TENSOR = 3
40  };
41 
42  // Result mapping types for ResultBlock
43  // -----------------------------------------------------------------------------
45  UNKNOWN_MAPPING = -1,
46  NODE_MAPPING = 0,
47  ELEMENT_MAPPING = 1,
48  ELEMENT_NODE_MAPPING = 3,
49  ELEMENT_FACE_MAPPING = 4
50  };
51 
52 
53  // Strain types for ResultBlock
54  // -----------------------------------------------------------------------------
55  enum StrainType
56  {
57  STRAINTYPE_NONE = -1,
58  STRAINTYPE_ENGINEERING = 0,
59  STRAINTYPE_STANDARD = 1
60  };
61 
62 public:
63  ResultBlock(int blockId, ResultType resultType, ResultMapping resultMapping);
64  ~ResultBlock();
65 
66  Str name() const;
67  void setName(const Str& resultName);
68 
69  int resultId() const;
70  void setResultId(int resultId);
71 
72  std::vector<int> resultValuesBlocks(size_t stateIndex) const;
73  bool setResultValuesBlocks(const std::vector<int>& resultValuesBlockIds, int stateId = 1);
74  bool addResultValuesBlock(int resultValuesBlockId, int stateId = 1);
75 
76  bool relativeDisplacementResults() const;
77  void setRelativeDisplacementResults(bool relative);
78 
79  void setDefaultDisplacementScaleFactor(float scale);
80  float defaultDisplacementScaleFactor() const;
81 
82  StrainType strainType() const;
83  void setStrainType(StrainType type);
84 
85  void addAttribute(const Str& attributeName, const Str& attributeValue);
86  Str attribute(const Str& attributeName) const;
87  std::vector<Str> attributeNames() const;
88 
89  ResultType resultType() const;
90  ResultMapping resultMapping() const;
91 
92  size_t stateCount() const;
93  size_t stateIndex(int stateId) const;
94  int stateId(size_t stateIndex) const;
95 
96  bool checkValidity() const;
97 
98 private:
99  ResultBlock(VTFxResultBlock* block, int blockId);
100 
101  VTFxBlock* internal_vtfxBlock() const;
102 
103 private:
104  friend class DatabasePrivate;
105 
106  CEE_PRIVATE_IMPL(ResultBlock);
107  CEE_DISALLOW_COPY_AND_ASSIGN(ResultBlock);
108 
109 };
110 
111 }
112 }
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppAssert.cpp:18
A general unicode based string class.
Definition: Str.h:28
ResultType
Global result type constants used by Ceetron Export. These constants are used for various methods of ...
Definition: ResultBlock.h:34
A block defining a result (scalars, vectors, or displacements) in a VTFx database.
Definition: ResultBlock.h:29
ResultMapping
Global result mapping type constants used by Ceetron Export. These constants are used for various met...
Definition: ResultBlock.h:44
Abstract base class for all VTFx blocks.
Definition: Block.h:29