Blender  V2.93
transform_snap.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #define SNAP_MIN_DISTANCE 30
24 
25 /* For enum. */
26 #include "DNA_space_types.h"
27 
28 bool peelObjectsTransform(struct TransInfo *t,
29  const float mval[2],
30  const bool use_peel_object,
31  /* return args */
32  float r_loc[3],
33  float r_no[3],
34  float *r_thickness);
35 
36 short snapObjectsTransform(struct TransInfo *t,
37  const float mval[2],
38  float *dist_px,
39  /* return args */
40  float r_loc[3],
41  float r_no[3]);
42 bool snapNodesTransform(struct TransInfo *t,
43  const int mval[2],
44  /* return args */
45  float r_loc[2],
46  float *r_dist_px,
47  char *r_node_border);
48 void snapFrameTransform(struct TransInfo *t,
49  const eAnimEdit_AutoSnap autosnap,
50  const bool is_frame_value,
51  const float delta,
52  /* return args */
53  float *r_val);
54 
55 bool transformModeUseSnap(const TransInfo *t);
56 
57 bool transform_snap_increment_ex(TransInfo *t, bool use_local_space, float *r_val);
58 bool transform_snap_increment(TransInfo *t, float *val);
59 bool transform_snap_grid(TransInfo *t, float *val);
60 
61 void snapSequenceBounds(TransInfo *t, const int mval[2]);
62 
63 bool activeSnap(const TransInfo *t);
64 bool validSnap(const TransInfo *t);
65 
66 void initSnapping(struct TransInfo *t, struct wmOperator *op);
67 void freeSnapping(struct TransInfo *t);
68 void applyProject(TransInfo *t);
70 void applySnapping(TransInfo *t, float *vec);
72 eRedrawFlag handleSnapping(TransInfo *t, const struct wmEvent *event);
73 void drawSnapping(const struct bContext *C, TransInfo *t);
74 bool usingSnappingNormal(const TransInfo *t);
75 bool validSnappingNormal(const TransInfo *t);
76 
77 void getSnapPoint(const TransInfo *t, float vec[3]);
78 void addSnapPoint(TransInfo *t);
81 
82 float transform_snap_distance_len_squared_fn(TransInfo *t, const float p1[3], const float p2[3]);
eAnimEdit_AutoSnap
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
#define C
Definition: RandGen.cpp:39
eRedrawFlag
Definition: transform.h:197
void snapSequenceBounds(TransInfo *t, const int mval[2])
bool transformModeUseSnap(const TransInfo *t)
bool usingSnappingNormal(const TransInfo *t)
bool transform_snap_grid(TransInfo *t, float *val)
void applySnapping(TransInfo *t, float *vec)
void applyProject(TransInfo *t)
void addSnapPoint(TransInfo *t)
bool validSnap(const TransInfo *t)
bool transform_snap_increment_ex(TransInfo *t, bool use_local_space, float *r_val)
void removeSnapPoint(TransInfo *t)
void snapFrameTransform(struct TransInfo *t, const eAnimEdit_AutoSnap autosnap, const bool is_frame_value, const float delta, float *r_val)
void drawSnapping(const struct bContext *C, TransInfo *t)
void getSnapPoint(const TransInfo *t, float vec[3])
eRedrawFlag updateSelectedSnapPoint(TransInfo *t)
bool transform_snap_increment(TransInfo *t, float *val)
void freeSnapping(struct TransInfo *t)
eRedrawFlag handleSnapping(TransInfo *t, const struct wmEvent *event)
bool peelObjectsTransform(struct TransInfo *t, const float mval[2], const bool use_peel_object, float r_loc[3], float r_no[3], float *r_thickness)
bool snapNodesTransform(struct TransInfo *t, const int mval[2], float r_loc[2], float *r_dist_px, char *r_node_border)
void applyGridAbsolute(TransInfo *t)
bool validSnappingNormal(const TransInfo *t)
void resetSnapping(TransInfo *t)
void initSnapping(struct TransInfo *t, struct wmOperator *op)
short snapObjectsTransform(struct TransInfo *t, const float mval[2], float *dist_px, float r_loc[3], float r_no[3])
float transform_snap_distance_len_squared_fn(TransInfo *t, const float p1[3], const float p2[3])
bool activeSnap(const TransInfo *t)