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 public:
54  ResultBlock(int blockId, ResultType resultType, ResultMapping resultMapping);
55  ~ResultBlock();
56 
57  Str name() const;
58  void setName(const Str& resultName);
59 
60  int resultId() const;
61  void setResultId(int resultId);
62 
63  std::vector<int> resultValuesBlocks(size_t stateIndex) const;
64  bool setResultValuesBlocks(const std::vector<int>& resultValuesBlockIds, int stateId = 1);
65  bool addResultValuesBlock(int resultValuesBlockId, int stateId = 1);
66 
67  bool relativeDisplacementResults() const;
68  void setRelativeDisplacementResults(bool relative);
69 
70  void setDefaultDisplacementScaleFactor(float scale);
71  float defaultDisplacementScaleFactor() const;
72 
73  ResultType resultType() const;
74  ResultMapping resultMapping() const;
75 
76  size_t stateCount() const;
77  size_t stateIndex(int stateId) const;
78  int stateId(size_t stateIndex) const;
79 
80  bool checkValidity() const;
81 
82 private:
83  ResultBlock(VTFxResultBlock* block, int blockId);
84 
85  VTFxBlock* internal_vtfxBlock() const;
86 
87 private:
88  friend class DatabasePrivate;
89 
90  CEE_PRIVATE_IMPL(ResultBlock);
91  CEE_DISALLOW_COPY_AND_ASSIGN(ResultBlock);
92 
93 };
94 
95 }
96 }
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppLogging.cpp:20
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