ArcGIS Procedural Runtime  3.2.10650
Geometry.h
1 /*
2  COPYRIGHT (c) 2012-2024 Esri R&D Center Zurich
3  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
4  Unpublished material - all rights reserved under the
5  Copyright Laws of the United States and applicable international
6  laws, treaties, and conventions.
7 
8  For additional information, contact:
9  Environmental Systems Research Institute, Inc.
10  Attn: Contracts and Legal Services Department
11  380 New York Street
12  Redlands, California, 92373
13  USA
14 
15  email: contracts@esri.com
16 */
17 
18 #ifndef PRTX_GEOMETRY_H_
19 #define PRTX_GEOMETRY_H_
20 
21 #include "prtx/prtx.h"
22 #include "prtx/Builder.h"
23 #include "prtx/URI.h"
24 #include "prtx/Content.h"
25 #include "prtx/Attributable.h"
26 
27 #include <vector>
28 #include <memory>
29 
30 #ifdef _MSC_VER
31 # pragma warning(push)
32 # pragma warning (disable : 4231 4251 4275 4660)
33 #endif
34 
35 
36 class AttributablePayload;
37 
38 
39 namespace prtx {
40 
41 class Mesh;
42 using MeshPtr = std::shared_ptr<Mesh>;
43 using MeshPtrVector = std::vector<MeshPtr>;
44 
45 class BoundingBox;
46 class Geometry;
47 typedef std::shared_ptr<Geometry> GeometryPtr;
48 typedef std::vector<GeometryPtr> GeometryPtrVector;
49 
59 class PRTX_EXPORTS_API Geometry : public Content, public Attributable {
60 
61 public:
62  virtual ~Geometry() {}
63 
67  URIPtr getURI() const {
68  return mURI;
69  }
70 
74  const MeshPtrVector& getMeshes() const {
75  return mMeshes;
76  }
77 
81  virtual const BoundingBox& getBoundingBox() const = 0;
82 
83 protected:
84  // @cond
85  Geometry(const prtx::URIPtr& uri) : mURI(uri) {}
86  Geometry(const prtx::URIPtr& uri, const MeshPtrVector& meshes);
87 
88  URIPtr mURI;
89  MeshPtrVector mMeshes;
90  // @endcond
91 };
92 
93 
97 class PRTX_EXPORTS_API GeometryBuilder : public SharedPtrBuilder<Geometry>, public AttributableSetter {
98 public:
102  GeometryBuilder();
103 
108  GeometryBuilder(const Geometry& geometry);
109 
110  virtual ~GeometryBuilder();
111 
112  // SharedPtrBuilder interface implementation
118  virtual GeometryPtr createShared(std::wstring* warnings = 0) const;
125  virtual GeometryPtr createSharedAndReset(std::wstring* warnings = 0);
126 
127 
132  void setURI(const URIPtr& uri);
133 
139  uint32_t addMesh(const MeshPtr& mesh);
140 
145  void addMeshes(const MeshPtrVector& meshes);
146 
150  virtual void setBool (const std::wstring& key, Bool val);
151  virtual void setInt (const std::wstring& key, int32_t val);
152  virtual void setFloat (const std::wstring& key, double val);
153  virtual void setString (const std::wstring& key, const std::wstring& val);
154  virtual void setBoolArray (const std::wstring& key, const BoolVector& val);
155  virtual void setIntArray (const std::wstring& key, const Int32Vector& val);
156  virtual void setFloatArray (const std::wstring& key, const DoubleVector& val);
157  virtual void setStringArray (const std::wstring& key, const WStringVector& val);
158  virtual void setBlindData (const std::wstring& key, void* val);
161 private:
162  URIPtr mURI;
163  MeshPtrVector mMeshes;
164 
165  AttributablePayload* mAttributes;
166 };
167 
168 
169 } /* namespace prtx */
170 
171 
172 
173 #ifdef _MSC_VER
174 # pragma warning(pop)
175 #endif
176 
177 #endif /* PRTX_GEOMETRY_H_ */
Definition: Builder.h:65
URIPtr getURI() const
Definition: Geometry.h:67
uint8_t Bool
uint8_t based Bool type
Definition: Types.h:30
std::vector< prtx::Bool > BoolVector
vector of uint8_t based Bool type
Definition: Types.h:31
Definition: BoundingBox.h:38
Definition: /Attributable.h:37
std::vector< double > DoubleVector
vector of double
Definition: Types.h:32
Definition: Content.h:40
const MeshPtrVector & getMeshes() const
Definition: Geometry.h:74
Definition: /Attributable.h:139
std::vector< GeometryPtr > GeometryPtrVector
vector of shared Geometry pointers
Definition: Geometry.h:48
Definition: Geometry.h:59
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
std::shared_ptr< URI > URIPtr
shared pointer implementation of prtx::URI
Definition: URI.h:37
std::shared_ptr< Geometry > GeometryPtr
shared Geometry pointer
Definition: DebugUtils.h:37
std::vector< MeshPtr > MeshPtrVector
vector of shared Mesh pointers
Definition: DataBackend.h:42
Definition: Geometry.h:97
std::shared_ptr< Mesh > MeshPtr
shared Mesh pointer
Definition: DataBackend.h:41
std::vector< int32_t > Int32Vector
vector of int32_t
Definition: Types.h:33
std::vector< std::wstring > WStringVector
vector of std::wstring
Definition: Types.h:35