Loading [MathJax]/extensions/tex2jax.js
MeshKernel
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages Concepts
MeshKernel.hpp
1//---- GPL ---------------------------------------------------------------------
2//
3// Copyright (C) Stichting Deltares, 2011-2021.
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation version 3.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17// contact: delft3d.support@deltares.nl
18// Stichting Deltares
19// P.O. Box 177
20// 2600 MH Delft, The Netherlands
21//
22// All indications and logos of, and references to, "Delft3D" and "Deltares"
23// are registered trademarks of Stichting Deltares, and remain the property of
24// Stichting Deltares. All rights reserved.
25//
26//------------------------------------------------------------------------------
27
28#pragma once
29
30#include <MeshKernel/Parameters.hpp>
31
32#include <MeshKernelApi/Contacts.hpp>
33#include <MeshKernelApi/CurvilinearGrid.hpp>
34#include <MeshKernelApi/GeometryList.hpp>
35#include <MeshKernelApi/GriddedSamples.hpp>
36#include <MeshKernelApi/Mesh1D.hpp>
37#include <MeshKernelApi/Mesh2D.hpp>
38
39#if defined(_WIN32)
40#if !defined(MKERNEL_API)
41#define MKERNEL_API __declspec(dllexport)
42#endif
43#else
44#define MKERNEL_API __attribute__((visibility("default")))
45#endif
46
49namespace meshkernelapi
50{
51 struct BoundingBox;
52#ifdef __cplusplus
53 extern "C"
54 {
55#endif
56
59 MKERNEL_API double mkernel_get_separator();
60
64
69 MKERNEL_API int mkernel_allocate_state(int projectionType, int& meshKernelId);
70
75 MKERNEL_API int mkernel_is_valid_state(int meshKernelId, bool& isValid);
76
82 MKERNEL_API int mkernel_set_undo_size(int undoStackSize);
83
88 MKERNEL_API int mkernel_undo_state(bool& undone, int& meshKernelId);
89
94 MKERNEL_API int mkernel_undo_state_count(int& committedCount, int& restoredCount);
95
101 MKERNEL_API int mkernel_undo_state_count_for_id(int meshKernelId, int& committedCount, int& restoredCount);
102
107 MKERNEL_API int mkernel_redo_state(bool& redone, int& meshKernelId);
108
111 MKERNEL_API int mkernel_clear_state();
112
115 MKERNEL_API int mkernel_clear_undo_state();
116
120 MKERNEL_API int mkernel_clear_undo_state_for_id(int meshKernelId);
121
130 MKERNEL_API int mkernel_contacts_compute_boundary(int meshKernelId,
131 const int* oneDNodeMask,
132 const GeometryList& polygons,
133 double searchRadius);
134
141 MKERNEL_API int mkernel_contacts_compute_multiple(int meshKernelId,
142 const int* oneDNodeMask);
143
152 MKERNEL_API int mkernel_contacts_compute_single(int meshKernelId,
153 const int* oneDNodeMask,
154 const GeometryList& polygons,
155 double projectionFactor);
156
164 MKERNEL_API int mkernel_contacts_compute_with_points(int meshKernelId,
165 const int* oneDNodeMask,
166 const GeometryList& points);
167
175 MKERNEL_API int mkernel_contacts_compute_with_polygons(int meshKernelId,
176 const int* oneDNodeMask,
177 const GeometryList& polygons);
178
183 MKERNEL_API int mkernel_contacts_get_data(int meshKernelId, Contacts& contacts);
184
189 MKERNEL_API int mkernel_contacts_get_dimensions(int meshKernelId, Contacts& contacts);
190
195 MKERNEL_API int mkernel_contacts_set(int meshKernelId, const Contacts& contacts);
196
202 MKERNEL_API int mkernel_curvilinear_compute_curvature(int meshKernelId, int direction, double* curvature);
203
211 const GeometryList& geometryList,
212 const meshkernel::CurvilinearParameters& curvilinearParameters,
213 const meshkernel::SplinesToCurvilinearParameters& splinesToCurvilinearParameters);
214
220 MKERNEL_API int mkernel_curvilinear_compute_grid_from_splines(int meshKernelId,
221 const GeometryList& geometryList,
222 const meshkernel::CurvilinearParameters& curvilinearParameters);
223
229 MKERNEL_API int mkernel_curvilinear_compute_smoothness(int meshKernelId, int direction, double* smoothness);
230
240 const GeometryList& polygons,
241 int firstNode,
242 int secondNode,
243 int thirdNode,
244 int useFourthSide);
245
252 const GeometryList& splines,
253 const meshkernel::CurvilinearParameters& curvilinearParameters);
254
263 const GeometryList& polygon,
264 int firstNode,
265 int secondNode,
266 int thirdNode);
267
269 MKERNEL_API int mkernel_curvilinear_convert_to_mesh2d(int meshKernelId);
270
275 MKERNEL_API int mkernel_curvilinear_delete_exterior(int meshKernelId,
276 const BoundingBox& boundingBox);
277
282 MKERNEL_API int mkernel_curvilinear_delete_interior(int meshKernelId,
283 const BoundingBox& boundingBox);
284
290 MKERNEL_API int mkernel_curvilinear_delete_node(int meshKernelId,
291 double xPointCoordinate,
292 double yPointCoordinate);
293
298
302 MKERNEL_API int mkernel_curvilinear_finalize_line_shift(int meshKernelId);
303
311 MKERNEL_API int mkernel_curvilinear_get_data(int meshKernelId, CurvilinearGrid& curvilinearGrid);
312
323 MKERNEL_API int mkernel_curvilinear_get_boundaries_as_polygons(int meshKernelId, int lowerLeftN, int lowerLeftM, int upperRightN, int upperRightM, GeometryList& boundaryPolygons);
324
335 MKERNEL_API int mkernel_curvilinear_count_boundaries_as_polygons(int meshKernelId, int lowerLeftN, int lowerLeftM, int upperRightN, int upperRightM, int& numberOfPolygonNodes);
336
345 MKERNEL_API int mkernel_curvilinear_get_dimensions(int meshKernelId, CurvilinearGrid& curvilinearGrid);
346
355 MKERNEL_API int mkernel_curvilinear_get_location_index(int meshKernelId,
356 double xCoordinate,
357 double yCoordinate,
358 int locationType,
359 const BoundingBox& boundingBox,
360 int& locationIndex);
361
365 MKERNEL_API int mkernel_curvilinear_initialize_line_shift(int meshKernelId);
366
374 const GeometryList& geometryList,
375 const meshkernel::CurvilinearParameters& curvilinearParameters,
376 const meshkernel::SplinesToCurvilinearParameters& splinesToCurvilinearParameters);
377
383 MKERNEL_API int mkernel_curvilinear_insert_face(int meshKernelId, double xCoordinate, double yCoordinate);
384
389 MKERNEL_API int mkernel_curvilinear_iterate_orthogonal_grid_from_splines(int meshKernelId, int layer);
390
403 MKERNEL_API int mkernel_curvilinear_line_attraction_repulsion(int meshKernelId,
404 double repulsionParameter,
405 double xFirstNodeOnTheLine,
406 double yFirstNodeOnTheLine,
407 double xSecondNodeOnTheLine,
408 double ySecondNodeOnTheLine,
409 double xLowerLeftCorner,
410 double yLowerLeftCorner,
411 double xUpperRightCorner,
412 double yUpperRightCorner);
413
423 MKERNEL_API int mkernel_curvilinear_line_mirror(int meshKernelId,
424 double mirroringFactor,
425 int numRowsToMirror,
426 double xFirstGridLineNode,
427 double yFirstGridLineNode,
428 double xSecondGridLineNode,
429 double ySecondGridLineNode);
430
434 MKERNEL_API int mkernel_curvilinear_line_shift(int meshKernelId);
435
440 MKERNEL_API int mkernel_curvilinear_compute_rectangular_grid(int meshKernelId,
441 const meshkernel::MakeGridParameters& makeGridParameters);
442
449 const meshkernel::MakeGridParameters& makeGridParameters,
450 const GeometryList& geometryList);
451
457 const meshkernel::MakeGridParameters& makeGridParameters);
458
463 MKERNEL_API int mkernel_curvilinear_compute_circular_grid(int meshKernelId,
464 const meshkernel::MakeGridParameters& parameters);
465
473 MKERNEL_API int mkernel_curvilinear_move_node(int meshKernelId,
474 double xFromPoint,
475 double yFromPoint,
476 double xToPoint,
477 double yToPoint);
478
486 MKERNEL_API int mkernel_curvilinear_move_node_line_shift(int meshKernelId,
487 double xFromCoordinate,
488 double yFromCoordinate,
489 double xToCoordinate,
490 double yToCoordinate);
491
502 MKERNEL_API int mkernel_curvilinear_refine(int meshKernelId,
503 double xLowerLeftCorner,
504 double yLowerLeftCorner,
505 double xUpperRightCorner,
506 double yUpperRightCorner,
507 int refinement);
508
513
520 MKERNEL_API int mkernel_curvilinear_full_refine(int meshKernelId,
521 int mRefinement,
522 int nRefinement);
523
532 MKERNEL_API int mkernel_curvilinear_orthogonalize(int meshKernelId,
533 const meshkernel::OrthogonalizationParameters& orthogonalizationParameters,
534 double xLowerLeftCorner,
535 double yLowerLeftCorner,
536 double xUpperRightCorner,
537 double yUpperRightCorner);
538
543 MKERNEL_API int mkernel_curvilinear_set(int meshKernelId, const CurvilinearGrid& grid);
544
552 MKERNEL_API int mkernel_curvilinear_set_block_line_shift(int meshKernelId,
553 double xLowerLeftCorner,
554 double yLowerLeftCorner,
555 double xUpperRightCorner,
556 double yUpperRightCorner);
557
563 MKERNEL_API int mkernel_curvilinear_frozen_line_is_valid(int meshKernelId, int frozenLineId, bool& isValid);
564
569 MKERNEL_API int mkernel_curvilinear_frozen_line_delete(int meshKernelId,
570 int frozenLineId);
571
580 MKERNEL_API int mkernel_curvilinear_frozen_line_add(int meshKernelId,
581 double xFirstGridLineNode,
582 double yFirstGridLineNode,
583 double xSecondGridLineNode,
584 double ySecondGridLineNode,
585 int& frozenLineId);
586
595 MKERNEL_API int mkernel_curvilinear_frozen_line_get(int meshKernelId,
596 int frozenLineId,
597 double& xFirstFrozenLineCoordinate,
598 double& yFirstFrozenLineCoordinate,
599 double& xSecondFrozenLineCoordinate,
600 double& ySecondFrozenLineCoordinate);
601
606 MKERNEL_API int mkernel_curvilinear_frozen_lines_get_count(int meshKernelId,
607 int& numFrozenLines);
608
613 MKERNEL_API int mkernel_curvilinear_frozen_lines_get_ids(int meshKernelId,
614 int* frozenLinesIds);
615
623 MKERNEL_API int mkernel_curvilinear_set_line_line_shift(int meshKernelId,
624 double xFirstGridLineNode,
625 double yFirstGridLineNode,
626 double xSecondGridLineNode,
627 double ySecondGridLineNode);
628
637 MKERNEL_API int mkernel_curvilinear_smoothing(int meshKernelId,
638 int smoothingIterations,
639 double xLowerLeftCorner,
640 double yLowerLeftCorner,
641 double xUpperRightCorner,
642 double yUpperRightCorner);
643
656 MKERNEL_API int mkernel_curvilinear_smoothing_directional(int meshKernelId,
657 int smoothingIterations,
658 double xFirstGridlineNode,
659 double yFirstGridlineNode,
660 double xSecondGridLineNode,
661 double ySecondGridLineNode,
662 double xLowerLeftCornerSmoothingArea,
663 double yLowerLeftCornerSmoothingArea,
664 double xUpperRightCornerSmootingArea,
665 double yUpperRightCornerSmootingArea);
666
677 MKERNEL_API int mkernel_curvilinear_snap_to_landboundary(int meshKernelId,
678 const GeometryList& land,
679 double sectionControlPoint1x,
680 double sectionControlPoint1y,
681 double sectionControlPoint2x,
682 double sectionControlPoint2y,
683 double regionControlPointX = mkernel_get_separator(),
684 double regionControlPointY = mkernel_get_separator());
685
696 MKERNEL_API int mkernel_curvilinear_snap_to_spline(int meshKernelId,
697 const GeometryList& spline,
698 double sectionControlPoint1x,
699 double sectionControlPoint1y,
700 double sectionControlPoint2x,
701 double sectionControlPoint2y,
702 double regionControlPointX = mkernel_get_separator(),
703 double regionControlPointY = mkernel_get_separator());
704
709 MKERNEL_API int mkernel_deallocate_property(int meshKernelId, int propertyId);
710
714 MKERNEL_API int mkernel_deallocate_state(int meshKernelId);
715
719 MKERNEL_API int mkernel_expunge_state(int meshKernelId);
720
724 MKERNEL_API int mkernel_get_averaging_method_closest_point(int& method);
725
730
734 MKERNEL_API int mkernel_get_averaging_method_max(int& method);
735
739 MKERNEL_API int mkernel_get_averaging_method_min(int& method);
740
745
750
754 MKERNEL_API int mkernel_get_edges_location_type(int& type);
755
759 MKERNEL_API int mkernel_get_error(char* errorMessage);
760
764 MKERNEL_API int mkernel_get_exit_code_success(int& exitCode);
765
769 MKERNEL_API int mkernel_get_exit_code_meshkernel_error(int& exitCode);
770
774 MKERNEL_API int mkernel_get_exit_code_not_implemented_error(int& exitCode);
775
779 MKERNEL_API int mkernel_get_exit_code_algorithm_error(int& exitCode);
780
784 MKERNEL_API int mkernel_get_exit_code_constraint_error(int& exitCode);
785
789 MKERNEL_API int mkernel_get_exit_code_mesh_geometry_error(int& exitCode);
790
794 MKERNEL_API int mkernel_get_exit_code_linear_algebra_error(int& exitCode);
795
799 MKERNEL_API int mkernel_get_exit_code_range_error(int& exitCode);
800
804 MKERNEL_API int mkernel_get_exit_code_stdlib_exception(int& exitCode);
805
809 MKERNEL_API int mkernel_get_exit_code_unknown_exception(int& exitCode);
810
814 MKERNEL_API int mkernel_get_faces_location_type(int& type);
815
820 MKERNEL_API int mkernel_get_geometry_error(int& invalidIndex, int& type);
821
825 MKERNEL_API int mkernel_get_interpolation_type_short(int& type);
826
830 MKERNEL_API int mkernel_get_interpolation_type_float(int& type);
831
835 MKERNEL_API int mkernel_get_interpolation_type_int(int& type);
836
840 MKERNEL_API int mkernel_get_interpolation_type_double(int& type);
841
845 MKERNEL_API int mkernel_get_nodes_location_type(int& type);
846
851 MKERNEL_API int mkernel_get_projection(int meshKernelId, int& projection);
852
856 MKERNEL_API int mkernel_get_projection_cartesian(int& projection);
857
861 MKERNEL_API int mkernel_get_projection_spherical(int& projection);
862
866 MKERNEL_API int mkernel_get_projection_spherical_accurate(int& projection);
867
873 MKERNEL_API int mkernel_get_splines(const GeometryList& geometryListIn,
874 GeometryList& geometryListOut,
875 int numberOfPointsBetweenNodes);
876
880 MKERNEL_API int mkernel_get_version(char* version);
881
889 MKERNEL_API int mkernel_mesh1d_get_data(int meshKernelId, Mesh1D& mesh1d);
890
899 MKERNEL_API int mkernel_mesh1d_get_dimensions(int meshKernelId, Mesh1D& mesh1d);
900
905 MKERNEL_API int mkernel_mesh1d_set(int meshKernelId, const Mesh1D& mesh1d);
906
911 MKERNEL_API int mkernel_mesh1d_add(int meshKernelId, const Mesh1D& mesh1d);
912
924 MKERNEL_API int mkernel_mesh2d_averaging_interpolation(int meshKernelId,
925 const GeometryList& samples,
926 int locationType,
927 int averagingMethodType,
928 double relativeSearchSize,
929 size_t minNumSamples,
930 GeometryList& results);
931
938
946 MKERNEL_API int mkernel_mesh2d_rotate(int meshKernelId, double centreX, double centreY, double theta);
947
954 MKERNEL_API int mkernel_mesh2d_set_property(int meshKernelId,
955 const meshkernel::InterpolationParameters& interpolationParameters,
956 const GeometryList& sampleData,
957 int& propertyId);
958
967 MKERNEL_API int mkernel_splines_snap_to_landboundary(int meshKernelId,
968 const GeometryList& land,
969 GeometryList& splines,
970 int startSplineIndex,
971 int endSplineIndex);
972
979 MKERNEL_API int mkernel_mesh2d_translate(int meshKernelId, double translationX, double translationY);
980
985 MKERNEL_API int mkernel_mesh2d_casulli_derefinement_elements(int meshKernelId, GeometryList& elements);
986
992 MKERNEL_API int mkernel_mesh2d_casulli_derefinement_elements_on_polygon(int meshKernelId, const GeometryList& polygonGeometry, GeometryList& elements);
993
997 MKERNEL_API int mkernel_mesh2d_casulli_derefinement(int meshKernelId);
998
1003 MKERNEL_API int mkernel_mesh2d_casulli_derefinement_on_polygon(int meshKernelId, const GeometryList& polygons);
1004
1008 MKERNEL_API int mkernel_mesh2d_casulli_refinement(int meshKernelId);
1009
1014 MKERNEL_API int mkernel_mesh2d_casulli_refinement_on_polygon(int meshKernelId, const GeometryList& polygons);
1015
1024 const GeometryList& polygons,
1025 int propertyId,
1026 const meshkernel::MeshRefinementParameters& meshRefinementParameters,
1027 const double minimumRefinementDepth);
1028
1038 MKERNEL_API int mkernel_mesh2d_compute_orthogonalization(int meshKernelId,
1039 int projectToLandBoundaryOption,
1040 const meshkernel::OrthogonalizationParameters& orthogonalizationParameters,
1041 const GeometryList& selectingPolygon,
1042 const GeometryList& landBoundaries);
1043
1050 MKERNEL_API int mkernel_mesh2d_connect_meshes(int meshKernelId, const Mesh2D& mesh2d, double searchFraction, bool connect);
1051
1059 MKERNEL_API int mkernel_mesh2d_convert_projection(int meshKernelId, int projectionType, const char* const zoneString);
1060
1067 MKERNEL_API int mkernel_mesh2d_convert_to_curvilinear(int meshKernelId, double xPointCoordinate, double yPointCoordinate);
1068
1074 MKERNEL_API int mkernel_mesh2d_count_hanging_edges(int meshKernelId, int& numEdges);
1075
1081 MKERNEL_API int mkernel_mesh2d_count_mesh_boundaries_as_polygons(int meshKernelId, GeometryList& selectionPolygon, int& numberOfPolygonNodes);
1082
1091 MKERNEL_API int mkernel_mesh2d_count_nodes_in_polygons(int meshKernelId,
1092 const GeometryList& geometryListIn,
1093 int inside,
1094 int& numberOfMeshNodes);
1095
1100 MKERNEL_API int mkernel_mesh2d_count_obtuse_triangles(int meshKernelId, int& numObtuseTriangles);
1101
1107 MKERNEL_API int mkernel_mesh2d_count_small_flow_edge_centers(int meshKernelId,
1108 double smallFlowEdgesLengthThreshold,
1109 int& numSmallFlowEdges);
1110
1117 MKERNEL_API int mkernel_mesh2d_delete(int meshKernelId,
1118 const GeometryList& polygon,
1119 int deletionOption,
1120 int invertDeletion);
1121
1132 MKERNEL_API int mkernel_mesh2d_delete_edge(int meshKernelId,
1133 double xCoordinate,
1134 double yCoordinate,
1135 double xLowerLeftBoundingBox,
1136 double yLowerLeftBoundingBox,
1137 double xUpperRightBoundingBox,
1138 double yUpperRightBoundingBox);
1139
1145 MKERNEL_API int mkernel_mesh2d_delete_edge_by_index(int meshKernelId, int edgeIndex);
1146
1150 MKERNEL_API int mkernel_mesh2d_delete_hanging_edges(int meshKernelId);
1151
1156 MKERNEL_API int mkernel_mesh2d_delete_node(int meshKernelId, int nodeIndex);
1157
1161 MKERNEL_API int mkernel_mesh2d_delete_orthogonalization(int meshKernelId);
1162
1170 double smallFlowEdgesThreshold,
1171 double minFractionalAreaTriangles);
1172
1177
1187 MKERNEL_API int mkernel_mesh2d_flip_edges(int meshKernelId,
1188 int isTriangulationRequired,
1189 int projectToLandBoundaryRequired,
1190 const GeometryList& selectingPolygon,
1191 const GeometryList& landBoundaries);
1192
1205 MKERNEL_API int mkernel_mesh2d_get_closest_node(int meshKernelId,
1206 double xCoordinateIn,
1207 double yCoordinateIn,
1208 double searchRadius,
1209 double xLowerLeftBoundingBox,
1210 double yLowerLeftBoundingBox,
1211 double xUpperRightBoundingBox,
1212 double yUpperRightBoundingBox,
1213 double& xCoordinateOut,
1214 double& yCoordinateOut);
1215
1223 MKERNEL_API int mkernel_mesh2d_get_data(int meshKernelId, Mesh2D& mesh2d);
1224
1229
1237 MKERNEL_API int mkernel_mesh2d_get_node_edge_data(int meshKernelId, Mesh2D& mesh2d);
1238
1247 MKERNEL_API int mkernel_mesh2d_get_dimensions(int meshKernelId,
1248 Mesh2D& mesh2d);
1249
1260 MKERNEL_API int mkernel_mesh2d_get_edge(int meshKernelId,
1261 double xCoordinate,
1262 double yCoordinate,
1263 double xLowerLeftBoundingBox,
1264 double yLowerLeftBoundingBox,
1265 double xUpperRightBoundingBox,
1266 double yUpperRightBoundingBox,
1267 int& edgeIndex);
1268
1273 MKERNEL_API int mkernel_mesh2d_get_hanging_edges(int meshKernelId, int* edges);
1274
1281 MKERNEL_API int mkernel_mesh2d_get_face_polygons(int meshKernelId, int numEdges, const GeometryList& facePolygons);
1282
1289 MKERNEL_API int mkernel_mesh2d_get_face_polygons_dimension(int meshKernelId, int numEdges, int& geometryListDimension);
1290
1306 int propertyValue,
1307 double minValue,
1308 double maxValue,
1309 int& geometryListDimension);
1310
1320 MKERNEL_API int mkernel_mesh2d_get_filtered_face_polygons(int meshKernelId,
1321 int propertyValue,
1322 double minValue,
1323 double maxValue,
1324 const GeometryList& facePolygons);
1325
1334 MKERNEL_API int mkernel_mesh2d_get_location_index(int meshKernelId,
1335 double xCoordinate,
1336 double yCoordinate,
1337 int locationType,
1338 const BoundingBox& boundingBox,
1339 int& locationIndex);
1340
1348 MKERNEL_API int mkernel_mesh2d_get_mesh_boundaries_as_polygons(int meshKernelId, GeometryList& selectionPolygon, GeometryList& boundaryPolygons);
1349
1361 MKERNEL_API int mkernel_mesh2d_get_node_index(int meshKernelId,
1362 double xCoordinate,
1363 double yCoordinate,
1364 double searchRadius,
1365 double xLowerLeftBoundingBox,
1366 double yLowerLeftBoundingBox,
1367 double xUpperRightBoundingBox,
1368 double yUpperRightBoundingBox,
1369 int& nodeIndex);
1370
1377 MKERNEL_API int mkernel_mesh2d_get_nodes_in_polygons(int meshKernelId,
1378 const GeometryList& geometryListIn,
1379 int inside,
1380 int* selectedNodes);
1381
1386 MKERNEL_API int mkernel_mesh2d_get_obtuse_triangles_mass_centers(int meshKernelId, GeometryList& result);
1387
1392 MKERNEL_API int mkernel_mesh2d_get_orthogonality(int meshKernelId, GeometryList& geometryList);
1393
1401 MKERNEL_API int mkernel_mesh2d_get_property(int meshKernelId, int propertyValue, int locationId, const GeometryList& geometrylist);
1402
1409 MKERNEL_API int mkernel_mesh2d_get_property_dimension(int meshKernelId, int propertyValue, int& dimension);
1410
1416 MKERNEL_API int mkernel_mesh2d_get_small_flow_edge_centers(int meshKernelId,
1417 double smallFlowEdgesThreshold,
1418 GeometryList& result);
1419
1424 MKERNEL_API int mkernel_mesh2d_get_smoothness(int meshKernelId, GeometryList& geometryList);
1425
1436 MKERNEL_API int mkernel_mesh2d_initialize_orthogonalization(int meshKernelId,
1437 int projectToLandBoundaryOption,
1438 meshkernel::OrthogonalizationParameters& orthogonalizationParameters,
1439 const GeometryList& selectingPolygon,
1440 const GeometryList& landBoundaries);
1441
1448 MKERNEL_API int mkernel_mesh2d_insert_edge(int meshKernelId, int startNode, int endNode, int& newEdgeIndex);
1449
1460 MKERNEL_API int mkernel_mesh2d_insert_edge_from_coordinates(int meshKernelId,
1461 double firstNodeX,
1462 double firstNodeY,
1463 double secondNodeX,
1464 double secondNodeY,
1465 int& firstNodeIndex,
1466 int& secondNodeIndex,
1467 int& edgeIndex);
1468
1475 MKERNEL_API int mkernel_mesh2d_insert_node(int meshKernelId, double xCoordinate, double yCoordinate, int& nodeIndex);
1476
1489 MKERNEL_API int mkernel_mesh2d_intersections_from_polygon(int meshKernelId,
1490 const GeometryList& boundaryPolygon,
1491 int* edgeNodes,
1492 int* edgeIndex,
1493 double* edgeDistances,
1494 double* segmentDistances,
1495 int* segmentIndexes,
1496 int* faceIndexes,
1497 int* faceNumEdges,
1498 int* faceEdgeIndex);
1499
1506 MKERNEL_API int mkernel_mesh2d_is_valid_property(int meshKernelId, const int propertyId, const int locationId, bool& propertyIsAvailable);
1507
1513 MKERNEL_API int mkernel_mesh2d_make_global(int meshKernelId, int numLongitudeNodes, int numLatitudeNodes);
1514
1519 MKERNEL_API int mkernel_mesh2d_make_triangular_mesh_from_polygon(int meshKernelId, const GeometryList& polygonPoints);
1520
1525 MKERNEL_API int mkernel_mesh2d_make_triangular_mesh_from_samples(int meshKernelId, const GeometryList& samples);
1526
1531 MKERNEL_API int mkernel_mesh2d_make_rectangular_mesh(int meshKernelId,
1532 const meshkernel::MakeGridParameters& makeGridParameters);
1533
1540 const meshkernel::MakeGridParameters& makeGridParameters,
1541 const GeometryList& geometryList);
1542
1548 const meshkernel::MakeGridParameters& makeGridParameters);
1549
1554 MKERNEL_API int mkernel_mesh2d_merge_nodes(int meshKernelId, const GeometryList& geometryListIn);
1555
1561 MKERNEL_API int mkernel_mesh2d_merge_nodes_with_merging_distance(int meshKernelId, const GeometryList& geometryListIn, double mergingDistance);
1562
1568 MKERNEL_API int mkernel_mesh2d_merge_two_nodes(int meshKernelId, int firstNode, int secondNode);
1569
1576 MKERNEL_API int mkernel_mesh2d_move_node(int meshKernelId, double xCoordinate, double yCoordinate, int nodeIndex);
1577
1584
1595 MKERNEL_API int mkernel_mesh2d_refine_based_on_gridded_samples(int meshKernelId,
1596 const GriddedSamples& griddedSamples,
1597 const meshkernel::MeshRefinementParameters& meshRefinementParameters,
1598 bool useNodalRefinement);
1599
1605 MKERNEL_API int mkernel_mesh2d_refine_based_on_polygon(int meshKernelId,
1606 const GeometryList& geometryList,
1607 const meshkernel::MeshRefinementParameters& meshRefinementParameters);
1608
1620 MKERNEL_API int mkernel_mesh2d_refine_based_on_samples(int meshKernelId,
1621 const GeometryList& samples,
1622 double relativeSearchRadius,
1623 int minimumNumSamples,
1624 const meshkernel::MeshRefinementParameters& meshRefinementParameters);
1625
1639 const GriddedSamples& griddedSamples,
1640 double relativeSearchRadius,
1641 int minimumNumSamples,
1642 int numberOfSmoothingIterations,
1643 const meshkernel::MeshRefinementParameters& meshRefinementParameters);
1644
1650 MKERNEL_API int mkernel_mesh2d_remove_disconnected_regions(int meshKernelId);
1651
1656 MKERNEL_API int mkernel_mesh2d_set(int meshKernelId, const Mesh2D& mesh2d);
1657
1663 MKERNEL_API int mkernel_mesh2d_snap_to_landboundary(int meshKernelId, const GeometryList& selectingPolygon, const GeometryList& landBoundaries);
1664
1673 MKERNEL_API int mkernel_mesh2d_split_row(int meshKernelId,
1674 int firstNode,
1675 int secondNode);
1676
1681 MKERNEL_API int mkernel_mesh2d_add(int meshKernelId, const Mesh2D& mesh2d);
1682
1691 MKERNEL_API int mkernel_mesh2d_triangulation_interpolation(int meshKernelId,
1692 const GeometryList& samples,
1693 int locationType,
1694 GeometryList& results);
1695
1703 MKERNEL_API int mkernel_network1d_compute_fixed_chainages(int meshKernelId,
1704 double* fixedChainages,
1705 int sizeFixedChainages,
1706 double minFaceSize,
1707 double fixedChainagesOffset);
1708
1713 MKERNEL_API int mkernel_network1d_compute_offsetted_chainages(int meshKernelId, double offset);
1714
1719 MKERNEL_API int mkernel_network1d_set(int meshKernelId, const GeometryList& polylines);
1720
1725 MKERNEL_API int mkernel_network1d_to_mesh1d(int meshKernelId, double minFaceSize);
1726
1736 MKERNEL_API int mkernel_polygon_count_offset(int meshKernelId,
1737 const GeometryList& geometryListIn,
1738 int innerPolygon,
1739 double distance,
1740 int& numberOfPolygonNodes);
1741
1753 MKERNEL_API int mkernel_polygon_count_refine(int meshKernelId,
1754 const GeometryList& polygonToRefine,
1755 int firstIndex,
1756 int secondIndex,
1757 double distance,
1758 int& numberOfPolygonNodes);
1759
1770 MKERNEL_API int mkernel_polygon_count_linear_refine(int meshKernelId,
1771 const GeometryList& polygonToRefine,
1772 int firstIndex,
1773 int secondIndex,
1774 int& numberOfPolygonNodes);
1775
1783 MKERNEL_API int mkernel_polygon_get_included_points(int meshKernelId,
1784 const GeometryList& selectingPolygon,
1785 const GeometryList& polygonToSelect,
1786 GeometryList& selectionResults);
1787
1797 MKERNEL_API int mkernel_polygon_get_offset(int meshKernelId,
1798 const GeometryList& geometryListIn,
1799 int inWard,
1800 double distance,
1801 GeometryList& geometryListOut);
1802
1814 MKERNEL_API int mkernel_polygon_refine(int meshKernelId,
1815 const GeometryList& polygonToRefine,
1816 int firstNodeIndex,
1817 int secondNodeIndex,
1818 double targetEdgeLength,
1819 GeometryList& refinedPolygon);
1820
1830 MKERNEL_API int mkernel_polygon_linear_refine(int meshKernelId,
1831 const GeometryList& polygonToRefine,
1832 int firstNodeIndex,
1833 int secondNodeIndex,
1834 GeometryList& refinedPolygon);
1835
1844 MKERNEL_API int mkernel_polygon_snap_to_landboundary(int meshKernelId,
1845 const GeometryList& land,
1846 GeometryList& polygon,
1847 int startIndex,
1848 int endIndex);
1849
1850#ifdef __cplusplus
1851 }
1852#endif
1853} // namespace meshkernelapi
Contains all structs and functions exposed at the API level.
Definition BoundingBox.hpp:33
MKERNEL_API int mkernel_mesh2d_count_hanging_edges(int meshKernelId, int &numEdges)
Count the number of hanging edges in a mesh2d. An hanging edge is an edge where one of the two nodes ...
MKERNEL_API int mkernel_expunge_state(int meshKernelId)
Deallocate mesh state and remove it completely, no undo for this meshKernelId will be possible after ...
MKERNEL_API int mkernel_mesh2d_merge_nodes(int meshKernelId, const GeometryList &geometryListIn)
Merges the mesh2d nodes within a distance of 0.001 m, effectively removing all small edges.
MKERNEL_API int mkernel_mesh2d_delete_edge_by_index(int meshKernelId, int edgeIndex)
Deletes a mesh2d edge given the index of the edge. The coordinates of the edge middle points are used...
MKERNEL_API int mkernel_mesh2d_get_filtered_face_polygons(int meshKernelId, int propertyValue, double minValue, double maxValue, const GeometryList &facePolygons)
Gets the geometry list containing the face polygons within the filtering range.
MKERNEL_API int mkernel_get_interpolation_type_short(int &type)
Get the integer indicating the interpolation type short.
MKERNEL_API int mkernel_get_averaging_method_min_absolute_value(int &method)
Gets an int indicating the minimum absolute value averaging method type.
MKERNEL_API int mkernel_mesh2d_delete_edge(int meshKernelId, double xCoordinate, double yCoordinate, double xLowerLeftBoundingBox, double yLowerLeftBoundingBox, double xUpperRightBoundingBox, double yUpperRightBoundingBox)
Deletes the closest mesh2d edge to a point. The coordinates of the edge middle points are used for ca...
MKERNEL_API int mkernel_curvilinear_get_location_index(int meshKernelId, double xCoordinate, double yCoordinate, int locationType, const BoundingBox &boundingBox, int &locationIndex)
Gets the grid location closet to a specific coordinate.
MKERNEL_API double mkernel_get_separator()
Gets the double value used in the back-end library as separator and missing value.
MKERNEL_API int mkernel_get_splines(const GeometryList &geometryListIn, GeometryList &geometryListOut, int numberOfPointsBetweenNodes)
Get the computed spline points between two corner nodes.
MKERNEL_API int mkernel_network1d_to_mesh1d(int meshKernelId, double minFaceSize)
Convert network chainages to mesh1d nodes and edges.
MKERNEL_API int mkernel_curvilinear_compute_circular_grid(int meshKernelId, const meshkernel::MakeGridParameters &parameters)
Compute a rectangular or circular curvilinear grid.
MKERNEL_API int mkernel_mesh2d_compute_orthogonalization(int meshKernelId, int projectToLandBoundaryOption, const meshkernel::OrthogonalizationParameters &orthogonalizationParameters, const GeometryList &selectingPolygon, const GeometryList &landBoundaries)
MKERNEL_API int mkernel_mesh2d_get_data(int meshKernelId, Mesh2D &mesh2d)
Gets the Mesh2D dimensions data.
MKERNEL_API int mkernel_undo_state_count_for_id(int meshKernelId, int &committedCount, int &restoredCount)
Count the number of undo actions for a particular meshKernelId.
MKERNEL_API int mkernel_curvilinear_initialize_orthogonal_grid_from_splines(int meshKernelId, const GeometryList &geometryList, const meshkernel::CurvilinearParameters &curvilinearParameters, const meshkernel::SplinesToCurvilinearParameters &splinesToCurvilinearParameters)
Generates a curvilinear grid from splines with the advancing front method. Initialization step (inter...
MKERNEL_API int mkernel_curvilinear_orthogonalize(int meshKernelId, const meshkernel::OrthogonalizationParameters &orthogonalizationParameters, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
Define a block on the curvilinear grid where to perform orthogonalization.
MKERNEL_API int mkernel_mesh1d_get_data(int meshKernelId, Mesh1D &mesh1d)
Gets the Mesh1D data.
MKERNEL_API int mkernel_curvilinear_insert_face(int meshKernelId, double xCoordinate, double yCoordinate)
Inserts a new face on a curvilinear grid. The new face will be inserted on top of the closest edge by...
MKERNEL_API int mkernel_polygon_count_linear_refine(int meshKernelId, const GeometryList &polygonToRefine, int firstIndex, int secondIndex, int &numberOfPolygonNodes)
Counts the number of polygon nodes resulting from polygon refinement with mkernel_polygon_linear_refi...
MKERNEL_API int mkernel_mesh2d_averaging_interpolation(int meshKernelId, const GeometryList &samples, int locationType, int averagingMethodType, double relativeSearchSize, size_t minNumSamples, GeometryList &results)
AveragingInterpolation interpolation (ec_module)
MKERNEL_API int mkernel_mesh2d_count_nodes_in_polygons(int meshKernelId, const GeometryList &geometryListIn, int inside, int &numberOfMeshNodes)
Counts the number of selected mesh node indices.
MKERNEL_API int mkernel_mesh2d_get_mesh_boundaries_as_polygons(int meshKernelId, GeometryList &selectionPolygon, GeometryList &boundaryPolygons)
Retrieves the boundaries of a mesh as a series of separated polygons.
MKERNEL_API int mkernel_contacts_compute_boundary(int meshKernelId, const int *oneDNodeMask, const GeometryList &polygons, double searchRadius)
Computes 1d-2d contacts, where 1d nodes are connected to the closest 2d faces at the boundary (ggeo_m...
MKERNEL_API int mkernel_mesh2d_delete_orthogonalization(int meshKernelId)
Cleans the orthogonalization algorithm state, allocated in mkernel_mesh2d_initialize_orthogonalizatio...
MKERNEL_API int mkernel_mesh2d_get_hanging_edges(int meshKernelId, int *edges)
Gets the indices of hanging edges. An hanging edge is an edge where one of the two nodes is not conne...
MKERNEL_API int mkernel_get_projection_cartesian(int &projection)
Gets an int indicating the cartesian projection.
MKERNEL_API int mkernel_polygon_count_offset(int meshKernelId, const GeometryList &geometryListIn, int innerPolygon, double distance, int &numberOfPolygonNodes)
Counts the number of polygon nodes resulting from polygon offset.
MKERNEL_API int mkernel_curvilinear_compute_rectangular_grid_on_extension(int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters)
Computes a rectangular curvilinear grid on a defined extension.
MKERNEL_API int mkernel_curvilinear_convert_to_mesh2d(int meshKernelId)
Converts a curvilinear grid to an unstructured mesh.
MKERNEL_API int mkernel_mesh2d_connect_meshes(int meshKernelId, const Mesh2D &mesh2d, double searchFraction, bool connect)
Connect two or more disconnected regions along boundary.
MKERNEL_API int mkernel_curvilinear_frozen_line_add(int meshKernelId, double xFirstGridLineNode, double yFirstGridLineNode, double xSecondGridLineNode, double ySecondGridLineNode, int &frozenLineId)
Sets a new frozen line in the meshkernel state.
MKERNEL_API int mkernel_mesh2d_delete_node(int meshKernelId, int nodeIndex)
Deletes a mesh2d node.
MKERNEL_API int mkernel_curvilinear_compute_orthogonal_grid_from_splines(int meshKernelId, const GeometryList &geometryList, const meshkernel::CurvilinearParameters &curvilinearParameters, const meshkernel::SplinesToCurvilinearParameters &splinesToCurvilinearParameters)
Generates curvilinear grid from splines with the advancing front method.
MKERNEL_API int mkernel_clear_undo_state()
Clear the undo state for all mesh kernel ids, no undo is possible after this.
MKERNEL_API double mkernel_get_inner_outer_separator()
Gets the double value used to separate the inner part of a polygon from its outer part.
MKERNEL_API int mkernel_mesh2d_make_triangular_mesh_from_samples(int meshKernelId, const GeometryList &samples)
Makes a triangular mesh from a set of samples, triangulating the sample points.
MKERNEL_API int mkernel_get_interpolation_type_float(int &type)
Get the integer indicating the interpolation type float.
MKERNEL_API int mkernel_curvilinear_get_boundaries_as_polygons(int meshKernelId, int lowerLeftN, int lowerLeftM, int upperRightN, int upperRightM, GeometryList &boundaryPolygons)
Gets the boundary polygon of a curvilinear grid, nodes with invalid coordinates are excluded.
MKERNEL_API int mkernel_network1d_compute_fixed_chainages(int meshKernelId, double *fixedChainages, int sizeFixedChainages, double minFaceSize, double fixedChainagesOffset)
Compute the network chainages from fixed point locations.
MKERNEL_API int mkernel_polygon_get_offset(int meshKernelId, const GeometryList &geometryListIn, int inWard, double distance, GeometryList &geometryListOut)
Generate a new polygon from an existing one by offsetting the perimeter by a given distance.
MKERNEL_API int mkernel_mesh2d_casulli_derefinement_on_polygon(int meshKernelId, const GeometryList &polygons)
De-refine mesh using the Casulli de-refinement algorithm.
MKERNEL_API int mkernel_polygon_count_refine(int meshKernelId, const GeometryList &polygonToRefine, int firstIndex, int secondIndex, double distance, int &numberOfPolygonNodes)
Counts the number of polygon nodes resulting from polygon refinement with mkernel_polygon_refine.
MKERNEL_API int mkernel_get_exit_code_mesh_geometry_error(int &exitCode)
Gets the exit code of an exception of type MeshGeometryexitCode.
MKERNEL_API int mkernel_mesh2d_count_mesh_boundaries_as_polygons(int meshKernelId, GeometryList &selectionPolygon, int &numberOfPolygonNodes)
Counts the number of polygon nodes contained in the mesh boundary polygons computed in function mkern...
MKERNEL_API int mkernel_mesh2d_prepare_outer_iteration_orthogonalization(int meshKernelId)
Prepares an outer orthogonalization iteration, computing the new orthogonalization and smoothing weig...
MKERNEL_API int mkernel_mesh2d_get_edge(int meshKernelId, double xCoordinate, double yCoordinate, double xLowerLeftBoundingBox, double yLowerLeftBoundingBox, double xUpperRightBoundingBox, double yUpperRightBoundingBox, int &edgeIndex)
Gets the closest mesh2d edge to a point in a bounding box.
MKERNEL_API int mkernel_redo_state(bool &redone, int &meshKernelId)
Attempt to redo by one undo-action.
MKERNEL_API int mkernel_mesh2d_delete_small_flow_edges_and_small_triangles(int meshKernelId, double smallFlowEdgesThreshold, double minFractionalAreaTriangles)
Deletes all small mesh2d flow edges and small triangles. The flow edges are the edges connecting face...
MKERNEL_API int mkernel_curvilinear_snap_to_spline(int meshKernelId, const GeometryList &spline, double sectionControlPoint1x, double sectionControlPoint1y, double sectionControlPoint2x, double sectionControlPoint2y, double regionControlPointX=mkernel_get_separator(), double regionControlPointY=mkernel_get_separator())
Sets the curvilinear grid.
MKERNEL_API int mkernel_mesh2d_intersections_from_polygon(int meshKernelId, const GeometryList &boundaryPolygon, int *edgeNodes, int *edgeIndex, double *edgeDistances, double *segmentDistances, int *segmentIndexes, int *faceIndexes, int *faceNumEdges, int *faceEdgeIndex)
Gets the edges intersected by a polygon, with additional information on the intersections.
MKERNEL_API int mkernel_mesh2d_count_small_flow_edge_centers(int meshKernelId, double smallFlowEdgesLengthThreshold, int &numSmallFlowEdges)
Counts the number of small mesh2d flow edges. The flow edges are the edges connecting faces circumcen...
MKERNEL_API int mkernel_get_projection_spherical_accurate(int &projection)
Gets an int indicating the spherical accurate projection.
MKERNEL_API int mkernel_mesh2d_get_obtuse_triangles_mass_centers(int meshKernelId, GeometryList &result)
Gets the mass centers of obtuse mesh2d triangles. Obtuse triangles are those having one edge longer t...
MKERNEL_API int mkernel_get_version(char *version)
Gets pointer to version string.
MKERNEL_API int mkernel_curvilinear_set_line_line_shift(int meshKernelId, double xFirstGridLineNode, double yFirstGridLineNode, double xSecondGridLineNode, double ySecondGridLineNode)
Sets the start and end nodes of the line to shift.
MKERNEL_API int mkernel_mesh2d_get_closest_node(int meshKernelId, double xCoordinateIn, double yCoordinateIn, double searchRadius, double xLowerLeftBoundingBox, double yLowerLeftBoundingBox, double xUpperRightBoundingBox, double yUpperRightBoundingBox, double &xCoordinateOut, double &yCoordinateOut)
Gets the closest mesh2d node coordinates to a point, searching within a radius.
MKERNEL_API int mkernel_mesh2d_merge_two_nodes(int meshKernelId, int firstNode, int secondNode)
Merges two mesh2d nodes into one.
MKERNEL_API int mkernel_get_exit_code_stdlib_exception(int &exitCode)
Gets the exit code of an exception of type std::exception.
MKERNEL_API int mkernel_mesh2d_get_small_flow_edge_centers(int meshKernelId, double smallFlowEdgesThreshold, GeometryList &result)
Gets the small mesh2d flow edges. The flow edges are the edges connecting faces circumcenters.
MKERNEL_API int mkernel_mesh2d_remove_disconnected_regions(int meshKernelId)
Remove any disconnected regions from a mesh2d.
MKERNEL_API int mkernel_curvilinear_compute_grid_from_splines(int meshKernelId, const GeometryList &geometryList, const meshkernel::CurvilinearParameters &curvilinearParameters)
Generates curvilinear grid from splines.
MKERNEL_API int mkernel_curvilinear_compute_smoothness(int meshKernelId, int direction, double *smoothness)
Computes the smoothness of a curvilinear grid.
MKERNEL_API int mkernel_curvilinear_line_attraction_repulsion(int meshKernelId, double repulsionParameter, double xFirstNodeOnTheLine, double yFirstNodeOnTheLine, double xSecondNodeOnTheLine, double ySecondNodeOnTheLine, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
Attracts/repulses grid lines in a block towards another set grid line.
MKERNEL_API int mkernel_deallocate_state(int meshKernelId)
Deallocate mesh state.
MKERNEL_API int mkernel_mesh2d_get_property_dimension(int meshKernelId, int propertyValue, int &dimension)
The dimension of a specified property of a 2D mesh.
MKERNEL_API int mkernel_get_averaging_method_inverse_distance_weighting(int &method)
Gets an int indicating the inverse distance weights averaging method type.
MKERNEL_API int mkernel_get_geometry_error(int &invalidIndex, int &type)
Gets the index of the erroneous entity.
MKERNEL_API int mkernel_curvilinear_initialize_line_shift(int meshKernelId)
Initializes the curvilinear line shift algorithm.
MKERNEL_API int mkernel_get_averaging_method_closest_point(int &method)
Gets an int indicating the closest point averaging method type.
MKERNEL_API int mkernel_clear_state()
Clear all internal mesh kernel state and undo actions, no undo will be possible after this.
MKERNEL_API int mkernel_curvilinear_compute_rectangular_grid_from_polygon(int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters, const GeometryList &geometryList)
Computes a rectangular curvilinear grid from polygon.
MKERNEL_API int mkernel_mesh2d_make_rectangular_mesh_from_polygon(int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters, const GeometryList &geometryList)
Makes a rectangular mesh from a polygon.
MKERNEL_API int mkernel_curvilinear_get_data(int meshKernelId, CurvilinearGrid &curvilinearGrid)
Gets the curvilinear grid data as a CurvilinearGrid struct (converted as set of edges and nodes)
MKERNEL_API int mkernel_mesh2d_get_dimensions(int meshKernelId, Mesh2D &mesh2d)
Gets the Mesh2D dimensions.
MKERNEL_API int mkernel_mesh2d_make_rectangular_mesh(int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters)
Makes a rectangular mesh.
MKERNEL_API int mkernel_get_exit_code_algorithm_error(int &exitCode)
Gets the exit code of an exception of type AlgorithmexitCode.
MKERNEL_API int mkernel_mesh2d_make_rectangular_mesh_on_extension(int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters)
Makes a rectangular mesh on a defined extension.
MKERNEL_API int mkernel_curvilinear_move_node_line_shift(int meshKernelId, double xFromCoordinate, double yFromCoordinate, double xToCoordinate, double yToCoordinate)
Moves a node of the line to shift, the operation can be performed multiple times.
MKERNEL_API int mkernel_mesh2d_flip_edges(int meshKernelId, int isTriangulationRequired, int projectToLandBoundaryRequired, const GeometryList &selectingPolygon, const GeometryList &landBoundaries)
Flips mesh2d edges, to optimize the mesh smoothness. This operation is usually performed after mkerne...
MKERNEL_API int mkernel_mesh2d_get_face_polygons(int meshKernelId, int numEdges, const GeometryList &facePolygons)
Gets the faces polygons with a number of edges larger or equal to numEdges.
MKERNEL_API int mkernel_mesh2d_make_triangular_mesh_from_polygon(int meshKernelId, const GeometryList &polygonPoints)
Generates a triangular mesh2d grid within a polygon. The size of the triangles is determined from the...
MKERNEL_API int mkernel_mesh2d_casulli_refinement_on_polygon(int meshKernelId, const GeometryList &polygons)
Refine mesh using the Casulli refinement algorithm.
MKERNEL_API int mkernel_mesh2d_get_node_index(int meshKernelId, double xCoordinate, double yCoordinate, double searchRadius, double xLowerLeftBoundingBox, double yLowerLeftBoundingBox, double xUpperRightBoundingBox, double yUpperRightBoundingBox, int &nodeIndex)
Finds the mesh2d node closest to a point, within a search radius.
MKERNEL_API int mkernel_mesh2d_move_node(int meshKernelId, double xCoordinate, double yCoordinate, int nodeIndex)
Moves a mesh2d node to a new position.
MKERNEL_API int mkernel_get_interpolation_type_int(int &type)
Get the integer indicating the interpolation type int.
MKERNEL_API int mkernel_mesh2d_convert_to_curvilinear(int meshKernelId, double xPointCoordinate, double yPointCoordinate)
Converts a mesh to a curvilinear mesh.
MKERNEL_API int mkernel_contacts_get_dimensions(int meshKernelId, Contacts &contacts)
Gets the number of 1d-2d contacts.
MKERNEL_API int mkernel_get_nodes_location_type(int &type)
Gets an int indicating the node location type.
MKERNEL_API int mkernel_mesh1d_get_dimensions(int meshKernelId, Mesh1D &mesh1d)
Gets the Mesh1D data dimensions.
MKERNEL_API int mkernel_get_exit_code_constraint_error(int &exitCode)
Gets the exit code of an exception of type ConstraintexitCode.
MKERNEL_API int mkernel_mesh2d_refine_based_on_samples(int meshKernelId, const GeometryList &samples, double relativeSearchRadius, int minimumNumSamples, const meshkernel::MeshRefinementParameters &meshRefinementParameters)
Refines a mesh2d based on samples. Refinement is achieved by successive splits of the face edges.
MKERNEL_API int mkernel_get_projection_spherical(int &projection)
Gets an int indicating the spherical projection.
MKERNEL_API int mkernel_mesh2d_get_property(int meshKernelId, int propertyValue, int locationId, const GeometryList &geometrylist)
Retrieves a specified property of a 2D mesh.
MKERNEL_API int mkernel_curvilinear_get_dimensions(int meshKernelId, CurvilinearGrid &curvilinearGrid)
Gets the curvilinear grid dimensions as a CurvilinearGrid struct (converted as set of edges and nodes...
MKERNEL_API int mkernel_mesh2d_casulli_derefinement(int meshKernelId)
De-refine mesh using the Casulli de-refinement algorithm.
MKERNEL_API int mkernel_mesh2d_delete_hanging_edges(int meshKernelId)
Deletes all hanging edges. An hanging edge is an edge where one of the two nodes is not connected.
MKERNEL_API int mkernel_mesh2d_translate(int meshKernelId, double translationX, double translationY)
Translate a mesh2d.
MKERNEL_API int mkernel_mesh2d_casulli_refinement(int meshKernelId)
Refine mesh using the Casulli refinement algorithm.
MKERNEL_API int mkernel_mesh2d_refine_ridges_based_on_gridded_samples(int meshKernelId, const GriddedSamples &griddedSamples, double relativeSearchRadius, int minimumNumSamples, int numberOfSmoothingIterations, const meshkernel::MeshRefinementParameters &meshRefinementParameters)
Refines a mesh2d based on samples with ridge refinement. This method automatically detects the ridges...
MKERNEL_API int mkernel_curvilinear_line_mirror(int meshKernelId, double mirroringFactor, int numRowsToMirror, double xFirstGridLineNode, double yFirstGridLineNode, double xSecondGridLineNode, double ySecondGridLineNode)
Mirrors a boundary gridline outwards. The boundary grid line is defined by its starting and ending po...
MKERNEL_API int mkernel_get_exit_code_range_error(int &exitCode)
Gets the exit code of an exception of type RangeexitCode.
MKERNEL_API int mkernel_curvilinear_delete_node(int meshKernelId, double xPointCoordinate, double yPointCoordinate)
Delete the node closest to a point.
MKERNEL_API int mkernel_mesh2d_convert_projection(int meshKernelId, int projectionType, const char *const zoneString)
Converts the projection of a mesh2d.
MKERNEL_API int mkernel_mesh2d_insert_edge_from_coordinates(int meshKernelId, double firstNodeX, double firstNodeY, double secondNodeX, double secondNodeY, int &firstNodeIndex, int &secondNodeIndex, int &edgeIndex)
Insert a new mesh2d edge from 2 coordinates.
MKERNEL_API int mkernel_curvilinear_iterate_orthogonal_grid_from_splines(int meshKernelId, int layer)
One advancement of the front in curvilinear grid from splines (interactive)
MKERNEL_API int mkernel_allocate_state(int projectionType, int &meshKernelId)
Creates a new mesh state and returns the generated meshKernelId.
MKERNEL_API int mkernel_mesh2d_insert_node(int meshKernelId, double xCoordinate, double yCoordinate, int &nodeIndex)
Insert a new mesh2d node at a specific coordinate.
MKERNEL_API int mkernel_curvilinear_snap_to_landboundary(int meshKernelId, const GeometryList &land, double sectionControlPoint1x, double sectionControlPoint1y, double sectionControlPoint2x, double sectionControlPoint2y, double regionControlPointX=mkernel_get_separator(), double regionControlPointY=mkernel_get_separator())
Sets the curvilinear grid.
MKERNEL_API int mkernel_mesh2d_rotate(int meshKernelId, double centreX, double centreY, double theta)
Rotate a mesh2d about a point.
MKERNEL_API int mkernel_mesh2d_triangulation_interpolation(int meshKernelId, const GeometryList &samples, int locationType, GeometryList &results)
Triangle interpolation (ec_module)
MKERNEL_API int mkernel_get_interpolation_type_double(int &type)
Get the integer indicating the interpolation type double.
MKERNEL_API int mkernel_curvilinear_refine(int meshKernelId, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner, int refinement)
Directional curvilinear grid refinement or de-refinement. Additional gridlines are added or removed p...
MKERNEL_API int mkernel_curvilinear_compute_transfinite_from_triangle(int meshKernelId, const GeometryList &polygon, int firstNode, int secondNode, int thirdNode)
Computes a curvilinear grid in a triangle. 3 separate polygon nodes need to be selected.
MKERNEL_API int mkernel_curvilinear_delete_interior(int meshKernelId, const BoundingBox &boundingBox)
Delete the interior part of a curvilinear grid.
MKERNEL_API int mkernel_contacts_compute_with_points(int meshKernelId, const int *oneDNodeMask, const GeometryList &points)
Computes 1d-2d contacts, where 1d nodes are connected to the 2d faces mass centers containing the inp...
MKERNEL_API int mkernel_curvilinear_set_block_line_shift(int meshKernelId, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
Defines a block on the curvilinear where the shifting is distributed.
MKERNEL_API int mkernel_contacts_compute_with_polygons(int meshKernelId, const int *oneDNodeMask, const GeometryList &polygons)
Computes 1d-2d contacts, where a 2d face per polygon is connected to the closest 1d node (ggeo_make1D...
MKERNEL_API int mkernel_get_averaging_method_min(int &method)
Gets an int indicating the minimum averaging method type.
MKERNEL_API int mkernel_curvilinear_finalize_line_shift(int meshKernelId)
Resets the instance of the line shift algorithm in MeshKernelState.
MKERNEL_API int mkernel_curvilinear_delete_exterior(int meshKernelId, const BoundingBox &boundingBox)
Delete the exterior part of a curvilinear grid.
MKERNEL_API int mkernel_deallocate_property(int meshKernelId, int propertyId)
Deallocate property calculator.
MKERNEL_API int mkernel_mesh1d_set(int meshKernelId, const Mesh1D &mesh1d)
Sets the meshkernel::Mesh1D state.
MKERNEL_API int mkernel_mesh2d_insert_edge(int meshKernelId, int startNode, int endNode, int &newEdgeIndex)
Insert a new mesh2d edge connecting two nodes.
MKERNEL_API int mkernel_mesh2d_compute_inner_ortogonalization_iteration(int meshKernelId)
Performs inner orthogonalization iteration, by slowly moving the mesh nodes to new optimal positions ...
MKERNEL_API int mkernel_mesh2d_refine_based_on_gridded_samples(int meshKernelId, const GriddedSamples &griddedSamples, const meshkernel::MeshRefinementParameters &meshRefinementParameters, bool useNodalRefinement)
Refine based on gridded samples.
MKERNEL_API int mkernel_mesh2d_refine_based_on_polygon(int meshKernelId, const GeometryList &geometryList, const meshkernel::MeshRefinementParameters &meshRefinementParameters)
Refines a mesh2d within a polygon. Refinement is achieved by splitting the edges contained in the pol...
MKERNEL_API int mkernel_curvilinear_compute_rectangular_grid(int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters)
Computes a rectangular curvilinear grid.
MKERNEL_API int mkernel_mesh2d_count_obtuse_triangles(int meshKernelId, int &numObtuseTriangles)
Gets the number of obtuse mesh2d triangles. Obtuse triangles are those having one edge longer than th...
MKERNEL_API int mkernel_curvilinear_frozen_line_is_valid(int meshKernelId, int frozenLineId, bool &isValid)
Checks if a curvilinear frozen line is valid.
MKERNEL_API int mkernel_mesh2d_set(int meshKernelId, const Mesh2D &mesh2d)
Sets the meshkernel::Mesh2D state.
MKERNEL_API int mkernel_mesh2d_get_location_index(int meshKernelId, double xCoordinate, double yCoordinate, int locationType, const BoundingBox &boundingBox, int &locationIndex)
Gets the mesh location closet to a specific coordinate.
MKERNEL_API int mkernel_mesh2d_merge_nodes_with_merging_distance(int meshKernelId, const GeometryList &geometryListIn, double mergingDistance)
Merges the mesh2d nodes within a distance of 0.001 m, effectively removing all small edges.
MKERNEL_API int mkernel_polygon_snap_to_landboundary(int meshKernelId, const GeometryList &land, GeometryList &polygon, int startIndex, int endIndex)
Snaps the polygon to the land boundary.
MKERNEL_API int mkernel_curvilinear_move_node(int meshKernelId, double xFromPoint, double yFromPoint, double xToPoint, double yToPoint)
Moves a point of a curvilinear grid from one location to another.
MKERNEL_API int mkernel_get_faces_location_type(int &type)
Gets an int indicating the faces location type.
MKERNEL_API int mkernel_mesh2d_delete(int meshKernelId, const GeometryList &polygon, int deletionOption, int invertDeletion)
Deletes a mesh in a polygon using several options.
MKERNEL_API int mkernel_contacts_compute_single(int meshKernelId, const int *oneDNodeMask, const GeometryList &polygons, double projectionFactor)
Computes 1d-2d contacts, where each single 1d node is connected to one mesh2d face circumcenter (ggeo...
MKERNEL_API int mkernel_curvilinear_compute_transfinite_from_splines(int meshKernelId, const GeometryList &splines, const meshkernel::CurvilinearParameters &curvilinearParameters)
Generates curvilinear grid from splines with transfinite interpolation.
MKERNEL_API int mkernel_mesh2d_set_property(int meshKernelId, const meshkernel::InterpolationParameters &interpolationParameters, const GeometryList &sampleData, int &propertyId)
Sets the property data for the mesh, the sample data points do not have to match the mesh2d nodes.
MKERNEL_API int mkernel_curvilinear_frozen_lines_get_ids(int meshKernelId, int *frozenLinesIds)
Gets the ids of the frozen lines.
MKERNEL_API int mkernel_contacts_set(int meshKernelId, const Contacts &contacts)
Sets the 1d-2d contacts.
MKERNEL_API int mkernel_mesh2d_get_filtered_face_polygons_dimension(int meshKernelId, int propertyValue, double minValue, double maxValue, int &geometryListDimension)
Retrieves the dimension of the geometry list containing the face polygons within the filtering range.
MKERNEL_API int mkernel_mesh2d_casulli_derefinement_elements(int meshKernelId, GeometryList &elements)
Get list of elements that will be removed after the Casulli de-refinement algorithm.
MKERNEL_API int mkernel_mesh2d_snap_to_landboundary(int meshKernelId, const GeometryList &selectingPolygon, const GeometryList &landBoundaries)
Snaps a mesh to a land boundary.
MKERNEL_API int mkernel_contacts_get_data(int meshKernelId, Contacts &contacts)
Gets the 1d-2d contacts indices (from index / to indices)
MKERNEL_API int mkernel_network1d_set(int meshKernelId, const GeometryList &polylines)
Sets the meshkernel::Network1D state.
MKERNEL_API int mkernel_get_averaging_method_simple_averaging(int &method)
Gets an int indicating the simple averaging method type.
MKERNEL_API int mkernel_curvilinear_refresh_orthogonal_grid_from_splines(int meshKernelId)
Converts curvilinear grid to mesh and refreshes the state (interactive)
MKERNEL_API int mkernel_contacts_compute_multiple(int meshKernelId, const int *oneDNodeMask)
Computes 1d-2d contacts, where a single 1d node is connected to multiple 2d face circumcenters (ggeo_...
MKERNEL_API int mkernel_mesh2d_get_node_edge_data(int meshKernelId, Mesh2D &mesh2d)
Gets only the node and edge Mesh2D data.
MKERNEL_API int mkernel_mesh2d_initialize_orthogonalization(int meshKernelId, int projectToLandBoundaryOption, meshkernel::OrthogonalizationParameters &orthogonalizationParameters, const GeometryList &selectingPolygon, const GeometryList &landBoundaries)
Initialization of the meshkernel::OrthogonalizationAndSmoothing algorithm.
MKERNEL_API int mkernel_mesh2d_is_valid_property(int meshKernelId, const int propertyId, const int locationId, bool &propertyIsAvailable)
Determine if the property data for the mesh can be computed.
MKERNEL_API int mkernel_mesh2d_casulli_derefinement_elements_on_polygon(int meshKernelId, const GeometryList &polygonGeometry, GeometryList &elements)
Get list of elements that will be removed after the Casulli de-refinement algorithm.
MKERNEL_API int mkernel_mesh2d_get_orthogonality_property_type(int &type)
Gets an int indicating the orthogonality property type for mesh2d.
MKERNEL_API int mkernel_set_undo_size(int undoStackSize)
Set the maximum size of the undo stack.
MKERNEL_API int mkernel_mesh1d_add(int meshKernelId, const Mesh1D &mesh1d)
Adds a mesh to the meshkernel::Mesh1D state.
MKERNEL_API int mkernel_curvilinear_set(int meshKernelId, const CurvilinearGrid &grid)
Sets the curvilinear grid.
MKERNEL_API int mkernel_curvilinear_compute_transfinite_from_polygon(int meshKernelId, const GeometryList &polygons, int firstNode, int secondNode, int thirdNode, int useFourthSide)
Computes a curvilinear grid in a polygon. 3 separate polygon nodes need to be selected.
MKERNEL_API int mkernel_curvilinear_smoothing_directional(int meshKernelId, int smoothingIterations, double xFirstGridlineNode, double yFirstGridlineNode, double xSecondGridLineNode, double ySecondGridLineNode, double xLowerLeftCornerSmoothingArea, double yLowerLeftCornerSmoothingArea, double xUpperRightCornerSmootingArea, double yUpperRightCornerSmootingArea)
Smooths a curvilinear grid along the direction specified by a segment.
MKERNEL_API int mkernel_network1d_compute_offsetted_chainages(int meshKernelId, double offset)
Compute the network chainages at a regular offset.
MKERNEL_API int mkernel_get_exit_code_not_implemented_error(int &exitCode)
Gets the exit code of an exception of type NotImplementedCode.
MKERNEL_API int mkernel_mesh2d_finalize_inner_ortogonalization_iteration(int meshKernelId)
Finalizes the orthogonalization outer iteration, computing the new coefficients for grid adaption and...
MKERNEL_API int mkernel_is_valid_state(int meshKernelId, bool &isValid)
Determine if the meshKernelId is valid.
MKERNEL_API int mkernel_curvilinear_line_shift(int meshKernelId)
Computes the new grid, shifting the line towards the moved nodes and distributing the shifting in blo...
MKERNEL_API int mkernel_curvilinear_frozen_line_delete(int meshKernelId, int frozenLineId)
Deletes an existing frozen line in the meshkernel state.
MKERNEL_API int mkernel_mesh2d_casulli_refinement_based_on_depths(int meshKernelId, const GeometryList &polygons, int propertyId, const meshkernel::MeshRefinementParameters &meshRefinementParameters, const double minimumRefinementDepth)
Refine mesh using the Casulli refinement algorithm based on the depth values.
MKERNEL_API int mkernel_polygon_linear_refine(int meshKernelId, const GeometryList &polygonToRefine, int firstNodeIndex, int secondNodeIndex, GeometryList &refinedPolygon)
Linear refines the polygon perimeter between two nodes.
MKERNEL_API int mkernel_curvilinear_frozen_lines_get_count(int meshKernelId, int &numFrozenLines)
Gets the number of stored frozen lines in the meshkernel state.
MKERNEL_API int mkernel_mesh2d_get_smoothness(int meshKernelId, GeometryList &geometryList)
Gets the smoothness, expressed as the ratio between the values of two neighboring faces areas.
MKERNEL_API int mkernel_get_exit_code_linear_algebra_error(int &exitCode)
Gets the exit code of an exception of type LinearAlgebraexitCode.
MKERNEL_API int mkernel_mesh2d_get_nodes_in_polygons(int meshKernelId, const GeometryList &geometryListIn, int inside, int *selectedNodes)
Gets the indices of the mesh2d nodes selected with a polygon.
MKERNEL_API int mkernel_get_exit_code_success(int &exitCode)
Gets the success exit code.
MKERNEL_API int mkernel_curvilinear_compute_curvature(int meshKernelId, int direction, double *curvature)
Computes the curvature of a curvilinear grid.
MKERNEL_API int mkernel_get_exit_code_meshkernel_error(int &exitCode)
Gets the exit code of an exception of type MeshKernelError.
MKERNEL_API int mkernel_curvilinear_frozen_line_get(int meshKernelId, int frozenLineId, double &xFirstFrozenLineCoordinate, double &yFirstFrozenLineCoordinate, double &xSecondFrozenLineCoordinate, double &ySecondFrozenLineCoordinate)
Sets a new frozen line in the meshkernel state.
MKERNEL_API int mkernel_curvilinear_delete_orthogonal_grid_from_splines(int meshKernelId)
Finalizes curvilinear grid from splines algorithm.
MKERNEL_API int mkernel_get_projection(int meshKernelId, int &projection)
Gets the coordinate projection of the meshkernel state.
MKERNEL_API int mkernel_get_edges_location_type(int &type)
Gets an int indicating the edge location type.
MKERNEL_API int mkernel_curvilinear_count_boundaries_as_polygons(int meshKernelId, int lowerLeftN, int lowerLeftM, int upperRightN, int upperRightM, int &numberOfPolygonNodes)
Count the number of nodes in curvilinear grid boundary polygons.
MKERNEL_API int mkernel_polygon_refine(int meshKernelId, const GeometryList &polygonToRefine, int firstNodeIndex, int secondNodeIndex, double targetEdgeLength, GeometryList &refinedPolygon)
Refines the polygon perimeter between two nodes. This interval is refined to achieve a target edge le...
MKERNEL_API int mkernel_clear_undo_state_for_id(int meshKernelId)
Clear the undo state for particular mesh kernel id, no undo for the id is possible after this.
MKERNEL_API int mkernel_get_averaging_method_max(int &method)
Gets an int indicating the max value averaging method type.
MKERNEL_API int mkernel_mesh2d_add(int meshKernelId, const Mesh2D &mesh2d)
Adds a mesh to the meshkernel::Mesh2D state.
MKERNEL_API int mkernel_mesh2d_get_face_polygons_dimension(int meshKernelId, int numEdges, int &geometryListDimension)
Gets the dimension of faces polygons with a number of edges larger or equal to numNodes.
MKERNEL_API int mkernel_mesh2d_get_orthogonality(int meshKernelId, GeometryList &geometryList)
Gets the mesh orthogonality, expressed as the ratio between the edges and the segments connecting the...
MKERNEL_API int mkernel_undo_state_count(int &committedCount, int &restoredCount)
Count the number of undo actions.
MKERNEL_API int mkernel_splines_snap_to_landboundary(int meshKernelId, const GeometryList &land, GeometryList &splines, int startSplineIndex, int endSplineIndex)
Snaps the spline (or splines) to the land boundary.
MKERNEL_API int mkernel_undo_state(bool &undone, int &meshKernelId)
Attempt to undo by one undo-action.
MKERNEL_API int mkernel_mesh2d_split_row(int meshKernelId, int firstNode, int secondNode)
An-isotropically refines the elements along a row or column, given a starting edge.
MKERNEL_API int mkernel_get_exit_code_unknown_exception(int &exitCode)
Gets the exit code of an exception of unknown type.
MKERNEL_API int mkernel_curvilinear_smoothing(int meshKernelId, int smoothingIterations, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
Smooths a curvilinear grid.
MKERNEL_API int mkernel_mesh2d_make_global(int meshKernelId, int numLongitudeNodes, int numLatitudeNodes)
Compute the global mesh with a given number of points along the longitude and latitude directions.
MKERNEL_API int mkernel_get_error(char *errorMessage)
Gets pointer to error message.
MKERNEL_API int mkernel_curvilinear_full_refine(int meshKernelId, int mRefinement, int nRefinement)
Curvilinear grid refinement. Additional gridlines are added in both directions, over the entire grid.
MKERNEL_API int mkernel_polygon_get_included_points(int meshKernelId, const GeometryList &selectingPolygon, const GeometryList &polygonToSelect, GeometryList &selectionResults)
Selects the polygon nodes within another polygon.
A struct used to describe parameters for generating a curvilinear grid in a C-compatible manner.
Definition Parameters.hpp:111
Parameters used by the sample interpolation.
Definition Parameters.hpp:270
This struct describes the necessary parameters to create a new curvilinear grid in a C-compatible man...
Definition Parameters.hpp:38
A struct used to describe the mesh refinement parameters in a C-compatible manner.
Definition Parameters.hpp:187
A struct used to describe the orthogonalization parameters in a C-compatible manner.
Definition Parameters.hpp:238
A struct used to describe the spline to curvilinear grid parameters in a C-compatible manner.
Definition Parameters.hpp:139
A struct describing a bounding box.
Definition BoundingBox.hpp:36
A struct used to describe contacts between a 1d and a 2d mesh.
Definition Contacts.hpp:34
A struct used to describe the values of a curvilinear grid in a C-compatible manner.
Definition CurvilinearGrid.hpp:34
A struct used to describe a list of geometries in a C-compatible manner.
Definition GeometryList.hpp:34
A struct describing gridded samples.
Definition GriddedSamples.hpp:34
A struct used to describe the values of a mesh 1d in a C-compatible manner.
Definition Mesh1D.hpp:34
A struct used to describe the values of an unstructured, two-dimensional mesh in a C-compatible manne...
Definition Mesh2D.hpp:34