Blender V4.3
geometry_data_retrieval.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include <stdio.h>
12
13#include <Eigen/Dense>
14
15#include "slim.h"
17#include "uv_initializer.h"
18
19using namespace Eigen;
20
21namespace slim {
22
24 int columns_2 = 2;
25 int columns_3 = 3;
31
32 bool use_weights = false;
33 double weight_influence = 0.0;
34
35 /* All the following maps have to be declared as last members. */
36 Map<MatrixXd> vertex_positions3d = Map<MatrixXd>(NULL, 0, 0);
37 Map<MatrixXd> uv_positions2d = Map<MatrixXd>(NULL, 0, 0);
39 Map<Matrix<double, Dynamic, Dynamic, RowMajor>> positions_of_explicitly_pinned_vertices2d =
40 Map<Matrix<double, Dynamic, Dynamic, RowMajor>>(NULL, 0, 0);
41
42 Map<MatrixXi> faces_by_vertexindices = Map<MatrixXi>(NULL, 0, 0);
43 Map<MatrixXi> edges_by_vertexindices = Map<MatrixXi>(NULL, 0, 0);
45 Map<VectorXi> explicitly_pinned_vertex_indices = Map<VectorXi>(NULL, 0);
46
47 Map<VectorXd> edge_lengths = Map<VectorXd>(NULL, 0);
48 Map<VectorXi> boundary_vertex_indices = Map<VectorXi>(NULL, 0);
49 Map<VectorXf> weights_per_vertex = Map<VectorXf>(NULL, 0);
50
52 GeometryData(const GeometryData &) = delete;
54
55 void construct_slim_data(SLIMData &slim_data,
56 bool skip_initialization,
57 int reflection_mode) const;
58
59 void retrieve_pinned_vertices(bool border_vertices_are_pinned);
60
61 private:
62 void set_geometry_data_matrices(SLIMData &slim_data) const;
63 bool has_valid_preinitialized_map() const;
64 bool can_initialization_be_skipped(bool skip_initialization) const;
65 void combine_matrices_of_pinned_and_boundary_vertices();
66 void initialize_if_needed(SLIMData &slim_data) const;
67 void initialize_uvs(SLIMData &slim_data) const;
68};
69
70} // namespace slim
#define NULL
void construct_slim_data(SLIMData &slim_data, bool skip_initialization, int reflection_mode) const
Map< VectorXi > explicitly_pinned_vertex_indices
Map< MatrixXi > edges_by_vertexindices
GeometryData & operator=(const GeometryData &)=delete
Map< VectorXi > boundary_vertex_indices
Map< MatrixXd > vertex_positions3d
void retrieve_pinned_vertices(bool border_vertices_are_pinned)
GeometryData(const GeometryData &)=delete
GeometryData(const MatrixTransfer &mt, MatrixTransferChart &chart)
Map< MatrixXi > faces_by_vertexindices
Map< VectorXf > weights_per_vertex
Map< Matrix< double, Dynamic, Dynamic, RowMajor > > positions_of_explicitly_pinned_vertices2d