ArcGIS Procedural Runtime  3.2.10650
ShapeUtils.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_SHAPEUTILS_H_
19 #define PRTX_SHAPEUTILS_H_
20 
21 #include "prt/Callbacks.h"
22 
23 #include "prtx/prtx.h"
24 #include "prtx/Shape.h"
25 #include "prtx/InitialShape.h"
26 
27 #include <cassert>
28 
29 
30 namespace prtx {
31 
32 
36 namespace ShapeUtils {
37 
38 
47 PRTX_EXPORTS_API void getGeometryToWorldTrafo(const Shape& shape, DoubleVector& trafoMatrix);
48 
49 
50 
59 PRTX_EXPORTS_API void getPivotToWorldTrafo(const Shape& shape, DoubleVector& trafoMatrix);
60 
68 PRTX_EXPORTS_API void getObjectToWorldTrafo(const Shape& shape, DoubleVector& trafoMatrix);
69 
70 
78 PRTX_EXPORTS_API inline void transformPoint(const prtx::DoubleVector& trafo, const double vIn[3], double vOut[3]) {
79  assert(trafo.size() == 16);
80  vOut[0] = trafo[0]*vIn[0] + trafo[4]*vIn[1] + trafo[ 8]*vIn[2] + trafo[12];
81  vOut[1] = trafo[1]*vIn[0] + trafo[5]*vIn[1] + trafo[ 9]*vIn[2] + trafo[13];
82  vOut[2] = trafo[2]*vIn[0] + trafo[6]*vIn[1] + trafo[10]*vIn[2] + trafo[14];
83 }
84 
85 
92 PRTX_EXPORTS_API void getBoundingBoxWorld(const prtx::Shape& shape, prtx::DoubleVector& bbMinMaxExtent);
93 
94 
110 PRTX_EXPORTS_API MaterialPtr combineMaterials(const Material& shapeMat, const Material& meshMat);
111 
112 
120 PRTX_EXPORTS_API std::wstring getStyledRuleSignature(const Shape& shape);
121 
122 //
130 PRTX_EXPORTS_API std::wstring getStyledRuleName(const Shape& shape);
131 
139 PRTX_EXPORTS_API std::wstring getRuleName(const Shape& shape);
140 
148 PRTX_EXPORTS_API std::wstring getRuleParameters(const Shape& shape);
149 
157 PRTX_EXPORTS_API std::wstring getRuleArguments(const Shape& shape);
158 
159 
160 
161 } // namespace ShapeUtils
162 
163 
164 } // namespace prtx
165 
166 
167 #endif /* PRTX_SHAPEUTILS_H_ */
void getObjectToWorldTrafo(const Shape &shape, DoubleVector &trafoMatrix)
void getBoundingBoxWorld(const prtx::Shape &shape, prtx::DoubleVector &bbMinMaxExtent)
std::vector< double > DoubleVector
vector of double
Definition: Types.h:32
std::wstring getStyledRuleSignature(const Shape &shape)
MaterialPtr combineMaterials(const Material &shapeMat, const Material &meshMat)
void transformPoint(const prtx::DoubleVector &trafo, const double vIn[3], double vOut[3])
Definition: ShapeUtils.h:78
std::shared_ptr< Material > MaterialPtr
shared Material pointer
Definition: DataBackend.h:45
std::wstring getStyledRuleName(const Shape &shape)
Definition: Material.h:202
void getGeometryToWorldTrafo(const Shape &shape, DoubleVector &trafoMatrix)
std::wstring getRuleArguments(const Shape &shape)
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
void getPivotToWorldTrafo(const Shape &shape, DoubleVector &trafoMatrix)
std::wstring getRuleName(const Shape &shape)
std::wstring getRuleParameters(const Shape &shape)
Definition: Shape.h:190