NodeBlock.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 
18 #include "CeeCore/Vec3f.h"
19 
20 #include <vector>
21 
22 class VTFxNodeBlock;
23 
24 namespace cee {
25 namespace vtfx {
26 
27 //=================================================================================================================================
28 //
29 //
30 //
31 //=================================================================================================================================
32 class CEE_VTFX_EXPORT NodeBlock : public Block
33 {
34 public:
35  NodeBlock(int blockId, bool withNodeIds);
36  virtual ~NodeBlock();
37 
38  size_t nodeCount() const;
39  std::vector<int> nodeIds() const;
40 
41  std::vector<Vec3f> nodes() const;
42  bool setNodes(const std::vector<float>& coordinates, const std::vector<int>& nodeIds = std::vector<int>());
43  bool setNodes(const std::vector<Vec3f>& coordinates, const std::vector<int>& nodeIds = std::vector<int>());
44 
45  bool allocateNodes(size_t numNodes);
46  bool addNode(float x, float y, float z, int nodeId = -1);
47  bool addNode(Vec3f node, int nodeId = -1);
48 
49  int nodeIndex(int nodeId);
50 
51 private:
52  NodeBlock(VTFxNodeBlock* block, int blockId);
53 
54  VTFxBlock* internal_vtfxBlock() const;
55 
56 private:
57  friend class DatabasePrivate;
58 
59  CEE_PRIVATE_IMPL(NodeBlock);
60  CEE_DISALLOW_COPY_AND_ASSIGN(NodeBlock);
61 };
62 
63 }
64 }
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppAssert.cpp:18
Vector class for a 3D float vector.
Definition: Vec3f.h:26
A block for storing nodes with coordinates and, optionally, node ids.
Definition: NodeBlock.h:32
Abstract base class for all VTFx blocks.
Definition: Block.h:29