Coot Scripting Interface  7000
c-interface-generic-objects.h
Go to the documentation of this file.
1 /* src/c-interface-generic-objects/.cc
2  *
3  * Copyright 2011 by the University of Oxford
4  * Copyright 2016 by Medical Research Council
5  * Author: Paul Emsley
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or (at
10  * your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301, USA
21  */
22 
23 #include <string>
24 
26 
27 
33 /* ----------------------------------------------------------------------- */
34 /* Generic Objects */
35 /* ----------------------------------------------------------------------- */
37 /* \{ */
38 
42 int new_generic_object_number(const std::string &obj_name);
43 
48 int new_generic_object_number_for_molecule(const std::string &obj_name, int imol);
49 
51 void to_generic_object_add_line(int object_number,
52  const char *colour,
53  int line_width,
54  float from_x1,
55  float from_y1,
56  float from_z1,
57  float to_x2,
58  float to_y2,
59  float to_z2);
60 
64 void to_generic_object_add_dashed_line(int object_number,
65  const char *colour,
66  int line_width,
67  float dash_density,
68  float from_x1,
69  float from_y1,
70  float from_z1,
71  float to_x2,
72  float to_y2,
73  float to_z2);
74 
76 void to_generic_object_add_point(int object_number,
77  const char *colour,
78  int point_width,
79  float from_x1,
80  float from_y1,
81  float from_z1);
82 
83 #ifndef SWIG
84 void to_generic_object_add_point_internal(int object_number,
85  const std::string &colour_name, // needed for indexing objects by colour
86  const coot::colour_holder &colour,
87  int point_width,
88  const clipper::Coord_orth &pt);
89 #endif // SWIG
90 
92 void to_generic_object_add_arc(int object_number,
93  const char *colour,
94  float radius,
95  float radius_inner,
96  float from_angle,
97  float to_angle,
98  float start_point_x,
99  float start_point_y,
100  float start_point_z,
101  float start_dir_x,
102  float start_dir_y,
103  float start_dir_z,
104  float normal_x1,
105  float normal_y1,
106  float normal_z1);
107 
108 void to_generic_object_add_dodecahedron(int object_number,
109  const char *colour,
110  float radius,
111  float x,
112  float y,
113  float z);
114 
115 void to_generic_object_add_pentakis_dodecahedron(int object_number,
116  const char *colour,
117  float stellation_factor,
118  float radius_factor,
119  float x,
120  float y,
121  float z);
122 
123 
125 void to_generic_object_add_display_list_handle(int object_number, int display_list_id);
126 
131 void set_display_generic_object(int object_number, short int istate);
132 
138 void set_display_generic_object_simple(int object_number, short int istate);
139 
140 
144 int generic_object_is_displayed_p(int object_number);
145 
147 int generic_object_index(const std::string &name);
148 
152 #ifdef __cplusplus
153 #ifdef USE_GUILE
154 SCM generic_object_name_scm(int obj_number);
155 #endif /* USE_GUILE */
156 #ifdef USE_PYTHON
157 PyObject *generic_object_name_py(unsigned int obj_number);
158 PyObject *get_generic_object_py(unsigned int obj_number);
159 #endif /* USE_PYTHON */
160 #endif /* __cplusplus */
161 
164 
167 void generic_object_info();
168 
173 short int generic_object_has_objects_p(int obj_no);
174 
177 void close_generic_object(int object_number);
178 
183 short int is_closed_generic_object_p(int object_number);
184 
187 void generic_object_clear(int object_number);
188 
193 void attach_generic_object_to_molecule(int obj_number, int imol);
194 
195 void set_display_generic_objects_as_solid(int state);
196 
197 
198 /* \} */
int generic_object_index(const std::string &name)
return the index of the object with name name, if not, return -1;
SCM generic_object_name_scm(int obj_number)
what is the name of generic object number obj_number?
void generic_object_info()
print to the console the name and display status of the generic display objects
int number_of_generic_objects()
return the number of generic display objects
void attach_generic_object_to_molecule(int obj_number, int imol)
attach the generic object to a particular molecule
void to_generic_object_add_display_list_handle(int object_number, int display_list_id)
add a display list handle generic object
void set_display_generic_object_simple(int object_number, short int istate)
set the display status of object number object_number,
int generic_object_is_displayed_p(int object_number)
is generic display object displayed?
Coot Scripting Interface - Generic objects.
void generic_object_clear(int object_number)
clear out the lines and points from object_number, but keep it displayable (not closed).
int new_generic_object_number_for_molecule(const std::string &obj_name, int imol)
create a new generic object with name objname and attach it to the given molecule ...
void to_generic_object_add_dashed_line(int object_number, const char *colour, int line_width, float dash_density, float from_x1, float from_y1, float from_z1, float to_x2, float to_y2, float to_z2)
add a dashed line to generic object object_number
void to_generic_object_add_line(int object_number, const char *colour, int line_width, float from_x1, float from_y1, float from_z1, float to_x2, float to_y2, float to_z2)
add line to generic object object_number
void close_generic_object(int object_number)
close generic object, clear the lines/points etc, not available for buttons/displaying etc ...
void to_generic_object_add_point(int object_number, const char *colour, int point_width, float from_x1, float from_y1, float from_z1)
add point to generic object object_number
void to_generic_object_add_arc(int object_number, const char *colour, float radius, float radius_inner, float from_angle, float to_angle, float start_point_x, float start_point_y, float start_point_z, float start_dir_x, float start_dir_y, float start_dir_z, float normal_x1, float normal_y1, float normal_z1)
add point to generic object object_number
void set_display_generic_object(int object_number, short int istate)
set the display status of object number object_number,
short int is_closed_generic_object_p(int object_number)
has the generic object been closed?
short int generic_object_has_objects_p(int obj_no)
does generic display object number obj_no have things to display? (predicate name) ...
int new_generic_object_number(const std::string &obj_name)
create a new generic object with name objname