Blender  V2.93
particle_edit_utildefines.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  * The Original Code is Copyright (C) 2007 by Janne Karhu.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #define KEY_K \
27  PTCacheEditKey *key; \
28  int k
29 #define POINT_P \
30  PTCacheEditPoint *point; \
31  int p
32 #define LOOP_POINTS for (p = 0, point = edit->points; p < edit->totpoint; p++, point++)
33 #define LOOP_VISIBLE_POINTS \
34  for (p = 0, point = edit->points; p < edit->totpoint; p++, point++) \
35  if (!(point->flag & PEP_HIDE))
36 #define LOOP_SELECTED_POINTS \
37  for (p = 0, point = edit->points; p < edit->totpoint; p++, point++) \
38  if (point_is_selected(point))
39 #define LOOP_UNSELECTED_POINTS \
40  for (p = 0, point = edit->points; p < edit->totpoint; p++, point++) \
41  if (!point_is_selected(point))
42 #define LOOP_EDITED_POINTS \
43  for (p = 0, point = edit->points; p < edit->totpoint; p++, point++) \
44  if (point->flag & PEP_EDIT_RECALC)
45 #define LOOP_TAGGED_POINTS \
46  for (p = 0, point = edit->points; p < edit->totpoint; p++, point++) \
47  if (point->flag & PEP_TAG)
48 #define LOOP_KEYS for (k = 0, key = point->keys; k < point->totkey; k++, key++)
49 #define LOOP_VISIBLE_KEYS \
50  for (k = 0, key = point->keys; k < point->totkey; k++, key++) \
51  if (!(key->flag & PEK_HIDE))
52 #define LOOP_SELECTED_KEYS \
53  for (k = 0, key = point->keys; k < point->totkey; k++, key++) \
54  if ((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE))
55 #define LOOP_TAGGED_KEYS \
56  for (k = 0, key = point->keys; k < point->totkey; k++, key++) \
57  if (key->flag & PEK_TAG)
58 
59 #define KEY_WCO ((key->flag & PEK_USE_WCO) ? key->world_co : key->co)