DataNodes.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: UnstructGrid
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, 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 "CeeUnstructGrid/Base.h"
16 
17 #include "CeeCore/RefCountedObject.h"
18 #include "CeeCore/Vec3d.h"
19 
20 #include <vector>
21 
22 
23 namespace cee {
24 namespace ug {
25 
26 
27 //==================================================================================================
28 //
29 // DataNodes stores the nodes (optionally with ID)
30 //
31 //==================================================================================================
32 class CEE_UG_EXPORT DataNodes : public RefCountedObject
33 {
34 public:
35  DataNodes(bool hasNodeIds);
36  virtual ~DataNodes();
37 
38  size_t nodeCount() const;
39  Vec3d node(size_t index) const;
40 
41  void resize(size_t nodeCount);
42  void setNode(size_t index, const Vec3d& node);
43 
44  void setNodes(const std::vector<Vec3d>& nodes);
45  void setNodes(const double nodes[], size_t nodeCount);
46  void setNodesFloat(const float nodes[], size_t nodeCount);
47 
48  bool hasNodeIds() const;
49 
50  int nodeId(size_t index) const;
51 
52  size_t nodeIndex(int nodeId) const;
53 
54  void setNodeId(size_t index, int nodeId);
55  void setNodeIds(const std::vector<int>& nodeIds);
56  void setNodeIds(const int nodeIds[], size_t nodeCount);
57 
58  const double* rawNodesPointer() const;
59  const int* rawIdsPointer() const;
60 
61 private:
62  CEE_PRIVATE_F(DataPart);
63  CEE_PRIVATE_F(ElementsQuery);
64  CEE_PRIVATE_IMPL(DataNodes);
65  CEE_DISALLOW_COPY_AND_ASSIGN(DataNodes);
66 };
67 
68 
69 } // namespace ug
70 } // namespace cee
A part in the geometry. Consists of a collection of node coordinates and a collection element connect...
Definition: DataPart.h:28
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
A query object for extracting data and information from data elements.
Definition: ElementsQuery.h:33
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
Collection of coordinates (and optionally ids) of the element nodes in a part.
Definition: DataNodes.h:32
Vector class for a 3D double vector.
Definition: Vec3d.h:26